From aba8d1daaae47d6f22febf01ce15b5ef276b15bb Mon Sep 17 00:00:00 2001 From: Acumen Date: Tue, 24 Aug 2004 17:17:23 +0000 Subject: [PATCH] Updated GUI scripts to include references to all the new GUI images for the next PASAP milestone in sprite1, and implemented some of it in hello and basefunctions. Mostly just throwing images on the screen, but some new stuff like it shows portraits and stat icons when clicking units now. This was SVN commit r1047. --- .../mods/official/gui/test/basefunctions.js | 38 ++- .../data/mods/official/gui/test/hello.xml | 62 ++++- .../data/mods/official/gui/test/sprite1.xml | 241 ++++++++++++++++-- 3 files changed, 308 insertions(+), 33 deletions(-) diff --git a/binaries/data/mods/official/gui/test/basefunctions.js b/binaries/data/mods/official/gui/test/basefunctions.js index 36f3d05fc3..296af12404 100755 --- a/binaries/data/mods/official/gui/test/basefunctions.js +++ b/binaries/data/mods/official/gui/test/basefunctions.js @@ -30,6 +30,13 @@ function GUIUpdateObjectInfo() { ObjectNameText = getGUIObjectByName("selection_name_test"); ObjectPositionText = getGUIObjectByName("selection_pos_test"); ObjectSpeedText = getGUIObjectByName("selection_speed_test"); + ObjectPortrait = getGUIObjectByName("selection_portrait_test"); + ObjectStatAttack = getGUIObjectByName("statistic_attack"); + ObjectStatHack = getGUIObjectByName("statistic_hack"); + ObjectStatPierce = getGUIObjectByName("statistic_pierce"); + ObjectStatAccuracy = getGUIObjectByName("statistic_accuracy"); + ObjectStatLOS = getGUIObjectByName("statistic_los"); + ObjectStatSpeed = getGUIObjectByName("statistic_speed"); // Check number of selected entities if (selection.length > 1) { @@ -44,6 +51,17 @@ function GUIUpdateObjectInfo() { if (!selection[0]) { + // Reset portrait + ObjectPortrait.hidden = true; + + // Reset statistic icons. + ObjectStatAttack.hidden = true; + ObjectStatHack.hidden = true; + ObjectStatPierce.hidden = true; + ObjectStatAccuracy.hidden = true; + ObjectStatLOS.hidden = true; + ObjectStatSpeed.hidden = true; + // Reset object name ObjectNameText.caption = ""; ObjectNameText.hidden = true; @@ -58,6 +76,24 @@ function GUIUpdateObjectInfo() { } else { + // Update portrait (temporary if/else statement until entity icons are implemented). + if (selection[0].name == "Prometheus Dude") ObjectPortrait.sprite="portrait_unit_dude_lrg"; + else + if (selection[0].name == "Deciduous Tree 1" || selection[0].name == "Deciduous Tree 2") ObjectPortrait.sprite="portrait_flora_deciduotree_lrg"; + else + if (selection[0].name == "House") ObjectPortrait.sprite="portrait_structure_heleho_lrg"; + else + ObjectPortrait.sprite="portrait_unknown_lrg"; + ObjectPortrait.hidden = false; + + // Turn on statistic icons. + ObjectStatAttack.hidden = false; + ObjectStatHack.hidden = false; + ObjectStatPierce.hidden = false; + ObjectStatAccuracy.hidden = false; + ObjectStatLOS.hidden = false; + ObjectStatSpeed.hidden = false; + // Update object name ObjectNameText.caption = selection[0].name; ObjectNameText.hidden = false; @@ -69,7 +105,7 @@ function GUIUpdateObjectInfo() { ObjectPositionText.hidden = false; // Update speed - ObjectSpeedText.caption = "Speed: " + selection[0].speed; + ObjectSpeedText.caption = selection[0].speed; ObjectSpeedText.hidden = false; } diff --git a/binaries/data/mods/official/gui/test/hello.xml b/binaries/data/mods/official/gui/test/hello.xml index 57891361bb..b98aba746f 100755 --- a/binaries/data/mods/official/gui/test/hello.xml +++ b/binaries/data/mods/official/gui/test/hello.xml @@ -66,6 +66,13 @@ ball.size = new GUISize(g_ballx-r, g_bally-r, g_ballx+r, g_bally+r); } } + + function Start() + { + var gameAttribs=new Object(); + gameAttribs.mapFile="test_01.pmp"; + startGame(gameAttribs); + } ]]> @@ -156,6 +163,50 @@ ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -