update to display vote counts instead of names
This commit is contained in:
parent
ade335943b
commit
f3792affba
@ -739,6 +739,7 @@ bool PopulateNominateListMenu(Menu menu, int client, const char[] filter = "")
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringMap sm = new StringMap();
|
||||||
static char map[PLATFORM_MAX_PATH];
|
static char map[PLATFORM_MAX_PATH];
|
||||||
static char display[PLATFORM_MAX_PATH];
|
static char display[PLATFORM_MAX_PATH];
|
||||||
for(int i = 0; i < GetArraySize(MapList); i++)
|
for(int i = 0; i < GetArraySize(MapList); i++)
|
||||||
@ -747,6 +748,25 @@ bool PopulateNominateListMenu(Menu menu, int client, const char[] filter = "")
|
|||||||
|
|
||||||
if(!filter[0] || StrContains(map, filter, false) != -1)
|
if(!filter[0] || StrContains(map, filter, false) != -1)
|
||||||
{
|
{
|
||||||
|
int nominate_count_for_particular_map = 0;
|
||||||
|
sm.GetValue(map, nominate_count_for_particular_map);
|
||||||
|
nominate_count_for_particular_map++;
|
||||||
|
sm.SetValue(map, nominate_count_for_particular_map, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(int i = 0; i < GetArraySize(MapList); i++)
|
||||||
|
{
|
||||||
|
GetArrayString(MapList, i, map, sizeof(map));
|
||||||
|
|
||||||
|
if(!filter[0] || StrContains(map, filter, false) != -1)
|
||||||
|
{
|
||||||
|
int nominate_count_for_particular_map = 0;
|
||||||
|
sm.GetValue(map, nominate_count_for_particular_map);
|
||||||
|
if (nominate_count_for_particular_map == -1)
|
||||||
|
{
|
||||||
|
//we already displayed vote count for this particular map
|
||||||
|
continue;
|
||||||
|
}
|
||||||
strcopy(display, sizeof(display), map);
|
strcopy(display, sizeof(display), map);
|
||||||
|
|
||||||
bool VIPRestriction = GetMapVIPRestriction(map);
|
bool VIPRestriction = GetMapVIPRestriction(map);
|
||||||
@ -754,17 +774,29 @@ bool PopulateNominateListMenu(Menu menu, int client, const char[] filter = "")
|
|||||||
Format(display, sizeof(display), "%s (%T)", display, "VIP Nomination", client);
|
Format(display, sizeof(display), "%s (%T)", display, "VIP Nomination", client);
|
||||||
|
|
||||||
int owner = GetArrayCell(OwnerList, i);
|
int owner = GetArrayCell(OwnerList, i);
|
||||||
|
char spelling[8];
|
||||||
|
if (nominate_count_for_particular_map == 1)
|
||||||
|
{
|
||||||
|
Format(spelling, sizeof(spelling), "Vote");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
Format(spelling, sizeof(spelling), "Votes");
|
||||||
|
}
|
||||||
if(!owner)
|
if(!owner)
|
||||||
Format(display, sizeof(display), "%s (Admin)", display);
|
Format(display, sizeof(display), "%s (Admin)", display);
|
||||||
else
|
else
|
||||||
Format(display, sizeof(display), "%s (%N)", display, owner);
|
Format(display, sizeof(display), "%s (%i %s)", display, nominate_count_for_particular_map, spelling);
|
||||||
|
nominate_count_for_particular_map = -1;
|
||||||
|
sm.SetValue(map, nominate_count_for_particular_map, true);
|
||||||
AddMenuItem(menu, map, display);
|
AddMenuItem(menu, map, display);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete MapList;
|
delete MapList;
|
||||||
delete OwnerList;
|
delete OwnerList;
|
||||||
|
delete sm;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user