UI.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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::create( %this )
  11. {
  12. if ($Server::Dedicated)
  13. return;
  14. // Use our prefs to configure our Canvas/Window
  15. configureCanvas();
  16. //Load UI stuff
  17. //we need to load this because some of the menu profiles use the sounds here
  18. exec("./scripts/datablocks/guiSounds.cs");
  19. //Profiles
  20. exec("./scripts/profiles.cs");
  21. //Now gui files
  22. exec("./scripts/guis/mainMenu.gui");
  23. exec("./scripts/guis/chooseLevelDlg.gui");
  24. exec("./scripts/guis/joinServerMenu.gui");
  25. exec("./scripts/guis/loadingGui.gui");
  26. exec("./scripts/guis/optionsMenu.gui");
  27. exec("./scripts/guis/pauseMenu.gui");
  28. exec("./scripts/guis/remapDlg.gui");
  29. exec("./scripts/guis/remapConfirmDlg.gui");
  30. exec("./scripts/guis/profiler.gui");
  31. exec("./scripts/guis/netGraphGui.gui");
  32. exec("./scripts/guis/FileDialog.gui");
  33. exec("./scripts/guis/guiMusicPlayer.gui");
  34. exec("./scripts/guis/startupGui.gui");
  35. //Load gui companion scripts
  36. exec("./scripts/chooseLevelDlg.cs");
  37. exec("./scripts/optionsList.cs");
  38. exec("./scripts/optionsMenu.cs");
  39. exec("./scripts/graphicsMenu.cs");
  40. exec("./scripts/controlsMenu.cs");
  41. exec("./scripts/chooseLevelDlg.cs");
  42. exec("./scripts/mainMenu.cs");
  43. exec("./scripts/joinServerMenu.cs");
  44. exec("./scripts/pauseMenu.cs");
  45. exec("./scripts/messageBoxes.cs");
  46. exec("./scripts/help.cs");
  47. exec("./scripts/cursors.cs");
  48. exec("./scripts/profiler.cs");
  49. exec("./scripts/FileDialog.cs");
  50. exec("./scripts/GuiTreeViewCtrl.cs");
  51. exec("./scripts/guiMusicPlayer.cs");
  52. exec("./scripts/startupGui.cs");
  53. %dbList = new ArrayObject(LevelFilesList);
  54. loadStartup();
  55. //Canvas.pushDialog(MainMenuGui);
  56. }
  57. function Game::destroy( %this )
  58. {
  59. }