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:
@@ -48,7 +48,7 @@ DisplayVoteMapMenu(client, mapCount, String:maps[5][])
|
||||
|
||||
if (mapCount == 1)
|
||||
{
|
||||
strcopy(g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[]), maps[0]);
|
||||
GetMapDisplayName(maps[0], g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[]));
|
||||
|
||||
g_hVoteMenu.SetTitle("Change Map To");
|
||||
g_hVoteMenu.AddItem(maps[0], "Yes");
|
||||
@@ -61,7 +61,9 @@ DisplayVoteMapMenu(client, mapCount, String:maps[5][])
|
||||
g_hVoteMenu.SetTitle("Map Vote");
|
||||
for (new i = 0; i < mapCount; i++)
|
||||
{
|
||||
g_hVoteMenu.AddItem(maps[i], maps[i]);
|
||||
decl String:displayName[PLATFORM_MAX_PATH];
|
||||
GetMapDisplayName(maps[i], displayName, sizeof(displayName));
|
||||
g_hVoteMenu.AddItem(maps[i], displayName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,8 +290,10 @@ int LoadMapList(Menu menu)
|
||||
|
||||
for (new i = 0; i < map_count; i++)
|
||||
{
|
||||
decl String:displayName[PLATFORM_MAX_PATH];
|
||||
GetArrayString(g_map_array, i, map_name, sizeof(map_name));
|
||||
menu.AddItem(map_name, map_name);
|
||||
GetMapDisplayName(map_name, displayName, sizeof(displayName));
|
||||
menu.AddItem(map_name, displayName);
|
||||
}
|
||||
|
||||
return map_count;
|
||||
|
||||
Reference in New Issue
Block a user