Add new function: GetMapDisplayName.

This function will resolve the name of a map using FindMap, then (if applicable), will turn a workshop map name into a nicely formatted name.

Currently only TF2 and CS:GO Map Workshops are supported.  More can be added at a later date.

This function returns false if a map was not found, but true in any other instance even if FindMap could not resolve the map name.

This patch also updates the following core plugins to use this GetMapDisplayName:

BaseTriggers
BaseVotes
MapChooser
NextMap
Nominations
RandomCycle
RockTheVote
This commit is contained in:
Ross Bemrose
2015-09-15 16:16:58 -04:00
parent c6c034f90a
commit 10a95cfdce
13 changed files with 195 additions and 50 deletions
+25
View File
@@ -0,0 +1,25 @@
#include <sourcemod>
public void OnPluginStart()
{
RegServerCmd("test_mapdisplayname", test_mapdisplayname);
}
public Action test_mapdisplayname( int argc )
{
char mapName[PLATFORM_MAX_PATH];
GetCmdArg(1, mapName, sizeof(mapName));
char displayName[PLATFORM_MAX_PATH];
if (GetMapDisplayName(mapName, displayName, sizeof(displayName)))
{
PrintToServer("GetMapDisplayName says \"%s\" for \"%s\"", displayName, mapName);
}
else
{
PrintToServer("GetMapDisplayName says \"%s\" was not found or not resolved", mapName);
}
return Plugin_Handled;
}