[CS:GO] Parent Menu

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
velocity
Senior Member
Posts: 186
Joined: Sat May 10, 2014 6:17 pm

[CS:GO] Parent Menu

Postby velocity » Sat Nov 10, 2018 5:24 pm

How would I make a parent_menu if it takes an argument like index.

Code: Select all

def menu_1(index):
    player = player_instances[index]
    steamid = player.steamid
    menu = PagedMenu(
        title='Menu 1',
        select_callback=None
    )
    menu.append(PagedOption('Hello1', 'hello'))
    menu.send(index)


def menu_2(index):
    menu = PagedMenu(
        title='Menu 2',
        select_callback=None,
        parent_menu=menu_1
    )
    menu.append(PagedOption('Hello2', 'hello'))
    menu.send(index)

User avatar
khaimovmr
Junior Member
Posts: 25
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Re: [CS:GO] Parent Menu

Postby khaimovmr » Sun Nov 11, 2018 12:23 am

velocity wrote:How would I make a parent_menu if it takes an argument like index.

Don't you mean that you want a dynamically composed menu items in your parent menu?
User avatar
Ayuto
Project Leader
Posts: 2013
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: [CS:GO] Parent Menu

Postby Ayuto » Sun Nov 11, 2018 3:44 pm

I would simply use the build_callback instead of creating individual menus for every player. Then you have one menu instance for all players, but they will be rebuilt for every player before they are sent/refreshed.
User avatar
velocity
Senior Member
Posts: 186
Joined: Sat May 10, 2014 6:17 pm

Re: [CS:GO] Parent Menu

Postby velocity » Tue Nov 13, 2018 2:08 pm

Im not sure what you mean, I never messed around with build_callback. How would I proceed?
User avatar
Ayuto
Project Leader
Posts: 2013
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: [CS:GO] Parent Menu

Postby Ayuto » Tue Nov 13, 2018 4:29 pm


Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 2 guests