1
0
forked from 0ad/0ad

Displaying civ icons on summary screen, moving "Civ centres built" and "Enemy civ centres destroyed" to new "Conquest" tab

This was SVN commit r8671.
This commit is contained in:
fcxSanya 2010-11-20 21:42:54 +00:00
parent 7e41f6d664
commit 68a63d62c8
11 changed files with 81 additions and 97 deletions

View File

@ -1,7 +1,7 @@
{
"Code": "cart",
"Name": "Carthaginians",
"Emblem": "cart.dds",
"Emblem": "session/portraits/emblems/emblem_carthaginians.png",
"History": "Carthage was founded in either 814 B.C. or 813 B.C. by a Tyrian Princess named Elissa or Dido. The culture spanned over seven hundred years. In 146 B.C., Carthage (the center of civilsation) was brought to its knees by the Romans. They are probably best known for the usage of elephants in battle. Not only did they ferry them across the Mediterranean, but they were also taken through the alps for a sly attack from the north of Rome. The Carthaginians were most active in the 4th and 3rd centuries B.C. Some famous Carthaginians were: Hamilcar Barca (who fought in the First Punic War), his son Hannibal Barca, and Maharbal (Hannibals cavalry commander). Some famous battles were: Acragas in 406 B.C., Zama in 202 B.C., and the Siege of Carthage 148-146 B.C.",
"Factions":
[

View File

@ -1,7 +1,7 @@
{
"Code": "celt",
"Name": "Celts",
"Emblem": "celt.dds",
"Emblem": "session/portraits/emblems/emblem_celts.png",
"History": "At its peak (around 200 B.C.), the massive Celtic Empire spanned from Spain to Romania and Northern Italy to Scotland; although it wasnt a true empire because the Celtic people were not united by any form of government, but only in language and various social aspects. Their lack of any cohesion was probably the largest contributing factor to their ultimate submission to Rome by 100 A.D. The other contributing factors were their lack of armour and their inability to counter the mighty legions and siege weapons of Rome.",
"Factions":
[

View File

@ -1,7 +1,7 @@
{
"Code":"hele",
"Name":"Hellenes",
"Emblem":"hele.dds",
"Emblem":"session/portraits/emblems/emblem_hellenes.png",
"History":"The Hellenes were a people famous today for their architecture, fighting ability, and culture. The Hellenic peoples of the Dorian, Ionian, and Aeolian tribes swept into modern day Greece from 3000 BC to around 1100 BC in successive waves that eventually supplanted the previously established cultures of Mycenae and Minoan Crete. They were most active during the period of colonization that took place in the 7th and 6th centuries BC, the Greco-Persian Wars (499-449 BC), the Peloponnesian War (431-404 BC), and the conquests of Alexander the Great (4th Century BC). Their civilization would endure until their final absorption by Rome in 146 BC.",
"Factions":
[

View File

@ -1,7 +1,7 @@
{
"Code": "iber",
"Name": "Iberians",
"Emblem": "iber.dds",
"Emblem": "session/portraits/emblems/emblem_iberians.png",
"History": "No one really knows when the Iberians appeared as a people, though first contact with them came in 1100 B.C. with the establishment of a trading post by the Phoenicians. They were a relatively peaceful culture, and when they fought it fighting in other's battles as mercenaries. When they fought their won battle, they proved tenacious when Rome sought to take their land and freedom away from them. Yet, the Iberians were put in submission once and for all by the Romans in 18 B.C.",
"Factions":
[

View File

@ -1,7 +1,7 @@
{
"Code": "pers",
"Name": "Persians",
"Emblem": "pers.dds",
"Emblem": "session/portraits/emblems/emblem_persians.png",
"History": "The Persians originally came from beyond the Zargos Mountains and moved into what is now Iran sometime in the first millennium B.C. They began their rise to power when Cyrus the Great led a revolt against the Median Empire, he would go on to conquer everything he possibly could. By the time of his death in 529 B.C. Cyrus had created the greatest empire thus far seen in the ancient world. In 0 AD we will cover the Achaemenid dynasty of Persia, this dynasty was ended by the conquests of Alexander the Great starting with the Greek victory the Battle of Granicus in 334 B.C.",
"Factions":
[

View File

@ -1,7 +1,7 @@
{
"Code": "rome",
"Name": "Romans",
"Emblem": "rome.dds",
"Emblem": "session/portraits/emblems/emblem_romans.png",
"History": "The Romans controlled the largest empire of the ancient world. Rising from a group of villages to controlling an empire stretching from southern Scotland to the Sahara Desert, Rome remained one of the strongest nations on earth for almost 800 years. Initially Rome controlled Italy, but after three wars with Carthage began to expand in all directions. At its peak, Rome's empire contained over 60 million inhabitants, one quarter of the Earth's population at that time. But this massive empire soon became too large to control and barbarians began swarming into the Empire. The 300 years before the fall of Rome in 476 A.D. were mostly spent trying to keep the ever-increasing flood of migrant barbarians back behind the Rhine and Danube rivers.",
"Factions":
[

View File

@ -3,6 +3,7 @@
<include>common/setup.xml</include>
<include>common/styles.xml</include>
<include>common/sprite1.xml</include>
<include>common/icon_sprites.xml</include>
<include>common/init.xml</include>
<include>summary/summary.xml</include>
<include>summary/sprites.xml</include>

View File

@ -80,7 +80,7 @@ function init(initData, hotloadData)
g_CivData = loadCivData();
g_CivData["gaia"] = { "Code": "gaia", "Name": "Gaia" };
getGUIObjectByName("civIcon").sprite = g_Players[Engine.GetPlayerID()].civ+"Icon";
getGUIObjectByName("civIcon").sprite = "stretched:"+g_CivData[g_Players[Engine.GetPlayerID()].civ].Emblem;
cacheMenuObjects();

View File

@ -9,65 +9,6 @@
/>
</sprite>
<!-- ================================ ================================ -->
<!-- Civ Icons -->
<!-- ================================ ================================ -->
<sprite name="romeIcon">
<image
texture="session/portraits/emblems/emblem_romans.png"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="heleIcon">
<image
texture="session/portraits/emblems/emblem_hellenes.png"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="maceIcon">
<image
texture="session/portraits/emblems/emblem_macedon.png"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="poleIcon">
<image
texture="session/portraits/emblems/emblem_poleis.png"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="celtIcon">
<image
texture="session/portraits/emblems/emblem_celts.png"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="persIcon">
<image
texture="session/portraits/emblems/emblem_persians.png"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="iberIcon">
<image
texture="session/portraits/emblems/emblem_iberians.png"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="cartIcon">
<image
texture="session/portraits/emblems/emblem_carthaginians.png"
size="0 0 100% 100%"
/>
</sprite>
<!-- ================================ ================================ -->
<!-- Unit Command Icons -->
<!-- ================================ ================================ -->

View File

@ -1,8 +1,8 @@
// Max player slots for any map (should read from config)
const MAX_SLOTS = 8;
var panelNames = [ 'unitsBuildingsPanel', 'resourcesPanel' ];
var panelButtonNames = [ 'unitsBuildingsPanelButton', 'resourcesPanelButton' ];
var panelNames = [ 'unitsBuildingsPanel', 'conquestPanel', 'resourcesPanel' ];
var panelButtonNames = [ 'unitsBuildingsPanelButton', 'conquestPanelButton', 'resourcesPanelButton' ];
/**
* @param time Time period in milliseconds (integer)
@ -39,6 +39,8 @@ function selectPanel(panelNumber)
function init(data)
{
var civData = loadCivData();
getGUIObjectByName("timeElapsed").caption = "Time elapsed: " + timeToString(data.timeElapsed);
getGUIObjectByName("summaryText").caption = data.gameResult;
@ -62,18 +64,22 @@ function init(data)
// align headers
var left = 50;
var width = 100;
getGUIObjectByName("playerNameHeading").size = left + " 26 " + (left + width) + " 100%"; left += width;
var playerNameHeadingWidth = 200;
getGUIObjectByName("playerName0Heading").size = left + " 26 " + (left + playerNameHeadingWidth) + " 100%"; left += playerNameHeadingWidth;
getGUIObjectByName("unitsTrainedHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
getGUIObjectByName("unitsLostHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
getGUIObjectByName("enemyUnitsKilledHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
getGUIObjectByName("buildingsConstructedHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
getGUIObjectByName("buildingsLostHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
getGUIObjectByName("enemyBuildingsDestroyedHeading").size = left + " 6 " + (left + width) + " 100%"; left += width;
var left = 50;
getGUIObjectByName("playerName1Heading").size = left + " 26 " + (left + playerNameHeadingWidth) + " 100%"; left += playerNameHeadingWidth;
getGUIObjectByName("civCentresBuiltHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
getGUIObjectByName("enemyCivCentresDestroyedHeading").size = left + " 6 " + (left + width) + " 100%"; left += width;
var left = 50;
getGUIObjectByName("playerName2Heading").size = left + " 26 " + (left + width) + " 100%"; left += width;
getGUIObjectByName("playerName2Heading").size = left + " 26 " + (left + playerNameHeadingWidth) + " 100%"; left += playerNameHeadingWidth;
getGUIObjectByName("foodGatheredHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
getGUIObjectByName("vegetarianRatioHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
getGUIObjectByName("woodGatheredHeading").size = left + " 16 " + (left + width) + " 100%"; left += width;
@ -102,6 +108,9 @@ function init(data)
var playerName = getGUIObjectByName("playerName"+k+"["+i+"]");
playerName.caption = playerState.name;
getGUIObjectByName("civIcon"+k+"["+i+"]").sprite = "stretched:"+civData[playerState.civ].Emblem;
}
var unitsTrained = getGUIObjectByName("unitsTrained["+i+"]");
@ -110,6 +119,7 @@ function init(data)
var buildingsConstructed = getGUIObjectByName("buildingsConstructed["+i+"]");
var buildingsLost = getGUIObjectByName("buildingsLost["+i+"]");
var enemyBuildingsDestroyed = getGUIObjectByName("enemyBuildingsDestroyed["+i+"]");
var civCentresBuilt = getGUIObjectByName("civCentresBuilt["+i+"]");
var enemyCivCentresDestroyed = getGUIObjectByName("enemyCivCentresDestroyed["+i+"]");
@ -121,7 +131,7 @@ function init(data)
// align counters
var left = 140;
var left = 240;
var width = 100;
unitsTrained.size = left + " 2 " + (left + width) + " 100%"; left += width;
unitsLost.size = left + " 2 " + (left + width) + " 100%"; left += width;
@ -129,22 +139,26 @@ function init(data)
buildingsConstructed.size = left + " 2 " + (left + width) + " 100%"; left += width;
buildingsLost.size = left + " 2 " + (left + width) + " 100%"; left += width;
enemyBuildingsDestroyed.size = left + " 2 " + (left + width) + " 100%"; left += width;
civCentresBuilt.size = left + " 2 " + (left + width) + " 100%"; left += width;
enemyCivCentresDestroyed.size = left + " 2 " + (left + width) + " 100%"; left += width;
var size = getGUIObjectByName("playerBox0["+i+"]").size;
size.right = left + 10;
getGUIObjectByName("playerBox0["+i+"]").size = size;
var left = 240;
civCentresBuilt.size = left + " 2 " + (left + width) + " 100%"; left += width;
enemyCivCentresDestroyed.size = left + " 2 " + (left + width) + " 100%"; left += width;
var size = getGUIObjectByName("playerBox1["+i+"]").size;
size.right = left + 10;
getGUIObjectByName("playerBox1["+i+"]").size = size;
var left = 140;
var left = 240;
foodGathered.size = left + " 2 " + (left + width) + " 100%"; left += width;
vegetarianRatio.size = left + " 2 " + (left + width) + " 100%"; left += width;
woodGathered.size = left + " 2 " + (left + width) + " 100%"; left += width;
metalGathered.size = left + " 2 " + (left + width) + " 100%"; left += width;
stoneGathered.size = left + " 2 " + (left + width) + " 100%"; left += width;
var size = getGUIObjectByName("playerBox1["+i+"]").size;
var size = getGUIObjectByName("playerBox2["+i+"]").size;
size.right = left + 10;
getGUIObjectByName("playerBox1["+i+"]").size = size;
getGUIObjectByName("playerBox2["+i+"]").size = size;
// display counters
unitsTrained.caption = playerState.statistics.unitsTrained;
@ -153,6 +167,7 @@ function init(data)
buildingsConstructed.caption = playerState.statistics.buildingsConstructed;
buildingsLost.caption = playerState.statistics.buildingsLost;
enemyBuildingsDestroyed.caption = playerState.statistics.enemyBuildingsDestroyed;
civCentresBuilt.caption = playerState.statistics.civCentresBuilt;
enemyCivCentresDestroyed.caption = playerState.statistics.enemyCivCentresDestroyed;

View File

@ -7,6 +7,7 @@
-->
<objects>
<script file="gui/common/functions_civinfo.js"/>
<script file="gui/summary/summary.js"/>
<object type="image" sprite="bkFillBlack">
@ -43,14 +44,18 @@
<action on="Press">selectPanel(0);</action>
Units/buildings
</object>
<object name="resourcesPanelButton" type="button" sprite="bgInfoHeading" text_align="center" size="160 75 310 101">
<object name="conquestPanelButton" type="button" sprite="bgInfoHeading" text_align="center" size="160 75 310 101">
<action on="Press">selectPanel(1);</action>
Conquest
</object>
<object name="resourcesPanelButton" type="button" sprite="bgInfoHeading" text_align="center" size="310 75 460 101">
<action on="Press">selectPanel(2);</action>
Resources
</object>
<object name="unitsBuildingsPanel" type="image" sprite="bgInfoBox" size="10 100 100%-10 100%-50">
<object size="0 0 100% 100%-50">
<object name="playerNameHeading" type="text" text_align="left" font="serif-bold-14" >
<object name="playerName0Heading" type="text" text_align="left" font="serif-bold-14" >
Player name
</object>
<object name="unitsTrainedHeading" type="text" text_align="center" font="serif-bold-14" >
@ -71,6 +76,32 @@
<object name="enemyBuildingsDestroyedHeading" type="text" text_align="center" font="serif-bold-14" >
Enemy&#10;buildings&#10;destroyed
</object>
</object>
<object size="0 65 100% 100%-50">
<repeat count="8">
<object type="image" name="playerBox0[n]" size="10 0 10 30" hidden="true">
<object name="playerColourBox0[n]" type="image" size="10 4 30 24" />
<object name="playerName0[n]" type="text" text_align="left" size="40 2 208 100%" />
<object name="civIcon0[n]" type="image" size="208 0 240 32"/>
<object name="unitsTrained[n]" type="text" text_align="center" />
<object name="unitsLost[n]" type="text" text_align="center" />
<object name="enemyUnitsKilled[n]" type="text" text_align="center" />
<object name="buildingsConstructed[n]" type="text" text_align="center" />
<object name="buildingsLost[n]" type="text" text_align="center" />
<object name="enemyBuildingsDestroyed[n]" type="text" text_align="center" />
</object>
</repeat>
</object>
</object>
<object name="conquestPanel" type="image" sprite="bgInfoBox" size="10 100 100%-10 100%-50" hidden="true">
<object size="0 0 100% 100%-50">
<object name="playerName1Heading" type="text" text_align="left" font="serif-bold-14" >
Player name
</object>
<object name="civCentresBuiltHeading" type="text" text_align="center" font="serif-bold-14" >
Civ centres&#10;built
</object>
@ -82,17 +113,12 @@
<object size="0 65 100% 100%-50">
<repeat count="8">
<object type="image" name="playerBox0[n]" size="10 0 10 30" hidden="true">
<object name="playerColourBox0[n]" type="image" size="10 4 30 24" />
<object name="playerName0[n]" type="text" text_align="left" size="40 2 140 100%" />
<object name="unitsTrained[n]" type="text" text_align="center" />
<object name="unitsLost[n]" type="text" text_align="center" />
<object name="enemyUnitsKilled[n]" type="text" text_align="center" />
<object name="buildingsConstructed[n]" type="text" text_align="center" />
<object name="buildingsLost[n]" type="text" text_align="center" />
<object name="enemyBuildingsDestroyed[n]" type="text" text_align="center" />
<object name="civCentresBuilt[n]" type="text" text_align="center" />
<object name="enemyCivCentresDestroyed[n]" type="text" text_align="center" />
<object type="image" name="playerBox1[n]" size="10 0 10 30" hidden="true">
<object name="playerColourBox1[n]" type="image" size="10 4 30 24" />
<object name="playerName1[n]" type="text" text_align="left" size="40 2 208 100%" />
<object name="civIcon1[n]" type="image" size="208 0 240 32"/>
<object name="civCentresBuilt[n]" type="text" text_align="center" />
<object name="enemyCivCentresDestroyed[n]" type="text" text_align="center" />
</object>
</repeat>
</object>
@ -124,14 +150,15 @@
<object size="0 65 100% 100%-50">
<repeat count="8">
<object type="image" name="playerBox1[n]" size="10 0 10 30" hidden="true">
<object name="playerColourBox1[n]" type="image" size="10 4 30 24" />
<object name="playerName1[n]" type="text" text_align="left" size="40 2 140 100%" />
<object name="foodGathered[n]" type="text" text_align="center" />
<object name="vegetarianRatio[n]" type="text" text_align="center" />
<object name="woodGathered[n]" type="text" text_align="center" />
<object name="metalGathered[n]" type="text" text_align="center" />
<object name="stoneGathered[n]" type="text" text_align="center" />
<object type="image" name="playerBox2[n]" size="10 0 10 30" hidden="true">
<object name="playerColourBox2[n]" type="image" size="10 4 30 24" />
<object name="playerName2[n]" type="text" text_align="left" size="40 2 208 100%" />
<object name="civIcon2[n]" type="image" size="208 0 240 32"/>
<object name="foodGathered[n]" type="text" text_align="center" />
<object name="vegetarianRatio[n]" type="text" text_align="center" />
<object name="woodGathered[n]" type="text" text_align="center" />
<object name="metalGathered[n]" type="text" text_align="center" />
<object name="stoneGathered[n]" type="text" text_align="center" />
</object>
</repeat>
</object>