Allowed selections with only one group to also show the unit stats area
Split unit cycle back to 2 functions This was SVN commit r7781.
This commit is contained in:
parent
ef0a80623c
commit
9a6c020fce
@ -37,6 +37,11 @@ EntityGroups.prototype.reset = function()
|
||||
this.groups = [];
|
||||
};
|
||||
|
||||
EntityGroups.prototype.getLength = function()
|
||||
{
|
||||
return this.groups.length;
|
||||
};
|
||||
|
||||
EntityGroups.prototype.getPrimary = function()
|
||||
{
|
||||
return this.primary;
|
||||
|
@ -10,7 +10,8 @@ function resetCycleIndex()
|
||||
displayedCycleIndex = 1;
|
||||
}
|
||||
|
||||
function cycleThroughSelection(forward)
|
||||
/*
|
||||
function cycleThroughSelection(forward) // uses boolean to determine direction (forward or reverse)
|
||||
{
|
||||
var selection = g_Selection.toList();
|
||||
|
||||
@ -62,10 +63,9 @@ function cycleThroughSelection(forward)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function cycleThroughSelection1()
|
||||
function cycleThroughSelection()
|
||||
{
|
||||
var selection = g_Selection.toList();
|
||||
|
||||
@ -273,9 +273,17 @@ function updateSelectionDetails(simState)
|
||||
var typeCount = g_Selection.groups.getGroup(entState.template).typeCount;
|
||||
getGUIObjectByName("sdSelectionCount").caption = ((typeCount > 1)? displayedCycleIndex + "/" + typeCount : "");
|
||||
|
||||
var visible = !(typeCount > 1);
|
||||
getGUIObjectByName("sdCycleArea").hidden = visible;
|
||||
getGUIObjectByName("sdStatsArea").hidden = true;
|
||||
// Show cycle area if there is more than one unit of that type
|
||||
if (typeCount > 1)
|
||||
getGUIObjectByName("sdCycleArea").hidden = false;
|
||||
else
|
||||
getGUIObjectByName("sdCycleArea").hidden = true;
|
||||
|
||||
// Hide stats area if there is more thanone group
|
||||
if (g_Selection.groups.getLength() > 1)
|
||||
getGUIObjectByName("sdStatsArea").hidden = true;
|
||||
else
|
||||
getGUIObjectByName("sdStatsArea").hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -319,13 +319,13 @@
|
||||
<!-- Cycle through units area -->
|
||||
<object size= "6 120 86 136" name="sdCycleArea" type="image" sprite="menuBackground">
|
||||
<object name="sdIconButtonReverse" style="wheatArrowDn" type="button" size="0 0 16 16">
|
||||
<action on="Press">cycleThroughSelection(false);</action>
|
||||
<action on="Press">reverseCycleThroughSelection();</action>
|
||||
</object>
|
||||
|
||||
<object name="sdSelectionCount" ghost="true" style="groupIconsCenteredText" type="text"/>
|
||||
|
||||
<object name="sdIconButtonForward" style="wheatArrowUp" type="button" size="100%-16 0 100% 16">
|
||||
<action on="Press">cycleThroughSelection(true);</action>
|
||||
<action on="Press">cycleThroughSelection();</action>
|
||||
</object>
|
||||
</object>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user