1
1
forked from 0ad/0ad

Revised online manual. Added placeholder rollovers to all units. Improved coordinate system.

This was SVN commit r1819.
This commit is contained in:
Acumen 2005-01-25 22:43:07 +00:00
parent c12c6a0e4d
commit dd7f2c53cf
18 changed files with 225 additions and 50 deletions

View File

@ -9,6 +9,8 @@
type.unit.mounted.spear="true"
type.unit.weapon.spear="true"
rollover="This was the weapon of choice from horseback. This was the unit that would eventually evolve to the medieval knight (after heavy influence by the Sarmartians and their lances). Infantry were an easy kill; just ride them down and skewer them with your stick and its point on the end. As with all cavalry – it was only the rich and the nobles who were able to fight from horseback due to the cost of owning such a beast."
/>
</Traits>
</Entity>

View File

@ -9,6 +9,8 @@
type.unit.mounted.sword="true"
type.unit.weapon.sword="true"
rollover="Fighting from horseback with a sword is a tricky thing to do. This required usage of a sword that was longer than the typical infantry sword. One needed a good reach to attack from the height of a horse. If you were without spear (the ideal weapon of choice) it was probably because you needed your hands free to do other tasks such as riding hard and fast. It wasn’t uncommon for the men to dismount and attack from foot if they were armed with only a sword."
/>
</Traits>
</Entity>

View File

@ -9,6 +9,8 @@
type.unit.mounted.bow="true"
type.unit.weapon.bow="true"
rollover="A very rare unit in Part 1. It was used by the Persians, but it didn’t gain much traction until the Parthians, Huns, Mongols, and other people of the nomadic steeps introduced them to western Europe. This was the most effective unit on the battlefield for several hundred years until the well armoured knight came along. Therefore, this unit will gain much more prominence in Part 2."
/>
</Traits>
</Entity>

View File

@ -9,6 +9,8 @@
type.unit.mounted.javelin="true"
type.unit.weapon.javelin="true"
rollover="The javelins thrown from a horse’s back were probably 3 at most. The idea was to quickly advance with 3 in hand, then throw them all. After you had done that it was time to switch to your secondary weapon which was usually a spear or a sword. However, in the game - these units will only have ranged attack."
/>
</Traits>
</Entity>

View File

@ -9,6 +9,7 @@
type.unit.foot.spear="true"
type.unit.weapon.spear="true"
rollover="Probably one of the most primitive units in the game. Fighting with a sharp object at the end of the pole didn’t require a lot of technology to develop. It also allowed the human to distance themselves from their attacker. As time passed the spears got longer and longer. Started with a fighting style similar to using a quarterstaff, then to using them in numbers as a ‘pin cushion’ vs. humans (sarissa in a phalanx). Later it was developed to combat cavalry. During the medieval period it evolved to the pike. These units tended to be armoured as heavily as possible."
/>
</Traits>
</Entity>

View File

@ -9,6 +9,7 @@
type.unit.foot.sword="true"
type.unit.weapon.sword="true"
rollover="Weapon is basically a developed sickle. Probably from the club, to the axe, to the sickle to the sword. It was the Romans who used them to combat the long range of the sarissa. Their spears were so long they had to use two hands to wield them. In a formation they were almost impossible to maneouvre. If flanked, they were easily cut down by a sword as demonstrated by the Romans at the battle of Cynoscephalae. Generally swordsmen were well armoured, had shields, and tended to be nobles. A good sword was an expensive weapon."
/>
</Traits>
</Entity>

View File

@ -9,6 +9,7 @@
type.unit.foot.bow="true"
type.unit.weapon.bow="true"
rollover="They tended to be lightly armoured. They usually only participated in the first stage of a battle, sending a volley of arrows raining down the enemy. Of course they would have to stop shooting once the melee units closed in. This means their job was largely over once the ‘true battle’ was underway. They spent hours training with a bow, but if you were hit by an arrow it was more likely an act of random chance than being specifically targeted by an archer."
/>
</Traits>
</Entity>

View File

@ -9,6 +9,7 @@
type.unit.foot.javelin="true"
type.unit.weapon.javelin="true"
rollover="These were the skirmishers. These lightly armoured units would advance quickly, throw a hail of javelins and then retreat back to their ranks. Grab another spear and repeat. They would do well against any unit that wasn’t wearing proper armour, but more poorly if they fought hand to hand vs a well armoured unit. They didn’t always have to thow their spears either. They used these light small spears in hand to hand similar to a quarterstaff. Also note that the development of the pilum was a key transition. This pilum was a weapon with a long steel shaft that would sink into a shield, nearly impossible to remove. This rendered the shield useless. They also weighted and balanced them to make them accurately hit with a punch."
/>
</Traits>
</Entity>

View File

@ -9,6 +9,8 @@
type.unit.foot.sling="true"
type.unit.weapon.sling="true"
rollover="They were amazing shots with their slings. They used choice rocks, and often specifically created ‘shot’ made from lead. They could pierce armour at close distances. They were lightly armoured because they needed the mobility in their arm regions. However, in the game we are making a gameplay consideration to have slingers act as 'mini-organic-onagers' that may cause damage to structures."
/>
</Traits>
</Entity>

View File

@ -6,6 +6,8 @@
generic="Female Citizen"
icon_cell="32"
rollover="Women in the ancient world took on a variety of roles - from leadership (Celts) to servant (Greeks). Women are hard workers, the economic backbone of any civilisation. In history, it was typical when all the males (capable of fighting) were killed for the females, children, and elderly to be sold as slaves."
/>
</Traits>
<Actions>

View File

@ -8,6 +8,8 @@
icon_cell="34"
type.unit.group.trade="true"
rollover="Trade was a very important part of ancient civilisation - effective trading and control of trade routes equaled wealth. Trade took place by many forms from foot to caravans to merchant ships. One of the most notorious examples of the power of trade was the Silk Road."
/>
</Traits>
</Entity>

View File

@ -92,11 +92,11 @@
]]></script>
<script file="gui/test/functions_session.js"><![CDATA[
initCoord();
initSession();
initGlobal();
initPreGame();
initAtlas();
initSession();
initManual();
]]></script>
</objects>

View File

@ -15,33 +15,55 @@
// Toggle manual if something selected.
if (selection.length)
{
ManualGUI = getGUIObjectByName("manual_gui");
ManualGUI.hidden = !ManualGUI.hidden;
GUIObjectToggle("manual_gui");
GUIObjectToggle("session_gui");
}
]]></action>
<object type="text" name="manual_bkg" sprite="translucent_background" size="50%-200 0%+50 50%+200 100%-50" font="prospero16" textcolor="255 255 255" z="100" hidden="false" ghost="true">
<object type="text" name="manual_bkg" sprite="0ad_window" font="prospero16" textcolor="0 0 0" z="100" hidden="false" ghost="true">
<action on="Load"><![CDATA[
setSizeArray("manual_bkg", sessionCoord[MANUAL_BKG], left_screen, top_screen, right_screen, bottom_screen);
]]></action>
<action on="Tick"><![CDATA[
if (selection.length && !( getGUIObjectByName( "manual_gui" ).hidden ))
{
manualDisplay();
}
]]></action>
</object>
<object type="button" name="manual_portrait" style="portrait" size="50%-192 0%+80 50%-128 0%+144" z="100" ghost="true"/>
<object type="button" name="manual_portrait" style="portrait" z="100" ghost="true">
<action on="Load"><![CDATA[
setSizeArray("manual_portrait", sessionCoord[MANUAL_PORTRAIT], left_screen, top_screen, left_screen, top_screen);
]]></action>
</object>
<object type="text" name="manual_name" sprite="translucent_background" size="50%-195 0%+149 50%+195 100%-205" font="prospero14" textcolor="255 255 255" z="100" ghost="true"/>
<!-- Gee needs to implement text clipping, so long text doesn't get clipped to these scroll windows yet. Scroll bars also don't block world input yet. -->
<object type="text" name="manual_rollover" scrollbar="true" scrollbar_style="manual_scrollbar" sprite="0ad_indent" font="trebuchet12" textcolor="0 0 0" z="100" ghost="false">
<action on="Load"><![CDATA[
setSizeArray("manual_rollover", sessionCoord[MANUAL_ROLLOVER], left_screen, top_screen, right_screen, top_screen);
]]></action>
</object>
<!-- Gee needs to implement text clipping, so long text doesn't get clipped to these scroll windows yet. Scroll bars also don't block world input yet. -->
<object type="text" name="manual_rollover" scrollbar="true" scrollbar_style="manual_scrollbar" sprite="translucent_background" size="50%-126 0%+80 50%+195 0%+144" font="prospero16" textcolor="255 255 255" z="100" ghost="false"/>
<object type="text" name="manual_history" scrollbar="true" scrollbar_style="manual_scrollbar" sprite="translucent_background" size="50%-195 100%-200 50%+195 100%-55" font="prospero16" textcolor="255 255 255" z="100" ghost="false"/>
<object type="text" name="manual_name" sprite="0ad_indent" font="trebuchet14" textcolor="0 0 0" z="100" ghost="true">
<action on="Load"><![CDATA[
setSizeArray("manual_name", sessionCoord[MANUAL_NAME], left_screen, top_screen, right_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="manual_exit_button" sprite="exit_sprite" sprite_over="exit_sprite_over" size="50%+184 0%+50 50%+200 0%+66" ghost="false" z="100" hidden="false">
<!-- Gee needs to implement text clipping, so long text doesn't get clipped to these scroll windows yet. Scroll bars also don't block world input yet. -->
<object type="text" name="manual_history" scrollbar="true" scrollbar_style="manual_scrollbar" sprite="0ad_indent" font="trebuchet12" textcolor="0 0 0" z="100" ghost="false">
<action on="Load"><![CDATA[
setSizeArray("manual_history", sessionCoord[MANUAL_HISTORY], left_screen, bottom_screen, right_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="manual_exit_button" sprite="exit_sprite" sprite_over="exit_sprite_over" ghost="false" z="100" hidden="false">
<action on="Load"><![CDATA[
setSizeArray("manual_exit_button", sessionCoord[MANUAL_EXIT_BUTTON], right_screen, top_screen, right_screen, top_screen);
]]></action>
<action on="Press"><![CDATA[
// Close manual.
ManualGUI = getGUIObjectByName("manual_gui");
ManualGUI.hidden = true;
GUIObjectHide("manual_gui");
GUIObjectUnhide("session_gui");
]]></action>
</object>
</object>

View File

@ -1,3 +1,67 @@
function initManual()
{
// ============================================= GLOBALS =================================================
MANUAL = new Object();
MANUAL.span = 5;
// Background of online manual.
MANUAL_BKG = addSizeArrayWH(sessionCoord, sessionCoord_Last,
50,
50
); sessionCoord_Last = addSizeArrayXY(sessionCoord, sessionCoord_Last,
50,
50
);
// Online manual portrait.
MANUAL_PORTRAIT = addSizeArrayWH(sessionCoord, sessionCoord_Last,
crd_portrait_lrg_width,
crd_portrait_lrg_height
); sessionCoord_Last = addSizeArrayXY(sessionCoord, sessionCoord_Last,
sessionCoord[MANUAL_BKG].x+10,
sessionCoord[MANUAL_BKG].y+30
);
// Online manual rollover.
MANUAL_ROLLOVER = addSizeArrayWH(sessionCoord, sessionCoord_Last,
60,
sessionCoord[MANUAL_PORTRAIT].height
); sessionCoord_Last = addSizeArrayXY(sessionCoord, sessionCoord_Last,
sessionCoord[MANUAL_PORTRAIT].x+sessionCoord[MANUAL_PORTRAIT].width+MANUAL.span,
sessionCoord[MANUAL_PORTRAIT].y
);
// Online manual history.
MANUAL_HISTORY = addSizeArrayWH(sessionCoord, sessionCoord_Last,
sessionCoord[MANUAL_ROLLOVER].width,
sessionCoord[MANUAL_ROLLOVER].height
); sessionCoord_Last = addSizeArrayXY(sessionCoord, sessionCoord_Last,
sessionCoord[MANUAL_PORTRAIT].x,
60
);
// Online manual text.
MANUAL_NAME = addSizeArrayWH(sessionCoord, sessionCoord_Last,
sessionCoord[MANUAL_HISTORY].width,
sessionCoord[MANUAL_HISTORY].y+sessionCoord[MANUAL_HISTORY].height+MANUAL.span
); sessionCoord_Last = addSizeArrayXY(sessionCoord, sessionCoord_Last,
sessionCoord[MANUAL_HISTORY].x,
sessionCoord[MANUAL_ROLLOVER].y+sessionCoord[MANUAL_ROLLOVER].height+MANUAL.span
);
// Online manual exit button.
MANUAL_EXIT_BUTTON = addSizeArrayWH(sessionCoord, sessionCoord_Last,
16,
16
); sessionCoord_Last = addSizeArrayXY(sessionCoord, sessionCoord_Last,
26,
25
);
}
// ====================================================================
function manualDisplay()
{
// Display heading.
@ -5,6 +69,8 @@ function manualDisplay()
ManualBkg.caption = "In-Game Help: ";
if (selection[0].traits.id.civ)
ManualBkg.caption += selection[0].traits.id.civ + ": ";
if (selection[0].traits.id.generic)
ManualBkg.caption += selection[0].traits.id.generic + ": ";
if (selection[0].traits.id.specific)
ManualBkg.caption += selection[0].traits.id.specific;

View File

@ -33,15 +33,16 @@ function loadSession()
// Create resource pools for each player, etc.
setupSession();
// Switch GUI from main menu to game session.
GUIObjectHide("loading_screen");
GUIObjectUnhide("session_gui");
FlipGUI(GUIType);
// Select session peace track.
curr_session_playlist_1 = newRandomSound("music", "peace");
// Fade out main theme and fade in session theme.
CrossFade(curr_music, curr_session_playlist_1, 0.0001);
// Switch GUI from main menu to game session.
GUIObjectHide("loading_screen");
GUIObjectUnhide("session_gui");
}
// ====================================================================

View File

@ -1,5 +1,39 @@
function initSession()
{
// ============================================= CONSTANTS =================================================
GUIType="bottom";
// Coord-style size table.
SizeCoord = new Array();
SizeCoord.last = 0;
// Initialise coordinate set for this page.
sessionCoord = new Array();
sessionCoord_Last = 0;
// Standard portrait widths.
crd_portrait_lrg_width = 64;
crd_portrait_lrg_height = crd_portrait_lrg_width;
crd_portrait_sml_width = 32;
crd_portrait_sml_height = crd_portrait_sml_width;
// Screen percentages.
top_screen = 0;
left_screen = 0;
mid_screen = 50;
bottom_screen = 100;
right_screen = 100;
// Small icons (eg Movement Rate, Food).
crd_mini_icon_width = 20;
crd_mini_icon_height = crd_mini_icon_width;
// Define cell reference constants for icon sheets.
initCellReference();
// ============================================= GLOBALS =================================================
initGroupPane();
initResourcePool();
initStatusOrb();

View File

@ -1,34 +1,3 @@
function initCoord()
{
GUIType="bottom";
// Coord-style size table.
SizeCoord = new Array();
SizeCoord.last = 0;
// Standard portrait widths.
crd_portrait_lrg_width = 64;
crd_portrait_lrg_height = crd_portrait_lrg_width;
crd_portrait_sml_width = 32;
crd_portrait_sml_height = crd_portrait_sml_width;
// Screen percentages.
top_screen = 0;
left_screen = 0;
mid_screen = 50;
bottom_screen = 100;
right_screen = 100;
// Small icons (eg Movement Rate, Food).
crd_mini_icon_width = 20;
crd_mini_icon_height = crd_mini_icon_width;
// Define cell reference constants for icon sheets.
initCellReference();
}
// ====================================================================
function AddSizeCoord(objectName, left1, top1, right1, bottom1, rleft1, rtop1, rright1, rbottom1, left2, top2, right2, bottom2, rleft2, rtop2, rright2, rbottom2)
{
// Used to store the two GUI style sizes for an object on creation (specified as coordinates).
@ -122,6 +91,52 @@ function setSizeArray(objectName, objectArrayElement, rleft, rtop, rright, rbott
{
// Use this function as a shortcut to change the size of a GUI control, via an array containing x, y, width and height.
switch (rleft)
{
case left_screen:
size_x1 = objectArrayElement.x;
break;
case right_screen:
size_x1 = -objectArrayElement.x-objectArrayElement.width;
break;
}
switch (rtop)
{
case top_screen:
size_y1 = objectArrayElement.y;
break;
case bottom_screen:
size_y1 = -objectArrayElement.y-objectArrayElement.height;
break;
}
switch (rright)
{
case left_screen:
size_x2 = objectArrayElement.x+objectArrayElement.width;
break;
case right_screen:
if (rleft == right_screen)
size_x2 = -objectArrayElement.x;
else
size_x2 = -objectArrayElement.width;
break;
}
switch (rbottom)
{
case top_screen:
size_y2 = objectArrayElement.y+objectArrayElement.height;
break;
case bottom_screen:
if (rtop == bottom_screen)
size_y2 = -objectArrayElement.y;
else
size_y2 = -objectArrayElement.height;
break;
}
getGUIObjectByName(objectName).size = new GUISize(size_x1, size_y1, size_x2, size_y2, rleft, rtop, rright, rbottom);
/*
if (rleft == left_screen && rtop == top_screen && rright == left_screen && rbottom == top_screen)
// Object is aligned to top left.
getGUIObjectByName(objectName).size = new GUISize(objectArrayElement.x, objectArrayElement.y, objectArrayElement.x+objectArrayElement.width, objectArrayElement.y+objectArrayElement.height, rleft, rtop, rright, rbottom);
@ -142,9 +157,13 @@ function setSizeArray(objectName, objectArrayElement, rleft, rtop, rright, rbott
// Object is aligned between left top and right top.
getGUIObjectByName(objectName).size = new GUISize(objectArrayElement.x, objectArrayElement.y, -objectArrayElement.width, objectArrayElement.y+objectArrayElement.height, rleft, rtop, rright, rbottom);
else
if (rleft == left_screen && rtop == top_screen && rright == right_screen && rbottom == bottom_screen)
// Object is aligned between left top and right bottom.
getGUIObjectByName(objectName).size = new GUISize(objectArrayElement.x, objectArrayElement.y, -objectArrayElement.width, -objectArrayElement.height, rleft, rtop, rright, rbottom);
else
if (rleft == left_screen && rtop == bottom_screen && rright == right_screen && rbottom == bottom_screen)
// Object is aligned between left bottom and right bottom.
getGUIObjectByName(objectName).size = new GUISize(objectArrayElement.x, -objectArrayElement.y-objectArrayElement.height, objectArrayElement.x+objectArrayElement.width, 0, rleft, rtop, rright, rbottom);
getGUIObjectByName(objectName).size = new GUISize(objectArrayElement.x, -objectArrayElement.y-objectArrayElement.height, -objectArrayElement.width, objectArrayElement.y, rleft, rtop, rright, rbottom);
else
if (rleft == left_screen && rtop == top_screen && rright == left_screen && rbottom == bottom_screen)
// Object is aligned between left top and left bottom.
@ -153,6 +172,7 @@ function setSizeArray(objectName, objectArrayElement, rleft, rtop, rright, rbott
if (rleft == left_screen && rtop == mid_screen && rright == left_screen && rbottom == mid_screen)
// Object is aligned to middle left.
getGUIObjectByName(objectName).size = new GUISize(objectArrayElement.x, objectArrayElement.y, objectArrayElement.x+objectArrayElement.width, objectArrayElement.y+objectArrayElement.height, rleft, rtop, rright, rbottom);
*/
}
// ====================================================================

View File

@ -189,6 +189,20 @@
<image texture="global/ui_gen_titlebar_right.png" real_texture_placement="0 0 64 32" size="95%-64 0%-10 100%+0 0%+22" />
</sprite>
<sprite name="0ad_indent">
<!-- Starting with top left corner continuing in a clockwise manner -->
<!-- Top border -->
<image backcolor="109 122 146" size="0 0 100%-1 1" />
<!-- Right border -->
<image backcolor="220 223 228" size="100%-1 0 100% 100%" />
<!-- Bottom border -->
<image backcolor="220 223 228" size="0 100%-1 100% 100%" />
<!-- Left border -->
<image backcolor="109 122 146" size="0 0 1 100%-1" />
<!-- middle -->
<image backcolor="0 0 0 85" size="1 1 100%-1 100%-1"/>
</sprite>
<sprite name="translucent_background">
<image backcolor="0 0 0 85" size="0 0 100% 100%"/>
</sprite>