SystemMenu.tscript 899 B

12345678910111213141516171819202122232425262728293031323334353637
  1. function SystemMenu::onWake(%this)
  2. {
  3. $MenuList = SystemMenuButtonList;
  4. $MenuList.listPosition = 0;
  5. }
  6. function SystemMenu::onSleep(%this)
  7. {
  8. }
  9. function systemMenuExitToMenu()
  10. {
  11. MessageBoxOKCancel("Exit?", "Do you wish to exit to the Main Menu?", "escapeFromGame();", "");
  12. }
  13. function systemMenuExitToDesktop()
  14. {
  15. MessageBoxOKCancel("Exit?", "Do you wish to exit to the desktop?", "quit();", "");
  16. }
  17. function SystemMenuButtonList::syncGUI(%this)
  18. {
  19. %this.callOnChildren("setHighlighted", false);
  20. %btn = %this.getObject(%this.listPosition);
  21. %btn.setHighlighted(true);
  22. //
  23. //Update the button imagery to comply to the last input device we'd used
  24. %device = Canvas.getLastInputDevice();
  25. if(%device $= "mouse")
  26. %device = "keyboard";
  27. //We'll call back to the GameMenu parent just to be sure everything's on the same page
  28. GameMenu.syncGui();
  29. }