Various GUI fixes to get the scripts in line with Mark's revised data types (much appreciated!).

This was SVN commit r1516.
This commit is contained in:
Acumen 2004-12-16 19:21:05 +00:00
parent d8ae8a524c
commit 4815f76c5f
8 changed files with 54 additions and 45 deletions

View File

@ -17,9 +17,9 @@
<Create
list=""
list.unit="hele_fem_b1;hele_isp_u1"
list.structciv="hele_cc;hele_fc;hele_ho1;hele_ho2;hele_ho3;hele_rc;hele_tc;hele_hc"
list.structciv="hele_cc;hele_fc;hele_ho_1;hele_rc;hele_tc;hele_hc"
list.structmil="hele_mc;hele_pc;hele_ff;hele_tf;hele_wc;hele_wg;hele_wt"
list.tech="tech1;tech2"
list.tech="hele_fem_b1"
/>
</Actions>
<Actor>Hellenes Civilisation Centre</Actor>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity Tag="hele_tf" Parent="tf">
<Entity Tag="hele_wt" Parent="wt">
<Traits>
<Id
civ_code="hele"

View File

@ -78,7 +78,7 @@
evt.inflictor.traits.up.curr = 0;
// Transmogrify him into his next rank.
// evt.inflictor.template = getEntityTemplate(evt.inflictor.traits.up.newentity);
evt.inflictor.template = getEntityTemplate(evt.inflictor.traits.up.newentity);
}
}

View File

@ -15,5 +15,11 @@
history="Greek women were kept under tight control by their husbands, rarely leaving the home for anything beyond the necessities of daily life. They could not own anything or be involved in any business or legal transaction. They acted as household cook, nurse, seamstress, and early educator to young children. Spartan women were an exception to the normal code of conduct and enjoyed many freedoms."
/>
</Traits>
<Actions>
<Create
list=""
list.structciv="hele_cc;hele_fc;hele_ho_1;hele_rc;hele_tc;hele_hc"
/>
</Actions>
<Actor>The Dudette</Actor>
</Entity>

View File

@ -20,7 +20,13 @@
hpcurr="10"
/>
</Traits>
<Actions>
<Create
list=""
list.structciv="hele_cc;hele_fc;hele_ho_1;hele_rc;hele_tc;hele_hc"
list.structmil="hele_mc;hele_pc;hele_ff;hele_tf;hele_wc;hele_wg;hele_wt"
/>
</Actions>
<Actor>The Spartan</Actor>
</Entity>

View File

@ -24,7 +24,7 @@
<Up
curr="0"
rank="1"
req="600"
req="200"
/>
</Traits>
<Actions>

View File

@ -710,21 +710,21 @@
crd_status_orb_stat1_1_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat1_1_y, crd_status_orb_stat1_1_x+crd_status_orb_stat1_1_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat1_1_y+crd_status_orb_stat1_1_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="session_panel_status_stat2_1" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<object type="text" name="session_panel_status_stat2_1" font="verdana8" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_stat2_1_x, crd_status_orb_stat2_1_y, crd_status_orb_stat2_1_x+crd_status_orb_stat2_1_width, crd_status_orb_stat2_1_y+crd_status_orb_stat2_1_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_stat2_1_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat2_1_y, crd_status_orb_stat2_1_x+crd_status_orb_stat2_1_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat2_1_y+crd_status_orb_stat2_1_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="session_panel_status_stat3_1" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<object type="text" name="session_panel_status_stat3_1" font="verdana8" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_stat3_1_x, crd_status_orb_stat3_1_y, crd_status_orb_stat3_1_x+crd_status_orb_stat3_1_width, crd_status_orb_stat3_1_y+crd_status_orb_stat3_1_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_stat3_1_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat3_1_y, crd_status_orb_stat3_1_x+crd_status_orb_stat3_1_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat3_1_y+crd_status_orb_stat3_1_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="session_panel_status_stat4_1" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<object type="text" name="session_panel_status_stat4_1" font="verdana8" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_stat4_1_x, crd_status_orb_stat4_1_y, crd_status_orb_stat4_1_x+crd_status_orb_stat4_1_width, crd_status_orb_stat4_1_y+crd_status_orb_stat4_1_height, left_screen, top_screen, left_screen, top_screen,
@ -752,21 +752,21 @@
crd_status_orb_stat1_2_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat1_2_y, crd_status_orb_stat1_2_x+crd_status_orb_stat1_2_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat1_2_y+crd_status_orb_stat1_2_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="session_panel_status_stat2_2" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<object type="text" name="session_panel_status_stat2_2" font="verdana8" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_stat2_2_x, crd_status_orb_stat2_2_y, crd_status_orb_stat2_2_x+crd_status_orb_stat2_2_width, crd_status_orb_stat2_2_y+crd_status_orb_stat2_2_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_stat2_2_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat2_2_y, crd_status_orb_stat2_2_x+crd_status_orb_stat2_2_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat2_2_y+crd_status_orb_stat2_2_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="session_panel_status_stat3_2" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<object type="text" name="session_panel_status_stat3_2" font="verdana8" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_stat3_2_x, crd_status_orb_stat3_2_y, crd_status_orb_stat3_2_x+crd_status_orb_stat3_2_width, crd_status_orb_stat3_2_y+crd_status_orb_stat3_2_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_stat3_2_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat3_2_y, crd_status_orb_stat3_2_x+crd_status_orb_stat3_2_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat3_2_y+crd_status_orb_stat3_2_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="text" name="session_panel_status_stat4_2" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<object type="text" name="session_panel_status_stat4_2" font="verdana8" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_stat4_2_x, crd_status_orb_stat4_2_y, crd_status_orb_stat4_2_x+crd_status_orb_stat4_2_width, crd_status_orb_stat4_2_y+crd_status_orb_stat4_2_height, left_screen, top_screen, left_screen, top_screen,

View File

@ -580,36 +580,38 @@ function UpdateList(listIcon, listCol)
// Build unit list.
if (selection[0].actions.create && selection[0].actions.create.list)
{
listName = "";
switch (listIcon)
{
case "tab_train":
listName = selection[0].actions.create.list.unit;
if (selection[0].actions.create.list.unit)
listName = selection[0].actions.create.list.unit.toString();
break;
case "tab_buildciv":
listName = selection[0].actions.create.list.structciv;
if (selection[0].actions.create.list.structciv)
listName = selection[0].actions.create.list.structciv.toString();
break;
case "tab_buildmil":
listName = selection[0].actions.create.list.structmil;
if (selection[0].actions.create.list.structmil)
listName = selection[0].actions.create.list.structmil.toString();
break;
case "tab_research":
listName = selection[0].actions.create.list.tech;
if (selection[0].actions.create.list.tech)
listName = selection[0].actions.create.list.tech.toString();
break;
default:
return 0;
break;
}
if (listName)
if (listName != "")
{
// Enable tab portrait.
setPortrait("session_panel_status_command_pri_" + listCol, listIcon);
GUIObjectUnhide("session_panel_status_command_pri_" + listCol);
// Extract entity list into an array.
// (Give it a string literally identical to the attribute, as for some reason it doesn't work right now. :(
// listArray = parseDelimiterString(listName, ";");
listArray = parseDelimiterString("hele_fem_b1;hele_isp_u1;hele_fem_b1;hele_fem_b1;hele_isp_u1;hele_isp_u1;hele_isp_u1;hele_isp_u1;hele_isp_u1;hele_isp_u1;hele_isp_u1;hele_isp_u1;hele_isp_u1", ";");
listArray = parseDelimiterString(listName, ";", listName.length);
// Populate appropriate command buttons.
for (createLoop = 1; createLoop <= command_sub_max; createLoop++)
@ -629,8 +631,8 @@ function UpdateList(listIcon, listCol)
return listArray;
}
}
else
return 0;
return 0;
}
// ====================================================================
@ -665,12 +667,12 @@ function UpdateCommandButtons()
{
// Update train/research/build lists.
listCounter = 1;
unitArray = UpdateList("tab_train", listCounter); if (unitArray != "0") listCounter++;
structcivArray = UpdateList("tab_buildciv", listCounter); if (structcivArray != "0") listCounter++;
structmilArray = UpdateList("tab_buildmil", listCounter); if (structmilArray != "0") listCounter++;
techArray = UpdateList("tab_research", listCounter); if (techArray != "0") listCounter++;
formationArray = UpdateList("tab_formation", listCounter); if (formationArray != "0") listCounter++;
behaviourArray = UpdateList("tab_behaviour", listCounter); if (behaviourArray != "0") listCounter++;
unitArray = UpdateList("tab_train", listCounter); if (unitArray != 0) listCounter++;
structcivArray = UpdateList("tab_buildciv", listCounter); if (structcivArray != 0) listCounter++;
structmilArray = UpdateList("tab_buildmil", listCounter); if (structmilArray != 0) listCounter++;
techArray = UpdateList("tab_research", listCounter); if (techArray != 0) listCounter++;
formationArray = UpdateList("tab_formation", listCounter); if (formationArray != 0) listCounter++;
behaviourArray = UpdateList("tab_behaviour", listCounter); if (behaviourArray != 0) listCounter++;
// Update commands.
commandCounter = command_max;
@ -798,55 +800,50 @@ function UpdateStatusOrb()
}
// Update Attack stats
if (selection[0].actions.attack)
{
if (selection[0].actions.attack.damage && selection[0].actions.attack.damage > 0)
if (selection[0].actions.attack && selection[0].actions.attack.damage && selection[0].actions.attack.damage > 0)
getGUIObjectByName("session_panel_status_stat1_1").caption = '[icon="icon_statistic_attack"]' + selection[0].actions.attack.damage;
else
getGUIObjectByName("session_panel_status_stat1_1").caption = "";
if (selection[0].actions.attack.hack && selection[0].actions.attack.hack > 0)
if (selection[0].actions.attack && selection[0].actions.attack.hack && selection[0].actions.attack.hack > 0)
getGUIObjectByName("session_panel_status_stat2_1").caption = '[icon="icon_statistic_hack"]' + Math.round(selection[0].actions.attack.hack*100) + '%';
else
getGUIObjectByName("session_panel_status_stat2_1").caption = "";
if (selection[0].actions.attack.pierce && selection[0].actions.attack.pierce > 0)
if (selection[0].actions.attack && selection[0].actions.attack.pierce && selection[0].actions.attack.pierce > 0)
getGUIObjectByName("session_panel_status_stat3_1").caption = '[icon="icon_statistic_pierce"]' + Math.round(selection[0].actions.attack.pierce*100) + '%';
else
getGUIObjectByName("session_panel_status_stat3_1").caption = "";
if (selection[0].actions.attack.crush && selection[0].actions.attack.crush > 0)
if (selection[0].actions.attack && selection[0].actions.attack.crush && selection[0].actions.attack.crush > 0)
getGUIObjectByName("session_panel_status_stat4_1").caption = '[icon="icon_statistic_crush"]' + Math.round(selection[0].actions.attack.crush*100) + '%';
else
getGUIObjectByName("session_panel_status_stat4_1").caption = "";
if (selection[0].actions.attack.range && selection[0].actions.attack.range > 0)
if (selection[0].actions.attack && selection[0].actions.attack.range && selection[0].actions.attack.range > 0)
getGUIObjectByName("session_panel_status_stat5_1").caption = '[icon="icon_statistic_range"]' + selection[0].actions.attack.range;
else
getGUIObjectByName("session_panel_status_stat5_1").caption = "";
if (selection[0].actions.attack.accuracy && selection[0].actions.attack.accuracy > 0)
if (selection[0].actions.attack && selection[0].actions.attack.accuracy && selection[0].actions.attack.accuracy > 0)
getGUIObjectByName("session_panel_status_stat6_1").caption = '[icon="icon_statistic_accuracy"]' + Math.round(selection[0].actions.attack.accuracy*100) + '%';
else
getGUIObjectByName("session_panel_status_stat6_1").caption = "";
}
// Update Armour & Other stats
if (selection[0].traits.armour)
{
if (selection[0].traits.armour.value && selection[0].traits.armour.value > 0)
if (selection[0].traits.armour && selection[0].traits.armour.value && selection[0].traits.armour.value > 0)
getGUIObjectByName("session_panel_status_stat1_2").caption = '[icon="icon_statistic_armour"]' + selection[0].traits.armour.value;
else getGUIObjectByName("session_panel_status_stat1_2").caption = "";
if (selection[0].traits.armour.hack && selection[0].traits.armour.hack > 0)
if (selection[0].traits.armour && selection[0].traits.armour.hack && selection[0].traits.armour.hack > 0)
getGUIObjectByName("session_panel_status_stat2_2").caption = '[icon="icon_statistic_hack"]' + Math.round(selection[0].traits.armour.hack*100) + '%';
else getGUIObjectByName("session_panel_status_stat2_2").caption = "";
if (selection[0].traits.armour.pierce && selection[0].traits.armour.pierce > 0)
if (selection[0].traits.armour && selection[0].traits.armour.pierce && selection[0].traits.armour.pierce > 0)
getGUIObjectByName("session_panel_status_stat3_2").caption = '[icon="icon_statistic_pierce"]' + Math.round(selection[0].traits.armour.pierce*100) + '%';
else getGUIObjectByName("session_panel_status_stat3_2").caption = "";
if (selection[0].traits.armour.crush && selection[0].traits.armour.crush > 0)
if (selection[0].traits.armour && selection[0].traits.armour.crush && selection[0].traits.armour.crush > 0)
getGUIObjectByName("session_panel_status_stat4_2").caption = '[icon="icon_statistic_crush"]' + Math.round(selection[0].traits.armour.crush*100) + '%';
else getGUIObjectByName("session_panel_status_stat4_2").caption = "";
}
if (selection[0].actions.move && selection[0].actions.move.speed)
getGUIObjectByName("session_panel_status_stat5_2").caption = '[icon="icon_statistic_speed"]' + selection[0].actions.move.speed;
else getGUIObjectByName("session_panel_status_stat5_2").caption = "";