mirror of
https://github.com/Resxt/Plutonium-T6-Scripts.git
synced 2025-04-19 13:42:54 +00:00
mapvote 2.1.3
Added logic to hide the map when there is only one map players can vote, just like how modes work (forgot to implement maps as well)
This commit is contained in:
parent
014b568c97
commit
92761ce822
@ -198,6 +198,10 @@ ListenForVoteInputs()
|
||||
{
|
||||
continue; // stop/skip execution
|
||||
}
|
||||
else if (section == "mode" && level.mapvote["maps"]["by_index"].size <= 1 && input == "mapvote_unselect")
|
||||
{
|
||||
continue; // stop/skip execution
|
||||
}
|
||||
|
||||
if (input == "mapvote_down")
|
||||
{
|
||||
@ -317,7 +321,7 @@ CreateVoteMenu()
|
||||
{
|
||||
sectionsSeparation = 0;
|
||||
|
||||
if (level.mapvote["modes"]["by_index"].size > 1)
|
||||
if (level.mapvote["modes"]["by_index"].size > 1 && level.mapvote["maps"]["by_index"].size > 1)
|
||||
{
|
||||
sectionsSeparation = 1;
|
||||
}
|
||||
@ -329,39 +333,42 @@ CreateVoteMenu()
|
||||
hudLastPosY = -(((level.mapvote["maps"]["by_index"].size * spacing) / 2) - (spacing / 2));
|
||||
}
|
||||
|
||||
for (mapIndex = 0; mapIndex < level.mapvote["maps"]["by_index"].size; mapIndex++)
|
||||
if (level.mapvote["maps"]["by_index"].size > 1)
|
||||
{
|
||||
mapVotesHud = CreateHudText("", "objective", 1.5, "LEFT", "CENTER", GetDvarInt("mapvote_horizontal_spacing"), hudLastPosY, true, 0);
|
||||
mapVotesHud.color = GetGscColor(GetDvar("mapvote_colors_selected"));
|
||||
|
||||
level.mapvote["hud"]["maps"][mapIndex] = mapVotesHud;
|
||||
|
||||
foreach (player in GetHumanPlayers())
|
||||
for (mapIndex = 0; mapIndex < level.mapvote["maps"]["by_index"].size; mapIndex++)
|
||||
{
|
||||
mapName = "";
|
||||
mapVotesHud = CreateHudText("", "objective", 1.5, "LEFT", "CENTER", GetDvarInt("mapvote_horizontal_spacing"), hudLastPosY, true, 0);
|
||||
mapVotesHud.color = GetGscColor(GetDvar("mapvote_colors_selected"));
|
||||
|
||||
if (IsMultiplayerMode())
|
||||
level.mapvote["hud"]["maps"][mapIndex] = mapVotesHud;
|
||||
|
||||
foreach (player in GetHumanPlayers())
|
||||
{
|
||||
mapName = level.mapvote["maps"]["by_index"][mapIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
mapName = level.mapvote["maps"]["by_index"][mapIndex][0];
|
||||
mapName = "";
|
||||
|
||||
if (IsMultiplayerMode())
|
||||
{
|
||||
mapName = level.mapvote["maps"]["by_index"][mapIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
mapName = level.mapvote["maps"]["by_index"][mapIndex][0];
|
||||
}
|
||||
|
||||
player.mapvote["map"][mapIndex]["hud"] = player CreateHudText(mapName, "objective", 1.5, "LEFT", "CENTER", -(GetDvarInt("mapvote_horizontal_spacing")), hudLastPosY);
|
||||
|
||||
if (mapIndex == 0)
|
||||
{
|
||||
player UpdateSelection("map", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetElementUnselected(player.mapvote["map"][mapIndex]["hud"]);
|
||||
}
|
||||
}
|
||||
|
||||
player.mapvote["map"][mapIndex]["hud"] = player CreateHudText(mapName, "objective", 1.5, "LEFT", "CENTER", -(GetDvarInt("mapvote_horizontal_spacing")), hudLastPosY);
|
||||
|
||||
if (mapIndex == 0)
|
||||
{
|
||||
player UpdateSelection("map", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetElementUnselected(player.mapvote["map"][mapIndex]["hud"]);
|
||||
}
|
||||
hudLastPosY += spacing;
|
||||
}
|
||||
|
||||
hudLastPosY += spacing;
|
||||
}
|
||||
|
||||
if (IsMultiplayerMode() && level.mapvote["modes"]["by_index"].size > 1)
|
||||
@ -384,6 +391,11 @@ CreateVoteMenu()
|
||||
|
||||
hudLastPosY += spacing;
|
||||
}
|
||||
|
||||
if (level.mapvote["maps"]["by_index"].size <= 1)
|
||||
{
|
||||
player UpdateSelection("mode", 0);
|
||||
}
|
||||
}
|
||||
|
||||
foreach(player in GetHumanPlayers())
|
||||
|
Loading…
x
Reference in New Issue
Block a user