Initial commit of GUI changes. You're not liable to see much difference (in fact, there's probably less functionality than there used to be).

This is mostly to commit the new icon sheets so Jason can commit changes
directly if he prefers, and because I'm about to get back onto fixing
the command lists (not necessarily ones that actually do things when you
click them, but at least get them updating properly on the screen for
Matei), and want to commit a semi-usable update before I potentially
break it all again.

This was SVN commit r3571.
This commit is contained in:
Acumen 2006-02-27 23:37:43 +00:00
parent cbdc4e9686
commit 268584d177
46 changed files with 2122 additions and 864 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -18,11 +18,11 @@
<Actions>
<Create>
<List>
<Unit>
<Train>
<Infantry_Spearman_B />
<Infantry_Slinger_B />
<Cavalry_Javelinist_B />
</Unit>
</Train>
</List>
</Create>
</Actions>

View File

@ -22,11 +22,11 @@
<Actions>
<Create>
<List>
<Unit>
<Train>
<Infantry_Spearman_B />
<Infantry_Javelinist_B />
<Cavalry_Javelinist_B />
</Unit>
</Train>
</List>
</Create>
</Actions>

View File

@ -20,11 +20,11 @@
<Actions>
<Create>
<List>
<Unit>
<Train>
<Infantry_Spearman_B />
<Infantry_Javelinist_B />
<Cavalry_Swordsman_B />
</Unit>
</Train>
</List>
</Create>
</Actions>

View File

@ -20,11 +20,11 @@
<Actions>
<Create>
<List>
<Unit>
<Train>
<Infantry_Swordsman_B />
<Infantry_Slinger_B />
<Cavalry_Javelinist_B />
</Unit>
</Train>
</List>
</Create>
</Actions>

View File

@ -22,11 +22,11 @@
<Actions>
<Create>
<List>
<Unit>
<Train>
<Infantry_Spearman_B />
<Infantry_Archer_B />
<Cavalry_Javelinist_B />
</Unit>
</Train>
</List>
</Create>
</Actions>

View File

@ -22,11 +22,11 @@
<Actions>
<Create>
<List>
<Unit>
<Train>
<Infantry_Spearman_B />
<Infantry_Javelinist_B />
<Cavalry_Spearman_B />
</Unit>
</Train>
</List>
</Create>
</Actions>

View File

@ -11,7 +11,7 @@
<Generic>Structure</Generic>
<Icon>sheet_civ</Icon>
<Icon>PortraitSheet</Icon>
<Classes>Structure</Classes>

View File

@ -56,12 +56,12 @@
<Actions>
<Create>
<List>
<Unit>
<Train>
<Support_Female_Citizen />
</Unit>
<Tech>
</Train>
<Research>
<Fem />
</Tech>
</Research>
</List>
<Speed>1</Speed>
</Create>

View File

@ -12,7 +12,7 @@
<Generic>Unit</Generic>
<Icon>sheet_civ</Icon>
<Icon>PortraitSheet</Icon>
<Classes>Unit</Classes>

View File

@ -201,7 +201,7 @@
// resource is updated, so at this point we don't sweat that they have the same
// coordinates).
addCrds (tempName, 50, 0, -200, 4,
snConst.MiniIcon.Width+54, snConst.MiniIcon.Height+5);
snConst.MiniIcon.Width+54, snConst.MiniIcon.Height-10+5);
}
]]></action>
</object>
@ -228,7 +228,7 @@
]]></action>
<object name="snStatusPanePortrait"
style="portrait"
style="snPortrait"
type="button"
hotkey="selection.snap"
>
@ -249,165 +249,175 @@
<!-- COMMAND BUTTONS (arc the Status Pane) -->
<object name="snStatusPaneCommand1_1"
style="snPortrait"
type="button"
>
</object>
<object name="snStatusPaneCommandGroup1" >
<object type="button" name="snStatusPaneCommand1_2" />
<object type="button" name="snStatusPaneCommand1_3" />
<object type="button" name="snStatusPaneCommand1_4" />
<object type="button" name="snStatusPaneCommand1_5" />
<object type="button" name="snStatusPaneCommand1_6" />
<object type="button" name="snStatusPaneCommand1_7" />
<object type="button" name="snStatusPaneCommand1_8" />
<object type="button" name="snStatusPaneCommand1_9" />
<object type="button" name="snStatusPaneCommand1_10" />
<object type="button" name="snStatusPaneCommand1_11" />
<object type="button" name="snStatusPaneCommand1_12" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand1_12" />
</object>
<object name="snStatusPaneCommand2_1"
style="snPortrait"
type="button"
/>
<object name="snStatusPaneCommandGroup2" >
<object type="button" name="snStatusPaneCommand2_2" />
<object type="button" name="snStatusPaneCommand2_3" />
<object type="button" name="snStatusPaneCommand2_4" />
<object type="button" name="snStatusPaneCommand2_5" />
<object type="button" name="snStatusPaneCommand2_6" />
<object type="button" name="snStatusPaneCommand2_7" />
<object type="button" name="snStatusPaneCommand2_8" />
<object type="button" name="snStatusPaneCommand2_9" />
<object type="button" name="snStatusPaneCommand2_10" />
<object type="button" name="snStatusPaneCommand2_11" />
<object type="button" name="snStatusPaneCommand2_12" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand2_12" />
</object>
<object name="snStatusPaneCommand3_1"
style="snPortrait"
type="button"
/>
<object name="snStatusPaneCommandGroup3" >
<object type="button" name="snStatusPaneCommand3_2" />
<object type="button" name="snStatusPaneCommand3_3" />
<object type="button" name="snStatusPaneCommand3_4" />
<object type="button" name="snStatusPaneCommand3_5" />
<object type="button" name="snStatusPaneCommand3_6" />
<object type="button" name="snStatusPaneCommand3_7" />
<object type="button" name="snStatusPaneCommand3_8" />
<object type="button" name="snStatusPaneCommand3_9" />
<object type="button" name="snStatusPaneCommand3_10" />
<object type="button" name="snStatusPaneCommand3_11" />
<object type="button" name="snStatusPaneCommand3_12" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand3_12" />
</object>
<object name="snStatusPaneCommand4_1"
style="snPortrait"
type="button"
/>
<object name="snStatusPaneCommandGroup4" >
<object type="button" name="snStatusPaneCommand4_2" />
<object type="button" name="snStatusPaneCommand4_3" />
<object type="button" name="snStatusPaneCommand4_4" />
<object type="button" name="snStatusPaneCommand4_5" />
<object type="button" name="snStatusPaneCommand4_6" />
<object type="button" name="snStatusPaneCommand4_7" />
<object type="button" name="snStatusPaneCommand4_8" />
<object type="button" name="snStatusPaneCommand4_9" />
<object type="button" name="snStatusPaneCommand4_10" />
<object type="button" name="snStatusPaneCommand4_11" />
<object type="button" name="snStatusPaneCommand4_12" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand4_12" />
</object>
<object name="snStatusPaneCommand5_1"
style="snPortrait"
type="button"
/>
<object name="snStatusPaneCommandGroup5" >
<object type="button" name="snStatusPaneCommand5_2" />
<object type="button" name="snStatusPaneCommand5_3" />
<object type="button" name="snStatusPaneCommand5_4" />
<object type="button" name="snStatusPaneCommand5_5" />
<object type="button" name="snStatusPaneCommand5_6" />
<object type="button" name="snStatusPaneCommand5_7" />
<object type="button" name="snStatusPaneCommand5_8" />
<object type="button" name="snStatusPaneCommand5_9" />
<object type="button" name="snStatusPaneCommand5_10" />
<object type="button" name="snStatusPaneCommand5_11" />
<object type="button" name="snStatusPaneCommand5_12" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand5_12" />
</object>
<object name="snStatusPaneCommand6_1"
style="snPortrait"
type="button"
/>
<object name="snStatusPaneCommandGroup6" >
<object type="button" name="snStatusPaneCommand6_2" />
<object type="button" name="snStatusPaneCommand6_3" />
<object type="button" name="snStatusPaneCommand6_4" />
<object type="button" name="snStatusPaneCommand6_5" />
<object type="button" name="snStatusPaneCommand6_6" />
<object type="button" name="snStatusPaneCommand6_7" />
<object type="button" name="snStatusPaneCommand6_8" />
<object type="button" name="snStatusPaneCommand6_9" />
<object type="button" name="snStatusPaneCommand6_10" />
<object type="button" name="snStatusPaneCommand6_11" />
<object type="button" name="snStatusPaneCommand6_12" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand6_12" />
</object>
<object name="snStatusPaneCommand7_1"
style="snPortrait"
type="button"
/>
<object name="snStatusPaneCommandGroup7" >
<object type="button" name="snStatusPaneCommand7_2" />
<object type="button" name="snStatusPaneCommand7_3" />
<object type="button" name="snStatusPaneCommand7_4" />
<object type="button" name="snStatusPaneCommand7_5" />
<object type="button" name="snStatusPaneCommand7_6" />
<object type="button" name="snStatusPaneCommand7_7" />
<object type="button" name="snStatusPaneCommand7_8" />
<object type="button" name="snStatusPaneCommand7_9" />
<object type="button" name="snStatusPaneCommand7_10" />
<object type="button" name="snStatusPaneCommand7_11" />
<object type="button" name="snStatusPaneCommand7_12" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand7_12" />
</object>
<object name="snStatusPaneCommand8_1"
style="snPortrait"
type="button"
/>
<object name="snStatusPaneCommandGroup8" >
<object type="button" name="snStatusPaneCommand8_2" />
<object type="button" name="snStatusPaneCommand8_3" />
<object type="button" name="snStatusPaneCommand8_4" />
<object type="button" name="snStatusPaneCommand8_5" />
<object type="button" name="snStatusPaneCommand8_6" />
<object type="button" name="snStatusPaneCommand8_7" />
<object type="button" name="snStatusPaneCommand8_8" />
<object type="button" name="snStatusPaneCommand8_9" />
<object type="button" name="snStatusPaneCommand8_10" />
<object type="button" name="snStatusPaneCommand8_11" />
<object type="button" name="snStatusPaneCommand8_12" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand8_12" />
</object>
<object name="snStatusPaneCommand9_1"
style="snPortrait"
type="button"
/>
<object name="snStatusPaneCommandGroup9" >
<object type="button" name="snStatusPaneCommand9_2" />
<object type="button" name="snStatusPaneCommand9_3" />
<object type="button" name="snStatusPaneCommand9_4" />
<object type="button" name="snStatusPaneCommand9_5" />
<object type="button" name="snStatusPaneCommand9_6" />
<object type="button" name="snStatusPaneCommand9_7" />
<object type="button" name="snStatusPaneCommand9_8" />
<object type="button" name="snStatusPaneCommand9_9" />
<object type="button" name="snStatusPaneCommand9_10" />
<object type="button" name="snStatusPaneCommand9_11" />
<object type="button" name="snStatusPaneCommand9_12" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand9_12" />
</object>
<object name="snStatusPaneCommand10_1"
style="snPortrait"
type="button"
/>
<object name="snStatusPaneCommandGroup10" >
<object type="button" name="snStatusPaneCommand10_2" />
<object type="button" name="snStatusPaneCommand10_3" />
<object type="button" name="snStatusPaneCommand10_4" />
<object type="button" name="snStatusPaneCommand10_5" />
<object type="button" name="snStatusPaneCommand10_6" />
<object type="button" name="snStatusPaneCommand10_7" />
<object type="button" name="snStatusPaneCommand10_8" />
<object type="button" name="snStatusPaneCommand10_9" />
<object type="button" name="snStatusPaneCommand10_10" />
<object type="button" name="snStatusPaneCommand10_11" />
<object type="button" name="snStatusPaneCommand10_12"
<object style="snPortrait" type="button" name="snStatusPaneCommand10_2" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_3" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_4" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_5" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_6" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_7" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_8" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_9" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_10" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_11" />
<object style="snPortrait" type="button" name="snStatusPaneCommand10_12"
>
<action on="Load"><![CDATA[
defineCommandButtons(this.name);

View File

@ -56,7 +56,7 @@
]]></action>
<object name="mnPortrait"
style="portrait"
style="snPortrait"
type="button"
>
<action on="Load"><![CDATA[

View File

@ -14,7 +14,7 @@ function initSession()
// Portraits (large and small).
snConst.Portrait = new Object();
snConst.Portrait.Sml = new Object();
snConst.Portrait.Sml.Width = 36;
snConst.Portrait.Sml.Width = 45;
snConst.Portrait.Sml.Height = snConst.Portrait.Sml.Width;
snConst.Portrait.Lrg = new Object();
snConst.Portrait.Lrg.Width = 64;
@ -22,7 +22,7 @@ function initSession()
// Small icons (eg Movement Rate, Food).
snConst.MiniIcon = new Object();
snConst.MiniIcon.Width = 20;
snConst.MiniIcon.Width = 30;
snConst.MiniIcon.Height = snConst.MiniIcon.Width;
// ============================================= GLOBALS =================================================
@ -35,66 +35,165 @@ function initSession()
function initCellReference()
{
// Define cell reference constants for icon sheets.
cellGroup = new Array();
// Define the cells in this icon sheet.
groupName = "Armour";
addCell (groupName, "rating", "Rating");
addCell (groupName, "hack", "Hack");
addCell (groupName, "pierce", "Pierce");
addCell (groupName, "crush", "Crush");
// icon_sheet_statistic
stat_accuracy = 0;
stat_attack = 1;
stat_armour = 2;
stat_los = 3;
stat_speed = 4;
stat_range = 5;
stat_hack = 6;
stat_pierce = 7;
stat_crush = 8;
stat_rank1 = 9;
stat_rank2 = 10;
stat_rank3 = 11;
stat_garrison = 12;
stat_heart = 13;
// Define the cells in this icon sheet.
groupName = "Attack";
addCell (groupName, "rating", "Rating");
addCell (groupName, "hack", "Hack");
addCell (groupName, "pierce", "Pierce");
addCell (groupName, "crush", "Crush");
// Define the cells in this icon sheet.
groupName = "Command";
addCell (groupName, "patrol", "Patrol");
addCell (groupName, "townbell", "Town Bell");
addCell (groupName, "lock", "Lock");
addCell (groupName, "unlock", "Unlock");
addCell (groupName, "kill", "Kill");
addCell (groupName, "explore", "Explore");
addCell (groupName, "rallypoint", "Rally Point");
addCell (groupName, "stop", "Stop");
addCell (groupName, "heal", "Heal");
addCell (groupName, "repair", "Repair");
addCell (groupName, "herd", "Herd");
addCell (groupName, "escort", "Escort");
addCell (groupName, "move", "Move");
addCell (groupName, "attack", "Attack");
addCell (groupName, "build", "Build");
// portrait_sheet_action
// generic actions
action_empty = 0;
action_attack = 1;
action_patrol = 2;
action_stop = 3;
action_gather_food = 4;
action_gather_wood = 5;
action_gather_stone = 6;
action_gather_ore = 7;
action_rally = 8;
action_repair = 9;
action_heal = 10;
action_scout = 11;
action_townbell = 12;
action_lock = 13;
action_unlock = 14;
// formation actions
action_formation_box = 23;
action_formation_column_c = 24;
action_formation_column_o = 25;
action_formation_line_c = 26;
action_formation_line_o = 27;
action_formation_phalanx = 28;
action_formation_skirmish = 29;
action_formation_testudo = 30;
action_formation_wedge = 31;
// stance actions
action_stance_aggress = 39;
action_stance_avoid = 40;
action_stance_defend = 41;
action_stance_hold = 42;
action_stance_stand = 43;
// tab actions
action_tab_command = 48;
action_tab_train = 49;
action_tab_buildciv = 50;
action_tab_buildmil = 51;
action_tab_research = 52;
action_tab_formation = 53;
action_tab_stance = 54;
action_tab_barter = 55;
// Define the cells in this icon sheet.
groupName = "Find";
addCell (groupName, "citizen", "Citizen");
addCell (groupName, "military", "Military");
addCell (groupName, "hero", "Hero");
addCell (groupName, "civcentre", "Civic Centre");
// Define the cells in this icon sheet.
groupName = "Formation";
addCell (groupName, "box", "Box");
addCell (groupName, "column_c", "Column Closed");
addCell (groupName, "line_c", "Line Closed");
addCell (groupName, "column_o", "Column Open");
addCell (groupName, "line_o", "Line Open");
addCell (groupName, "flank", "Flank");
addCell (groupName, "skirmish", "Skirmish");
addCell (groupName, "wedge", "Wedge");
addCell (groupName, "testudo", "Testudo");
addCell (groupName, "phalanx", "Phalanx");
// Define the cells in this icon sheet.
groupName = "Garrison";
addCell (groupName, "garrison", "Garrison");
addCell (groupName, "unload", "Unload");
addCell (groupName, "unloadtotarget", "Unload to Target");
// Define the cells in this icon sheet.
groupName = "Gather";
addCell (groupName, "food", "Food");
addCell (groupName, "wood", "Wood");
addCell (groupName, "stone", "Stone");
addCell (groupName, "ore", "Ore");
addCell (groupName, "fish", "Fish");
addCell (groupName, "fruit", "Fruit");
addCell (groupName, "grain", "Grain");
addCell (groupName, "meat", "Meat");
addCell (groupName, "milk", "Milk");
// Define the cells in this icon sheet.
groupName = "Menu";
addCell (groupName, "game", "Game");
addCell (groupName, "diplomacy", "Diplomacy");
addCell (groupName, "objectives", "Objectives");
addCell (groupName, "score", "Score");
addCell (groupName, "chat", "Chat");
// Define the cells in this icon sheet.
groupName = "MiniMap";
addCell (groupName, "flare", "Flare");
addCell (groupName, "flare", "Terrain");
addCell (groupName, "flare", "Territories");
addCell (groupName, "friendorfoe", "Friend or Foe");
addCell (groupName, "economic", "Economic");
addCell (groupName, "military", "Military");
addCell (groupName, "resources", "Resources");
// Define the cells in this icon sheet.
groupName = "Rank";
addCell (groupName, "advanced", "Advanced");
addCell (groupName, "elite", "Elite");
// Define the cells in this icon sheet.
groupName = "Replay";
addCell (groupName, "pause", "Pause");
addCell (groupName, "play", "Play");
addCell (groupName, "rewind", "Rewind");
addCell (groupName, "fastforward", "Fast Forward");
addCell (groupName, "start", "Start");
addCell (groupName, "end", "End");
addCell (groupName, "cycle", "Cycle");
// Define the cells in this icon sheet.
groupName = "Resource";
addCell (groupName, "food", "Food");
addCell (groupName, "wood", "Wood");
addCell (groupName, "stone", "Stone");
addCell (groupName, "ore", "Ore");
addCell (groupName, "population", "Population");
// Define the cells in this icon sheet.
groupName = "Stance";
addCell (groupName, "aggress", "Aggress");
addCell (groupName, "defend", "Defend");
addCell (groupName, "avoid", "Avoid");
addCell (groupName, "stand", "Stand");
addCell (groupName, "hold", "Hold");
// Define the cells in this icon sheet.
groupName = "Statistic";
addCell (groupName, "accuracy", "Accuracy");
addCell (groupName, "vision", "Vision");
addCell (groupName, "speed", "Speed");
addCell (groupName, "range", "Range");
addCell (groupName, "capacity", "Capacity");
addCell (groupName, "health", "Health");
addCell (groupName, "stamina", "Stamina");
// Define the cells in this icon sheet.
groupName = "Tab";
addCell (groupName, "structciv", "Construct Civic Buildings");
addCell (groupName, "structmil", "Construct Military Buildings");
addCell (groupName, "train", "Train");
addCell (groupName, "research", "Research");
addCell (groupName, "command", "Command");
}
// ====================================================================
function addCell (group, cellID, cellName)
{
// Add a cell ID to a cell container group.
// If this array does not exist,
if (!cellGroup[group])
{
// Create the container.
cellGroup[group] = new Array();
cellGroup[group].length = new Object(0);
}
cellGroup[group][cellID] = new Array();
cellGroup[group][cellID].id = new Object (cellGroup[group].length);
cellGroup[group][cellID].name = new Object (cellName);
cellGroup[group].length++;
}
// ====================================================================
@ -104,9 +203,9 @@ function setPortrait(objectName, portraitString, portraitSuffix, portraitCell)
// Use this function as a shortcut to change a portrait object to a different portrait image.
// Accepts an object and specifies its default, rollover (lit) and disabled (gray) sprites.
// Sprite Format: "ui_portrait_"portraitString"_"portraitSuffix
// Sprite Format: "ui_portrait_"portraitString"_"portraitSuffix"_lit"
// Sprite Format: "ui_portrait_"portraitString"_"portraitSuffix"_gray"
// Sprite Format: "sn""portraitString""portraitSuffix"
// Sprite Format: "sn""portraitString""portraitSuffix""Over"
// Sprite Format: "sn""portraitString""portraitSuffix""Disabled"
// Note: Make sure the file follows this naming convention or bad things could happen.
// Get GUI object
@ -121,12 +220,12 @@ function setPortrait(objectName, portraitString, portraitSuffix, portraitCell)
// Set the three portraits.
if (portraitSuffix && portraitSuffix != "")
setPortraitGUIObject.sprite = "ui_portrait_" + portraitString + "_" + portraitSuffix;
setPortraitGUIObject.sprite = "sn" + portraitString + portraitSuffix;
else
setPortraitGUIObject.sprite = "ui_portrait_" + portraitString;
setPortraitGUIObject.sprite = "sn" + portraitString;
setPortraitGUIObject.sprite_over = setPortraitGUIObject.sprite + "_lit";
setPortraitGUIObject.sprite_disabled = setPortraitGUIObject.sprite + "_gray";
setPortraitGUIObject.sprite_over = setPortraitGUIObject.sprite + "Over";
setPortraitGUIObject.sprite_disabled = setPortraitGUIObject.sprite + "Disabled";
// If the source texture is a multi-frame image (icon sheet), specify correct cell.
if (portraitCell && portraitCell != "")

View File

@ -49,7 +49,7 @@ function refreshManual()
if (selection[0].traits.id.icon)
{
setPortrait ("mnPortrait", selection[0].traits.id.icon,
selection[0].traits.id.civ_code, selection[0].traits.id.icon_cell);
toTitleCase(selection[0].traits.id.civ_code), selection[0].traits.id.icon_cell);
}
// Display rollover text.

View File

@ -17,7 +17,7 @@ function defineCommandButtons(command)
// Maximum number of entries in a list.
snStatusPaneCommand.list.max = command.substring (command.lastIndexOf ("_")+1, command.length); // 12
// Number of tabs that are single buttons (no list).
// Number of tabs that have to be single buttons (no list).
snStatusPaneCommand.button.max = 5;
// When we reach this button, split the rows (remainder are vertical, not horizontal).
snStatusPaneCommand.split = 7;
@ -30,8 +30,6 @@ function defineCommandButtons(command)
// Update each tab.
for (var tabLoop = 1; tabLoop <= snStatusPaneCommand.tab.max; tabLoop++)
{
snStatusPaneCommand[tabLoop] = new Array();
tempGroupObject = getGUIObjectByName("snStatusPaneCommand" +
"Group" + tabLoop);
@ -41,18 +39,8 @@ function defineCommandButtons(command)
tempListObject = getGUIObjectByName("snStatusPaneCommand" +
tabLoop + "_" + listLoop);
// Define properties of list buttons.
tempListObject.style = "snAction";
// Set portrait to default.
setPortrait (tempListObject.name, "default_square");
// Create parameters where command button information will later be stored.
snStatusPaneCommand[tabLoop][listLoop] = new Array();
snStatusPaneCommand[tabLoop][listLoop].type = new Object();
snStatusPaneCommand[tabLoop][listLoop].name = new Object();
snStatusPaneCommand[tabLoop][listLoop].object = new Object();
snStatusPaneCommand[tabLoop][listLoop].last = new Object();
setPortrait (tempListObject.name, "IconPortrait");
// Determine x and y position for current button.
if (tabLoop >= snStatusPaneCommand.split)
@ -95,114 +83,268 @@ function defineCommandButtons(command)
}
// Define dimensions of list buttons.
addCrd ("snStatusPaneCommand" + tabLoop + "_" + listLoop, rb, 0, 100, x, y,
addCrds ("snStatusPaneCommand" + tabLoop + "_" + listLoop, 0, 100, x, y,
snConst.Portrait.Sml.Width, snConst.Portrait.Sml.Height);
addCrd ("snStatusPaneCommand" + tabLoop + "_" + listLoop, lb, 100, 100);
addCrd ("snStatusPaneCommand" + tabLoop + "_" + listLoop, lt, 100, 0);
addCrd ("snStatusPaneCommand" + tabLoop + "_" + listLoop, rt, 0, 0);
// Set array affected when button pressed.
tempListObject.onPress = function (event)
{
pressCommandButton(this);
}
/*
// Store indexes to the button for easy future reference.
Crd[getCrd ("snStatusPaneCommand" + tabLoop + "_" + listLoop, true)].tab = tabLoop;
Crd[getCrd ("snStatusPaneCommand" + tabLoop + "_" + listLoop, true)].list = listLoop;
// Create quantity and entity for create lists for future use.
Crd[getCrd ("snStatusPaneCommand" + tabLoop + "_" + listLoop, true)].entity = "";
Crd[getCrd ("snStatusPaneCommand" + tabLoop + "_" + listLoop, true)].quantity = 0;
*/
}
}
}
// ====================================================================
function UpdateList(listIcon, listCol)
function updateList (listTab, listGroup)
{
// Populates a given column of command icons with appropriate build portraits for the selected object.
// Returns an array of this selection.
// Build unit list.
if ( selection[0].traits.id.civ_code
&& selection[0].actions
&& selection[0].actions.create
&& selection[0].actions.create.list )
// If any items in the list (construction, train, research, etc, need to be updated, update that list.)
if ( shouldUpdateStat (listGroup) )
{
list = null;
switch (listIcon)
// Get tab.
tabObject = getGUIObjectByName ("snStatusPaneCommand" + listCounter + "_1");
groupObject = getGUIObjectByName ("snStatusPaneCommand" + "Group" + listCounter);
// Enable tab.
guiUnHide (tabObject.name);
// Set tab portrait.
setPortrait ("snStatusPaneCommand" + listCounter + "_1", "IconSheet", "TabButton", cellGroup["Tab"][listTab].id);
tooltip = cellGroup["Tab"][listTab].name;
tooltip += " Tab";
tabObject.tooltip = tooltip;
// Set tab function.
tabObject.onPress = function (event)
{
case action_tab_train:
if ( selection[0].actions.create.list.unit && shouldUpdateStat( "actions.create.list.unit" ) )
list = selection[0].actions.create.list.unit;
break;
case action_tab_buildciv:
if ( selection[0].actions.create.list.structciv && shouldUpdateStat( "actions.create.list.structciv" ) )
list = selection[0].actions.create.list.structciv;
break;
case action_tab_buildmil:
if ( selection[0].actions.create.list.structmil && shouldUpdateStat( "actions.create.list.structmil" ) )
list = selection[0].actions.create.list.structmil;
break;
case action_tab_research:
if ( selection[0].actions.create.list.tech && shouldUpdateStat( "actions.create.list.tech" ) )
list = selection[0].actions.create.list.tech;
break;
default:
return 0;
break;
// Click the tab button to toggle visibility of its list.
guiToggle ( "snStatusPaneCommandGroup" + this.name.substring (this.name.lastIndexOf ("d")+1, this.name.lastIndexOf ("_")) );
}
if ( list )
// If the list hasn't been hidden (tab is open),
if ( groupObject.hidden == false )
{
// Enable tab portrait.
guiUnHide("snStatusPaneCommand" + "Group" + listCol);
guiUnHide("snStatusPaneCommand" + listCol + "_1");
setPortrait("snStatusPaneCommand" + listCol + "_1", "sheet_action", "", listIcon);
// Reset list length.
snStatusPaneCommand[listCol][1].last = 0;
// Store content info in tab button for future reference.
snStatusPaneCommand[listCol][1].type = "list";
// Extract entity list into an array.
listArray = [];
for( i in list )
for ( i in listGroup )
{
listArray[listArray.length] = i.toString();
listArray[listArray.length] = i;
// Store any current quantity in the queue for this object.
// if (listGroup[i].quantity)
// listArray[listArray.length].quantity = listGroup[i].quantity;
}
// Populate appropriate command buttons.
// Populate the buttons in this tab's list.
for (createLoop = 1; createLoop < snStatusPaneCommand.list.max; createLoop++)
{
if (createLoop < listArray.length)
{
// Get name of current button.
listObject = getGUIObjectByName ("snStatusPaneCommand" + listCounter + "_" + (createLoop+1));
// Get name of entity to display in list.
UpdateListEntityName = selection[0].traits.id.civ_code + "_" + listArray[createLoop];
updateListEntityName = selection[0].traits.id.civ_code + "_" + listArray[createLoop];
getGUIObjectByName ("snStatusPaneCommand" + listCol + "_" + (createLoop+1)).caption = "";
// Store name of entity to display in list in this button's coordinate.
// Crd[getCrd (listObject.name, true)].entity = new Object(updateListEntityName);
guiUnHide("snStatusPaneCommand" + listCol + "_" + (createLoop+1));
setPortrait("snStatusPaneCommand" + listCol + "_" + (createLoop+1),
getEntityTemplate(UpdateListEntityName).traits.id.icon,
selection[0].traits.id.civ_code,
getEntityTemplate(UpdateListEntityName).traits.id.icon_cell);
// Set tooltip.
listObject.tooltip = getEntityTemplate(updateListEntityName).traits.id.civ + " " + getEntityTemplate(updateListEntityName).traits.id.generic;
// Store content info in tab button for future reference.
snStatusPaneCommand[listCol][createLoop+1].name = listIcon;
snStatusPaneCommand[listCol][createLoop+1].object = listArray[createLoop];
snStatusPaneCommand[listCol][createLoop+1].type = "list";
snStatusPaneCommand[listCol][createLoop+1].last++;
// Create quantity container in entity's create list if necessary.
// if (!listGroup[listArray[createLoop]].quantity)
// listGroup[listArray[createLoop]].quantity = new Object(0);
// Set caption to counter.
// if (listGroup[listArray[createLoop]].quantity > 1)
// listObject.caption = listGroup[listArray[createLoop]].quantity-1;
// Store pointer to quantity in coordinate.
// Crd[getCrd (listObject.name, true)].quantity = new Object(listGroup[listArray[createLoop]].quantity);
// Set portrait.
switch (listTab)
{
case "research":
// Skip research list for the moment, since we don't have any portraits for techs.
break;
default:
setPortrait (listObject.name,
getEntityTemplate(updateListEntityName).traits.id.icon,
toTitleCase(selection[0].traits.id.civ_code),
getEntityTemplate(updateListEntityName).traits.id.icon_cell);
break;
}
// Reveal portrait.
guiUnHide (listObject.name);
/*
// Set function that occurs when the button is pressed (left-clicked).
// (Somehow, we also need to do one for right-clicking -- decrement counter and remove item from queue.)
listObject.onPress = function (event)
{
switch (listTab)
{
case "StructCiv":
case "StructMil":
// Create building placement cursor.
startPlacing (Crd[getCrd (this.name, true)].entity);
break;
default:
// Attempt to add the entry to the queue.
if (attemptAddToBuildQueue (selection[0], Crd[getCrd (this.name, true)].entity, Crd[getCrd (this.name, true)].tab, Crd[getCrd (this.name, true)].list))
// if (attemptAddToBuildQueue (selection[0], updateListEntityName, tab, list))
{
// // Create quantity container in entity's create list if necessary.
// if (!listGroup[Crd[getCrd (this.name, true)].list].quantity)
// listGroup[Crd[getCrd (this.name, true)].list].quantity = new Object(0);
// Increment counter.
listGroup[Crd[getCrd (this.name, true)].list].quantity++;
// Set caption to counter.
if (listGroup[Crd[getCrd (this.name, true)].list].quantity > 1)
this.caption = listGroup[Crd[getCrd (this.name, true)].list].quantity-1;
console.write (this.caption);
}
break;
}
}
*/
}
else
{
guiHide("snStatusPaneCommand" + listCol + "_" + parseInt(createLoop+1));
// Conceal this button.
guiHide ("snStatusPaneCommand" + listCounter + "_" + parseInt(createLoop+1));
// Ensure it doesn't have a stored entity to display in list.
// Crd[getCrd ("snStatusPaneCommand" + listCounter + "_" + parseInt(createLoop+1), true)].entity = "";
// Ensure it doesn't have a stored quantity of queued items.
// Crd[getCrd ("snStatusPaneCommand" + listCounter + "_" + parseInt(createLoop+1), true)].quantity = 0;
}
}
return listArray;
}
listCounter++;
}
return 0;
}
// ====================================================================
function UpdateCommand(listIcon, listCol)
function refreshCommandButtons()
{
// Set start of tabs.
listCounter = 1;
if ( selection[0].actions && shouldUpdateStat( "actions" ) )
{
// Update production lists (Construction, Train, Barter). (Tab button, persistent buttons, click them to do things.)
if ( shouldUpdateStat( "actions.create" ) && shouldUpdateStat( "actions.create.list" ) )
{
// Everything in this block is tied to properties in
// actions.create.list, the above check should limit the
// number of times this update is needlessly made.
// Get train/research/build lists by seeking through entity's creation list.
listRoot = selection[0].actions.create.list;
for (listTab in listRoot)
{
// Note: This check indicates the production lists are updated twice on some occasions. I don't know why (error from shouldUpdate()?).
console.write (listTab + " " + listRoot[listTab]);
if (listTab != "research") // Do research later.
updateList (listTab, listRoot[listTab]);
}
}
// Update selection lists (formation, stance, trade). (Tab button holds current selection, click a button to select a new option and close the tab.)
// Update research production list (which should always go last after all the other lists).
if ( shouldUpdateStat( "actions.create" ) && shouldUpdateStat( "actions.create.list" )
&& shouldUpdateStat( "actions.create.list.research" ) && selection[0].actions.create.list.research )
{
updateList ("research", selection[0].actions.create.list.research);
}
// Update commands. (Click "tab" button to do something; no list).
// This whole section needs to be rewritten (now list of XML attributes instead of semicolon-delimited string).
/*
unitArray = UpdateList(action_tab_train, listCounter); if (unitArray != 0) listCounter++;
structcivArray = UpdateList(action_tab_buildciv, listCounter); if (structcivArray != 0) listCounter++;
structmilArray = UpdateList(action_tab_buildmil, listCounter); if (structmilArray != 0) listCounter++;
techArray = UpdateList(action_tab_research, listCounter); if (techArray != 0) listCounter++;
formationArray = UpdateList(action_tab_formation, listCounter); if (formationArray != 0) listCounter++;
stanceArray = UpdateList(action_tab_stance, listCounter); if (stanceArray != 0) listCounter++;
*/
if ( shouldUpdateStat( "actions" ) )
{
// Update commands.
commandCounter = snStatusPaneCommand.tab.max;
/*
commandCounter = UpdateCommand(cellGroup["Command"]["attack"].id, commandCounter);
commandCounter = UpdateCommand(cellGroup["Command"]["patrol"].id, commandCounter);
commandCounter = UpdateCommand(cellGroup["Command"]["repair"].id, commandCounter);
commandCounter = UpdateCommand(cellGroup["Gather"]["food"].id, commandCounter);
commandCounter = UpdateCommand(cellGroup["Gather"]["wood"].id, commandCounter);
commandCounter = UpdateCommand(cellGroup["Gather"]["stone"].id, commandCounter);
commandCounter = UpdateCommand(cellGroup["Gather"]["ore"].id, commandCounter);
*/
}
}
if (listCounter > 0 && commandCounter > 0)
{
// Clear remaining buttons between them.
for (commandClearLoop = listCounter; commandClearLoop <= commandCounter; commandClearLoop++)
{
guiHide ("snStatusPaneCommand" + commandClearLoop + "_1");
// If this slot could possibly contain a list, hide that too.
guiHide ("snStatusPaneCommand" + "Group" + commandClearLoop);
}
}
/*
// Update production queue.
GUIObject = getGUIObjectByName("snStatusPaneCommandProgress");
// If the entity has a production item underway,
if ( selection[0].actions.create && selection[0].actions.create.progress
&& selection[0].actions.create.progress.valueOf()
&& selection[0].actions.create.progress.valueOf().current
&& selection[0].actions.create.queue.valueOf()
&& selection[0].actions.create.queue.valueOf()[0].traits.creation.time )
{
// Set the value of the production progress bar.
GUIObject.caption = ((Math.round(Math.round(selection[0].actions.create.progress.valueOf().current)) * 100 ) / Math.round(selection[0].actions.create.queue.valueOf()[0].traits.creation.time));
// Set position of progress bar.
GUIObject.size = getGUIObjectByName("snStatusPaneCommand" + selection[0].actions.create.queue.valueOf()[0].tab + "_" + selection[0].actions.create.queue.valueOf()[0].list).size;
// Set progress bar tooltip.
// GUIObject.tooltip = "Training " + selection[0].actions.create.queue.valueOf()[0].traits.id.generic + " ... " + (Math.round(selection[0].actions.create.queue.valueOf()[0].traits.creation.time-Math.round(selection[0].actions.create.progress.valueOf().current)) + " seconds remaining.";
// Reveal progressbar.
GUIObject.hidden = false;
// Seek through queue.
for( queueEntry = 0; queueEntry < selection[0].actions.create.queue.valueOf().length; queueEntry++)
{
// Update list buttons so that they match the number of entries of that type in the queue.
getGUIObjectByName("snStatusPaneCommand" + selection[0].actions.create.queue.valueOf()[queueEntry].tab + "_" + selection[0].actions.create.queue.valueOf()[queueEntry].list).caption++;
}
}
else
{
// Hide the progress bar.
GUIObject.hidden = true;
GUIObject.tooltip = "";
}
*/
}
// ====================================================================
// ====================================================================
function UpdateCommand(listIcon, listCounter)
{
// Similar to UpdateList, but without the list.
// Updates a particular command button with a particular action.
@ -223,25 +365,25 @@ function UpdateCommand(listIcon, listCol)
)
{
// Set appearance of tab.
setPortrait("snStatusPaneCommand" + listCol + "_1", "sheet_action", "", listIcon);
guiUnHide("snStatusPaneCommand" + listCol + "_1");
setPortrait("snStatusPaneCommand" + listCounter + "_1", "IconSheetCommand", "Button", listIcon);
guiUnHide("snStatusPaneCommand" + listCounter + "_1");
// Hide its list.
guiHide("snStatusPaneCommand" + "Group" + listCol);
guiHide("snStatusPaneCommand" + "Group" + listCounter);
// Store content info in tab button for future reference.
snStatusPaneCommand[listCol][1].type = "command";
snStatusPaneCommand[listCol][1].last = 0;
snStatusPaneCommand[listCol][1].name = listIcon;
snStatusPaneCommand[listCounter][1].type = "command";
snStatusPaneCommand[listCounter][1].last = 0;
snStatusPaneCommand[listCounter][1].name = listIcon;
return (listCol-1);
return (listCounter-1);
}
else
return (listCol);
return (listCounter);
}
// ====================================================================
/*
function pressCommandButton(commandButton)
{
// Determine current object, tab, and list from command button name.
@ -305,88 +447,96 @@ console.write (snStatusPaneCommand[tab][list].type);
break;
}
}
// ====================================================================
function refreshCommandButtons()
{
if( shouldUpdateStat( "actions.create.list" ) )
{
// Everything in this block is tied to properties in
// actions.create.list, the above check should limit the
// number of times this update is needlessly made.
// Update train/research/build lists.
listCounter = 1;
// This whole section needs to be rewritten (now list of XML attributes instead of semicolon-delimited string).
unitArray = UpdateList(action_tab_train, listCounter); if (unitArray != 0) listCounter++;
structcivArray = UpdateList(action_tab_buildciv, listCounter); if (structcivArray != 0) listCounter++;
structmilArray = UpdateList(action_tab_buildmil, listCounter); if (structmilArray != 0) listCounter++;
techArray = UpdateList(action_tab_research, listCounter); if (techArray != 0) listCounter++;
formationArray = UpdateList(action_tab_formation, listCounter); if (formationArray != 0) listCounter++;
stanceArray = UpdateList(action_tab_stance, listCounter); if (stanceArray != 0) listCounter++;
}
if( shouldUpdateStat( "actions" ) )
{
// Update commands.
commandCounter = snStatusPaneCommand.tab.max;
commandCounter = UpdateCommand(action_attack, commandCounter);
commandCounter = UpdateCommand(action_patrol, commandCounter);
commandCounter = UpdateCommand(action_repair, commandCounter);
commandCounter = UpdateCommand(action_gather_food, commandCounter);
commandCounter = UpdateCommand(action_gather_wood, commandCounter);
commandCounter = UpdateCommand(action_gather_stone, commandCounter);
commandCounter = UpdateCommand(action_gather_ore, commandCounter);
}
if (listCounter > 0 && commandCounter > 0)
{
// Clear remaining buttons between them.
for (commandClearLoop = listCounter; commandClearLoop <= commandCounter; commandClearLoop++)
{
guiHide("snStatusPaneCommand" + commandClearLoop + "_1");
// If this slot could possibly contain a list, hide that too.
guiHide("snStatusPaneCommand" + "Group" + commandClearLoop);
}
}
/*
// Update production queue.
GUIObject = getGUIObjectByName("snStatusPaneCommandProgress");
// If the entity has a production item underway,
if ( selection[0].actions.create && selection[0].actions.create.progress
&& selection[0].actions.create.progress.valueOf()
&& selection[0].actions.create.progress.valueOf().current
&& selection[0].actions.create.queue.valueOf()
&& selection[0].actions.create.queue.valueOf()[0].traits.creation.time )
{
// Set the value of the production progress bar.
GUIObject.caption = ((Math.round(Math.round(selection[0].actions.create.progress.valueOf().current)) * 100 ) / Math.round(selection[0].actions.create.queue.valueOf()[0].traits.creation.time));
// Set position of progress bar.
GUIObject.size = getGUIObjectByName("snStatusPaneCommand" + selection[0].actions.create.queue.valueOf()[0].tab + "_" + selection[0].actions.create.queue.valueOf()[0].list).size;
// Set progress bar tooltip.
// GUIObject.tooltip = "Training " + selection[0].actions.create.queue.valueOf()[0].traits.id.generic + " ... " + (Math.round(selection[0].actions.create.queue.valueOf()[0].traits.creation.time-Math.round(selection[0].actions.create.progress.valueOf().current)) + " seconds remaining.";
// Reveal progressbar.
GUIObject.hidden = false;
// Seek through queue.
for( queueEntry = 0; queueEntry < selection[0].actions.create.queue.valueOf().length; queueEntry++)
{
// Update list buttons so that they match the number of entries of that type in the queue.
getGUIObjectByName("snStatusPaneCommand" + selection[0].actions.create.queue.valueOf()[queueEntry].tab + "_" + selection[0].actions.create.queue.valueOf()[queueEntry].list).caption++;
}
}
else
{
// Hide the progress bar.
GUIObject.hidden = true;
GUIObject.tooltip = "";
}
*/
}
// ====================================================================
/*
function UpdateListold(listIcon, listCounter)
{
// Populates a given column of command icons with appropriate build portraits for the selected object.
// Returns an array of this selection.
// Build unit list.
if ( selection[0].traits.id.civ_code
&& selection[0].actions
&& selection[0].actions.create
&& selection[0].actions.create.list )
{
list = null;
switch (listIcon)
{
case action_tab_train:
if ( selection[0].actions.create.list.unit && shouldUpdateStat( "actions.create.list.unit" ) )
list = selection[0].actions.create.list.unit;
break;
case action_tab_buildciv:
if ( selection[0].actions.create.list.structciv && shouldUpdateStat( "actions.create.list.structciv" ) )
list = selection[0].actions.create.list.structciv;
break;
case action_tab_buildmil:
if ( selection[0].actions.create.list.structmil && shouldUpdateStat( "actions.create.list.structmil" ) )
list = selection[0].actions.create.list.structmil;
break;
case action_tab_research:
if ( selection[0].actions.create.list.tech && shouldUpdateStat( "actions.create.list.tech" ) )
list = selection[0].actions.create.list.tech;
break;
default:
return 0;
break;
}
if ( list )
{
// Enable tab portrait.
guiUnHide("snStatusPaneCommand" + "Group" + listCounter);
guiUnHide("snStatusPaneCommand" + listCounter + "_1");
setPortrait("snStatusPaneCommand" + listCounter + "_1", "sheet_action", "", listIcon);
// Reset list length.
snStatusPaneCommand[listCounter][1].last = 0;
// Store content info in tab button for future reference.
snStatusPaneCommand[listCounter][1].type = "list";
// Extract entity list into an array.
listArray = [];
for( i in list )
{
listArray[listArray.length] = i.toString();
}
// Populate appropriate command buttons.
for (createLoop = 1; createLoop < snStatusPaneCommand.list.max; createLoop++)
{
if (createLoop < listArray.length)
{
// Get name of entity to display in list.
UpdateListEntityName = selection[0].traits.id.civ_code + "_" + listArray[createLoop];
getGUIObjectByName ("snStatusPaneCommand" + listCounter + "_" + (createLoop+1)).caption = "";
guiUnHide("snStatusPaneCommand" + listCounter + "_" + (createLoop+1));
setPortrait("snStatusPaneCommand" + listCounter + "_" + (createLoop+1),
getEntityTemplate(UpdateListEntityName).traits.id.icon,
selection[0].traits.id.civ_code,
getEntityTemplate(UpdateListEntityName).traits.id.icon_cell);
// Store content info in tab button for future reference.
snStatusPaneCommand[listCounter][createLoop+1].name = listIcon;
snStatusPaneCommand[listCounter][createLoop+1].object = listArray[createLoop];
snStatusPaneCommand[listCounter][createLoop+1].type = "list";
snStatusPaneCommand[listCounter][createLoop+1].last++;
}
else
{
guiHide("snStatusPaneCommand" + listCounter + "_" + parseInt(createLoop+1));
}
}
return listArray;
}
}
return 0;
}
*/

View File

@ -12,7 +12,7 @@ function refreshStatusPane()
// Update portrait
if (selection[0].traits.id.icon)
setPortrait ("snStatusPanePortrait", selection[0].traits.id.icon,
selection[0].traits.id.civ_code, selection[0].traits.id.icon_cell);
toTitleCase(selection[0].traits.id.civ_code), selection[0].traits.id.icon_cell);
}
if( shouldUpdateStat( "actions" ) )

View File

@ -45,8 +45,6 @@ function addResource (resourceName, resourceQty)
// Ensure resource name is title-case.
resourceName = toTitleCase (resourceName);
// Create uppercase name.
resourceNameU = resourceName.toUpperCase();
if (!localPlayer.resource)
{
@ -59,7 +57,7 @@ function addResource (resourceName, resourceQty)
}
// Store resource's name and starting value.
localPlayer.resource.valueOf()[resourceNameU] = resourceQty;
localPlayer.resource.valueOf()[resourceName] = resourceQty;
// The array is now one index longer.
localPlayer.resource.length++;
@ -91,13 +89,11 @@ function setResources (resourceName, resourceQty)
// Ensure resource name is title-case.
resourceName = toTitleCase (resourceName);
// Create uppercase name.
resourceNameU = resourceName.toUpperCase();
// if ( localPlayer.resource.valueOf()[resourceNameU] )
// if ( localPlayer.resource.valueOf()[resourceName] )
// {
// Set resource value.
localPlayer.resource.valueOf()[resourceNameU] = resourceQty;
localPlayer.resource.valueOf()[resourceName] = resourceQty;
// Dynamically adjust width of resource counter based on caption length.
refreshResources();
@ -119,13 +115,11 @@ function giveResources (resourceName, resourceQty)
// Ensure resource name is title-case.
resourceName = toTitleCase (resourceName);
// Create uppercase name.
resourceNameU = resourceName.toUpperCase();
// console.write (localPlayer.resource.valueOf()[resourceNameU]);
// if ( localPlayer.resource.valueOf()[resourceNameU] )
// if ( localPlayer.resource.valueOf()[resourceName] )
// {
// Set resource value.
localPlayer.resource.valueOf()[resourceNameU] += resourceQty;
localPlayer.resource.valueOf()[resourceName] += resourceQty;
// Dynamically adjust width of resource counter based on caption length.
refreshResources();
@ -148,13 +142,11 @@ function deductResources (resourceName, resourceQty)
// Ensure resource name is title-case.
resourceName = toTitleCase (resourceName);
// Create uppercase name.
resourceNameU = resourceName.toUpperCase();
// if( localPlayer.resource.valueOf()[resourceNameU] )
// if( localPlayer.resource.valueOf()[resourceName] )
// {
// Set resource value.
localPlayer.resource.valueOf()[resourceNameU] -= resourceQty;
localPlayer.resource.valueOf()[resourceName] -= resourceQty;
// Dynamically adjust width of resource counter based on caption length.
refreshResources();
@ -175,12 +167,12 @@ function refreshResources ()
{
// Refreshes all resource counters after update.
pool = localPlayer.resource;
resourcePool = localPlayer.resource;
resourceCount = 0;
for (resource in pool)
for (currResource in resourcePool)
{
// Pass the array index of the resource as the second parameter (as we'll need that to determine the centered screen position of each counter).
refreshResource (toTitleCase(resource), resourceUIArray[resourceCount]);
refreshResource (toTitleCase(currResource), resourceUIArray[resourceCount]);
resourceCount++;
}
}
@ -190,6 +182,9 @@ function refreshResources ()
function refreshResource (resourceName, resourceIndex)
{
// Refresh the onscreen counter for a given resource (called to recalculate the size of the coordinates, as these dynamically adjust depending on character length).
// Ensure resource name is title-case.
resourceName = toTitleCase (resourceName);
// Ignore the "Housing" resource ... It doesn't work like normal resources and doesn't have a counter to resize.
if (resourceName == "Housing")
@ -200,11 +195,11 @@ function refreshResource (resourceName, resourceIndex)
// Update counter caption (since we need to have up-to-date text to determine the length of the counter).
caption
= "[icon=iconResource" + resourceName + " displace=\"0 0\"] "
+ localPlayer.resource.valueOf()[resourceName.toUpperCase()];
+ localPlayer.resource.valueOf()[resourceName];
// The Population counter also lists the amount of available housing.
if (resourceName == "Population")
caption
+= "/" + localPlayer.resource.valueOf()["HOUSING"];
+= "/" + localPlayer.resource.valueOf()["Housing"];
resourceObject.caption = caption;
// Update caption tooltip.

View File

@ -69,8 +69,10 @@ function addArrayElement(Array)
function toTitleCase (string)
{
// Returns the title-case version of a given string.
if (!string) console.write ("toTileCase(): String " + string + " has no properties.");
// Returns the title-case version of a given string.
string = string.toString();
string = string.substring(0,1).toUpperCase() + string.substring(1, string.length).toLowerCase();
return (string);
}

View File

@ -59,33 +59,33 @@
-->
<icon name="iconResourceFood"
sprite="icon_sheet_resource"
sprite="snIconSheetResource"
cell_id="0"
size="20 20"
size="30 30"
/>
<icon name="iconResourceWood"
sprite="icon_sheet_resource"
sprite="snIconSheetResource"
cell_id="1"
size="20 20"
size="30 30"
/>
<icon name="iconResourceStone"
sprite="icon_sheet_resource"
sprite="snIconSheetResource"
cell_id="2"
size="20 20"
size="30 30"
/>
<icon name="iconResourceOre"
sprite="icon_sheet_resource"
sprite="snIconSheetResource"
cell_id="3"
size="20 20"
size="30 30"
/>
<icon name="iconResourcePopulation"
sprite="icon_sheet_resource"
sprite="snIconSheetResource"
cell_id="4"
size="20 20"
size="30 30"
/>

File diff suppressed because it is too large Load Diff

View File

@ -456,9 +456,9 @@
/>
<style name="snAction"
sprite="ui_portrait_defaultcircle"
sprite_over="ui_portrait_defaultcircle_lit"
sprite_disabled="ui_portrait_defaultcircle_gray"
sprite="snIconCommand"
sprite_over="snIconCommandOver"
sprite_disabled="snIconCommandDisabled"
text_align="right"
textcolor="255 255 255"
tooltip_style="snToolTip"
@ -466,9 +466,9 @@
/>
<style name="snPortrait"
sprite="ui_portrait_default_square"
sprite_over="ui_portrait_default_square_lit"
sprite_disabled="ui_portrait_default_square_Gray"
sprite="snIconPortrait"
sprite_over="snIconPortraitOver"
sprite_disabled="snIconPortraitDisabled"
text_align="right"
textcolor="255 255 255"
tooltip_style="snToolTip"
@ -633,17 +633,6 @@ NOT YET CONVERTED NOT YET CONVERTED NOT YET CONVERTED NOT YET CONVERTED NOT YET
tooltip=""
/>
<!-- Empty entity portrait. -->
<style name="portrait"
sprite="ui_portrait_default_square"
sprite_over="ui_portrait_default_square_lit"
sprite_disabled="ui_portrait_default_square_grey"
text_align="right"
textcolor="255 255 255"
tooltip_style="snToolTip"
tooltip="(TBA)"
/>
<style name="portrait_progress"
sprite_background=""
sprite_bar="translucent_background"

View File

@ -0,0 +1 @@
ps -editor

View File

@ -0,0 +1,2 @@
rmgen cantabrian_highlands cantabrian_generated
rmgen neareastern_badlands neareastern_generated