forked from 0ad/0ad
This was SVN commit r2217.
This commit is contained in:
parent
158f967926
commit
d2410624e4
@ -12,7 +12,7 @@
|
||||
|
||||
<object type="empty" name="JUKEBOX_GUI" size="0 0 100% 100%" z="1" hidden="true">
|
||||
|
||||
<object type="text" name="JUKEBOX_BKG" sprite="0ad_window" font="prospero16" textcolor="0 0 0" z="100" hidden="false" ghost="true"><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_BKG]); ]]></action>
|
||||
<object type="text" name="JUKEBOX_BKG" sprite="0ad_window" font="prospero16" textcolor="0 0 0" hidden="false" ghost="true"><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_BKG]); ]]></action>
|
||||
<action on="Tick"><![CDATA[
|
||||
if (!getGUIObjectByName("JUKEBOX_GUI").hidden)
|
||||
jukeboxDisplay();
|
||||
@ -20,11 +20,13 @@
|
||||
</object>
|
||||
|
||||
<object type="button" name="JUKEBOX_TITLEBAR" sprite="message_box_titlebar_middle" font="prospero18" text_align="center" text_valign="center" ><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_TITLEBAR]); GUIObjectSetCaption(this.name, "Jukebox"); ]]></action></object>
|
||||
<!--
|
||||
<object type="combobox" name="JUKEBOX_CATEGORY" sprite="0ad_window" text_align="left" ><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_CATEGORY]); GUIObjectSetCaption(this.name, "All"); ]]></action></object>
|
||||
<object type="list" name="JUKEBOX_LIST_FILE" sprite="0ad_indent" text_align="left" ><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_LIST_FILE]); GUIObjectSetCaption(this.name, ""); ]]></action></object>
|
||||
-->
|
||||
<object type="button" name="JUKEBOX_EXIT_BUTTON" sprite="exit_sprite" sprite_over="exit_sprite_over" ghost="false" z="100" hidden="false"><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_EXIT_BUTTON]); ]]></action>
|
||||
<object type="image" name="JUKEBOX_TITLEBAR_LEFT" sprite="message_box_titlebar_left" ><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_TITLEBAR_LEFT]); ]]></action></object>
|
||||
<object type="image" name="JUKEBOX_TITLEBAR_RIGHT" sprite="message_box_titlebar_right" ><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_TITLEBAR_RIGHT]); ]]></action></object>
|
||||
|
||||
<object type="button" name="JUKEBOX_LIST_FILE" sprite="0ad_indent" text_align="left" ><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_LIST_FILE]); GUIObjectSetCaption(this.name, ""); ]]></action></object>
|
||||
<object type="button" name="JUKEBOX_CATEGORY" style="session_button_object" ><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_CATEGORY]); GUIObjectSetCaption(this.name, "All"); ]]></action></object>
|
||||
|
||||
<object type="button" name="JUKEBOX_EXIT_BUTTON" sprite="exit_sprite" sprite_over="exit_sprite_over" ghost="false" hidden="false"><action on="Load"><![CDATA[ setSizeArray(this.name, Crd[JUKEBOX_EXIT_BUTTON]); ]]></action>
|
||||
<action on="Press"><![CDATA[
|
||||
// Close jukebox.
|
||||
GUIObjectHide("JUKEBOX_GUI");
|
||||
|
@ -1,47 +1,60 @@
|
||||
function initJukebox()
|
||||
{
|
||||
// ============================================ CONSTANTS ================================================
|
||||
|
||||
JUKEBOX = new Object();
|
||||
JUKEBOX.span = 5;
|
||||
|
||||
// ============================================= GLOBALS =================================================
|
||||
|
||||
// Background of jukebox.
|
||||
JUKEBOX_BKG = addArrayElement(Crd, Crd.last);
|
||||
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen;
|
||||
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen;
|
||||
Crd[Crd.last-1].width = 50;
|
||||
Crd[Crd.last-1].height = 50;
|
||||
Crd[Crd.last-1].x = 50;
|
||||
Crd[Crd.last-1].y = 50;
|
||||
Crd[Crd.last-1].x = 80; // 120;
|
||||
Crd[Crd.last-1].y = 180; // 150;
|
||||
Crd[Crd.last-1].width = Crd[Crd.last-1].x*2-Crd[Crd.last-1].x;
|
||||
Crd[Crd.last-1].height = Crd[Crd.last-1].y*2-Crd[Crd.last-1].y;
|
||||
|
||||
// Title background of jukebox.
|
||||
JUKEBOX_TITLEBAR = addArrayElement(Crd, Crd.last);
|
||||
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
|
||||
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
|
||||
Crd[Crd.last-1].width = 100;
|
||||
Crd[Crd.last-1].width = 200;
|
||||
Crd[Crd.last-1].height = 32;
|
||||
Crd[Crd.last-1].x = 0;
|
||||
Crd[Crd.last-1].y = Crd[JUKEBOX_BKG].y;
|
||||
Crd[Crd.last-1].x = -(Crd[Crd.last-1].width/2);
|
||||
Crd[Crd.last-1].y = Crd[JUKEBOX_BKG].y-Crd[Crd.last-1].height;
|
||||
|
||||
// Title left of jukebox.
|
||||
JUKEBOX_TITLEBAR_LEFT = addArrayElement(Crd, Crd.last);
|
||||
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
|
||||
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
|
||||
Crd[Crd.last-1].width = 50;
|
||||
Crd[Crd.last-1].height = Crd[JUKEBOX_TITLEBAR].height;
|
||||
Crd[Crd.last-1].x = -Crd[JUKEBOX_TITLEBAR].width+Crd[Crd.last-1].width;
|
||||
Crd[Crd.last-1].y = Crd[JUKEBOX_TITLEBAR].y;
|
||||
|
||||
// Title right of jukebox.
|
||||
JUKEBOX_TITLEBAR_RIGHT = addArrayElement(Crd, Crd.last);
|
||||
Crd[Crd.last-1].rleft = mid_screen; Crd[Crd.last-1].rtop = top_screen;
|
||||
Crd[Crd.last-1].rright = mid_screen; Crd[Crd.last-1].rbottom = top_screen;
|
||||
Crd[Crd.last-1].width = Crd[JUKEBOX_TITLEBAR_LEFT].width;
|
||||
Crd[Crd.last-1].height = Crd[JUKEBOX_TITLEBAR_LEFT].height;
|
||||
Crd[Crd.last-1].x = -Crd[JUKEBOX_TITLEBAR].x;
|
||||
Crd[Crd.last-1].y = Crd[JUKEBOX_TITLEBAR_LEFT].y;
|
||||
|
||||
// List of tracks.
|
||||
JUKEBOX_LIST_FILE = addArrayElement(Crd, Crd.last);
|
||||
Crd[Crd.last-1].rleft = left_screen; Crd[Crd.last-1].rtop = top_screen;
|
||||
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen;
|
||||
Crd[Crd.last-1].width = 100;
|
||||
Crd[Crd.last-1].height = 75;
|
||||
Crd[Crd.last-1].x = 100;
|
||||
Crd[Crd.last-1].y = 100;
|
||||
Crd[Crd.last-1].x = Crd[JUKEBOX_BKG].x+50;
|
||||
Crd[Crd.last-1].y = Crd[JUKEBOX_BKG].y+50;
|
||||
Crd[Crd.last-1].width = Crd[Crd.last-1].x*2-Crd[Crd.last-1].x;
|
||||
Crd[Crd.last-1].height = Crd[Crd.last-1].y*2-Crd[Crd.last-1].y+10;
|
||||
|
||||
// Combobox to select category of tracks to list.
|
||||
JUKEBOX_CATEGORY = addArrayElement(Crd, Crd.last);
|
||||
Crd[Crd.last-1].rleft = right_screen; Crd[Crd.last-1].rtop = bottom_screen;
|
||||
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = bottom_screen;
|
||||
Crd[Crd.last-1].width = 100;
|
||||
Crd[Crd.last-1].height = 32;
|
||||
Crd[Crd.last-1].x = 20;
|
||||
Crd[Crd.last-1].y = 20;
|
||||
Crd[Crd.last-1].width = 90;
|
||||
Crd[Crd.last-1].height = 35;
|
||||
Crd[Crd.last-1].x = Crd[JUKEBOX_LIST_FILE].x;
|
||||
Crd[Crd.last-1].y = Crd[JUKEBOX_BKG].y+10;
|
||||
|
||||
// Jukebox exit button.
|
||||
JUKEBOX_EXIT_BUTTON = addArrayElement(Crd, Crd.last);
|
||||
@ -49,8 +62,8 @@ function initJukebox()
|
||||
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = top_screen;
|
||||
Crd[Crd.last-1].width = 16;
|
||||
Crd[Crd.last-1].height = 16;
|
||||
Crd[Crd.last-1].x = 26;
|
||||
Crd[Crd.last-1].y = 25;
|
||||
Crd[Crd.last-1].x = Crd[JUKEBOX_BKG].x-Crd[Crd.last-1].width-10;
|
||||
Crd[Crd.last-1].y = Crd[JUKEBOX_BKG].y-Crd[Crd.last-1].height-10;
|
||||
}
|
||||
|
||||
// ====================================================================
|
||||
|
@ -58,8 +58,8 @@ function initManual()
|
||||
Crd[Crd.last-1].rright = right_screen; Crd[Crd.last-1].rbottom = top_screen;
|
||||
Crd[Crd.last-1].width = 16;
|
||||
Crd[Crd.last-1].height = 16;
|
||||
Crd[Crd.last-1].x = 26;
|
||||
Crd[Crd.last-1].y = 25;
|
||||
Crd[Crd.last-1].x = Crd[Crd.last-1].width+MANUAL.span*2-1;
|
||||
Crd[Crd.last-1].y = Crd[Crd.last-1].height+MANUAL.span*2-1;
|
||||
}
|
||||
|
||||
// ====================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user