Displaying the Find Servers menu manually

Grab your favourite IDE and tinker with the innards of game engines

Displaying the Find Servers menu manually

Postby SM Sith Lord on Sun Jul 28, 2013 5:51 pm

I finally figured out how to completely replace the main menu of my mod, but I still want to be able to trigger the standard Options and Find Servers sub-menus from my new main menu.

I looked at Resource/GameMenu.res and found the panel commands that the standard Find Servers and Options buttons call. For example, "OpenServerBrowser" for Find Servers and "OpenOptionsDialog" for the Options sub-menu.

I'm thinking all I need to do is get a pointer to the main menu panel and then issue some OnCommand() calls to it to do what I need, but I don't know how to get a pointer to the main menu panel to issue such calls to.

How do I get a pointer to the main menu panel so I can use ->OnCommand() on it? Thanks.
SM Sith Lord
Been Here A While
Been Here A While
 
Joined: Sat Nov 25, 2006 4:25 pm
Location: Los Angles, CA

Re: Displaying the Find Servers menu manually

Postby SM Sith Lord on Thu Aug 22, 2013 3:40 am

Playing around with the following console commands I was able to *see* a pointer to the panel I need to send commands to, but I don't know how to get this pointer in code lol.

Code: Select all
vgui_drawtree 1
vgui_drawpanelptr 1


You can see the HEX pointer value under this heading:
Code: Select all
MatSystemTopPanel > staticPanel > GameUI Panel > BaseGameUIPanel > GameMenu


If I were able to get that pointer in code, and assuming I could turn it into a Panel*, I am assuming I'd just need to do pPanel->OnCommand("OpenCreateMultiplayerGameDialog") to show the server browser. :(
SM Sith Lord
Been Here A While
Been Here A While
 
Joined: Sat Nov 25, 2006 4:25 pm
Location: Los Angles, CA

Re: Displaying the Find Servers menu manually

Postby Gary on Thu Aug 22, 2013 4:17 am

I might just be really tired but what exactly are you trying to do? It sounds like want to summon the options and server browser menu. Maybe something like engine->ClientCmd("OpenServerBrowser") ?
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Displaying the Find Servers menu manually

Postby dark0r on Thu Aug 22, 2013 4:53 pm

IGameUI::SendMainMenuCommand seems to be the exact method you're looking for. I assume you're using Source 2013?
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: Displaying the Find Servers menu manually

Postby SM Sith Lord on Sun Sep 08, 2013 2:05 pm

Gary, that is exactly what I want to do, except that OpenServerBrowser is an unknown command and I need to also do it for the options menu.

dark0r:
That looks like exactly what I need, however I haven't updated to the Source 2013 branch yet.

However, because it took me so long to figure this one out I already worked around it and decided to keep a form of the main menu in there. Thanks for your guys help and I will sure use that method after I port over to 2013.

FYI, another very useful feature that is completely lacking from pre-2013 branches is the ability to force the game window to be borderless. Pre-2013 doesn't even have the borderless settings in their enums. :(
SM Sith Lord
Been Here A While
Been Here A While
 
Joined: Sat Nov 25, 2006 4:25 pm
Location: Los Angles, CA

Return to Programming

Who is online

Users browsing this forum: No registered users