Forum

Results 1 to 5 of 5
  1. #1
    Join Date
    January 2010
    Location
    Phoenix, AZ
    Posts
    99

    Lua menu items questions

    I see in the testmodule demo how to create menu items for teamspeak and how to add an Icon for it.

    My question is, Is it possible to update these menu items after they have been created.

    Specifically I'd like to set an Icon for On, and an Icon for Off, and when I select the menu item it will toggle to the alternate image.

    Along the same lines can I update the text on the menu items also after it has been created.

    One last thing, is there a way to create submenus for my plugin ? So when I create a menu for my plugin it would have a submenu titled with my plugin name and the menu entries underneath the submenu.

    Thanks
    Bob

  2. #2
    Join Date
    September 2012
    Posts
    6,076
    Quote Originally Posted by sgtrwe View Post
    I see in the testmodule demo how to create menu items for teamspeak and how to add an Icon for it.

    My question is, Is it possible to update these menu items after they have been created.

    Specifically I'd like to set an Icon for On, and an Icon for Off, and when I select the menu item it will toggle to the alternate image.

    Along the same lines can I update the text on the menu items also after it has been created.
    Unfortunately you cannot modify the menu items after they've been created. All items will need to be created upon initialization of the plugin and all you can do later is enable/disable them.

    Quote Originally Posted by sgtrwe View Post
    One last thing, is there a way to create submenus for my plugin ? So when I create a menu for my plugin it would have a submenu titled with my plugin name and the menu entries underneath the submenu.

    Thanks
    Bob
    Menu items created through these functions always end up in a submenu named after your plugin. You cannot however create your own submenu inside the one created automatically by the client.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  3. #3
    Join Date
    January 2010
    Location
    Phoenix, AZ
    Posts
    99
    Thanks Chris

    Quote Originally Posted by Chris View Post
    Unfortunately you cannot modify the menu items after they've been created. All items will need to be created upon initialization of the plugin and all you can do later is enable/disable them..
    Does it have to be during the init ? I'd like to get some information from min .ini file and put it on the menu, is there any way to call it after init ?

    Quote Originally Posted by Chris View Post
    Menu items created through these functions always end up in a submenu named after your plugin. You cannot however create your own submenu inside the one created automatically by the client.
    Right now all items are showing up under the "Plugins/Lua Plugins" menu. So my items are on the same menu as the testmodule items.

    I was hoping for what you said "Plugins/Lua Plugins/My Module"

  4. #4
    Join Date
    September 2012
    Posts
    6,076
    Right now I can only speak for regular (compiled) plugins, don't exactly know how LUA Scripts do it.
    For regular plugins (not lua scripts), the client will call ts3plugin_initMenus which is the only place you can register / create your menu items.

    From the looks of the lua demo, a similar thing happens there.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  5. #5
    Join Date
    January 2010
    Location
    Phoenix, AZ
    Posts
    99
    Well, I'm experimenting and having some kind of success.

    I've created a set of menu items like the testmodule, but for the text I initialized an array of strings and the initial call to create_menus works.

    When the lua plugin starts, I am able to modify the array of strings, so that helps with putting variable information on the menus.

    I am able to change all the menu items in the startup routine, and I can chenge each one more than once.

    But sometime after this, and I haven't figured out where, I can no longer make changes to the menu items.

    If anyone has any Ideas I would welcome them.

    Thanks

    I'll post some code, when I have something more viable.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 642
    Last Post: June 1st, 2019, 11:00 PM
  2. Replies: 8
    Last Post: March 19th, 2015, 07:14 AM
  3. [Request] Menu to plugin line testmodule menu ( can;t handle it)
    By Viziss in forum Client Plugins / Lua Scripts
    Replies: 0
    Last Post: March 12th, 2015, 11:40 PM
  4. Replies: 3
    Last Post: July 14th, 2010, 09:30 AM
  5. Public Channel Password & Other misc items
    By wG|Phantom in forum Permission System
    Replies: 2
    Last Post: March 17th, 2010, 04:53 PM

Posting Permissions

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