From c802dc31528285773931186041b28b5ffb1bafad Mon Sep 17 00:00:00 2001 From: Acumen Date: Wed, 22 Mar 2006 18:21:27 +0000 Subject: [PATCH] * Fixed minor glitch which was causing the garrison icon to not appear. (Temporarily moved garrison value into command cell sheet, then changed mind and swapped it back to having its own sheet, since it'd probably need to be coloured to match the nearby supply icon.) This was SVN commit r3673. --- .../ui/session/icons/sheets/garrison.txt | 2 - .../functions_page_session_status_pane.js | 6 +- .../data/mods/official/gui/test/sprite1.xml | 67 +++++++++++++++++++ 3 files changed, 71 insertions(+), 4 deletions(-) diff --git a/binaries/data/mods/official/art/textures/ui/session/icons/sheets/garrison.txt b/binaries/data/mods/official/art/textures/ui/session/icons/sheets/garrison.txt index 464c2e318a..d144fab93e 100644 --- a/binaries/data/mods/official/art/textures/ui/session/icons/sheets/garrison.txt +++ b/binaries/data/mods/official/art/textures/ui/session/icons/sheets/garrison.txt @@ -1,3 +1 @@ garrison,Garrison, -unload,Unload, -unloadtotarget,Unload to Target, diff --git a/binaries/data/mods/official/gui/test/functions_page_session_status_pane.js b/binaries/data/mods/official/gui/test/functions_page_session_status_pane.js index 4c13d90866..f988a0bc31 100644 --- a/binaries/data/mods/official/gui/test/functions_page_session_status_pane.js +++ b/binaries/data/mods/official/gui/test/functions_page_session_status_pane.js @@ -97,12 +97,13 @@ textCaption += '[font=verdana10][color="' + Math.round(selection[0].player.getCo // Update garrison capacity. if( shouldUpdateStat( "traits.garrison" ) ) { - // Update Supply/Garrison var guiObject = getGUIObjectByName("snStatusPaneGarrison"); guiObject.caption = ''; if (selection[0].traits.garrison) { + // Set garrison icon. + getGUIObjectByName ("snStatusPaneGarrisonIcon").cell_id = cellGroup["Garrison"]["garrison"].id; if (selection[0].traits.garrison.curr && selection[0].traits.garrison.max) { guiObject.caption += '[color="blue"]' + selection[0].traits.garrison.curr + '/' + selection[0].traits.garrison.max + '[/color] '; @@ -116,6 +117,7 @@ textCaption += '[font=verdana10][color="' + Math.round(selection[0].player.getCo getGUIObjectByName ("snStatusPaneGarrisonIcon").hidden = true; } } + if( shouldUpdateStat( "traits.supply" ) ) { guiObject = getGUIObjectByName("snStatusPaneSupply"); @@ -126,7 +128,7 @@ textCaption += '[font=verdana10][color="' + Math.round(selection[0].player.getCo if (selection[0].traits.supply.curr && selection[0].traits.supply.max && selection[0].traits.supply.type) { // Set resource icon. - getGUIObjectByName ("snStatusPaneSupplyIcon").cell_id = cellGroup["Resource"][selection[0].traits.supply.type]; + getGUIObjectByName ("snStatusPaneSupplyIcon").cell_id = cellGroup["Resource"][selection[0].traits.supply.type].id; // Special case for infinity. if (selection[0].traits.supply.curr == "0" && selection[0].traits.supply.max == "0") guiObject.caption += '[color="brown"] [icon="iconInfinity"] [/color] '; diff --git a/binaries/data/mods/official/gui/test/sprite1.xml b/binaries/data/mods/official/gui/test/sprite1.xml index bb61e3810d..44d7a671c1 100644 --- a/binaries/data/mods/official/gui/test/sprite1.xml +++ b/binaries/data/mods/official/gui/test/sprite1.xml @@ -1859,6 +1859,73 @@ size="0 0 100% 100%" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +