Recreating GameUI

From Valve Developer Community
Revision as of 11:47, 26 February 2008 by Etset (talk | contribs) (minor tidy & categorized)

Jump to: navigation, search

This article will focus on recreating the GameUI so it's easier to modify as well as control the GameMenu.

Note:There is no code posted for the below changes, so following the directions will not show expected results. The code will be released once the recreation is finished.

Base modifications

Make resource\GameMenu.res so it's empty or has "GameMenu"{} in it.
This will remove the GameMenu so it can be replaced by the new one.
Remove the title and title2 KeyValues from GameInfo.txt.
This will remove the two title texts that appear on the backdrop.
If no resource\SourceScheme.res exists, extract it from source engine.gcf.
Modify resource\SourceScheme.res so MainMenu.Backdrop is "0 0 0 0".
This will make it so the backdrop is not faded due to panels foreign to GameUI not having control over backdrop fades.

Singleplayer mods

New Game dialog

The custom new game dialog has been made so it uses the list in resource\ChapterList.res. Here's an example of the file:

"ChapterList"
{
	"Training"	"trainingmap1"
	"1"		"chapter1map1"
	"#Two"		"chapter2map1"
	"Three"		"chapter3map1"
}

Notes

  • The training map is a special chapter key name that is handled by different code.
  • The key name of a chapter ("1", "#Two", ...) defines what will be shown on the new game dialog (CHAPTER 1, CAPÍTULO DOS, etc).
    • Localized strings referenced must be defined in a localization file.
  • If the key name is text, such as "Three," it will appear as is for any language.
  • sv_unlockedchapters is checked by running down this list in order, so arrange the chapter KeyValues in order.

Fixes

  • This dialog takes into account absolute paths for the -game parameter.

Multiplayer mods

Create Multiplayer Game dialog

The custom create MP game dialog has been made so it uses the ConVar list in cfg\server_settings_default.txt.

"ServerOptions"
{
	"hostname"
	{
		"label"		"#Valve_Hostname"
		"type"		"string"
		"initial"	"Hostname"
	}

	"maxplayers"
	{
		"label"		"#Valve_Max_Players"
		"type"		"integer"
		"minimum"	"2"
		"maximum"	"16"
		"initial"	"16"
	}

	"sv_password"
	{
		"label"		"#Valve_Server_Password"
		"type"		"string"
		"initial"	""
	}

	"mp_fraglimit"
	{
		"Frag Limit"
		"type"		"integer"
		"minimum"	"0"
		"initial"	"0"
	}

	"mp_timelimit"
	{
		"label"		"Time Limit (Min.)"
		"type"		"float"
		"minimum"	"0"
		"initial"	"0"
	}

	"mp_teamplay"
	{
		"Frag Limit"
		"type"		"boolean"
		"initial"	"0"
	}

	"mp_weaponstay"
	{
		"label"		"Weapons Stay"
		"type"		"boolean"
		"initial"	"0"
	}

	"mp_footsteps"
	{
		"label"		"#Valve_Footsteps"
		"type"		"boolean"
		"initial"	"1"
	}

	"mp_flashlight"
	{
		"label"		"Flashlight"
		"type"		"boolean"
		"initial"	"0"
	}

	"mp_forcerespawn"
	{
		"label"		"Force Respawn"
		"type"		"boolean"
		"initial"	"0"
	}
}

New localized strings

"NewUI_NoMapsAvailable"		"No visible maps are available for this mod"