Compare commits
1
Commits
1ccb5cc387
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
789b8ebef9 |
@@ -2310,6 +2310,16 @@ NominateResult InternalNominateMap(char[] map, int owner)
|
||||
return Nominate_Added;
|
||||
}
|
||||
|
||||
public void GetMapCategory(const char[] mapname, char[] output_category, int maxlen)
|
||||
{
|
||||
strcopy(output_category, maxlen, "Uncategorized");
|
||||
if (g_Config && g_Config.JumpToKey(mapname))
|
||||
{
|
||||
g_Config.GetString("MapCategory", output_category, maxlen, "Uncategorized");
|
||||
g_Config.Rewind();
|
||||
}
|
||||
}
|
||||
|
||||
/* Add natives to allow nominate and initiate vote to be call */
|
||||
|
||||
/* native bool NominateMap(const char[] map, bool force, &NominateError:error); */
|
||||
@@ -3054,7 +3064,17 @@ public int Native_SimulateMapEnd(Handle plugin, int numParams)
|
||||
|
||||
stock void AddMapItem(const char[] map)
|
||||
{
|
||||
AddMenuItem(g_VoteMenu, map, map);
|
||||
char map_with_category[1024];
|
||||
if (StrContains(map, "ze_") == 0)
|
||||
{
|
||||
GetMapCategory(map, map_with_category, sizeof(map_with_category));
|
||||
Format(map_with_category, sizeof(map_with_category), "%s (%s)", map, map_with_category);
|
||||
AddMenuItem(g_VoteMenu, map, map_with_category);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddMenuItem(g_VoteMenu, map, map);
|
||||
}
|
||||
}
|
||||
|
||||
stock void GetMapItem(Handle menu, int position, char[] map, int mapLen)
|
||||
|
||||
Reference in New Issue
Block a user