From 61fa8d29f6ff40bb18ecd3512203055cd4809283 Mon Sep 17 00:00:00 2001 From: WhiteTreePaladin Date: Thu, 30 Sep 2010 22:39:45 +0000 Subject: [PATCH] Some more in-game GUI progress. Multiple selections now look more like the mockup, but all the stats icons and bars still reference the first unit. I will fix that part later. This was SVN commit r8216. --- .../gui/session_new/selection_details.js | 58 ++++++++--------- .../mods/public/gui/session_new/session.xml | 51 ++++++++------- .../mods/public/gui/session_new/sprites.xml | 64 ++++++++++++++++++- .../public/gui/session_new/unit_commands.js | 9 ++- 4 files changed, 123 insertions(+), 59 deletions(-) diff --git a/binaries/data/mods/public/gui/session_new/selection_details.js b/binaries/data/mods/public/gui/session_new/selection_details.js index 7372c9c0a2..48edbc643f 100644 --- a/binaries/data/mods/public/gui/session_new/selection_details.js +++ b/binaries/data/mods/public/gui/session_new/selection_details.js @@ -2,39 +2,24 @@ const RESOURCE_ICON_CELL_IDS = {food : 0, wood : 1, stone : 2, metal : 3}; function layoutSelectionMultiple() { -// getGUIObjectByName("specific").hidden = true; -// getGUIObjectByName("iconBorder").hidden = true; -// getGUIObjectByName("statsArea").hidden = true; -// getGUIObjectByName("health").hidden = true; -// getGUIObjectByName("stamina").hidden = true; - - - getGUIObjectByName("detailsArea").hidden = true; + getGUIObjectByName("specific").hidden = true; + getGUIObjectByName("iconBorder").hidden = true; + getGUIObjectByName("attackIcon").size = "-4 10 32 46"; + getGUIObjectByName("armourIcon").size = "-4 46 32 82"; + + getGUIObjectByName("barsArea").size = "50%+60 40 100% 136" } -function layoutSelectionSingle(entState) +function layoutSelectionSingle() { - getGUIObjectByName("detailsArea").hidden = false; - - getGUIObjectByName("specific").hidden = false; getGUIObjectByName("iconBorder").hidden = false; -// getGUIObjectByName("sdStatsArea").hidden = false; - if (entState.hitpoints != undefined) - getGUIObjectByName("health").hidden = false; - else - getGUIObjectByName("health").hidden = true; - - var player = Engine.GetPlayerID(); - if (entState.player == player || g_DevSettings.controlAll) - { - //if (entState.stamina != undefined) - getGUIObjectByName("stamina").hidden = false; - //else - // getGUIObjectByName("stamina").hidden = true; - } + getGUIObjectByName("attackIcon").size = "0 0 48 48"; + getGUIObjectByName("armourIcon").size = "0 48 48 96"; + + getGUIObjectByName("barsArea").size = "50%+48 40 100% 136" } // Fills out information that most entities have @@ -173,14 +158,25 @@ function updateSelectionDetails() // Fill out general info and display it if (selection.length == 1) - { - displayGeneralInfo(entState, template); // must come after layout functions - getGUIObjectByName("detailsArea").hidden = false; - } + layoutSelectionSingle(); else + layoutSelectionMultiple(); + + if (entState.hitpoints != undefined) + getGUIObjectByName("health").hidden = false; + else + getGUIObjectByName("health").hidden = true; + + var player = Engine.GetPlayerID(); + if (entState.player == player || g_DevSettings.controlAll) { - getGUIObjectByName("detailsArea").hidden = true; + //if (entState.stamina != undefined) + getGUIObjectByName("stamina").hidden = false; + //else + // getGUIObjectByName("stamina").hidden = true; } + + displayGeneralInfo(entState, template); // must come after layout functions // Show Panels detailsPanel.hidden = false; diff --git a/binaries/data/mods/public/gui/session_new/session.xml b/binaries/data/mods/public/gui/session_new/session.xml index 6c84c1aa1f..2b0a51e62a 100644 --- a/binaries/data/mods/public/gui/session_new/session.xml +++ b/binaries/data/mods/public/gui/session_new/session.xml @@ -168,7 +168,7 @@ -