1
0
forked from 0ad/0ad

Resource Pool update.

This was SVN commit r1330.
This commit is contained in:
Acumen 2004-11-15 21:07:02 +00:00
parent e1bb0a3d2e
commit b727fbfa15
10 changed files with 142 additions and 142 deletions

View File

@ -46,6 +46,9 @@
<script file="gui/test/functions_session_group_pane.js"><![CDATA[
]]></script>
<script file="gui/test/functions_session_resource_pool.js"><![CDATA[
]]></script>
<script file="gui/test/functions_session_status_orb.js"><![CDATA[
]]></script>

View File

@ -19,7 +19,6 @@
startGame();
GUIObjectUnhide("session_gui");
GUIObjectHide("pregame_gui");
GUIObjectUnhide("End_Game_Button");
FlipGUI(GUIType);
]]></action>
<action on="MouseEnter"><![CDATA[

View File

@ -484,137 +484,63 @@
</object>
<!-- GROUP: TOP BAR -->
<!-- GROUP: RESOURCE BAR -->
<object type="empty" name="session_top_bar" hotkey="resourcepool.toggle" size="0 0 100% 100%" z="1" hidden="false">
<action on="Press"><![CDATA[
GUIObjectToggle("session_top_bar");
]]></action>
<!-- FOOD icon/background/text-->
<object type="text" name="resource_food" sprite="resource_food" z="70" ghost="true" hidden="false">
<object type="button" name="resource_food_counter" sprite="resource_food_counter" style="resource_counter" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%-191 0%+4 50%-171 0%+24",
"50%-191 100%-24 50%-171 100%-4");
]]></action>
</object>
<object type="text" name="resource_food_counter" sprite="resource_counter" z="70" font="prospero16" textcolor="255 255 255" ghost="true" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%-171 0%+5 50%-118 0%+24",
"50%-171 100%-24 50%-118 100%-5");
]]></action>
</object>
<object type="text" name="resource_food_text" font="prospero16" textcolor="255 255 255" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
this.caption = "123,456";
AddSizeString(this.name,
"50%-175 0%+1 50%-118 0%+10",
"50%-175 100%-28 50%-118 100%-4");
]]></action>
</object>
this.caption = "123,456";
<!-- WOOD -->
<!-- icon/background/text -->
<object type="text" name="resource_wood" sprite="resource_wood" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%-111 0%+4 50%-91 0%+24",
"50%-111 100%-24 50%-91 100%-4");
AddSizeCoord(this.name,
crd_resource_food_x, crd_resource_food_y, crd_resource_food_x+crd_resource_counter_width, crd_resource_food_y+crd_resource_counter_height, mid_screen, top_screen, mid_screen, top_screen,
crd_resource_food_x, -crd_resource_food_y-crd_resource_counter_height, crd_resource_food_x+crd_resource_counter_width, -crd_resource_food_y, mid_screen, bottom_screen, mid_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="resource_wood_counter" sprite="resource_counter" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%-91 0%+5 50%-38 0%+24",
"50%-91 100%-24 50%-38 100%-5");
]]></action>
</object>
<object type="text" name="resource_wood_text" font="prospero16" textcolor="255 255 255" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
this.caption = "789,012";
AddSizeString(this.name,
"50%-95 0%+1 50%-42 0%+10",
"50%-95 100%-28 50%-42 100%-4");
]]></action>
</object>
<!-- STONE -->
<!-- icon/background/text -->
<object type="text" name="resource_stone" sprite="resource_stone" z="70" ghost="true" hidden="false">
<object type="button" name="resource_wood_counter" sprite="resource_wood_counter" style="resource_counter" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%-31 0%+4 50%-11 0%+24",
"50%-31 100%-24 50%-11 100%-4");
]]></action>
</object>
<object type="text" name="resource_stone_counter" sprite="resource_counter" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%-11 0%+5 50%+42 0%+24",
"50%-11 100%-24 50%+42 100%-5");
]]></action>
</object>
<object type="text" name="resource_stone_text" font="prospero16" textcolor="255 255 255" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
this.caption = "345,678";
AddSizeString(this.name,
"50%-13 0%+1 50%+40 0%+10",
"50%-13 100%-28 50%+40 100%-4");
]]></action>
</object>
this.caption = "789,012";
<!-- ORE -->
<!-- icon/background/text -->
<object type="text" name="resource_ore" sprite="resource_ore" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%+49 0%+4 50%-29 0%+24",
"50%+49 100%-24 50%-29 100%-4");
AddSizeCoord(this.name,
crd_resource_wood_x, crd_resource_wood_y, crd_resource_wood_x+crd_resource_counter_width, crd_resource_wood_y+crd_resource_counter_height, mid_screen, top_screen, mid_screen, top_screen,
crd_resource_wood_x, -crd_resource_wood_y-crd_resource_counter_height, crd_resource_wood_x+crd_resource_counter_width, -crd_resource_wood_y, mid_screen, bottom_screen, mid_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="resource_ore_counter" sprite="resource_counter" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%+69 0%+5 50%+122 0%+24",
"50%+69 100%-24 50%+122 100%-5");
]]></action>
</object>
<object type="text" name="resource_ore_text" font="prospero16" textcolor="255 255 255" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
this.caption = "910,123";
AddSizeString(this.name,
"50%+67 0%+1 50%+120 0%+24",
"50%+67 100%-28 50%+120 100%-4");
]]></action>
</object>
<!-- POPULATION -->
<!-- icon/background/text -->
<object type="text" name="resource_population" sprite="resource_population" z="70" ghost="true" hidden="false">
<object type="button" name="resource_stone_counter" sprite="resource_stone_counter" style="resource_counter" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%+129 0%+4 50%+149 0%+24",
"50%+129 100%-24 50%+149 100%-4");
]]></action>
</object>
<object type="text" name="resource_population_counter" sprite="resource_counter_long" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
AddSizeString(this.name,
"50%+149 0%+5 50%+202 0%+24",
"50%+149 100%-24 50%+202 100%-5");
]]></action>
</object>
<object type="text" name="resource_population_text" font="prospero16" textcolor="255 255 255" z="70" ghost="true" hidden="false">
<action on="Load"><![CDATA[
this.caption = "100/150";
AddSizeString(this.name,
"50%+147 0%+1 50%+200 0%+24",
"50%+147 100%-28 50%+200 100%-4");
]]></action>
</object>
this.caption = "109,854";
<!-- / GROUP: TOP BAR -->
AddSizeCoord(this.name,
crd_resource_stone_x, crd_resource_stone_y, crd_resource_stone_x+crd_resource_counter_width, crd_resource_stone_y+crd_resource_counter_height, mid_screen, top_screen, mid_screen, top_screen,
crd_resource_stone_x, -crd_resource_stone_y-crd_resource_counter_height, crd_resource_stone_x+crd_resource_counter_width, -crd_resource_stone_y, mid_screen, bottom_screen, mid_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="resource_ore_counter" sprite="resource_ore_counter" style="resource_counter" z="70" hidden="false">
<action on="Load"><![CDATA[
this.caption = "42";
AddSizeCoord(this.name,
crd_resource_ore_x, crd_resource_ore_y, crd_resource_ore_x+crd_resource_counter_width, crd_resource_ore_y+crd_resource_counter_height, mid_screen, top_screen, mid_screen, top_screen,
crd_resource_ore_x, -crd_resource_ore_y-crd_resource_counter_height, crd_resource_ore_x+crd_resource_counter_width, -crd_resource_ore_y, mid_screen, bottom_screen, mid_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="resource_population_counter" sprite="resource_population_counter" style="resource_counter" z="70" hidden="false">
<action on="Load"><![CDATA[
this.caption = "199/200";
AddSizeCoord(this.name,
crd_resource_population_x, crd_resource_population_y, crd_resource_population_x+crd_resource_counter_long_width, crd_resource_population_y+crd_resource_counter_height, mid_screen, top_screen, mid_screen, top_screen,
crd_resource_population_x, -crd_resource_population_y-crd_resource_counter_height, crd_resource_population_x+crd_resource_counter_long_width, -crd_resource_population_y, mid_screen, bottom_screen, mid_screen, bottom_screen);
]]></action>
</object>
<!-- / GROUP: RESOURCE BAR -->
</object>
<!-- GROUP: MAP ORB -->
@ -804,20 +730,20 @@
</object>
<!-- STATUS ORB STATISTICS AND ICONS (Experience, Hitpoints, Supply, Garrison) -->
<object type="button" name="session_panel_status_icon_supply" sprite="resource_food" textcolor="252 148 78" text-align="center" text-valign="center" ghost="true" z="70" hidden="false">
<object type="button" name="session_panel_status_icon_supply" textcolor="252 148 78" text-align="center" text-valign="center" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_icon_supply",
"0%+135 0%+65 0%+150 0%+130",
"0%+135 100%-110 0%+150 100%-45");
getGUIObjectByName("session_panel_status_icon_supply").caption = "1575";
getGUIObjectByName("session_panel_status_icon_supply").caption = "[icon=icon_resource_food] 1575";
]]></action>
</object>
<object type="button" name="session_panel_status_icon_garrison" sprite="statistic_garrison" textcolor="100 100 255" text-align="center" text-valign="center" ghost="true" z="70" hidden="false">
<object type="button" name="session_panel_status_icon_garrison" textcolor="100 100 255" text-align="center" text-valign="center" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_icon_garrison",
"0%+126 0%+65 0%+141 0%+130",
"0%+126 100%-160 0%+141 100%-95");
getGUIObjectByName("session_panel_status_icon_garrison").caption = "23/30";
"0%+116 0%+65 0%+141 0%+130",
"0%+116 100%-160 0%+141 100%-95");
getGUIObjectByName("session_panel_status_icon_garrison").caption = "[icon=icon_statistic_garrison] 23/30";
]]></action>
</object>

View File

@ -37,16 +37,10 @@
<!-- TEMPORARY END GAME BUTTON; REMOVE WHEN GAME MENU IMPLEMENTED; BUTTON IS OUTSIDE OF pregame_gui IN ORDER TO BE VISIBLE DURING GAME -->
<object type="button" name="End_Game_Button" sprite="sprite1" sprite-over="sprite1-over" sprite-pressed="sprite1-pressed" z="105" textcolor="0 0 0" text-align="center" text-valign="center" hidden="true">End Game
<action on="Load"><![CDATA[
AddSizeString(this.name,
"100%-150 100%-53 100%-30 100%-32",
"100%-150 0%+32 100%-30 0%+53");
]]></action>
<object type="button" name="End_Game_Button" hotkey="endgame" z="105" hidden="true">
<action on="Press"><![CDATA[
endGame();
GUIObjectHide("session_gui");
GUIObjectHide("End_Game_Button");
GUIObjectUnhide("pregame_gui");
]]></action>
</object>

View File

@ -2,6 +2,7 @@ function initSession()
{
initCoord();
initGroupPane();
initResourcePool();
}
// ====================================================================

View File

@ -11,6 +11,15 @@ function initCoord()
crd_portrait_lrg_height = crd_portrait_lrg_width;
crd_portrait_sml_width = 32;
crd_portrait_sml_height = crd_portrait_sml_width;
// Screen percentages.
top_screen = 0;
mid_screen = 50;
bottom_screen = 100;
// Small icons (eg Movement Rate, Food).
crd_mini_icon_width = 20;
crd_mini_icon_height = crd_mini_icon_width;
}
// ====================================================================
@ -139,6 +148,8 @@ function FlipGUI(NewGUIType)
break;
}
}
UpdateGroupPane();
}
else
{

View File

@ -0,0 +1,24 @@
function initResourcePool()
{
// Resource counter (base).
crd_resource_counter_width_base = 53;
crd_resource_counter_height_base = 19;
// Resource counter (short).
crd_resource_counter_width = crd_mini_icon_width+crd_resource_counter_width_base+1;
crd_resource_counter_height = crd_mini_icon_height;
// Resource counter (long).
crd_resource_counter_long_width = crd_resource_counter_width+9;
crd_resource_counter_long_height = crd_resource_counter_height;
// Resource counter span.
crd_resource_counter_span = 5;
crd_resource_food_x = -200;
crd_resource_food_y = 4;
crd_resource_wood_x = crd_resource_food_x+crd_resource_counter_width+crd_resource_counter_span;
crd_resource_wood_y = crd_resource_food_y;
crd_resource_stone_x = crd_resource_wood_x+crd_resource_counter_width+crd_resource_counter_span;
crd_resource_stone_y = crd_resource_wood_y;
crd_resource_ore_x = crd_resource_stone_x+crd_resource_counter_width+crd_resource_counter_span;
crd_resource_ore_y = crd_resource_stone_y;
crd_resource_population_x = crd_resource_ore_x+crd_resource_counter_width+crd_resource_counter_span;
crd_resource_population_y = crd_resource_ore_y;
}

View File

@ -42,7 +42,16 @@
sprite-button-top-pressed="sprite2-pressed"
/>
<icon name="smiley" texture="test2" size="16 16" />
<!-- Resource Icons -->
<icon name="icon_resource_food" texture="resource_food" size="20 20"/>
<icon name="icon_resource_wood" texture="resource_wood" size="20 20"/>
<icon name="icon_resource_stone" texture="resource_stone" size="20 20"/>
<icon name="icon_resource_ore" texture="resource_ore" size="20 20"/>
<icon name="icon_resource_population" texture="resource_population" size="20 20"/>
<!-- Statistic Icons -->
<icon name="icon_statistic_garrison" texture="statistic_garrison" size="20 20"/>
<!-- Commented out until tooltips are implemented as documented.
<tooltip name="session_tooltip"

View File

@ -236,36 +236,61 @@
<!--
==========================================
TOP BAR
RESOURCE BAR
==========================================
-->
<sprite name="resource_food">
<image texture="ui_icon_resource_food_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_food_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="resource_wood">
<image texture="ui_icon_resource_wood_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_wood_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="resource_stone">
<image texture="ui_icon_resource_stone_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_stone_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="resource_ore">
<image texture="ui_icon_resource_ore_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_ore_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="resource_population">
<image texture="ui_icon_resource_population_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_population_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="resource_counter">
<image texture="ui_icon_resource_counter.png" texture-size="0 0 64 64" size="0 0 53 19" />
<image texture="ui_icon_resource_counter.png" texture-size="0 0 64 64" size="0 0 100% 100%" />
</sprite>
<sprite name="resource_counter_long">
<image texture="ui_icon_resource_counter_long.png" texture-size="0 0 64 64" size="0 0 62 19" />
<image texture="ui_icon_resource_counter_long.png" texture-size="0 0 64 64" size="0 0 100% 100%" />
</sprite>
<sprite name="resource_food_counter">
<image texture="ui_icon_resource_food_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_counter.png" texture-size="0 0 64 64" size="21 0 100% 100%" />
</sprite>
<sprite name="resource_wood_counter">
<image texture="ui_icon_resource_wood_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_counter.png" texture-size="0 0 64 64" size="21 0 100% 100%" />
</sprite>
<sprite name="resource_stone_counter">
<image texture="ui_icon_resource_stone_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_counter.png" texture-size="0 0 64 64" size="21 0 100% 100%" />
</sprite>
<sprite name="resource_ore_counter">
<image texture="ui_icon_resource_ore_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_counter.png" texture-size="0 0 64 64" size="21 0 100% 100%" />
</sprite>
<sprite name="resource_population_counter">
<image texture="ui_icon_resource_population_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_resource_counter_long.png" texture-size="0 0 64 64" size="21 0 100% 100%" />
</sprite>
<!--
@ -275,23 +300,23 @@
-->
<sprite name="statistic_hp">
<image texture="ui_icon_statistic_hp_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_statistic_hp_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="statistic_rank1">
<image texture="ui_icon_statistic_rank1_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_statistic_rank1_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="statistic_rank2">
<image texture="ui_icon_statistic_rank2_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_statistic_rank2_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="statistic_rank3">
<image texture="ui_icon_statistic_rank3_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_statistic_rank3_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="statistic_garrison">
<image texture="ui_icon_statistic_garrison_20.png" texture-size="0 0 32 32" size="0 0 20 20" />
<image texture="ui_icon_statistic_garrison_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<!--

View File

@ -23,6 +23,14 @@
sprite2-disabled="sprite2-disabled"
/>
<style name="resource_counter"
text-valign="bottom"
text-align="right"
font="prospero16"
textcolor="255 255 255"
ghost="true"
/>
<!-- Empty entity portrait. -->
<style name="portrait"
sprite="ui_portrait_default_64"