Forum

Results 1 to 3 of 3
  1. #1
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376

    Solved [pluginsdk] Not possible to disable menus by default

    In my opinion it's not possible to disable menus by default (if I overlooked that, please correct me).

    Some thoughts:

    The only moment, I know, that my menus are created, is after the function ts3plugin_initMenus was called.

    Of course, I could check, if that function already was called and disable the menus manually in another function (or work with another thread), but that seems to be a bit dirty.

    My suggestion is, to add a member to the PluginMenuItem-Struct, which determines, if the menu is enabled.

    Like this:
    Code:
    struct PluginMenuItem {
    	enum PluginMenuType type;
    	int id;
    	char text[PLUGIN_MENU_BUFSZ];
    	char icon[PLUGIN_MENU_BUFSZ];
    	bool enabled;
    };
    Last edited by Thomas; March 16th, 2012 at 03:22 AM.

  2. #2
    Join Date
    June 2008
    Location
    Krün, Germany
    Posts
    510
    Client 3.0.6 has a new function setPluginMenuEnabled, which can be called right after creating the menus in initMenus or later at runtime whenever you need.

    So in ts3plugin_initMenus you could do:
    Code:
    /* Create menu code here.... */
    ts3Functions.setPluginMenuEnabled(pluginID, MENU_ID_GLOBAL_2, 0);
    That would create the menuitem initially disabled. The advantage over the additional parameter is that you can call this function later to dynamically change the menu, too.

  3. #3
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Ah ok, didn't know, that you can call setPluginMenuEnabled in the initMenus function.

    Thanks for the reply.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Disable notifications from server by default
    By SylenThunder in forum Server Support
    Replies: 2
    Last Post: January 11th, 2015, 10:44 PM
  2. Replies: 2
    Last Post: June 27th, 2011, 03:16 PM
  3. [No Bug] Permission menus are gone
    By varela1george in forum Bug Reports [EN/DE]
    Replies: 7
    Last Post: June 1st, 2011, 05:01 AM
  4. [Suggestion] Disable user ability to change slots pr. default
    By mrKayne in forum Suggestions and Feedback
    Replies: 1
    Last Post: April 29th, 2010, 10:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •