Index: binaries/data/mods/public/gui/session/selection_details.js =================================================================== --- binaries/data/mods/public/gui/session/selection_details.js +++ binaries/data/mods/public/gui/session/selection_details.js @@ -96,9 +96,18 @@ Engine.GetGUIObjectByName("rankIcon").tooltip = ""; } + let showHealth = entState.hitpoints; + let showResource = entState.resourceSupply; + + let captureSection = Engine.GetGUIObjectByName("captureSection"); + let healthSection = Engine.GetGUIObjectByName("healthSection"); + let resourceSection = Engine.GetGUIObjectByName("resourceSection"); + let sectionPosa = Engine.GetGUIObjectByName("sectionPosa"); + let sectionPosb = Engine.GetGUIObjectByName("sectionPosb"); + // Hitpoints - Engine.GetGUIObjectByName("healthSection").hidden = !entState.hitpoints; - if (entState.hitpoints) + healthSection.hidden = !showHealth; + if (showHealth) { let unitHealthBar = Engine.GetGUIObjectByName("healthBar"); let healthSize = unitHealthBar.size; @@ -120,10 +129,18 @@ "hitpoints": Math.ceil(entState.hitpoints), "maxHitpoints": Math.ceil(entState.maxHitpoints) }); + + resourceSection.size = showResource ? sectionPosb.size : sectionPosa.size; + captureSection.size = showResource ? sectionPosa.size : sectionPosb.size; + } + else + { + resourceSection.size = healthSection.size; + captureSection.size = sectionPosb.size; } // CapturePoints - Engine.GetGUIObjectByName("captureSection").hidden = !entState.capturePoints; + captureSection.hidden = !entState.capturePoints; if (entState.capturePoints) { let setCaptureBarPart = function(playerID, startSize) { @@ -146,10 +163,14 @@ if (i != entState.player) size = setCaptureBarPart(i, size); - Engine.GetGUIObjectByName("captureStats").caption = sprintf(translate("%(capturePoints)s / %(maxCapturePoints)s"), { + let captureText = sprintf(translate("%(capturePoints)s / %(maxCapturePoints)s"), { "capturePoints": Math.ceil(entState.capturePoints[entState.player]), "maxCapturePoints": Math.ceil(entState.maxCapturePoints) }); + + let showSmallCapture = showResource && showHealth; + Engine.GetGUIObjectByName("captureStats").caption = showSmallCapture ? "": captureText; + Engine.GetGUIObjectByName("capture").tooltip = showSmallCapture ? captureText : ""; } // Experience @@ -175,7 +196,7 @@ } // Resource stats - Engine.GetGUIObjectByName("resourceSection").hidden = !entState.resourceSupply; + resourceSection.hidden = !showResource; if (entState.resourceSupply) { let resources = entState.resourceSupply.isInfinite ? translate("∞") : // Infinity symbol @@ -196,10 +217,6 @@ }); Engine.GetGUIObjectByName("resourceStats").caption = resources; - if (entState.hitpoints) - Engine.GetGUIObjectByName("resourceSection").size = Engine.GetGUIObjectByName("captureSection").size; - else - Engine.GetGUIObjectByName("resourceSection").size = Engine.GetGUIObjectByName("healthSection").size; } // Resource carrying Index: binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml =================================================================== --- binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml +++ binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml @@ -5,14 +5,14 @@ - + - - + + Health: - - + + @@ -21,12 +21,12 @@ - - + + Capture points: - - + + - - - - + + + + + + + - + Attack and Armor Index: binaries/data/mods/public/gui/session/sprites.xml =================================================================== --- binaries/data/mods/public/gui/session/sprites.xml +++ binaries/data/mods/public/gui/session/sprites.xml @@ -335,6 +335,17 @@ /> + + + + + +