1
0
forked from 0ad/0ad

Various GUI updates.

This was SVN commit r1340.
This commit is contained in:
Acumen 2004-11-16 21:14:26 +00:00
parent 16287e8195
commit 419a1e0a7d
7 changed files with 238 additions and 77 deletions

View File

@ -13,8 +13,8 @@
<object type="empty" name="pregame_gui" size="0 0 100% 100%" z="1" hidden="false">
<action on="Load"><![CDATA[
// Play main 0 A.D. theme when the main menu starts.
curr_music = new Sound("audio/music/menu_track.ogg");
curr_music.loop();
// curr_music = new Sound("audio/music/menu_track.ogg");
// curr_music.loop();
]]></action>
<object type="image" name="pregame-mainmenu-background-image" sprite="pregame-mainmenu-background" size="0 0 100% 100%" z="100" hidden="false" />
@ -25,7 +25,9 @@
GUIObjectUnhide("session_gui");
GUIObjectHide("pregame_gui");
FlipGUI(GUIType);
curr_music.free(); // Close main theme when starting game session.
// curr_music.free(); // Close main theme when starting game session.
curr_session_music = new Sound("audio/music/germanic_peace_1.ogg");
curr_session_music.play();
]]></action>
<action on="MouseEnter"><![CDATA[
tooltipObject = getGUIObjectByName("pregame-mainmenu-tooltip");
@ -49,7 +51,7 @@
<object type="button" name="pregame-mainmenu-wfg-logo" sprite="pregame-mainmenu-wfg-logo-256x64" size="10 91.666666%-30 25.9765% 100%-30" z="102" hidden="false">
<action on="Press"><![CDATA[
btCode = new Array("GUIObjectHide('mb_main');");
messageBox(420, 420, "[icon=0ad_icon] A.D. - History Is Yours For The Taking\nby Wildfire Games, 2002-2004\n\nVersion 0.1.2 (PASAP II)\n\n" +
messageBox(420, 420, "[icon=0ad_icon] A.D. - History Is Yours For The Taking\nby Wildfire Games, 2002-2005\n\nVersion 0.1.2 (PASAP II)\n\n" +
"This is a confidental pre-release version of the game!\n\nVisit http://www.wildfiregames.com/0ad/ " +
"to learn more about [icon=0ad_icon] A.D., participate in the community and meet the developers.\n\n", "About [icon=0ad_icon] A.D.", 2, new Array(), btCode);
]]></action>

View File

@ -492,8 +492,6 @@
<object type="button" name="resource_food_counter" sprite="resource_food_counter" style="resource_counter" z="70" hidden="false">
<action on="Load"><![CDATA[
this.caption = "123,456";
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);
@ -502,8 +500,6 @@
<object type="button" name="resource_wood_counter" sprite="resource_wood_counter" style="resource_counter" z="70" hidden="false">
<action on="Load"><![CDATA[
this.caption = "789,012";
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);
@ -512,8 +508,6 @@
<object type="button" name="resource_stone_counter" sprite="resource_stone_counter" style="resource_counter" z="70" hidden="false">
<action on="Load"><![CDATA[
this.caption = "109,854";
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);
@ -522,8 +516,6 @@
<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);
@ -532,8 +524,6 @@
<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);
@ -651,100 +641,104 @@
</object>
<!-- RANK ICON -->
<object type="button" name="session_panel_status_icon_rank" sprite="statistic_rank2" ghost="true" z="70" hidden="false">
<object type="button" name="session_panel_status_icon_rank" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_icon_rank",
"0%+50 0%+44 0%+70 0%+47",
"0%+50 100%-180 0%+70 100%-160");
AddSizeCoord(this.name,
crd_status_orb_rank_x, crd_status_orb_rank_y, crd_status_orb_rank_x+crd_status_orb_rank_width, crd_status_orb_rank_y+crd_status_orb_rank_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_rank_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_rank_y, crd_status_orb_rank_x+crd_status_orb_rank_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_rank_y+crd_status_orb_rank_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<!-- HITPOINTS BAR -->
<object type="progressbar" name="session_panel_status_icon_hp_bar" style="group_portrait_bar" sprite-background="back-bar" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_icon_hp_bar",
"0%+6 0%+147 0%+66 0%+160",
"0%+6 100%-114 0%+66 100%-108");
]]></action>
</object>
<!-- EXPERIENCE BAR -->
<object type="progressbar" name="session_panel_status_icon_exp_bar" style="up_bar" sprite-background="back-bar" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_icon_exp_bar",
"0%+6 0%+147 0%+66 0%+160",
"0%+6 100%-106 0%+66 100%-98");
AddSizeCoord(this.name,
crd_status_orb_hpbar_x, crd_status_orb_hpbar_y, crd_status_orb_hpbar_x+crd_status_orb_hpbar_width, crd_status_orb_hpbar_y+crd_status_orb_hpbar_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_hpbar_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_hpbar_y, crd_status_orb_portrait_x+crd_status_orb_hpbar_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_hpbar_y+crd_status_orb_hpbar_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<!-- HITPOINTS TEXT -->
<object type="button" name="session_panel_status_icon_hp_text" font="verdana10" textcolor="0 255 0" text-align="center" text-valign="bottom" ghost="true" z="70" hidden="false">
<object type="button" name="session_panel_status_icon_hp_text" font="verdana10" textcolor="0 255 0" text-align="left" text-valign="center" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_icon_hp_text",
"0%+46 0%+148 0%+146 0%+161",
"0%+46 100%-110 0%+146 100%-104");
AddSizeCoord(this.name,
crd_status_orb_hpbar_text_x, crd_status_orb_hpbar_text_y, crd_status_orb_hpbar_text_x+crd_status_orb_hpbar_text_width, crd_status_orb_hpbar_text_y+crd_status_orb_hpbar_text_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_hpbar_text_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_hpbar_text_y, crd_status_orb_hpbar_text_x+crd_status_orb_hpbar_text_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_hpbar_text_y+crd_status_orb_hpbar_text_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<!-- EXPERIENCE BAR -->
<object type="progressbar" name="session_panel_status_icon_xp_bar" style="up_bar" sprite-background="back-bar" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_xpbar_x, crd_status_orb_xpbar_y, crd_status_orb_xpbar_x+crd_status_orb_xpbar_width, crd_status_orb_xpbar_y+crd_status_orb_xpbar_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_xpbar_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_xpbar_y, crd_status_orb_portrait_x+crd_status_orb_xpbar_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_xpbar_y+crd_status_orb_xpbar_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<!-- EXPERIENCE TEXT -->
<object type="button" name="session_panel_status_icon_exp_text" font="verdana10" textcolor="255 255 0" text-align="center" text-valign="bottom" ghost="true" z="70" hidden="false">
<object type="button" name="session_panel_status_icon_xp_text" font="verdana10" textcolor="255 255 0" text-align="left" text-valign="center" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_icon_exp_text",
"0%+46 0%+148 0%+146 0%+161",
"0%+46 100%-102 0%+146 100%-94");
getGUIObjectByName("session_panel_status_icon_exp_text").caption = "100/200";
AddSizeCoord(this.name,
crd_status_orb_xpbar_text_x, crd_status_orb_xpbar_text_y, crd_status_orb_xpbar_text_x+crd_status_orb_xpbar_text_width, crd_status_orb_xpbar_text_y+crd_status_orb_xpbar_text_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_xpbar_text_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_xpbar_text_y, crd_status_orb_xpbar_text_x+crd_status_orb_xpbar_text_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_xpbar_text_y+crd_status_orb_xpbar_text_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="session_panel_status_icon_hp" sprite="statistic_hp" ghost="true" z="70" hidden="true">
<!-- GARRISON COUNTER -->
<object type="button" name="session_panel_status_icon_garrison" textcolor="100 100 255" font="verdana11" text-align="left" text-valign="bottom" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_icon_hp",
"0%+75 0%+125 0%+95 0%+145",
"0%+75 100%-57 0%+95 100%-37");
AddSizeCoord(this.name,
crd_status_orb_garrison_x, crd_status_orb_garrison_y, crd_status_orb_garrison_x+crd_status_orb_garrison_width, crd_status_orb_garrison_y+crd_status_orb_garrison_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_garrison_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_garrison_y, crd_status_orb_garrison_x+crd_status_orb_garrison_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_garrison_y+crd_status_orb_garrison_height, left_screen, bottom_screen, left_screen, bottom_screen);
getGUIObjectByName("session_panel_status_icon_garrison").caption = "[icon=icon_statistic_garrison] 23/30";
]]></action>
</object>
<!-- SUPPLY COUNTER -->
<object type="button" name="session_panel_status_icon_supply" textcolor="252 148 78" font="verdana11" text-align="left" text-valign="bottom" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_supply_x, crd_status_orb_supply_y, crd_status_orb_supply_x+crd_status_orb_supply_width, crd_status_orb_supply_y+crd_status_orb_supply_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_supply_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_supply_y, crd_status_orb_supply_x+crd_status_orb_supply_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_supply_y+crd_status_orb_supply_height, left_screen, bottom_screen, left_screen, bottom_screen);
getGUIObjectByName("session_panel_status_icon_supply").caption = "[icon=icon_resource_wood] 1575";
]]></action>
</object>
<!-- NAME TEXT -->
<object type="text" name="session_panel_status_name1" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_name1",
"0%+2 0%+4 0%+254 0%+27",
"0%+2 100%-60 0%+254 100%-37");
AddSizeCoord(this.name,
crd_status_orb_name1_x, crd_status_orb_name1_y, crd_status_orb_name1_x+crd_status_orb_name1_width, crd_status_orb_name1_y+crd_status_orb_name1_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_name1_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_name1_y, crd_status_orb_name1_x+crd_status_orb_name1_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_name1_y+crd_status_orb_name1_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="session_panel_status_name2" font="verdana12" textcolor="255 255 255" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_name2",
"0%+2 0%+19 0%+254 0%+42",
"0%+2 100%-45 0%+254 100%-22");
AddSizeCoord(this.name,
crd_status_orb_name2_x, crd_status_orb_name2_y, crd_status_orb_name2_x+crd_status_orb_name2_width, crd_status_orb_name2_y+crd_status_orb_name2_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_name2_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_name2_y, crd_status_orb_name2_x+crd_status_orb_name2_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_name3_y+crd_status_orb_name3_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="session_panel_status_name3" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeString("session_panel_status_name3",
"0%+2 0%+34 0%+254 0%+59",
"0%+2 100%-28 0%+254 100%-17");
AddSizeCoord(this.name,
crd_status_orb_name3_x, crd_status_orb_name3_y, crd_status_orb_name3_x+crd_status_orb_name3_width, crd_status_orb_name3_y+crd_status_orb_name3_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_name3_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_name3_y, crd_status_orb_name3_x+crd_status_orb_name3_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_name3_y+crd_status_orb_name3_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<!-- STATUS ORB STATISTICS AND ICONS (Experience, Hitpoints, Supply, Garrison) -->
<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 = "[icon=icon_resource_food] 1575";
]]></action>
</object>
<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%+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>
<object type="text" name="session_panel_status_armour" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_armour_x, crd_status_orb_armour_y, crd_status_orb_armour_x+crd_status_orb_armour_width, crd_status_orb_armour_y+crd_status_orb_armour_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_armour_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_armour_y, crd_status_orb_armour_x+crd_status_orb_armour_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_armour_y+crd_status_orb_armour_height, left_screen, bottom_screen, left_screen, bottom_screen);
getGUIObjectByName("session_panel_status_armour").caption = "Attack:\nArmour:\n";
]]></action>
</object>
<!-- PRIMARY COMMAND BUTTONS (arcs the Status Orb) -->
<object type="button" name="session_panel_status_command_pri_1" style="portrait" textcolor="255 255 255" z="70" hidden="false">1

View File

@ -56,6 +56,29 @@ function manualDisplay()
if (selection[0].traits.id.rank)
ManualRollover.caption += "Rank: " + selection[0].traits.id.rank + "\n";
// Display experience.
if (selection[0].traits.transform && selection[0].traits.transform.upcurr && selection[0].traits.transform.upreq)
ManualRollover.caption += "XP: " + selection[0].traits.transform.upcurr + "/" + selection[0].traits.transform.upreq + "\n";
// Display UP on death.
if (selection[0].traits.loot.up)
ManualRollover.caption += "UP: " + selection[0].traits.loot.up + "\n";
// Display loot.
if (selection[0].traits.loot.food || selection[0].traits.loot.wood || selection[0].traits.loot.stone || selection[0].traits.loot.ore)
{
ManualRollover.caption += "Loot: ";
if (selection[0].traits.loot.food)
ManualRollover.caption += selection[0].traits.loot.food + " Food ";
if (selection[0].traits.loot.wood)
ManualRollover.caption += selection[0].traits.loot.wood + " Wood ";
if (selection[0].traits.loot.stone)
ManualRollover.caption += selection[0].traits.loot.stone + " Stone ";
if (selection[0].traits.loot.ore)
ManualRollover.caption += selection[0].traits.loot.ore + " Ore ";
ManualRollover.caption += "\n";
}
// Armour.
if (selection[0].traits.armour)
{
@ -72,7 +95,7 @@ function manualDisplay()
ManualRollover.caption += "Hack: " + Math.round(selection[0].traits.armour.hack*100) + "%, ";
if (selection[0].traits.armour.pierce)
ManualRollover.caption += "Hack: " + Math.round(selection[0].traits.armour.pierce*100) + "%";
ManualRollover.caption += "Pierce: " + Math.round(selection[0].traits.armour.pierce*100) + "%";
ManualRollover.caption += "]\n";
}
@ -94,7 +117,7 @@ function manualDisplay()
ManualRollover.caption += "Hack: " + Math.round(selection[0].actions.attack.hack*100) + "%, ";
if (selection[0].actions.attack.pierce)
ManualRollover.caption += "Hack: " + Math.round(selection[0].actions.attack.pierce*100) + "%";
ManualRollover.caption += "Pierce: " + Math.round(selection[0].actions.attack.pierce*100) + "%";
ManualRollover.caption += "]\n";
}

View File

@ -76,6 +76,8 @@ function getObjectInfo()
}
}
// Modify any resources given/taken (later, we need to base this on a resource-changing event).
UpdateResourcePool();
}
// ====================================================================

View File

@ -21,4 +21,50 @@ function initResourcePool()
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;
// Initialise Resource Pools.
Resource = new Object();
Resource.Food = 0;
Resource.Wood = 0;
Resource.Stone = 0;
Resource.Ore = 0;
Resource.Pop = new Object();
Resource.Pop.Curr = 0;
Resource.Pop.Housing = 0;
}
// ====================================================================
function GiveResources(resourceName, resourceQty)
{
// Generic function to add resources to the player's Pool.
switch (resourceName)
{
case "Food":
Resource.Food += resourceQty;
break;
case "Wood":
Resource.Wood += resourceQty;
break;
case "Stone":
Resource.Stone += resourceQty;
break;
case "Ore":
Resource.Ore += resourceQty;
break;
default:
break;
}
}
// ====================================================================
function UpdateResourcePool()
{
getGUIObjectByName("resource_food_counter").caption = Resource.Food;
getGUIObjectByName("resource_wood_counter").caption = Resource.Wood;
getGUIObjectByName("resource_stone_counter").caption = Resource.Stone;
getGUIObjectByName("resource_ore_counter").caption = Resource.Ore;
getGUIObjectByName("resource_population_counter").caption = Resource.Pop.Curr + "/" + Resource.Pop.Housing;
}

View File

@ -7,10 +7,81 @@ function initStatusOrb()
crd_status_orb_bkg_height = crd_status_orb_bkg_width;
// Status Orb large portrait.
crd_status_orb_portrait_x = 5;
crd_status_orb_portrait_y = 5;
crd_status_orb_portrait_x = 7;
crd_status_orb_portrait_y = 6;
crd_status_orb_portrait_width = crd_portrait_lrg_width;
crd_status_orb_portrait_height = crd_status_orb_portrait_width;
// Status Orb rank icon.
crd_status_orb_rank_width = crd_mini_icon_width;
crd_status_orb_rank_height = crd_mini_icon_width;
crd_status_orb_rank_x = crd_status_orb_portrait_x+crd_status_orb_portrait_width-crd_status_orb_rank_width;
crd_status_orb_rank_y = crd_status_orb_portrait_y;
// Status Orb health bar.
crd_status_orb_hpbar_span = 2;
crd_status_orb_hpbar_x = crd_status_orb_portrait_x;
crd_status_orb_hpbar_y = crd_status_orb_portrait_y+crd_status_orb_portrait_height+crd_status_orb_hpbar_span;
crd_status_orb_hpbar_width = crd_status_orb_portrait_width;
crd_status_orb_hpbar_height = 6;
// Status Orb health text.
crd_status_orb_hpbar_text_span_x = 4;
crd_status_orb_hpbar_text_span_y = 0;
crd_status_orb_hpbar_text_x = crd_status_orb_hpbar_x+crd_status_orb_hpbar_width+crd_status_orb_hpbar_text_span_x;
crd_status_orb_hpbar_text_y = crd_status_orb_hpbar_y+crd_status_orb_hpbar_text_span_y;
crd_status_orb_hpbar_text_width = 100;
crd_status_orb_hpbar_text_height = crd_status_orb_hpbar_height;
// Status Orb xp bar.
crd_status_orb_xpbar_x = crd_status_orb_hpbar_x;
crd_status_orb_xpbar_y = crd_status_orb_hpbar_y+crd_status_orb_hpbar_height+crd_status_orb_hpbar_span+1;
crd_status_orb_xpbar_width = crd_status_orb_hpbar_width;
crd_status_orb_xpbar_height = crd_status_orb_hpbar_height;
// Status Orb xp text.
crd_status_orb_xpbar_text_x = crd_status_orb_xpbar_x+crd_status_orb_xpbar_width+crd_status_orb_hpbar_text_span_x;
crd_status_orb_xpbar_text_y = crd_status_orb_xpbar_y+crd_status_orb_hpbar_text_span_y;
crd_status_orb_xpbar_text_width = crd_status_orb_hpbar_text_width;
crd_status_orb_xpbar_text_height = crd_status_orb_hpbar_text_height;
// Garrison counter.
crd_status_orb_garrison_span_x = 5;
crd_status_orb_garrison_span_y = 2;
crd_status_orb_garrison_x = crd_status_orb_portrait_x+crd_status_orb_portrait_width+crd_status_orb_garrison_span_x;
crd_status_orb_garrison_y = crd_status_orb_portrait_y+crd_status_orb_garrison_span_y;
crd_status_orb_garrison_width = 65;
crd_status_orb_garrison_height = 30;
// Supply counter.
crd_status_orb_supply_x = crd_status_orb_garrison_x;
crd_status_orb_supply_y = crd_status_orb_garrison_y+crd_status_orb_garrison_height-2;
crd_status_orb_supply_width = crd_status_orb_garrison_width+20;
crd_status_orb_supply_height = crd_status_orb_garrison_height;
// Name3.
crd_status_orb_name3_width = 252;
crd_status_orb_name3_height = 14;
crd_status_orb_name3_x = crd_status_orb_bkg_x+2;
crd_status_orb_name3_y = crd_status_orb_bkg_y+crd_status_orb_bkg_height-crd_status_orb_name3_height-8;
// Name2.
crd_status_orb_name2_width = crd_status_orb_name3_width;
crd_status_orb_name2_height = crd_status_orb_name3_height+1;
crd_status_orb_name2_x = crd_status_orb_name3_x;
crd_status_orb_name2_y = crd_status_orb_name3_y-crd_status_orb_name2_height;
// Name1.
crd_status_orb_name1_width = crd_status_orb_name2_width;
crd_status_orb_name1_height = crd_status_orb_name2_height;
crd_status_orb_name1_x = crd_status_orb_name2_x;
crd_status_orb_name1_y = crd_status_orb_name2_y-crd_status_orb_name1_height+1;
// Armour.
crd_status_orb_armour_width = crd_status_orb_bkg_width;
crd_status_orb_armour_height = (crd_status_orb_name1_y)-(crd_status_orb_xpbar_y+crd_status_orb_xpbar_height)-10;
crd_status_orb_armour_x = crd_status_orb_name3_x;
crd_status_orb_armour_y = crd_status_orb_xpbar_y+crd_status_orb_xpbar_height+10;
}
// ====================================================================
@ -69,10 +140,31 @@ function UpdateStatusOrb()
getGUIObjectByName("session_panel_status_icon_rank").sprite = "";
// Update hitpoints
if (selection[0].traits.health.curr & selection[0].traits.health.hitpoints)
if (selection[0].traits.health.curr && selection[0].traits.health.hitpoints)
{
getGUIObjectByName("session_panel_status_icon_hp_text").caption = Math.round(selection[0].traits.health.curr) + "/" + Math.round(selection[0].traits.health.hitpoints);
getGUIObjectByName("session_panel_status_icon_hp_text").hidden = false;
getGUIObjectByName("session_panel_status_icon_hp_bar").caption = ((Math.round(selection[0].traits.health.curr) * 100 ) / Math.round(selection[0].traits.health.hitpoints));
getGUIObjectByName("session_panel_status_icon_hp_bar").hidden = false;
}
else
{
getGUIObjectByName("session_panel_status_icon_hp_text").hidden = true;
getGUIObjectByName("session_panel_status_icon_hp_bar").hidden = true;
}
// Update upgrade points
if (selection[0].traits.transform && selection[0].traits.transform.upcurr && selection[0].traits.transform.upreq)
{
getGUIObjectByName("session_panel_status_icon_xp_text").caption = Math.round(selection[0].traits.transform.upcurr) + "/" + Math.round(selection[0].traits.transform.upreq);
getGUIObjectByName("session_panel_status_icon_xp_text").hidden = false;
getGUIObjectByName("session_panel_status_icon_xp_bar").caption = ((Math.round(selection[0].traits.transform.upcurr) * 100 ) / Math.round(selection[0].traits.transform.upreq));
getGUIObjectByName("session_panel_status_icon_xp_bar").hidden = false;
}
else
{
getGUIObjectByName("session_panel_status_icon_xp_text").hidden = true;
getGUIObjectByName("session_panel_status_icon_xp_bar").hidden = true;
}
// Reveal Status Orb

View File

@ -50,11 +50,13 @@
<icon name="icon_resource_population" texture="resource_population" size="20 20" />
<!-- Statistic Icons -->
<icon name="icon_statistic_garrison" texture="statistic_garrison" size="20 20" />
<icon name="icon_statistic_rank1" texture="statistic_rank1" size="20 20" />
<icon name="icon_statistic_rank2" texture="statistic_rank2" size="20 20" />
<icon name="icon_statistic_rank3" texture="statistic_rank3" size="20 20" />
<icon name="icon_statistic_hp" texture="statistic_hp" size="20 20" />
<!-- Generic Icons / malte, 15th nov -->
<icon name="0ad_icon" texture="0ad_icon" size="16 16" />
<!-- Commented out until tooltips are implemented as documented.