Correct assignment dropdowns to always be adjustable by the game controller.

This was SVN commit r15454.
This commit is contained in:
JoshuaJB
2014-06-28 05:02:29 +00:00
parent c2763dca24
commit dd3fdf6800
@@ -1286,12 +1286,15 @@ function onGameAttributesChange()
var team = getSetting(pData, pDefs, "Team");
var civ = getSetting(pData, pDefs, "Civ");
// Nobody but the controller can assign people
pAssignmentText.hidden = g_IsController;
pAssignment.hidden = !g_IsController;
pAssignmentText.caption = pAssignment.list[pAssignment.selected];
// For clients or scenarios, hide some player dropdowns
// TODO: Allow clients to choose their own civ and team
if (!g_IsController || g_GameAttributes.mapType == "scenario")
{
pAssignmentText.hidden = false;
pAssignment.hidden = true;
pCivText.hidden = false;
pCiv.hidden = true;
pTeamText.hidden = false;
@@ -1302,12 +1305,9 @@ function onGameAttributesChange()
else
pCivText.caption = g_CivData[civ].Name;
pTeamText.caption = (team !== undefined && team >= 0) ? team+1 : "-";
pAssignmentText.caption = pAssignment.list[pAssignment.selected];
}
else if (g_GameAttributes.mapType != "scenario")
{
pAssignmentText.hidden = true;
pAssignment.hidden = false;
pCivText.hidden = true;
pCiv.hidden = false;
pTeamText.hidden = true;