Menu questions

Please post any questions about developing your plugin here. Please use the search function before posting!
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Menu questions

Postby decompile » Wed Feb 24, 2016 10:38 pm

Hey,

Im currently working with the menus and i have a question about it.

In the select_callback

Syntax: Select all

def sometestcallback(menu, player_index, choice):


I dont understand how i can get the integer, seems like choice is a object.

2nd:
When i return menu, will the menu be re-created or is the menu saved in sometihng like a cache and instantly shown?

3rd:
Is menu.text needed? I see from the forum example its used there, but from some scripts its just simply "menu.append("text123")

Sorry mobile grammar
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Thu Feb 25, 2016 6:11 am

Choice is either a SimpleOption or a PagedOption object. It depends on the menu type you are using. Type help(choice) for more information.

Returning a menu works in the same way like sending a menu. The only difference is that it will be added to the beginning of the menu queue. Thus, it gets displayed instantly. The menus package doesn't cache anything.

I guess you mean the Text class. It's not necessary to use it. It's actually only useful if you plan to subclass it and override the render method.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 19 guests