Talk:Manipulating the game menu items

From Valve Developer Community
Jump to: navigation, search

You can use: "OnlyInGame" "1" to make a menu entry only appear when a game is launched. Is there any way to implement the opposite effect (i.e. a menu entry only appears before when a game is not launched)? --Daktor 10:55, 6 Sep 2006 (PDT)

I think you would have to put "Onlyinmenu" "1" or "Notingame" "1". I'll test these out now. Danm36 04:17, 24 Oct 2007 (PDT)

In GameMenu.res, an entry of this type: "command" "engine xxx" will launch the con_command "xxx". Other entries are of the type: "command" "OpenServerBrowser", where is the implementation for "OpenServerBrowser". It doesn't seem to map to a con_command, so what does it map to? --Daktor 11:36, 6 Sep 2006 (PDT)


In reference to the above, to run a map directly from a menu command, an entry of the type "command" "engine map mymap" will do the trick, and can be used for (eg) training maps, or just to bypass the chapter selection screen. --Winston 11:02, 2 Jun 2007 (UTC)

Conditional items

Does anybody know how to add a section that only appears when certain conditions are met other than the 'notmulti' 'notingame' etc. as I want a button called 'Bonus maps' only to appear when sv_unlockedchapters 4 is met (When the MOD is complete) This is what I have made.

	"13"
	{
		"label" "Bonus maps"
		"command" "engine map Bonus1"
		"sv_unlockedchapters" "4"                <--Doesn't work
	}

Danm36 09:08, 23 Oct 2007 (PDT)

You would need code to do that. --TomEdwards 10:51, 23 Oct 2007 (PDT)
O.K. Thanks. Danm36 04:16, 24 Oct 2007 (PDT)

Font

How do i change the font of the said menu items?

Open URL in Menu

Hi, I'm releasing a beta version of my game and I think it would be very helpful if I could include a "Report a Bug" link in the menu so that if a user saw a bug, it could open up Steam and go to the Report Bugs section of my Moddb forum. My current GameMenu.res Report Bugs section:

"GameMenu"
{
"1"
{
"label" "Report a Bug"
"command" "steam://openurl/http://www.moddb.com/mods/cloned-cube/forum/board/report-a-bug/add"
"InGameOrder" "10"
}

The "Report a Bug" link appears, however it does nothing when I click on it. --Cubis 17:23, 16 August 2011 (PDT)

Mod's dedicated localization not working in

The article says the following:

Note: If you are making your own mod then you will need to make sure that you make a copy of ../Resource/HL2_english.txt and rename it to ../Resource/NameOfYourMod_english.txt. Otherwise Source will not be able to locate it.

However, using Source SDK 2013, mod's localization files aren't loaded at the time the game menu is initialized, making custom entries or renamed default ones show the localization token (e.g. #MyMenuEntry). I don't want to be working with copies of the whole gameui_<language>.txt files, so I found out this apparent bug. I've had to add custom code to manually fix this.

Does anyone know if that claim is supposed to work in Source 2013, or maybe it's outdated information belonging to an older engine version like Source 2007? Thank you

Apparently you just do g_pVGuiLocalize->AddFile( "Resource/vgui_%language%.txt"); or something similar. I don't see where they called this for hl2 though. Loudslappingsounds (talk) 05:57, 29 December 2020 (PST)
Thank you, although I don't know of a suitable working place (during initialization) where I'd place my custom g_pVGuiLocalize->AddFile("resource/mod_hl2rp_%language%.txt"); therefore instead. --Adrianilloo (talk) 04:46, 1 January 2021 (PST)