Source SDK

Source SDK

Miata Jan 14, 2021 @ 6:48pm
How to edit de Main Menu in Source SDK 2013 Singleplayer?
I searched for many tutorials on the internet, and I didn't find anything helpful, the only helpful guide I found on the internet, was the wiki that is out of date.

How can I edit the game menu?

If I edit SRC in Visual Studio and rebuild, what do I do next?
< >
Showing 1-6 of 6 comments
Miata Jan 15, 2021 @ 6:24am 
This content I read before, but is basic. And I need more advanced for can add new panel with visual studio
Adrián Jan 21, 2021 @ 12:35pm 
There are few options:

  1. If you want to e.g. add a custom tab to the default Settings dialog, it can cause some problems such as content not being rendered due to certain protection measures against crashes due to Panels within an hierarchy being owned by multiple DLL boundaries altogether (vgui2.dll and client.dll) - Security regarding virtual table differences
  2. If you are fine or directly want instead to add a new game menu entry, it requires a bit of hacking. You'll need to find the pointer to the game menu panel which is handled by VGUI2 module (vgui2.dlll) at a decent initialization place of your choice from client.dll, and then parent your desired custom entry to it. You are able to position it within the menu options list through GameMenu.res and stylize whatever custom window you want displayed after pressing it through normal scheme files.
  3. Source 2013 makes it easier to override the whole game menu at once instead, but in that case you loose the features that all default options provide: https://developer.valvesoftware.com/wiki/Override_GameUI

I currently have custom code to go as the second option. If you're interested you may add me or I can try to discuss the approach here.
Last edited by Adrián; Jan 21, 2021 @ 12:46pm
Glitchcode2447 Jun 30, 2023 @ 7:55pm 
Do you still have the custom code?
Adrián Jul 1, 2023 @ 11:52am 
Originally posted by Glitchcode2447:
Do you still have the custom code?

Yeah, I could actually have linked it beforehand, since it's included in my mod's public source code, but probably didn't want to have to explain how it works. But two basic steps to achieve it, briefly explained (you'll then have to analyze and understand the relevant code parts):

1. Read this: https://developer.valvesoftware.com/wiki/Manipulating_the_game_menu_items
2. Relate the command handling part to my mod code: https://github.com/HL2RP/HL2RP/blob/b6f9e3a76088f29260d561ae4ad92b5569f78d24/mp/src/game/client/hl2rp/hl2rp_configuration.cpp#L139 (this is the command handler for my custom main menu entry). The rest of file also includes the game menu panel pointer detection and custom panel parenting.
Last edited by Adrián; Jul 1, 2023 @ 12:01pm
SN Dec 1, 2023 @ 6:26pm 
Originally posted by ๖ۣۜSKß Adrián:
There are few options:

  1. If you want to e.g. add a custom tab to the default Settings dialog, it can cause some problems such as content not being rendered due to certain protection measures against crashes due to Panels within an hierarchy being owned by multiple DLL boundaries altogether (vgui2.dll and client.dll) - Security regarding virtual table differences

Hey man, can you tell me one thing? In Source Code 2007 there is a file "gameui/OptionsDialog.cpp" in which you can change the settings panel as you want (including the Difficulty, Keyboard, etc. tabs, even remove them all).
But in Source 2013 I can’t find anywhere how to change these tabs, there you can only change their content (there's even a resource optionssubaudio.res, optionssubvideo.res, but no options.res (main layout))
Maybe you know where the root of the generation of this settings panel is? I just can't find, maybe I'm just dumb
< >
Showing 1-6 of 6 comments
Per page: 1530 50