main.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. function initializeWorldEditor()
  23. {
  24. echo(" % - Initializing World Editor");
  25. // Load GUI
  26. exec("./gui/profiles.ed.cs");
  27. exec("./scripts/cursors.ed.cs");
  28. exec("./gui/guiCreateNewTerrainGui.gui" );
  29. exec("./gui/GenericPromptDialog.ed.gui" );
  30. exec("./gui/guiTerrainImportGui.gui" );
  31. exec("./gui/guiTerrainExportGui.gui" );
  32. exec("./gui/EditorGui.ed.gui");
  33. exec("./gui/objectBuilderGui.ed.gui");
  34. exec("./gui/TerrainEditorVSettingsGui.ed.gui");
  35. exec("./gui/EditorChooseLevelGui.ed.gui");
  36. exec("./gui/VisibilityLayerWindow.ed.gui");
  37. exec("./gui/ManageBookmarksWindow.ed.gui");
  38. exec("./gui/ManageSFXParametersWindow.ed.gui" );
  39. exec("./gui/TimeAdjustGui.ed.gui");
  40. exec("./gui/AddFMODProjectDlg.ed.gui");
  41. exec("./gui/SelectObjectsWindow.ed.gui");
  42. exec("./gui/ProceduralTerrainPainterGui.gui" );
  43. // Load Scripts.
  44. exec("./scripts/menus.ed.cs");
  45. exec("./scripts/menuHandlers.ed.cs");
  46. exec("./scripts/editor.ed.cs");
  47. exec("./scripts/editor.bind.ed.cs");
  48. exec("./scripts/undoManager.ed.cs");
  49. exec("./scripts/lighting.ed.cs");
  50. exec("./scripts/EditorGui.ed.cs");
  51. exec("./scripts/editorPrefs.ed.cs");
  52. exec("./scripts/editorRender.ed.cs");
  53. exec("./scripts/editorPlugin.ed.cs");
  54. exec("./scripts/EditorChooseLevelGui.ed.cs");
  55. exec("./scripts/visibilityLayer.ed.cs");
  56. exec("./scripts/cameraBookmarks.ed.cs");
  57. exec("./scripts/ManageSFXParametersWindow.ed.cs");
  58. exec("./scripts/AddFMODProjectDlg.ed.cs");
  59. exec("./scripts/SelectObjectsWindow.ed.cs");
  60. // Load Custom Editors
  61. loadDirectory(expandFilename("./scripts/editors"));
  62. loadDirectory(expandFilename("./scripts/interfaces"));
  63. // Create the default editor plugins before calling buildMenus.
  64. new ScriptObject( WorldEditorPlugin )
  65. {
  66. superClass = "EditorPlugin";
  67. editorGui = EWorldEditor;
  68. };
  69. // aka. The ObjectEditor.
  70. new ScriptObject( WorldEditorInspectorPlugin )
  71. {
  72. superClass = "WorldEditorPlugin";
  73. editorGui = EWorldEditor;
  74. };
  75. new ScriptObject( TerrainEditorPlugin )
  76. {
  77. superClass = "EditorPlugin";
  78. editorGui = ETerrainEditor;
  79. };
  80. new ScriptObject( TerrainPainterPlugin )
  81. {
  82. superClass = "EditorPlugin";
  83. editorGui = ETerrainEditor;
  84. };
  85. new ScriptObject( MaterialEditorPlugin )
  86. {
  87. superClass = "WorldEditorPlugin";
  88. editorGui = EWorldEditor;
  89. };
  90. // Expose stock visibility/debug options.
  91. EVisibility.addOption( "Render: Zones", "$Zone::isRenderable", "" );
  92. EVisibility.addOption( "Render: Portals", "$Portal::isRenderable", "" );
  93. EVisibility.addOption( "Render: Occlusion Volumes", "$OcclusionVolume::isRenderable", "" );
  94. EVisibility.addOption( "Render: Triggers", "$Trigger::renderTriggers", "" );
  95. EVisibility.addOption( "Render: PhysicalZones", "$PhysicalZone::renderZones", "" );
  96. EVisibility.addOption( "Render: Sound Emitters", "$SFXEmitter::renderEmitters", "" );
  97. EVisibility.addOption( "Render: Mission Area", "EWorldEditor.renderMissionArea", "" );
  98. EVisibility.addOption( "Render: Sound Spaces", "$SFXSpace::isRenderable", "" );
  99. EVisibility.addOption( "Wireframe Mode", "$gfx::wireframe", "" );
  100. EVisibility.addOption( "Debug Render: Player Collision", "$Player::renderCollision", "" );
  101. EVisibility.addOption( "Debug Render: Terrain", "TerrainBlock::debugRender", "" );
  102. EVisibility.addOption( "Debug Render: Decals", "$Decals::debugRender", "" );
  103. EVisibility.addOption( "Debug Render: Light Frustums", "$Light::renderLightFrustums", "" );
  104. EVisibility.addOption( "Debug Render: Bounding Boxes", "$Scene::renderBoundingBoxes", "" );
  105. EVisibility.addOption( "Debug Render: Physics World", "$PhysicsWorld::render", "togglePhysicsDebugViz" );
  106. EVisibility.addOption( "AL: Disable Shadows", "$Shadows::disable", "" );
  107. EVisibility.addOption( "AL: Light Color Viz", "$AL_LightColorVisualizeVar", "toggleLightColorViz" );
  108. EVisibility.addOption( "AL: Light Specular Viz", "$AL_LightSpecularVisualizeVar", "toggleLightSpecularViz" );
  109. EVisibility.addOption( "AL: Normals Viz", "$AL_NormalsVisualizeVar", "toggleNormalsViz" );
  110. EVisibility.addOption( "AL: Depth Viz", "$AL_DepthVisualizeVar", "toggleDepthViz" );
  111. EVisibility.addOption( "AL: Color Buffer", "$AL_ColorBufferShaderVar", "toggleColorBufferViz" );
  112. EVisibility.addOption( "AL: Spec Map", "$AL_SpecMapShaderVar", "toggleSpecMapViz");
  113. EVisibility.addOption( "AL: Backbuffer", "$AL_BackbufferVisualizeVar", "toggleBackbufferViz" );
  114. EVisibility.addOption( "AL: Glow Buffer", "$AL_GlowVisualizeVar", "toggleGlowViz" );
  115. EVisibility.addOption( "AL: PSSM Cascade Viz", "$AL::PSSMDebugRender", "" );
  116. EVisibility.addOption( "Frustum Lock", "$Scene::lockCull", "" );
  117. EVisibility.addOption( "Disable Zone Culling", "$Scene::disableZoneCulling", "" );
  118. EVisibility.addOption( "Disable Terrain Occlusion", "$Scene::disableTerrainOcclusion", "" );
  119. }
  120. function destroyWorldEditor()
  121. {
  122. }