Index: ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js +++ ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js @@ -36,23 +36,11 @@ g_SelectionPanels.Alert = { "getMaxNumberOfItems": function() { - return 3; + return 2; }, - "conflictsWith": ["Barter"], "getItems": function(unitEntStates) { - let ret = []; - - if (unitEntStates.some(state => state.alertRaiser && !state.alertRaiser.hasRaisedAlert)) - ret.push("raise"); - - if (unitEntStates.some(state => state.alertRaiser && state.alertRaiser.hasRaisedAlert && state.alertRaiser.canIncreaseLevel)) - ret.push("increase"); - - if (unitEntStates.some(state => state.alertRaiser && state.alertRaiser.hasRaisedAlert)) - ret.push("end"); - - return ret; + return unitEntStates.some(state => !!state.alertRaiser) ? ["raise", "end"] : []; }, "setupButton": function(data) { @@ -62,9 +50,6 @@ case "raise": raiseAlert(); return; - case "increase": - increaseAlertLevel(); - return; case "end": endOfAlert(); return; @@ -77,10 +62,6 @@ data.icon.sprite = "stretched:session/icons/bell_level1.png"; data.button.tooltip = translate("Raise an alert!"); break; - case "increase": - data.icon.sprite = "stretched:session/icons/bell_level2.png"; - data.button.tooltip = translate("Increase the alert level to protect more units"); - break; case "end": data.button.tooltip = translate("End of alert."); data.icon.sprite = "stretched:session/icons/bell_level0.png"; @@ -88,7 +69,7 @@ } data.button.enabled = controlsPlayer(data.player); - setPanelObjectPosition(data.button, this.getMaxNumberOfItems() - data.i - 1, data.rowLength); + setPanelObjectPosition(data.button, this.getMaxNumberOfItems() - data.i, data.rowLength); return true; } }; @@ -99,7 +80,7 @@ return 4; }, "rowLength": 4, - "conflictsWith": ["Alert", "Garrison"], + "conflictsWith": ["Garrison"], "getItems": function(unitEntStates) { // If more than `rowLength` resources, don't display icons. Index: ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js +++ ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js @@ -461,23 +461,10 @@ function raiseAlert() { Engine.PostNetworkCommand({ - "type": "increase-alert-level", + "type": "alert-raise", "entities": g_Selection.toList().filter(ent => { let state = GetEntityState(ent); - return state && state.alertRaiser && !state.alertRaiser.hasRaisedAlert; - }) - }); -} - -function increaseAlertLevel() -{ - raiseAlert(); - - Engine.PostNetworkCommand({ - "type": "increase-alert-level", - "entities": g_Selection.toList().filter(ent => { - let state = GetEntityState(ent); - return state && state.alertRaiser && state.alertRaiser.canIncreaseLevel; + return state && !!state.alertRaiser; }) }); } @@ -488,7 +475,7 @@ "type": "alert-end", "entities": g_Selection.toList().filter(ent => { let state = GetEntityState(ent); - return state && state.alertRaiser && state.alertRaiser.hasRaisedAlert; + return state && !!state.alertRaiser; }) }); } Index: ps/trunk/binaries/data/mods/public/gui/session/selection_panels_left/barter_panel.xml =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/selection_panels_left/barter_panel.xml +++ ps/trunk/binaries/data/mods/public/gui/session/selection_panels_left/barter_panel.xml @@ -1,19 +1,19 @@