1
1
forked from 0ad/0ad

Not finished with session yet, so committing just the shared bits I've modified (ie anything without *session*.* in the title) so that Malte can do his network GUI now that Simon's committed his changes. *nudge* *nudge*

This was SVN commit r1932.
This commit is contained in:
Acumen 2005-02-23 21:13:36 +00:00
parent 85a95e3e41
commit 71701ba244
2 changed files with 96 additions and 2 deletions

View File

@ -103,7 +103,7 @@ function addSizeArrayXY(objectArray, objectElement, objectX, objectY)
// ====================================================================
function setSizeArray(objectName, objectArrayElement, rleft, rtop, rright, rbottom)
function calcSizeArray(objectName, objectArrayElement, rleft, rtop, rright, rbottom)
{
// Use this function as a shortcut to change the size of a GUI control, via an array containing x, y, width, height and 4 relative sizes.
// Alternatively, specify 4 relative sizes to override and use these ones instead.
@ -180,12 +180,74 @@ function setSizeArray(objectName, objectArrayElement, rleft, rtop, rright, rbott
break;
}
return new GUISize(setSizeContainer.x1, setSizeContainer.y1, setSizeContainer.x2, setSizeContainer.y2, setSizeContainer.rleft, setSizeContainer.rtop, setSizeContainer.rright, setSizeContainer.rbottom);
}
// ====================================================================
function setSizeArray(objectName, objectArrayElement, rleft, rtop, rright, rbottom)
{
// Set appropriate size for dimensions.
getGUIObjectByName(objectName).size = new GUISize(setSizeContainer.x1, setSizeContainer.y1, setSizeContainer.x2, setSizeContainer.y2, setSizeContainer.rleft, setSizeContainer.rtop, setSizeContainer.rright, setSizeContainer.rbottom);
getGUIObjectByName(objectName).size = calcSizeArray(objectName, objectArrayElement, rleft, rtop, rright, rbottom);
}
// ====================================================================
function addSizeCoordArray(objectName, objectArrayElement, objectArrayElement_Flp)
{
// Used to store the two GUI style sizes for an object on creation (specified as coordinates).
// Used later by FlipGUI() to switch the objects to a new set of positions.
// This uses the revised coordinate system, so it handles the flipping internally.
// If an optional secondary coordinate object is specified by parameter, it will
// use the values in this object for the flipped version, rather than automatically
// generating a top-down flip.
SizeCoord[SizeCoord.last] = new Object();
SizeCoord[SizeCoord.last].name = objectName;
// Determine relatives for the second size.
addSizeContainer = new Object();
if (objectArrayElement_Flp) // Specify new flipped coordinates from object.
{
addSizeContainer.rleft = objectArrayElement_Flp.rleft;
addSizeContainer.rtop = objectArrayElement_Flp.rtop;
addSizeContainer.rright = objectArrayElement_Flp.rright;
addSizeContainer.rbottom = objectArrayElement_Flp.rbottom;
addSizeContainer.width = objectArrayElement_Flp.width;
addSizeContainer.height = objectArrayElement_Flp.height;
addSizeContainer.x = objectArrayElement_Flp.x;
addSizeContainer.y = objectArrayElement_Flp.y;
}
else // Generate flipped version automatically.
{
addSizeContainer.rleft = objectArrayElement.rleft;
addSizeContainer.rtop = 100-objectArrayElement.rtop;
addSizeContainer.rright = objectArrayElement.rright;
addSizeContainer.rbottom = 100-objectArrayElement.rbottom;
if (addSizeContainer.rtop <= 0) addSizeContainer.rtop = 0;
if (addSizeContainer.rbottom <= 0) addSizeContainer.rbottom = 0;
if (addSizeContainer.rtop >= 100) addSizeContainer.rtop = 100;
if (addSizeContainer.rbottom >= 100) addSizeContainer.rbottom = 100;
addSizeContainer.x = objectArrayElement.x;
addSizeContainer.y = objectArrayElement.y;
addSizeContainer.width = objectArrayElement.width;
addSizeContainer.height = objectArrayElement.height;
if (addSizeContainer.rtop == 100 && objectArrayElement.y < 0) addSizeContainer.y = objectArrayElement.y*-1;
if (addSizeContainer.rbottom == 100 && objectArrayElement.y < 0) addSizeContainer.y = objectArrayElement.y*-1;
}
// Assign the two sizes to array for retrieval when needed.
SizeCoord[SizeCoord.last].size1 = calcSizeArray(objectName, objectArrayElement);
SizeCoord[SizeCoord.last].size2 = calcSizeArray(objectName, addSizeContainer);
SizeCoord.last++; // Increment counter for next entry.
}
// ====================================================================
function setCoordInputUpDown(setCoordObjectUp, setCoordObjectDn, parentInput, rleft, rtop, rright, rbottom)
{
// Set the coordinates for the up/down button for an input box.

View File

@ -39,6 +39,26 @@
ghost="false"
/>
<style name="session_object"
tooltip_style="session_tooltip"
tooltip="(TBA)"
/>
<style name="session_ghost_object"
tooltip_style="session_tooltip"
tooltip="(TBA)"
ghost="true"
/>
<style name="session_ghost_heading_object"
font="verdana10"
textcolor="200 200 200"
text_align="center"
tooltip_style="session_tooltip"
tooltip="(TBA)"
ghost="true"
/>
<!-- Empty entity portrait. -->
<style name="portrait"
sprite="ui_portrait_default_square"
@ -46,6 +66,8 @@
sprite_disabled="ui_portrait_default_square_grey"
text_align="right"
textcolor="255 255 255"
tooltip_style="session_tooltip"
tooltip="(TBA)"
/>
<style name="action"
@ -54,6 +76,8 @@
sprite_disabled="ui_portrait_default_circle_grey"
text_align="right"
textcolor="255 255 255"
tooltip_style="session_tooltip"
tooltip="(TBA)"
/>
<!-- Entity progress bar. -->
@ -61,24 +85,32 @@
sprite_background=""
sprite_bar="green_bar"
ghost="true"
tooltip_style="session_tooltip"
tooltip="(TBA)"
/>
<style name="up_bar"
sprite_background=""
sprite_bar="yellow_bar"
ghost="true"
tooltip_style="session_tooltip"
tooltip="(TBA)"
/>
<style name="blue_bar"
sprite_background=""
sprite_bar="blue_bar"
ghost="true"
tooltip_style="session_tooltip"
tooltip="(TBA)"
/>
<style name="blue_bar_outlined"
sprite_background="only_black_border"
sprite_bar="blue_bar_outlined"
ghost="true"
tooltip_style="session_tooltip"
tooltip="(TBA)"
/>
<!-- Atlas Editor -->