main.cs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. exec("tools/gui/renderTargetVisualizer.ed.gui");
  44. exec("./gui/shadowViz.gui" );
  45. exec("./gui/probeBakeDlg.gui" );
  46. exec("tools/gui/cubemapEditor.gui" );
  47. exec("tools/gui/postFxEditor.gui" );
  48. // Load Scripts.
  49. exec("./scripts/menus.ed.cs");
  50. exec("./scripts/menuHandlers.ed.cs");
  51. exec("./scripts/editor.ed.cs");
  52. exec("./scripts/editorInputCommands.cs");
  53. exec("./scripts/editor.keybinds.cs");
  54. exec("./scripts/undoManager.ed.cs");
  55. exec("./scripts/lighting.ed.cs");
  56. exec("./scripts/EditorGui.ed.cs");
  57. exec("./scripts/editorPrefs.ed.cs");
  58. exec("./scripts/editorRender.ed.cs");
  59. exec("./scripts/editorPlugin.ed.cs");
  60. exec("./scripts/EditorChooseLevelGui.ed.cs");
  61. exec("./scripts/cameraBookmarks.ed.cs");
  62. exec("./scripts/ManageSFXParametersWindow.ed.cs");
  63. exec("./scripts/AddFMODProjectDlg.ed.cs");
  64. exec("./scripts/SelectObjectsWindow.ed.cs");
  65. exec("./scripts/cameraCommands.ed.cs");
  66. exec("./scripts/probeBake.ed.cs");
  67. exec("./scripts/visibility/visibilityLayer.ed.cs");
  68. exec("./scripts/visibility/lightViz.cs");
  69. exec("./scripts/visibility/shadowViz.cs");
  70. exec("./scripts/visibility/probeViz.cs");
  71. exec("./scripts/visibility/miscViz.cs");
  72. exec("tools/gui/postFxEditor.cs" );
  73. exec("tools/gui/renderTargetVisualizer.ed.cs");
  74. // Load Custom Editors
  75. loadDirectory(expandFilename("./scripts/editors"));
  76. loadDirectory(expandFilename("./scripts/interfaces"));
  77. // Create the default editor plugins before calling buildMenus.
  78. new ScriptObject( WorldEditorPlugin )
  79. {
  80. superClass = "EditorPlugin";
  81. editorGui = EWorldEditor;
  82. };
  83. // aka. The ObjectEditor.
  84. new ScriptObject( WorldEditorInspectorPlugin )
  85. {
  86. superClass = "WorldEditorPlugin";
  87. editorGui = EWorldEditor;
  88. };
  89. new ScriptObject( TerrainEditorPlugin )
  90. {
  91. superClass = "EditorPlugin";
  92. editorGui = ETerrainEditor;
  93. };
  94. new ScriptObject( TerrainPainterPlugin )
  95. {
  96. superClass = "EditorPlugin";
  97. editorGui = ETerrainEditor;
  98. };
  99. new ScriptObject( MaterialEditorPlugin )
  100. {
  101. superClass = "WorldEditorPlugin";
  102. editorGui = EWorldEditor;
  103. };
  104. setupEditorVisibilityMenu();
  105. // Expose stock visibility/debug options.
  106. /*EVisibility.addOption( "Render: Zones", "$Zone::isRenderable", "" );
  107. EVisibility.addOption( "Render: Portals", "$Portal::isRenderable", "" );
  108. EVisibility.addOption( "Render: Occlusion Volumes", "$OcclusionVolume::isRenderable", "" );
  109. EVisibility.addOption( "Render: Triggers", "$Trigger::renderTriggers", "" );
  110. EVisibility.addOption( "Render: PhysicalZones", "$PhysicalZone::renderZones", "" );
  111. EVisibility.addOption( "Render: Sound Emitters", "$SFXEmitter::renderEmitters", "" );
  112. EVisibility.addOption( "Render: Mission Area", "EWorldEditor.renderMissionArea", "" );
  113. EVisibility.addOption( "Render: Sound Spaces", "$SFXSpace::isRenderable", "" );
  114. EVisibility.addOption( "Wireframe Mode", "$gfx::wireframe", "" );
  115. EVisibility.addOption( "Debug Render: Player Collision", "$Player::renderCollision", "" );
  116. EVisibility.addOption( "Debug Render: Terrain", "TerrainBlock::debugRender", "" );
  117. EVisibility.addOption( "Debug Render: Decals", "$Decals::debugRender", "" );
  118. EVisibility.addOption( "Debug Render: Light Frustums", "$Light::renderLightFrustums", "" );
  119. EVisibility.addOption( "Debug Render: Bounding Boxes", "$Scene::renderBoundingBoxes", "" );
  120. EVisibility.addOption( "Debug Render: Physics World", "$PhysicsWorld::render", "togglePhysicsDebugViz" );
  121. EVisibility.addOption( "AL: Disable Shadows", "$Shadows::disable", "" );
  122. EVisibility.addOption( "AL: Light Color Viz", "$AL_LightColorVisualizeVar", "toggleLightColorViz" );
  123. EVisibility.addOption( "AL: Light Specular Viz", "$AL_LightSpecularVisualizeVar", "toggleLightSpecularViz" );
  124. EVisibility.addOption( "AL: Normals Viz", "$AL_NormalsVisualizeVar", "toggleNormalsViz" );
  125. EVisibility.addOption( "AL: Depth Viz", "$AL_DepthVisualizeVar", "toggleDepthViz" );
  126. EVisibility.addOption( "AL: Color Buffer", "$AL_ColorBufferShaderVar", "toggleColorBufferViz" );
  127. EVisibility.addOption( "AL: Spec Map", "$AL_SpecMapShaderVar", "toggleSpecMapViz");
  128. EVisibility.addOption( "AL: Backbuffer", "$AL_BackbufferVisualizeVar", "toggleBackbufferViz" );
  129. EVisibility.addOption( "AL: Glow Buffer", "$AL_GlowVisualizeVar", "toggleGlowViz" );
  130. EVisibility.addOption( "AL: PSSM Cascade Viz", "$AL::PSSMDebugRender", "" );
  131. EVisibility.addOption( "Frustum Lock", "$Scene::lockCull", "" );
  132. EVisibility.addOption( "Disable Zone Culling", "$Scene::disableZoneCulling", "" );
  133. EVisibility.addOption( "Disable Terrain Occlusion", "$Scene::disableTerrainOcclusion", "" );
  134. EVisibility.addOption( "Probes: Attenuation", "$Probes::showAttenuation", "" );
  135. EVisibility.addOption( "Probes: Specular Cubemaps", "$Probes::showSpecularCubemaps", "" );
  136. EVisibility.addOption( "Probes: Diffuse Cubemaps", "$Probes::showDiffuseCubemaps", "" );
  137. EVisibility.addOption( "Probes: Contribution", "$Probes::showProbeContrib", "" );
  138. EVisibility.addOption( "Colorblindness: Protanopia", "$CBV_Protanopia", "toggleColorBlindnessViz" );
  139. EVisibility.addOption( "Colorblindness: Protanomaly", "$CBV_Protanomaly", "toggleColorBlindnessViz" );
  140. EVisibility.addOption( "Colorblindness: Deuteranopia", "$CBV_Deuteranopia", "toggleColorBlindnessViz" );
  141. EVisibility.addOption( "Colorblindness: Deuteranomaly", "$CBV_Deuteranomaly", "toggleColorBlindnessViz" );
  142. EVisibility.addOption( "Colorblindness: Tritanopia", "$CBV_Tritanopia", "toggleColorBlindnessViz" );
  143. EVisibility.addOption( "Colorblindness: Tritanomaly", "$CBV_Tritanomaly", "toggleColorBlindnessViz" );
  144. EVisibility.addOption( "Colorblindness: Achromatopsia", "$CBV_Achromatopsia", "toggleColorBlindnessViz" );
  145. EVisibility.addOption( "Colorblindness: Achromatomaly", "$CBV_Achromatomaly", "toggleColorBlindnessViz" );*/
  146. }
  147. function destroyWorldEditor()
  148. {
  149. }