Copied GUI XML files in preparation for the new code
This was SVN commit r648.
This commit is contained in:
parent
d59e656986
commit
0b48b21ae7
133
binaries/data/mods/official/gui/gui.dtd
Executable file
133
binaries/data/mods/official/gui/gui.dtd
Executable file
@ -0,0 +1,133 @@
|
|||||||
|
<!--
|
||||||
|
Types
|
||||||
|
-->
|
||||||
|
<!ENTITY % bool "(true|false)">
|
||||||
|
<!ENTITY % align "(left|center|right)">
|
||||||
|
<!ENTITY % valign "(top|center|bottom)">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Defines
|
||||||
|
-->
|
||||||
|
<!ENTITY % unique_settings
|
||||||
|
"name CDATA #IMPLIED
|
||||||
|
type CDATA 'empty'
|
||||||
|
style CDATA #IMPLIED"
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ENTITY % base_settings
|
||||||
|
"absolute %bool; #IMPLIED
|
||||||
|
enabled %bool; #IMPLIED
|
||||||
|
ghost %bool; #IMPLIED
|
||||||
|
hidden %bool; #IMPLIED
|
||||||
|
size CDATA #IMPLIED
|
||||||
|
z CDATA #IMPLIED"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Defaults are not put in here, because it ruins the concept of styles -->
|
||||||
|
|
||||||
|
<!ENTITY % ex_settings
|
||||||
|
"checked %bool; #IMPLIED
|
||||||
|
font CDATA #IMPLIED
|
||||||
|
input-initvalue-destroyed-at-focus %bool; #IMPLIED
|
||||||
|
rectcolor-selected CDATA #IMPLIED
|
||||||
|
scrollbar %bool; #IMPLIED
|
||||||
|
scrollbar-style CDATA #IMPLIED
|
||||||
|
sprite CDATA #IMPLIED
|
||||||
|
sprite2 CDATA #IMPLIED
|
||||||
|
sprite-disabled CDATA #IMPLIED
|
||||||
|
sprite2-disabled CDATA #IMPLIED
|
||||||
|
sprite-over CDATA #IMPLIED
|
||||||
|
sprite2-over CDATA #IMPLIED
|
||||||
|
sprite-pressed CDATA #IMPLIED
|
||||||
|
sprite2-pressed CDATA #IMPLIED
|
||||||
|
square-side CDATA #IMPLIED
|
||||||
|
textalign %align; #IMPLIED
|
||||||
|
textcolor CDATA #IMPLIED
|
||||||
|
textcolor-disabled CDATA #IMPLIED
|
||||||
|
textcolor-over CDATA #IMPLIED
|
||||||
|
textcolor-pressed CDATA #IMPLIED
|
||||||
|
textcolor-selected CDATA #IMPLIED
|
||||||
|
textvalign %valign; #IMPLIED
|
||||||
|
tooltip CDATA #IMPLIED
|
||||||
|
tooltip-style CDATA #IMPLIED"
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<objects>
|
||||||
|
-->
|
||||||
|
<!ELEMENT objects (object*)>
|
||||||
|
<!ELEMENT object (#PCDATA|object|action)*>
|
||||||
|
<!ATTLIST object
|
||||||
|
%unique_settings;
|
||||||
|
%base_settings;
|
||||||
|
%ex_settings;
|
||||||
|
>
|
||||||
|
<!ELEMENT action (#PCDATA)>
|
||||||
|
<!ATTLIST action
|
||||||
|
on CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<styles>
|
||||||
|
-->
|
||||||
|
<!ELEMENT styles (style*)>
|
||||||
|
<!ELEMENT style EMPTY>
|
||||||
|
<!ATTLIST style
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
%base_settings;
|
||||||
|
%ex_settings;
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<setup>
|
||||||
|
-->
|
||||||
|
<!ELEMENT setup (icon|scrollbar|tooltip)*>
|
||||||
|
<!ELEMENT scrollbar EMPTY>
|
||||||
|
<!ELEMENT icon EMPTY>
|
||||||
|
<!ELEMENT tooltip EMPTY>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<scrollbar>
|
||||||
|
-->
|
||||||
|
<!ATTLIST scrollbar
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
width CDATA #IMPLIED
|
||||||
|
scroll-wheel %bool; #IMPLIED
|
||||||
|
alwaysshown %bool; #IMPLIED
|
||||||
|
scroll-speed CDATA #IMPLIED
|
||||||
|
sprite-button-top CDATA #IMPLIED
|
||||||
|
sprite-button-top-pressed CDATA #IMPLIED
|
||||||
|
sprite-button-top-disabled CDATA #IMPLIED
|
||||||
|
sprite-button-top-over CDATA #IMPLIED
|
||||||
|
sprite-button-bottom CDATA #IMPLIED
|
||||||
|
sprite-button-bottom-pressed CDATA #IMPLIED
|
||||||
|
sprite-button-bottom-disabled CDATA #IMPLIED
|
||||||
|
sprite-button-bottom-over CDATA #IMPLIED
|
||||||
|
sprite-bar-vertical CDATA #IMPLIED
|
||||||
|
sprite-bar-vertical-over CDATA #IMPLIED
|
||||||
|
sprite-bar-vertical-pressed CDATA #IMPLIED
|
||||||
|
sprite-back-vertical CDATA #IMPLIED
|
||||||
|
minimum-bar-size CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<sprites>
|
||||||
|
-->
|
||||||
|
<!ELEMENT sprites (sprite*)>
|
||||||
|
<!ELEMENT sprite (image+)>
|
||||||
|
<!ELEMENT image EMPTY>
|
||||||
|
|
||||||
|
<!ATTLIST sprite
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ATTLIST image
|
||||||
|
texture CDATA #IMPLIED
|
||||||
|
size CDATA #IMPLIED
|
||||||
|
texture_size CDATA #IMPLIED
|
||||||
|
backcolor CDATA #IMPLIED
|
||||||
|
bordercolor CDATA #IMPLIED
|
||||||
|
border %bool; #IMPLIED
|
||||||
|
z-level CDATA #IMPLIED
|
||||||
|
>
|
83
binaries/data/mods/official/gui/test/hello.xml
Executable file
83
binaries/data/mods/official/gui/test/hello.xml
Executable file
@ -0,0 +1,83 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
|
||||||
|
|
||||||
|
<!DOCTYPE objects SYSTEM "../gui.dtd">
|
||||||
|
|
||||||
|
<objects>
|
||||||
|
<object
|
||||||
|
type="button"
|
||||||
|
name="arena"
|
||||||
|
sprite="sprite1"
|
||||||
|
size="0 0 600 400"
|
||||||
|
z="100"
|
||||||
|
>
|
||||||
|
<action on="Load"><![CDATA[
|
||||||
|
g_ballx = 300;
|
||||||
|
g_bally = 200;
|
||||||
|
// g_balldx = 23;
|
||||||
|
// g_balldy = 11;
|
||||||
|
g_balldx = 0;
|
||||||
|
g_balldy = 0;
|
||||||
|
]]></action>
|
||||||
|
|
||||||
|
<action on="MouseOver"><![CDATA[
|
||||||
|
g_ballx += g_balldx;
|
||||||
|
g_bally += g_balldy;
|
||||||
|
if (g_ballx > 600) {
|
||||||
|
g_balldx *= -0.9;
|
||||||
|
g_ballx = 600-(g_ballx-600);
|
||||||
|
}
|
||||||
|
else if (g_ballx < 0) {
|
||||||
|
g_balldx *= -0.9;
|
||||||
|
g_ballx = -g_ballx;
|
||||||
|
}
|
||||||
|
if (g_bally > 400) {
|
||||||
|
g_balldy *= -0.9;
|
||||||
|
g_bally = 400-(g_bally-400);
|
||||||
|
}
|
||||||
|
else if (g_bally < 0) {
|
||||||
|
g_balldy *= -0.9;
|
||||||
|
g_bally = -g_bally;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gravitate towards the mouse
|
||||||
|
var vect_x = g_ballx-mouse.x;
|
||||||
|
var vect_y = g_bally-mouse.y;
|
||||||
|
var dsquared = vect_x*vect_x + vect_y*vect_y;
|
||||||
|
if (dsquared < 1000) dsquared = 1000;
|
||||||
|
var force = 10000.0 / dsquared;
|
||||||
|
var mag = Math.sqrt(vect_x*vect_x + vect_y*vect_y);
|
||||||
|
vect_x /= mag; vect_y /= mag;
|
||||||
|
g_balldx -= force * vect_x;
|
||||||
|
g_balldy -= force * vect_y;
|
||||||
|
|
||||||
|
var ball = getGUIObjectByName('ball');
|
||||||
|
var r=5;
|
||||||
|
ball.size = new GUISize(g_ballx-r, g_bally-r, g_ballx+r, g_bally+r);
|
||||||
|
]]></action>
|
||||||
|
</object>
|
||||||
|
|
||||||
|
<object
|
||||||
|
type="button"
|
||||||
|
name="ball"
|
||||||
|
sprite="sprite1"
|
||||||
|
size="0 0 1 1"
|
||||||
|
z="120"
|
||||||
|
>*
|
||||||
|
<action on="Press"><![CDATA[
|
||||||
|
writeConsole(mouse);
|
||||||
|
]]></action>
|
||||||
|
</object>
|
||||||
|
|
||||||
|
<object
|
||||||
|
type="button"
|
||||||
|
sprite="sprite1"
|
||||||
|
size="592 2 608 18"
|
||||||
|
z="200"
|
||||||
|
>*
|
||||||
|
<action on="Press"><![CDATA[
|
||||||
|
var arena = getGUIObjectByName('arena');
|
||||||
|
arena.hidden = !arena.hidden;
|
||||||
|
]]></action>
|
||||||
|
</object>
|
||||||
|
|
||||||
|
</objects>
|
31
binaries/data/mods/official/gui/test/setup.xml
Executable file
31
binaries/data/mods/official/gui/test/setup.xml
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
|
||||||
|
|
||||||
|
<!DOCTYPE setup SYSTEM "..\gui.dtd">
|
||||||
|
|
||||||
|
<setup>
|
||||||
|
<scrollbar name="sb" width="18" minimum-bar-size="5"
|
||||||
|
sprite-button-top="sprite2"
|
||||||
|
sprite-button-top-over="null"
|
||||||
|
sprite-button-bottom="sprite2"
|
||||||
|
sprite-button-bottom-over="null"
|
||||||
|
sprite-back-vertical="grey"
|
||||||
|
sprite-bar-vertical="sprite2"
|
||||||
|
sprite-bar-vertical-over="null"
|
||||||
|
sprite-bar-vertical-pressed="null"
|
||||||
|
sprite-button-bottom-pressed="sprite2-pressed"
|
||||||
|
sprite-button-top-pressed="sprite2-pressed"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<scrollbar name="sb2" width="37" minimum-bar-size="5"
|
||||||
|
sprite-button-top="scroll"
|
||||||
|
sprite-button-top-over="null"
|
||||||
|
sprite-button-bottom="scroll"
|
||||||
|
sprite-button-bottom-over="null"
|
||||||
|
sprite-back-vertical="null"
|
||||||
|
sprite-bar-vertical="scroll-bar"
|
||||||
|
sprite-bar-vertical-over="null"
|
||||||
|
sprite-bar-vertical-pressed="null"
|
||||||
|
sprite-button-bottom-pressed="scroll"
|
||||||
|
sprite-button-top-pressed="scroll"
|
||||||
|
/>
|
||||||
|
</setup>
|
105
binaries/data/mods/official/gui/test/sprite1.xml
Executable file
105
binaries/data/mods/official/gui/test/sprite1.xml
Executable file
@ -0,0 +1,105 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
|
||||||
|
|
||||||
|
<!DOCTYPE sprites SYSTEM "..\gui.dtd">
|
||||||
|
|
||||||
|
<sprites>
|
||||||
|
<sprite name="sprite1">
|
||||||
|
<!-- Starting with top left corner continuing in a clockwise manner -->
|
||||||
|
<image backcolor="255 255 255" size="0 1 1 100%-1" />
|
||||||
|
<image backcolor="255 255 255" size="0 0 100%-1 1" />
|
||||||
|
<image backcolor="64 64 64" size="100%-1 0 100% 100%" />
|
||||||
|
<image backcolor="64 64 64" size="0 100%-1 100%-1 100%" />
|
||||||
|
<image backcolor="128 128 128" size="100%-2 1 100%-1 100%-1" />
|
||||||
|
<image backcolor="128 128 128" size="1 100%-2 100%-1 100%-1" />
|
||||||
|
<!-- middle -->
|
||||||
|
<image backcolor="212 208 200" size="1 1 100%-2 100%-2" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="sprite4">
|
||||||
|
<image backcolor="50 50 50" size="0 0 100% 100%" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="sprite1-over">
|
||||||
|
<!-- Starting with top left corner continuing in a clockwise manner -->
|
||||||
|
<image backcolor="255 255 255" size="0 1 1 100%-1" />
|
||||||
|
<image backcolor="255 255 255" size="0 0 100%-1 1" />
|
||||||
|
<image backcolor="64 64 64" size="100%-1 0 100% 100%" />
|
||||||
|
<image backcolor="64 64 64" size="0 100%-1 100%-1 100%" />
|
||||||
|
<image backcolor="128 128 128" size="100%-2 1 100%-1 100%-1" />
|
||||||
|
<image backcolor="128 128 128" size="1 100%-2 100%-1 100%-1" />
|
||||||
|
<!-- middle -->
|
||||||
|
<image backcolor="200 0 0" size="1 1 100%-2 100%-2" />
|
||||||
|
<image backcolor="212 208 200" size="2 2 100%-3 100%-3" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="sprite1-ch">
|
||||||
|
<!-- Starting with top left corner continuing in a clockwise manner -->
|
||||||
|
<image backcolor="255 255 255" size="0 1 1 100%-1" />
|
||||||
|
<image backcolor="255 255 255" size="0 0 100%-1 1" />
|
||||||
|
<image backcolor="64 64 64" size="100%-1 0 100% 100%" />
|
||||||
|
<image backcolor="64 64 64" size="0 100%-1 100%-1 100%" />
|
||||||
|
<image backcolor="128 128 128" size="100%-2 1 100%-1 100%-1" />
|
||||||
|
<image backcolor="128 128 128" size="1 100%-2 100%-1 100%-1" />
|
||||||
|
<!-- middle -->
|
||||||
|
<image backcolor="212 208 200" size="4 4 100%-5 100%-5" z-level="1" />
|
||||||
|
<image backcolor="128 0 0" size="4 4 100%-5 100%-5" z-level="1" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="sprite1-pressed">
|
||||||
|
<image backcolor="64 64 64" size="0 0 100% 100%" />
|
||||||
|
<image backcolor="128 128 128" size="1 1 100%-1 100%-1" z-level="1" />
|
||||||
|
<image backcolor="212 208 200" size="2 2 100%-2 100%-2" z-level="2" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="sprite2">
|
||||||
|
<!-- Starting with top left corner continuing in a clockwise manner -->
|
||||||
|
<image backcolor="212 208 200" size="0 1 1 100%-1" />
|
||||||
|
<image backcolor="212 208 200" size="0 0 100%-1 1" />
|
||||||
|
<image backcolor="255 255 255" size="1 2 1 100%-2" />
|
||||||
|
<image backcolor="255 255 255" size="1 1 100%-2 2" />
|
||||||
|
<image backcolor="64 64 64" size="100%-1 0 100% 100%" />
|
||||||
|
<image backcolor="64 64 64" size="0 100%-1 100%-1 100%" />
|
||||||
|
<image backcolor="128 128 128" size="100%-2 1 100%-1 100%-1" />
|
||||||
|
<image backcolor="128 128 128" size="1 100%-2 100%-1 100%-1" />
|
||||||
|
<!-- middle -->
|
||||||
|
<image backcolor="212 208 200" size="2 2 100%-2 100%-2" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="sprite2-pressed">
|
||||||
|
<image backcolor="128 128 128" size="0 0 100% 100%" />
|
||||||
|
<image backcolor="212 208 200" size="1 1 100%-1 100%-1" z-level="1" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="sprite1">
|
||||||
|
<!-- Starting with top left corner continuing in a clockwise manner -->
|
||||||
|
<image backcolor="255 255 255" size="0 1 1 100%-1" />
|
||||||
|
<image backcolor="255 255 255" size="0 0 100%-1 1" />
|
||||||
|
<image backcolor="64 64 64" size="100%-1 0 100% 100%" />
|
||||||
|
<image backcolor="64 64 64" size="0 100%-1 100%-1 100%" />
|
||||||
|
<image backcolor="128 128 128" size="100%-2 1 100%-1 100%-1" />
|
||||||
|
<image backcolor="128 128 128" size="1 100%-2 100%-1 100%-1" />
|
||||||
|
<!-- middle -->
|
||||||
|
<image backcolor="212 208 200" size="1 1 100%-2 100%-2" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="grey">
|
||||||
|
<image backcolor="243 242 240" size="0 0 100% 100%" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="white-border">
|
||||||
|
<image backcolor="100 70 120" size="0 0 100% 100%" />
|
||||||
|
<image backcolor="255 255 255" size="-1 -1 100%+1 0" />
|
||||||
|
<image backcolor="255 255 255" size="-1 100% 100%+1 100%+1" />
|
||||||
|
<image backcolor="255 255 255" size="-1 0 0 100%" />
|
||||||
|
<image backcolor="255 255 255" size="100% 0 100%+1 100%" />
|
||||||
|
</sprite>
|
||||||
|
|
||||||
|
<sprite name="scroll">
|
||||||
|
<!--<image backcolor="128 128 128" size="0 0 100% 100%" />-->
|
||||||
|
<image backcolor="150 105 180" size="2 2 100%-2 100%-2" z-level="1" />
|
||||||
|
</sprite>
|
||||||
|
<sprite name="scroll-bar">
|
||||||
|
<!--<image backcolor="128 128 128" size="0 0 100% 100%" />-->
|
||||||
|
<image backcolor="150 105 180" size="2 0 100%-2 100%" z-level="1" />
|
||||||
|
</sprite>
|
||||||
|
</sprites>
|
24
binaries/data/mods/official/gui/test/styles.xml
Executable file
24
binaries/data/mods/official/gui/test/styles.xml
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
|
||||||
|
|
||||||
|
<!DOCTYPE styles SYSTEM "..\gui.dtd">
|
||||||
|
|
||||||
|
<styles>
|
||||||
|
<!-- The default values -->
|
||||||
|
<style name="default"
|
||||||
|
hidden="false"
|
||||||
|
enabled="true"
|
||||||
|
z="0"
|
||||||
|
absolute="true"
|
||||||
|
scrollbar-style="sb2"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<style name="button"
|
||||||
|
sprite="sprite1"
|
||||||
|
sprite-pressed="sprite1-pressed"
|
||||||
|
sprite-disabled="sprite1-disabled"
|
||||||
|
sprite-over="sprite1-over"
|
||||||
|
sprite2="sprite1-ch"
|
||||||
|
sprite2-pressed="sprite2-pressed"
|
||||||
|
sprite2-disabled="sprite2-disabled"
|
||||||
|
/>
|
||||||
|
</styles>
|
Loading…
Reference in New Issue
Block a user