Difference between revisions of "Recreating GameUI"

From Valve Developer Community
Jump to: navigation, search
m (Detach from documentation)
m (minor tidy & categorized)
Line 2: Line 2:
  
 
{{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.}}
 
{{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=
+
 
 +
== Base modifications ==
 
;Make <code>resource\GameMenu.res</code> so it's empty or has <code>"GameMenu"{}</code> in it.:This will remove the GameMenu so it can be replaced by the new one.
 
;Make <code>resource\GameMenu.res</code> so it's empty or has <code>"GameMenu"{}</code> in it.:This will remove the GameMenu so it can be replaced by the new one.
 
;Remove the <code>title</code> and <code>title2</code> KeyValues from <code>GameInfo.txt</code>.:This will remove the two title texts that appear on the backdrop.
 
;Remove the <code>title</code> and <code>title2</code> KeyValues from <code>GameInfo.txt</code>.:This will remove the two title texts that appear on the backdrop.
 
;If no <code>resource\SourceScheme.res</code> exists, extract it from <code>source engine.[[GCF|gcf]]</code>.
 
;If no <code>resource\SourceScheme.res</code> exists, extract it from <code>source engine.[[GCF|gcf]]</code>.
 
;Modify <code>resource\SourceScheme.res</code> so <code>MainMenu.Backdrop</code> 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.
 
;Modify <code>resource\SourceScheme.res</code> so <code>MainMenu.Backdrop</code> 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==
+
== Singleplayer mods ==
 +
=== New Game dialog ===
 
The custom new game dialog has been made so it uses the list in <code>resource\ChapterList.res</code>.
 
The custom new game dialog has been made so it uses the list in <code>resource\ChapterList.res</code>.
 
Here's an example of the file:
 
Here's an example of the file:
Line 19: Line 21:
 
  "Three" "chapter3map1"
 
  "Three" "chapter3map1"
 
  }
 
  }
===Notes===
+
 
 +
==== Notes ====
 
* The training map is a special chapter key name that is handled by different code.
 
* 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).
 
* The key name of a chapter ("1", "#Two", ...) defines what will be shown on the new game dialog (CHAPTER 1, CAPÍTULO DOS, etc).
Line 26: Line 29:
 
* <code>[[sv_unlockedchapters]]</code> is checked by running down this list in order, so arrange the chapter KeyValues in order.
 
* <code>[[sv_unlockedchapters]]</code> is checked by running down this list in order, so arrange the chapter KeyValues in order.
  
===Fixes===
+
==== Fixes ====
 
* This dialog takes into account absolute paths for the <code>-game</code> parameter.
 
* This dialog takes into account absolute paths for the <code>-game</code> parameter.
  
=Multiplayer Mods=
+
== Multiplayer mods ==
==Create Multiplayer Game Dialog==
+
=== Create Multiplayer Game dialog ===
 
The custom create MP game dialog has been made so it uses the [[ConVar]] list in <code>cfg\server_settings_default.txt</code>.
 
The custom create MP game dialog has been made so it uses the [[ConVar]] list in <code>cfg\server_settings_default.txt</code>.
 
<pre>"ServerOptions"
 
<pre>"ServerOptions"
Line 108: Line 111:
 
}
 
}
 
}</pre>
 
}</pre>
==New Localized Strings==
+
=== New localized strings ===
 
  "NewUI_NoMapsAvailable" "No visible maps are available for this mod"
 
  "NewUI_NoMapsAvailable" "No visible maps are available for this mod"
 +
 +
[[Category:Modding]]

Revision as of 11:47, 26 February 2008

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"