xeongamer1 / sourcemod-ultimate-mapchooser

Automatically exported from code.google.com/p/sourcemod-ultimate-mapchooser
0 stars 0 forks source link

Add more variables to "display-template" #27

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Requested by Doobie in IRC.

All map/group options should be available for inclusion in the display-template.

Example: "{MAP} ({min_players} - {max_players})"
Output:  "cp_dustbowl (12 - 24)"

Requires a new Native: UMC_DefineTemplateVariable(const String:varName[])
-when it's called, core will store the varName along with the calling plugin 
into a trie (varName: pluginHandle)
-when the variable is found in a template string, the calling plugin is fetched 
and the appropriate forward is called (since this is a private forward, the 
FunctionID would normally need to be supplied. we can disguise it as a global 
forward by using GetFunctionByName to look up the FunctionID from the calling 
plugin handle).

New forward: UMC_LookupTemplateVariable(const String:varName[], 
String:buffer[], maxlen)

Original issue reported on code.google.com by Steell1...@gmail.com on 15 Mar 2012 at 1:40

GoogleCodeExporter commented 8 years ago
add another template variable {nominated}

issue: how to determine what text to display if {nominated} is true

{nominated="<text>"} -- might not be able to parse using a regex (can't use {} 
or "")
cvar -- do we really need another?

Original comment by Steell1...@gmail.com on 16 Mar 2012 at 1:31

GoogleCodeExporter commented 8 years ago

Original comment by Steell1...@gmail.com on 16 Mar 2012 at 1:54