- Timestamp:
- 08/28/11 00:44:08 (13 years ago)
- Location:
- ps/trunk/binaries/data/mods/public/gui
- Files:
-
- 4 edited
-
pregame/mainmenu.xml (modified) (6 diffs)
-
session/menu.js (modified) (4 diffs)
-
session/session.xml (modified) (9 diffs)
-
session/utility_functions.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.xml
r10112 r10114 187 187 > 188 188 Learn To Play 189 <action on="Press"><![CDATA[ 190 // close submenu if left open 189 <action on="Press"> 191 190 getGUIObjectByName("submenu").hidden = true; 192 // open game manual dialog 193 Engine.PushGuiPage("page_manual.xml", { "page": "intro" }); 194 ]]></action> 191 <![CDATA[ 192 Engine.PushGuiPage("page_manual.xml", { "page": "intro" }); 193 ]]> 194 </action> 195 195 </object> 196 196 … … 203 203 tooltip="Challenge the computer player to a single player match." 204 204 > 205 Single Player 206 <action on="Press"><![CDATA[ 207 updateSubmenu("submenuSinglePlayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2); 208 ]]></action> 205 Single Player 206 <action on="Press"> 207 <![CDATA[ 208 updateSubmenu("submenuSinglePlayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2); 209 ]]> 210 </action> 209 211 </object> 210 212 … … 218 220 > 219 221 Multiplayer 220 <action on="Press"><![CDATA[ 221 updateSubmenu("submenuMultiplayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2); 222 ]]></action> 222 <action on="Press"> 223 <![CDATA[ 224 updateSubmenu("submenuMultiplayer", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2); 225 ]]> 226 </action> 223 227 </object> 224 228 … … 232 236 > 233 237 Tools <![CDATA[&]]> Options 234 <action on="Press"><![CDATA[ 235 updateSubmenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2); 236 ]]></action> 238 <action on="Press"> 239 <![CDATA[ 240 updateSubmenu("submenuToolsAndOptions", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 2); 241 ]]> 242 </action> 237 243 </object> 238 244 … … 246 252 > 247 253 History 248 <action on="Press"><![CDATA[ 249 // close submenu if left open 254 <action on="Press"> 250 255 getGUIObjectByName("submenu").hidden = true; 251 // open history dialog 252 Engine.PushGuiPage("page_civinfo.xml"); 253 ]]></action> 256 <![CDATA[ 257 Engine.PushGuiPage("page_civinfo.xml"); 258 ]]> 259 </action> 254 260 </object> 255 261 … … 262 268 tooltip="Exit Game" 263 269 > 264 Exit 265 <action on="Press"><![CDATA[ 266 // close submenu if left open 270 Exit Game 271 <action on="Press"> 267 272 getGUIObjectByName("submenu").hidden = true; 268 // open exit dialog 269 var btCaptions = ["Yes", "No"]; 270 var btCode = [exit, null]; 271 messageBox(400, 200, "Are you sure you want to quit 0 A.D.?", "Confirmation", 0, btCaptions, btCode); 272 ]]></action> 273 <![CDATA[ 274 var btCaptions = ["Yes", "No"]; 275 var btCode = [exit, null]; 276 messageBox(400, 200, "Are you sure you want to quit 0 A.D.?", "Confirmation", 0, btCaptions, btCode); 277 ]]> 278 </action> 273 279 </object> 274 280 </object> -
ps/trunk/binaries/data/mods/public/gui/session/menu.js
r10072 r10114 1 function toggleDeveloperOverlay()1 function openMenu() 2 2 { 3 var devCommands = getGUIObjectByName("devCommands"); 4 var text = devCommands.hidden? "opened." : "closed."; 5 submitChatDirectly("The Developer Overlay was " + text); 6 devCommands.hidden = !devCommands.hidden; 3 getGUIObjectByName("menuScreen").hidden = false; 4 getGUIObjectByName("menu").hidden = false; 7 5 } 8 6 9 function openMenuDialog()7 function closeMenu() 10 8 { 11 var menu = getGUIObjectByName("menuDialogPanel");12 g_SessionDialog.open("Menu", null, menu, 204, 224, null);9 getGUIObjectByName("menuScreen").hidden = true; 10 getGUIObjectByName("menu").hidden = true; 13 11 } 14 12 15 function openSettings Dialog()13 function openSettings() 16 14 { 17 var settings = getGUIObjectByName("settingsDialogPanel"); 18 g_SessionDialog.open("Settings", null, settings, 340, 252, null); 15 closeMenu(); 16 closeChat(); 17 getGUIObjectByName("settingsDialogPanel").hidden = false; 18 } 19 20 function closeSettings() 21 { 22 getGUIObjectByName("settingsDialogPanel").hidden = true; 19 23 } 20 24 21 25 function openChat() 22 26 { 27 closeMenu(); 28 closeSettings(); 23 29 getGUIObjectByName("chatInput").focus(); // Grant focus to the input area 24 30 getGUIObjectByName("chatDialogPanel").hidden = false; 25 g_SessionDialog.close();31 26 32 } 27 33 … … 30 36 getGUIObjectByName("chatInput").caption = ""; // Clear chat input 31 37 getGUIObjectByName("chatDialogPanel").hidden = true; 32 g_SessionDialog.close();33 38 } 34 39 35 40 function toggleChatWindow() 36 41 { 42 closeSettings(); 43 37 44 var chatWindow = getGUIObjectByName("chatDialogPanel"); 38 45 var chatInput = getGUIObjectByName("chatInput"); … … 44 51 45 52 chatWindow.hidden = !chatWindow.hidden; 46 g_SessionDialog.close();47 53 } 48 54 49 55 function togglePause() 50 56 { 57 closeMenu(); 58 closeChat(); 59 closeSettings(); 60 51 61 var pauseOverlay = getGUIObjectByName("pauseOverlay"); 52 62 … … 63 73 64 74 pauseOverlay.hidden = !pauseOverlay.hidden; 65 g_SessionDialog.close();66 75 } 67 76 68 function openExitGameDialog()77 function toggleDeveloperOverlay() 69 78 { 70 g_SessionDialog.open("Exit Game", "Do you really want to quit?", null, 320, 140, leaveGame); 79 var devCommands = getGUIObjectByName("devCommands"); 80 var text = devCommands.hidden? "opened." : "closed."; 81 submitChatDirectly("The Developer Overlay was " + text); 82 devCommands.hidden = !devCommands.hidden; 71 83 } 72 84 73 85 function escapeKeyAction() 74 86 { 75 var sessionDialog = getGUIObjectByName("sessionDialog"); 76 77 if (!sessionDialog.hidden) 78 g_SessionDialog.close(); 79 else 80 getGUIObjectByName("chatDialogPanel").hidden = true; 87 closeMenu(); 88 closeChat(); 89 closeSettings(); 81 90 } -
ps/trunk/binaries/data/mods/public/gui/session/session.xml
r10108 r10114 31 31 32 32 <!-- ================================ ================================ --> 33 <!-- ALPHA LABELS (alpha, build time, revision) -->34 <!-- ================================ ================================ -->35 36 <!-- Displays Alpha name and number -->37 <object size="100%-200 32 100% 52" name="alphaLabel" type="text" style="centeredText" font="serif-bold-16" textcolor="white" ghost="true">38 ALPHA VI : Fortuna39 </object>40 41 <!-- Displays build date and revision number-->42 <object size="100%-200 52 100% 72" name="buildTimeLabel" type="text" style="centeredText" font="serif-12" textcolor="white" ghost="true">43 <action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action>44 </object>45 46 <!-- ================================ ================================ -->47 33 <!-- HOTKEYS (For some reason, they won't work properly unless outside menu) --> 48 34 <!-- ================================ ================================ --> … … 104 90 105 91 <!-- Dev/cheat commands --> 106 <object name="devCommands" size="100%-156 72 100%-16 232" type="image" sprite="devCommandsBackground"92 <object name="devCommands" size="100%-156 100 100%-8 260" type="image" sprite="devCommandsBackground" 107 93 hidden="true" hotkey="session.devcommands.toggle"> 108 94 <action on="Press"> … … 209 195 210 196 </object> 211 212 <!-- ================================ ================================ --> 213 <!-- Session Dialog --> 214 <!-- ================================ ================================ --> 215 <object name="sessionDialog" 197 198 <!-- ================================ ================================ --> 199 <!-- Menu --> 200 <!-- ================================ ================================ --> 201 <object name="menuScreen" 202 type="image" 203 hidden="true" 204 > 205 <!-- hides the submenu when the mouse leaves the mainMenuButtons or submenu --> 206 <action on="MouseEnter"> 207 closeMenu(); 208 </action> 209 210 <object name="menu" 211 style="TranslucentPanelThinBorder" 212 type="image" 213 size="100%-164 0 100% 200" 214 hidden="true" 215 > 216 <object size="4 36 100%-4 50%+20"> 217 218 <!-- Settings button --> 219 <object type="button" 220 name="settingsButton" 221 style="StoneButtonFancy" 222 size="0 0 100% 32" 223 tooltip_style="sessionToolTip" 224 > 225 Settings 226 <action on="Press"> 227 openSettings(); 228 </action> 229 </object> 230 231 <!-- Chat button --> 232 <object type="button" 233 name="chatButton" 234 style="StoneButtonFancy" 235 size="0 32 100% 64" 236 tooltip_style="sessionToolTip" 237 > 238 Chat 239 <action on="Press"> 240 openChat(); 241 </action> 242 </object> 243 244 <!-- Pause Button --> 245 <object type="button" 246 name="pauseButton" 247 style="StoneButtonFancy" 248 size="0 64 100% 96" 249 tooltip_style="sessionToolTip" 250 > 251 <object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object> 252 <action on="Press"> 253 togglePause(); 254 </action> 255 </object> 256 257 <!-- Exit button --> 258 <object type="button" 259 name="menuExitButton" 260 style="StoneButtonFancy" 261 size="0 96 100% 128" 262 tooltip_style="sessionToolTip" 263 > 264 Exit Game 265 <action on="Press">escapeKeyAction();<![CDATA[ 266 var btCaptions = ["Yes", "No"]; 267 var btCode = [exit, null]; 268 messageBox(400, 200, "Are you sure you want to quit?", "Confirmation", 0, btCaptions, btCode); 269 ]]></action> 270 </object> 271 272 <!-- Close button --> 273 <object type="button" 274 style="StoneButtonFancy" 275 size="0 128 100% 160" 276 tooltip_style="sessionToolTip" 277 > 278 Close 279 <action on="Press">closeMenu();</action> 280 </object> 281 </object> 282 </object> 283 </object> 284 285 <!-- ================================ ================================ --> 286 <!-- Settings Window --> 287 <!-- ================================ ================================ --> 288 <object name="settingsDialogPanel" 216 289 style="StonePanelLight" 217 290 type="image" 218 291 size="50%-180 50%-200 50%+180 50%+50" 219 292 hidden="true" 220 z="30"221 293 > 222 <object name="sessionDialogTitleBar" size="50%-96 -16 50%+96 16" type="image" style="StoneDialogTitleBar"> 223 <object name="sessionDialogTitle" type="text" style="TitleText" size="0 -2 100% 100%">Title</object> 224 </object> 225 226 <object name="sessionDialogMessage" size="20 10 100%-20 100%-48" type="text" style="dialogText"/> 227 228 <object size="0 100%-48 100% 100%"> 229 <object name="sessionDialogConfirm" size="32 100%-64 144 100%-32" type="button" style="StoneButton"> 230 OK 231 <action on="Press"></action> 232 </object> 233 234 <object name="sessionDialogCancel" size="100%-144 100%-64 100%-32 100%-32" type="button" style="StoneButton"> 235 Cancel 236 <action on="Press">g_SessionDialog.close();</action> 237 </object> 238 </object> 239 </object> 240 241 <!-- ================================ ================================ --> 242 <!-- Menu --> 243 <!-- ================================ ================================ --> 244 <object name="menuDialogPanel" 245 size="0 50%-180 100% 50%+20" 246 type="image" 247 hidden="true" 248 z="30" 249 > 250 <!-- Settings button --> 251 <object type="button" 252 name="settingsButton" 253 style="StoneButtonFancy" 254 size="0 0 100% 32" 255 tooltip_style="sessionToolTip" 256 > 257 Settings 258 <action on="Press">openSettingsDialog();</action> 259 </object> 260 261 <!-- Chat button --> 262 <object type="button" 263 name="chatButton" 264 style="StoneButtonFancy" 265 size="0 32 100% 64" 266 tooltip_style="sessionToolTip" 267 > 268 Chat 269 <action on="Press">openChat();</action> 270 </object> 271 272 <!-- Pause Button --> 273 <object type="button" 274 name="pauseButton" 275 style="StoneButtonFancy" 276 size="0 64 100% 96" 277 tooltip_style="sessionToolTip" 278 > 279 <object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object> 280 <action on="Press">togglePause();</action> 281 </object> 282 283 <!-- Exit button --> 284 <object type="button" 285 name="menuExitButton" 286 style="StoneButtonFancy" 287 size="0 96 100% 128" 288 tooltip_style="sessionToolTip" 289 > 290 Quit 291 <action on="Press"> 292 openExitGameDialog(); 293 </action> 294 </object> 295 </object> 296 297 <!-- ================================ ================================ --> 298 <!-- Settings Window --> 299 <!-- ================================ ================================ --> 300 <object name="settingsDialogPanel" 301 style="TranslucentPanelThinBorder" 302 type="image" 303 size="80%-180 50%-200 50%+180 50%+50" 304 hidden="true" 305 z="30" 306 > 307 <!-- Settings / shadows --> 308 <object size="0 10 100%-80 35" type="text" style="settingsText" ghost="true">Enable Shadows</object> 309 <object name="shadowsCheckbox" size="100%-56 15 100%-30 40" type="checkbox" style="wheatCrossBox" checked="true"> 310 <action on="Load">if (renderer.shadows) this.checked = true; else this.checked = false;</action> 311 <action on="Press">renderer.shadows = this.checked;</action> 312 </object> 313 314 <!-- Settings / Shadow PCF --> 315 <object size="0 35 100%-80 60" type="text" style="settingsText" ghost="true">Enable Shadow Filtering</object> 316 <object name="shadowPCFCheckbox" size="100%-56 40 100%-30 65" type="checkbox" style="wheatCrossBox" checked="true"> 317 <action on="Load">if (renderer.shadowPCF) this.checked = true; else this.checked = false;</action> 318 <action on="Press">renderer.shadowPCF = this.checked;</action> 319 </object> 320 321 <!-- Settings / Water --> 322 <object size="0 60 100%-80 85" type="text" style="settingsText" ghost="true">Enable Water Reflections</object> 323 <object name="fancyWaterCheckbox" size="100%-56 65 100%-30 90" type="checkbox" style="wheatCrossBox" checked="true"> 324 <action on="Load">if (renderer.fancyWater) this.checked = true; else this.checked = false;</action> 325 <action on="Press">renderer.fancyWater = this.checked;</action> 326 </object> 327 328 <!-- Settings / Music--> 329 <object size="0 85 100%-80 110" type="text" style="settingsText" ghost="true">Enable Music</object> 330 <object size="100%-56 90 100%-30 115" type="checkbox" style="wheatCrossBox" checked="true"> 331 <action on="Press">if (this.checked) startMusic(); else stopMusic();</action> 332 </object> 333 334 <!-- Settings / Dev Overlay --> 335 <object size="0 110 100%-80 135" type="text" style="settingsText" ghost="true">Developer Overlay</object> 336 <object size="100%-56 115 100%-30 140" type="checkbox" style="wheatCrossBox" checked="false"> 337 <action on="Press">toggleDeveloperOverlay();</action> 338 </object> 339 </object> 294 <object name="sessionDialogTitleBar" size="50%-96 -16 50%+96 16" type="image" style="StoneDialogTitleBar"> 295 <object name="sessionDialogTitle" type="text" style="TitleText" size="0 -2 100% 100%">Settings</object> 296 </object> 297 298 <object style="TranslucentPanelThinBorder" 299 type="image" 300 size="32 32 100%-32 100%-64" 301 > 302 <!-- Settings / shadows --> 303 <object size="0 10 100%-80 35" type="text" style="RightLabelText" ghost="true">Enable Shadows</object> 304 <object name="shadowsCheckbox" size="100%-56 15 100%-30 40" type="checkbox" style="wheatCrossBox" checked="true"> 305 <action on="Load">if (renderer.shadows) this.checked = true; else this.checked = false;</action> 306 <action on="Press">renderer.shadows = this.checked;</action> 307 </object> 308 309 <!-- Settings / Shadow PCF --> 310 <object size="0 35 100%-80 60" type="text" style="RightLabelText" ghost="true">Enable Shadow Filtering</object> 311 <object name="shadowPCFCheckbox" size="100%-56 40 100%-30 65" type="checkbox" style="wheatCrossBox" checked="true"> 312 <action on="Load">if (renderer.shadowPCF) this.checked = true; else this.checked = false;</action> 313 <action on="Press">renderer.shadowPCF = this.checked;</action> 314 </object> 315 316 <!-- Settings / Water --> 317 <object size="0 60 100%-80 85" type="text" style="RightLabelText" ghost="true">Enable Water Reflections</object> 318 <object name="fancyWaterCheckbox" size="100%-56 65 100%-30 90" type="checkbox" style="wheatCrossBox" checked="true"> 319 <action on="Load">if (renderer.fancyWater) this.checked = true; else this.checked = false;</action> 320 <action on="Press">renderer.fancyWater = this.checked;</action> 321 </object> 322 323 <!-- Settings / Music--> 324 <object size="0 85 100%-80 110" type="text" style="RightLabelText" ghost="true">Enable Music</object> 325 <object size="100%-56 90 100%-30 115" type="checkbox" style="wheatCrossBox" checked="true"> 326 <action on="Press">if (this.checked) startMusic(); else stopMusic();</action> 327 </object> 328 329 <!-- Settings / Dev Overlay --> 330 <object size="0 110 100%-80 135" type="text" style="RightLabelText" ghost="true">Developer Overlay</object> 331 <object size="100%-56 115 100%-30 140" type="checkbox" style="wheatCrossBox" checked="false"> 332 <action on="Press">toggleDeveloperOverlay();</action> 333 </object> 334 </object> 335 336 <!-- Close button --> 337 <object type="button" 338 style="StoneButton" 339 size="50%-64 100%-56 50%+64 100%-24" 340 tooltip_style="sessionToolTip" 341 > 342 Close 343 <action on="Press">this.parent.hidden = true</action> 344 </object> 345 </object> 340 346 341 347 <!-- ================================ ================================ --> … … 345 351 type="image" 346 352 sprite="topPanel" 347 size="-3 0 100%+3 32"353 size="-3 0 100%+3 40" 348 354 > 349 355 <!-- ================================ ================================ --> … … 354 360 > 355 361 <!-- Food --> 356 <object size=" 6 0 96100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold">357 <object size="0 0 34 30" type="image" style="resourceIcon" cell_id="0"/>358 <object size="3 20 100% 100%-2" type="text" style="resourceText" name="resourceFood"/>362 <object size="0 0 80 100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold"> 363 <object size="0 -6 48 42" type="image" style="resourceIcon" cell_id="0"/> 364 <object size="36 0 100% 100%-2" type="text" style="resourceText" name="resourceFood"/> 359 365 </object> 360 366 361 367 <!-- Wood --> 362 <object size="9 8 0 188100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold">363 <object size="0 0 34 30" type="image" style="resourceIcon" cell_id="1"/>364 <object size="3 20 100% 100%-2" type="text" style="resourceText" name="resourceWood"/>368 <object size="90 0 180 100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold"> 369 <object size="0 -6 48 42" type="image" style="resourceIcon" cell_id="1"/> 370 <object size="36 0 100% 100%-2" type="text" style="resourceText" name="resourceWood"/> 365 371 </object> 366 372 367 373 <!-- Stone --> 368 <object size="1 90 0 280 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold">369 <object size="0 2 34 30" type="image" style="resourceIcon" cell_id="2"/>370 <object size="3 20 100% 100%-2" type="text" style="resourceText" name="resourceStone"/>374 <object size="180 0 270 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold"> 375 <object size="0 -2 48 42" type="image" style="resourceIcon" cell_id="2"/> 376 <object size="36 0 100% 100%-2" type="text" style="resourceText" name="resourceStone"/> 371 377 </object> 372 378 373 379 <!-- Metal --> 374 <object size="2 82 0 372100%" type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold">375 <object size="0 0 34 30" type="image" style="resourceIcon" cell_id="3"/>376 <object size="3 20 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/>380 <object size="270 0 360 100%" type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold"> 381 <object size="0 -6 48 42" type="image" style="resourceIcon" cell_id="3"/> 382 <object size="36 0 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/> 377 383 </object> 378 384 379 385 <!-- Population --> 380 <object size="3 74 0 464100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold">381 <object size=" -2 0 30 28" type="image" style="resourceIcon" cell_id="4"/>382 <object size=" 32 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/>386 <object size="360 0 450 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold"> 387 <object size="0 -6 44 38" type="image" style="resourceIcon" cell_id="4"/> 388 <object size="42 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/> 383 389 </object> 384 390 </object> … … 394 400 <!--<object size="50%+50 4 50%+300 100%-2" name="PhaseTitleBar" type="text" font="serif-bold-stroke-14" textcolor="white"> Death Match :: Village Phase</object>--> 395 401 396 402 403 <!-- ================================ ================================ --> 404 <!-- ALPHA LABELS (alpha, build time, revision) --> 405 <!-- ================================ ================================ --> 406 407 <!-- Displays Alpha name and number --> 408 <object size="70%-128 1 70%+128 100%" name="alphaLabel" type="text" style="CenteredLabelText" text_valign="top" ghost="true"> 409 ALPHA VI : Fortuna 410 411 <!-- Displays build date and revision number--> 412 <object size="50%-128 0 50%+128 100%-3" name="buildTimeLabel" type="text" text_align="center" text_valign="bottom" font="serif-12" textcolor="white" ghost="true"> 413 <action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action> 414 </object> 415 </object> 416 417 418 397 419 <!-- ================================ ================================ --> 398 420 <!-- Menu Button --> … … 400 422 <object type="button" 401 423 name="menuButton" 402 size="100%-80 0 100%-4 100%" 424 size="100%-164 4 100%-8 36" 425 style="StoneButtonFancy" 403 426 tooltip_style="sessionToolTip" 404 427 > 405 <object size="0 0 100% 100%" type="image" sprite="menuButton" name="menuButtonText" ghost="true">MENU</object>406 <action on="Press">openMenu Dialog();</action>407 </object> <!-- END OF MENU -->428 <object size="50%-32 50%-16 50%+32 50%+16" type="image" sprite="menuButton" name="menuButtonText" ghost="true">MENU</object> 429 <action on="Press">openMenu();</action> 430 </object> <!-- END OF MENU BUTTON --> 408 431 409 432 </object> <!-- END OF TOP PANEL --> … … 669 692 670 693 <object name="unitResearchPanel" 671 style="TranslucentPanel "694 style="TranslucentPanelThinBorder" 672 695 size="0 100%-56 100% 100%" 673 696 type="text" … … 697 720 size="4 -56 100% 0" 698 721 type="image" 699 style="TranslucentPanel "722 style="TranslucentPanelThinBorder" 700 723 > 701 724 <object size="-4 -2 52 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom" cell_id="3" tooltip="Production queue"> -
ps/trunk/binaries/data/mods/public/gui/session/utility_functions.js
r10072 r10114 3 3 const FAUNA = "fauna"; 4 4 const SPECIAL = "special"; 5 6 //-------------------------------- -------------------------------- --------------------------------7 // Session Dialog (only one at a time)8 //-------------------------------- -------------------------------- --------------------------------9 var g_SessionDialog = new SessionDialog();10 11 function SessionDialog()12 {13 this.referencedPanel = {};14 }15 16 SessionDialog.prototype.open = function(title, message, referencedPanel, x, y, confirmFunction)17 {18 // hide previous panel referencedPanel if applicable19 if (this.referencedPanel)20 this.referencedPanel.hidden = true21 22 // set dialog title if applicable23 getGUIObjectByName("sessionDialogTitle").caption = title? title : "";24 25 // set dialog message if applicable26 getGUIObjectByName("sessionDialogMessage").caption = message? message : "";27 28 // set panel reference if applicable29 if(referencedPanel)30 {31 referencedPanel.size = "50%-" + ((x/2)-30) + " 50%-" + ((y/2)-30) + " 50%+" + ((x/2)-30) + " 50%+" + ((y/2)-72);32 referencedPanel.hidden = false;33 this.referencedPanel = referencedPanel;34 }35 36 // set confirm function if applicable37 if (confirmFunction)38 {39 var buttonFunction = function () {40 this.close(referencedPanel); // "this" is defined as SessionDialog in this context41 confirmFunction();42 };43 44 var dialog = this;45 var confirmButton = getGUIObjectByName("sessionDialogConfirm");46 confirmButton.onpress = function() { buttonFunction.call(dialog); };47 confirmButton.hidden = false;48 confirmButton.size = "32 100%-56 144 100%-24";49 getGUIObjectByName("sessionDialogCancel").size = "100%-144 100%-56 100%-32 100%-24";50 getGUIObjectByName("sessionDialogCancel").caption = "Cancel";51 }52 else53 {54 getGUIObjectByName("sessionDialogConfirm").hidden = true;55 getGUIObjectByName("sessionDialogCancel").size = "50%-72 100%-56 50%+72 100%-24";56 getGUIObjectByName("sessionDialogCancel").caption = "Close";57 }58 59 getGUIObjectByName("sessionDialog").size = "50%-" + x/2 + " 50%-" + y/2 + " 50%+" + x/2 + " 50%+" + y/2;60 getGUIObjectByName("sessionDialog").hidden = false;61 };62 63 64 SessionDialog.prototype.close = function()65 {66 getGUIObjectByName("sessionDialog").hidden = true;67 if (this.referencedPanel)68 this.referencedPanel.hidden = true;69 };70 5 71 6 //-------------------------------- -------------------------------- -------------------------------- … … 97 32 "state": playerState.state, 98 33 "guid": undefined, // network guid for players controlled by hosts 99 "disconnected": false ,// flag for host-controlled players who have left the game34 "disconnected": false // flag for host-controlled players who have left the game 100 35 }; 101 36 players.push(player);
Note:
See TracChangeset
for help on using the changeset viewer.
