UI.tscript 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // The general flow of a gane - server's creation, loading and hosting clients, and then destruction is as follows:
  2. // First, a client will always create a server in the event that they want to host a single player
  3. // game. Torque3D treats even single player connections as a soft multiplayer game, with some stuff
  4. // in the networking short-circuited to sidestep around lag and packet transmission times.
  5. // initServer() is called, loading the default server scripts.
  6. // After that, if this is a dedicated server session, initDedicated() is called, otherwise initClient is called
  7. // to prep a playable client session.
  8. // When a local game is started - a listen server - via calling StartGame() a server is created and then the client is
  9. // connected to it via createAndConnectToLocalServer().
  10. function UI::onCreate( %this )
  11. {
  12. }
  13. function UI::onDestroy( %this )
  14. {
  15. }
  16. function UI::initServer(%this){}
  17. function UI::onCreateGameServer(%this){}
  18. function UI::onDestroyGameServer(%this){}
  19. function UI::initClient(%this)
  20. {
  21. //Load UI stuff
  22. //we need to load this because some of the menu profiles use the sounds here
  23. //%this.queueExec("./datablocks/guiSounds");
  24. //Profiles
  25. %this.queueExec("./scripts/profiles");
  26. //Navigation Utility Scripts
  27. %this.queueExec("./scripts/menuNavigation");
  28. //Now gui files
  29. %this.queueExec("./scripts/menuInputHandling");
  30. %this.queueExec("./guis/mainMenu");
  31. %this.queueExec("./guis/mainMenu.gui");
  32. %this.queueExec("./guis/mainMenuButtons");
  33. %this.queueExec("./guis/mainMenuButtons.gui");
  34. %this.queueExec("./guis/chooseLevelDlg");
  35. %this.queueExec("./guis/chooseLevelDlg.gui");
  36. %this.queueExec("./guis/joinServerMenu");
  37. %this.queueExec("./guis/joinServerMenu.gui");
  38. %this.queueExec("./guis/loadingGui.gui");
  39. %this.queueExec("./guis/optionsMenu");
  40. %this.queueExec("./guis/optionsMenu.gui");
  41. %this.queueExec("./guis/pauseMenu");
  42. %this.queueExec("./guis/pauseMenu.gui");
  43. %this.queueExec("./guis/remapDlg.gui");
  44. %this.queueExec("./guis/remapConfirmDlg.gui");
  45. %this.queueExec("./guis/profiler");
  46. %this.queueExec("./guis/profiler.gui");
  47. %this.queueExec("./guis/netGraphGui.gui");
  48. %this.queueExec("./guis/RecordingsDlg.gui");
  49. %this.queueExec("./guis/guiMusicPlayer");
  50. %this.queueExec("./guis/guiMusicPlayer.gui");
  51. %this.queueExec("./guis/startupGui");
  52. %this.queueExec("./guis/startupGui.gui");
  53. // Load Editor Dialogs
  54. %this.queueExec("./guis/messageBoxDlg.gui");
  55. //Load scripts
  56. %this.queueExec("./scripts/controlsMenu");
  57. %this.queueExec("./scripts/messageBoxes");
  58. %this.queueExec("./scripts/help");
  59. %this.queueExec("./scripts/cursors");
  60. %this.queueExec("./scripts/utility");
  61. if(isToolBuild())
  62. %this.queueExec("./tools/creator.tscript");
  63. }
  64. function UI::onCreateClientConnection(%this){}
  65. function UI::onDestroyClientConnection(%this){}