UI.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.cs");
  24. //Profiles
  25. %this.queueExec("./scripts/profiles.cs");
  26. //Now gui files
  27. %this.queueExec("./scripts/menuInputButtons.cs");
  28. %this.queueExec("./guis/mainMenu.cs");
  29. %this.queueExec("./guis/mainMenu.gui");
  30. %this.queueExec("./guis/chooseLevelDlg.cs");
  31. %this.queueExec("./guis/chooseLevelDlg.gui");
  32. %this.queueExec("./guis/joinServerMenu.cs");
  33. %this.queueExec("./guis/joinServerMenu.gui");
  34. %this.queueExec("./guis/loadingGui.gui");
  35. %this.queueExec("./guis/optionsMenu.cs");
  36. %this.queueExec("./guis/optionsMenu.gui");
  37. %this.queueExec("./guis/pauseMenu.cs");
  38. %this.queueExec("./guis/pauseMenu.gui");
  39. %this.queueExec("./guis/remapDlg.gui");
  40. %this.queueExec("./guis/remapConfirmDlg.gui");
  41. %this.queueExec("./guis/profiler.cs");
  42. %this.queueExec("./guis/profiler.gui");
  43. %this.queueExec("./guis/netGraphGui.gui");
  44. %this.queueExec("./guis/RecordingsDlg.gui");
  45. %this.queueExec("./guis/guiMusicPlayer.cs");
  46. %this.queueExec("./guis/guiMusicPlayer.gui");
  47. %this.queueExec("./guis/startupGui.cs");
  48. %this.queueExec("./guis/startupGui.gui");
  49. // Load Editor Dialogs
  50. %this.queueExec("./guis/messageBoxDlg.gui");
  51. //Load scripts
  52. %this.queueExec("./scripts/controlsMenu.cs");
  53. %this.queueExec("./scripts/messageBoxes.cs");
  54. %this.queueExec("./scripts/help.cs");
  55. %this.queueExec("./scripts/cursors.cs");
  56. %this.queueExec("./scripts/utility.cs");
  57. }
  58. function UI::onCreateClientConnection(%this){}
  59. function UI::onDestroyClientConnection(%this){}