From 10df58f716731d070b7954919fb36e773d6a5fd5 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 9 Jul 2016 20:08:25 -0500 Subject: [PATCH] Duplicating changes in the tools folder over to the Empty template for parity. --- .../gui/superToolTipDlg.ed.gui | 45 ++++ .../Empty/game/tools/componentEditor/main.cs | 28 +++ .../scripts/componentEditor.ed.cs | 233 ++++++++++++++++++ .../scripts/superToolTipDlg.ed.cs | 155 ++++++++++++ .../game/tools/decalEditor/decalEditorGui.cs | 4 +- .../gui/guiMaterialPreviewWindow.ed.gui | 12 +- .../gui/guiMaterialPropertiesWindow.ed.gui | 39 ++- .../scripts/materialEditor.ed.cs | 58 ++--- .../particleEditor/ParticleEditor.ed.gui | 193 ++++++++++++++- .../particleParticleEditor.ed.cs | 14 ++ .../worldEditor/gui/GeneralSettingsTab.ed.gui | 71 ++++++ .../gui/ProceduralTerrainPainterGui.gui | 1 + .../gui/TerrainPainterWindow.ed.gui | 2 +- .../ForestEditorPalette.ed.gui | 6 +- .../gui/guiTerrainMaterialDlg.ed.gui | 16 +- .../tools/worldEditor/scripts/EditorGui.ed.cs | 167 ++++++++++++- .../worldEditor/scripts/editorPrefs.ed.cs | 1 + .../worldEditor/scripts/editors/creator.ed.cs | 51 +++- .../interfaces/terrainMaterialDlg.ed.cs | 24 +- .../worldEditor/scripts/menuHandlers.ed.cs | 11 + .../tools/worldEditor/scripts/menus.ed.cs | 13 + 21 files changed, 1070 insertions(+), 74 deletions(-) create mode 100644 Templates/Empty/game/tools/componentEditor/gui/superToolTipDlg.ed.gui create mode 100644 Templates/Empty/game/tools/componentEditor/main.cs create mode 100644 Templates/Empty/game/tools/componentEditor/scripts/componentEditor.ed.cs create mode 100644 Templates/Empty/game/tools/componentEditor/scripts/superToolTipDlg.ed.cs diff --git a/Templates/Empty/game/tools/componentEditor/gui/superToolTipDlg.ed.gui b/Templates/Empty/game/tools/componentEditor/gui/superToolTipDlg.ed.gui new file mode 100644 index 000000000..ef506941a --- /dev/null +++ b/Templates/Empty/game/tools/componentEditor/gui/superToolTipDlg.ed.gui @@ -0,0 +1,45 @@ +%guiContent = new GuiControl(SuperTooltipDlg) { + canSaveDynamicFields = "0"; + Profile = "GuiTransparentProfileModeless"; + class = "SuperTooltip"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "0 0"; + Extent = "640 480"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + hovertime = "1000"; + + new GuiControl(SuperTooltipWindow) { + canSaveDynamicFields = "0"; + Profile = "EditorTextEditBoldModeless"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "216 160"; + Extent = "221 134"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + hovertime = "1000"; + internalName = "tooltipWindow"; + + new GuiMLTextCtrl(SuperTooltipMLText) { + canSaveDynamicFields = "0"; + Profile = "EditorMLTextProfileModeless"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "5 5"; + Extent = "210 14"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + hovertime = "1000"; + lineSpacing = "2"; + allowColorChars = "0"; + maxChars = "-1"; + internalName = "tooltipMLText"; + }; + }; +}; + diff --git a/Templates/Empty/game/tools/componentEditor/main.cs b/Templates/Empty/game/tools/componentEditor/main.cs new file mode 100644 index 000000000..56d74830a --- /dev/null +++ b/Templates/Empty/game/tools/componentEditor/main.cs @@ -0,0 +1,28 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +//Scripts +exec("./scripts/componentEditor.ed.cs"); +exec("./scripts/superToolTipDlg.ed.cs"); + +//gui +exec("./gui/superToolTipDlg.ed.gui"); diff --git a/Templates/Empty/game/tools/componentEditor/scripts/componentEditor.ed.cs b/Templates/Empty/game/tools/componentEditor/scripts/componentEditor.ed.cs new file mode 100644 index 000000000..9a9ce33d6 --- /dev/null +++ b/Templates/Empty/game/tools/componentEditor/scripts/componentEditor.ed.cs @@ -0,0 +1,233 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +function GuiInspectorEntityGroup::CreateContent(%this) +{ +} + +function GuiInspectorEntityGroup::InspectObject( %this, %targetObject ) +{ + %this.stack.clear(); + %this.stack.addGuiControl(%this.createAddComponentList()); +} + +function GuiInspectorEntityGroup::createAddComponentList(%this) +{ + %extent = %this.getExtent(); + + %container = new GuiControl() + { + Profile = "EditorContainerProfile"; + HorizSizing = "width"; + VertSizing = "bottom"; + Position = "0 0"; + Extent = %extent.x SPC "25"; + }; + + %componentList = new GuiPopUpMenuCtrlEx(QuickEditComponentList) + { + Profile = "GuiPopupMenuProfile"; + HorizSizing = "width"; + VertSizing = "bottom"; + position = "28 4"; + Extent = (%extent.x - 28) SPC "18"; + hovertime = "100"; + tooltip = "The component to add to the object"; + tooltipProfile = "EditorToolTipProfile"; + }; + + %addButton = new GuiIconButtonCtrl() { + class = AddComponentQuickEditButton; + Profile = "EditorButton"; + HorizSizing = "right"; + VertSizing = "bottom"; + Position = "2 0"; + Extent = "24 24"; + buttonMargin = "4 4"; + iconLocation = "Left"; + sizeIconToButton = "0"; + iconBitmap = "tools/gui/images/iconAdd.png"; + hovertime = "100"; + tooltip = "Add the selected component to the object"; + tooltipProfile = "EditorToolTipProfile"; + componentList = %componentList; + }; + + %componentList.refresh(); + + %container.add(%componentList); + %container.add(%addButton); + + if(!isObject("componentTooltipTheme")) + { + %theme = createsupertooltiptheme("componentTooltipTheme"); + %theme.addstyle("headerstyle", ""); + %theme.addstyle("headertwostyle", ""); + %theme.addstyle("basictextstyle", ""); + %theme.setdefaultstyle("title", "headerstyle"); + %theme.setdefaultstyle("paramtitle", "headertwostyle"); + %theme.setdefaultstyle("param", "basictextstyle"); + %theme.setspacing(3, 0); + } + + return %container; +} + +function QuickEditComponentList::refresh(%this) +{ + %this.clear(); + + //find all ComponentAssets + %assetQuery = new AssetQuery(); + if(!AssetDatabase.findAssetType(%assetQuery, "ComponentAsset")) + return; //if we didn't find ANY, just exit + + // Find all the types. + %count = %assetQuery.getCount(); + + %categories = ""; + for (%i = 0; %i < %count; %i++) + { + %assetId = %assetQuery.getAsset(%i); + + %componentAsset = AssetDatabase.acquireAsset(%assetId); + %componentType = %componentAsset.componentType; + if (!isInList(%componentType, %categories)) + %categories = %categories TAB %componentType; + } + + %categories = trim(%categories); + + %index = 0; + %categoryCount = getFieldCount(%categories); + for (%i = 0; %i < %categoryCount; %i++) + { + %category = getField(%categories, %i); + %this.addCategory(%category); + + for (%j = 0; %j < %count; %j++) + { + %assetId = %assetQuery.getAsset(%j); + + %componentAsset = AssetDatabase.acquireAsset(%assetId); + %componentType = %componentAsset.componentType; + %friendlyName = %componentAsset.friendlyName; + + if (%componentType $= %category) + { + //TODO: Haven't worked out getting categories to look distinct + //from entries in the drop-down so for now just indent them for the visual distinction + %spacedName = " " @ %friendlyName; + %this.add(%spacedName, %index); + %this.component[%index] = %componentAsset; + %index++; + } + } + } +} + +function QuickEditComponentList::onHotTrackItem( %this, %itemID ) +{ + %componentObj = %this.component[%itemID]; + if( isObject( %componentObj ) && %this.componentDesc != %componentObj ) + { + SuperTooltipDlg.init("componentTooltipTheme"); + SuperTooltipDlg.setTitle(%componentObj.friendlyName); + SuperTooltipDlg.addParam("", %componentObj.description @ "\n"); + + %fieldCount = %componentObj.getComponentFieldCount(); + for (%i = 0; %i < %fieldCount; %i++) + { + %name = getField(%componentObj.getComponentField(%i), 0); + + SuperTooltipDlg.addParam(%name, %description @ "\n"); + } + %position = %this.getGlobalPosition(); + SuperTooltipDlg.processTooltip( %position,0,1 ); + %this.opened = true; + %this.componentDesc = %componentObj; + } + else if( !isObject( %componentObj ) ) + { + if( %this.opened == true ) + SuperTooltipDlg.hide(); + %this.componentDesc = ""; + } +} + +function QuickEditComponentList::setProperty(%this, %object) +{ + %this.objectToAdd = %object; +} + +function QuickEditComponentList::onSelect(%this) +{ + if( %this.opened == true ) + SuperTooltipDlg.hide(); + + %this.componentToAdd = %this.component[%this.getSelected()]; +} + +function QuickEditComponentList::onCancel( %this ) +{ + if( %this.opened == true ) + SuperTooltipDlg.hide(); +} + +function AddComponentQuickEditButton::onClick(%this) +{ + %component = %this.componentList.componentToAdd; + + %componentName = %this.componentList.componentToAdd.componentName; + %componentClass = %this.componentList.componentToAdd.componentClass; + + %command = "$ComponentEditor::newComponent = new" SPC %componentClass SPC "(){ class = \"" + @ %componentName @ "\"; };"; + + eval(%command); + + %instance = $ComponentEditor::newComponent; + %undo = new UndoScriptAction() + { + actionName = "Added Component"; + class = UndoAddComponent; + object = %this.componentList.objectToAdd; + component = %instance; + }; + + %undo.addToManager(LevelBuilderUndoManager); + + %instance.owner = Inspector.getInspectObject(0); + %instance.owner.add(%instance); + + Inspector.schedule( 50, "refresh" ); + EWorldEditor.isDirty = true; +} + +function addComponent(%obj, %instance) +{ + echo("Adding the component!"); + %obj.addComponent(%instance); + Inspector.schedule( 50, "refresh" ); + EWorldEditor.isDirty = true; +} + diff --git a/Templates/Empty/game/tools/componentEditor/scripts/superToolTipDlg.ed.cs b/Templates/Empty/game/tools/componentEditor/scripts/superToolTipDlg.ed.cs new file mode 100644 index 000000000..7f25bd5e6 --- /dev/null +++ b/Templates/Empty/game/tools/componentEditor/scripts/superToolTipDlg.ed.cs @@ -0,0 +1,155 @@ +function createSuperTooltipTheme(%name) +{ + %theme = new ScriptObject() + { + class = SuperTooltipTheme; + }; + + %theme.setName(%name); + + return %theme; +} + +function SuperTooltipTheme::addStyle(%this, %name, %style) +{ + %this.styles[%name] = %style; +} + +function SuperTooltipTheme::setDefaultStyle(%this, %type, %default) +{ + %this.defaultStyles[%type] = %default; +} + +function SuperTooltipTheme::setSpacing(%this, %verticalSpace, %horizontalSpace) +{ + %this.verticalSpace = %verticalSpace; + %this.horizontalSpace = %horizontalSpace; +} + +function SuperTooltipTheme::getStyle(%this, %name) +{ + return %this.styles[%name]; +} + +function SuperTooltip::init(%this, %theme) +{ + %this.clearTooltip(); + + if(isObject(%theme)) + %this.setTheme(%theme); +} + +function SuperTooltip::clearTooltip(%this) +{ + if(%this.paramCount > 0) + { + for(%i=0;%i<%this.paramCount;%i++) + %this.param[%i] = ""; + } + + %this.title = ""; + %this.paramCount = 0; +} + +function SuperTooltip::processTooltip(%this, %globalPos, %verticalAlign, %horizontalAlign) +{ + if (%verticalAlign $= "") + %verticalAlign = 1; + if (%horizontalAlign $= "") + %horizontalAlign = 0; + + %tooltipWindow = %this.findObjectByInternalName("tooltipWindow"); + + if(isObject(%tooltipWindow)) + %tooltipMLText = %tooltipWindow.findObjectByInternalName("tooltipMLText"); + else + return false; + + if(!isObject(%tooltipMLText)) + return false; + + %verticalSpace = %this.theme.verticalSpace; + %horizontalSpace = %this.theme.horizontalSpace; + + if (%verticalAlign == 1) + %verticalSpace = -%verticalSpace; + if (%horizontalAlign == 1) + %horizontalSpace = -%horizontalSpace; + + %text = %this.getFormatedText(); + %tooltipMLText.setText(%text); + + canvas.pushDialog(%this); + + %tooltipMLText.forceReflow(); + %MLExtent = %tooltipMLText.extent; + %MLHeight = getWord(%MLExtent, 1); + + %tooltipExtent = %tooltipWindow.extent; + %tooltipWidth = getWord(%tooltipExtent, 0); + %tooltipHeight = %MLHeight; + %tooltipWindow.extent = %tooltipWidth SPC %tooltipHeight; + + %globalPosX = getWord(%globalPos, 0); + %globalPosY = getWord(%globalPos, 1); + + %tooltipPosX = %globalPosX - (%horizontalAlign * %tooltipWidth) + %horizontalSpace; + %tooltipPosY = %globalPosY - (%verticalAlign * %tooltipHeight) + %verticalSpace; + + %tooltipWindow.setPosition(%tooltipPosX, %tooltipPosY); + + return true; +} + +function SuperTooltip::hide(%this) +{ + canvas.popDialog(%this); + + %this.clearTooltip(); +} + +function SuperTooltip::setTheme(%this, %theme) +{ + %this.theme = %theme; +} + +function SuperTooltip::setTitle(%this, %title, %style) +{ + if(%style !$= "") + %themeStyle = %this.theme.styles[%style]; + else + %themeStyle = %this.theme.getStyle(%this.theme.defaultStyles[Title]); + + %this.title = %themeStyle @ %title; +} + +function SuperTooltip::addParam(%this, %title, %text, %paramTitleStyle, %paramStyle) +{ + if(%paramTitleStyle !$= "") + %themeTitleStyle = %this.theme.styles[%paramTitleStyle]; + else + %themeTitleStyle = %this.theme.getStyle(%this.theme.defaultStyles[ParamTitle]); + + if(%paramStyle !$= "") + %themeStyle = %this.theme.styles[%paramStyle]; + else + %themeStyle = %this.theme.getStyle(%this.theme.defaultStyles[Param]); + + if (%title $= "") + %this.param[%this.paramCount] = %themeStyle @ %text @ "\n"; + else + %this.param[%this.paramCount] = %themeTitleStyle @ %title @ ": " @ %themeStyle @ %text @ "\n"; + %this.paramCount++; +} + +function SuperTooltip::getFormatedText(%this) +{ + %text = %this.title @ "\n\n"; + + for(%i=0;%i<%this.paramCount;%i++) + { + %text = %text @ %this.param[%i]; + } + + return %text; +} \ No newline at end of file diff --git a/Templates/Empty/game/tools/decalEditor/decalEditorGui.cs b/Templates/Empty/game/tools/decalEditor/decalEditorGui.cs index c6e24b10b..3636b29a1 100644 --- a/Templates/Empty/game/tools/decalEditor/decalEditorGui.cs +++ b/Templates/Empty/game/tools/decalEditor/decalEditorGui.cs @@ -315,7 +315,7 @@ function DecalEditorGui::updateDecalPreview( %this, %material ) if( isObject( %material ) ) DecalPreviewWindow-->decalPreview.setBitmap( MaterialEditorGui.searchForTexture( %material.getId(), %material.diffuseMap[0]) ); else - DecalPreviewWindow-->decalPreview.setBitmap("tools/materialeditor/gui/unknownImage"); + DecalPreviewWindow-->decalPreview.setBitmap("tools/materialEditor/gui/unknownImage"); } function DecalEditorGui::updateInstancePreview( %this, %material ) @@ -323,7 +323,7 @@ function DecalEditorGui::updateInstancePreview( %this, %material ) if( isObject( %material ) ) DecalPreviewWindow-->instancePreview.setBitmap( MaterialEditorGui.searchForTexture( %material.getId(), %material.diffuseMap[0]) ); else - DecalPreviewWindow-->instancePreview.setBitmap("tools/materialeditor/gui/unknownImage"); + DecalPreviewWindow-->instancePreview.setBitmap("tools/materialEditor/gui/unknownImage"); } function DecalEditorGui::rebuildInstanceTree( %this ) diff --git a/Templates/Empty/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui b/Templates/Empty/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui index 54e55012e..8110d2c34 100644 --- a/Templates/Empty/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui +++ b/Templates/Empty/game/tools/materialEditor/gui/guiMaterialPreviewWindow.ed.gui @@ -365,7 +365,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl(matEd_cubeMapEd_xPosTxt) { @@ -408,7 +408,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl(matEd_cubeMapEd_xNegTxt) { @@ -451,7 +451,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl(matEd_cubeMapEd_yPosTxt) { @@ -494,7 +494,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl(matEd_cubeMapEd_yNegTxt) { @@ -537,7 +537,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl(matEd_cubeMapEd_zPosTxt) { @@ -580,7 +580,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl(matEd_cubeMapEd_zNegTxt) { diff --git a/Templates/Empty/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui b/Templates/Empty/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui index 63ce28e2a..328d946b6 100644 --- a/Templates/Empty/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui +++ b/Templates/Empty/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui @@ -277,7 +277,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiBitmapButtonCtrl() { @@ -429,7 +429,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl() { @@ -555,7 +555,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl() { @@ -713,7 +713,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiBitmapButtonCtrl() { @@ -858,7 +858,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiBitmapButtonCtrl() { @@ -1003,7 +1003,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiBitmapButtonCtrl() { @@ -1129,7 +1129,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl() { @@ -1255,7 +1255,7 @@ canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl() { @@ -2240,6 +2240,29 @@ useMouseEvents = "0"; useInactiveState = "0"; }; + new GuiCheckBoxCtrl() { + canSaveDynamicFields = "0"; + internalName = "subSurfaceCheckbox"; + Enabled = "1"; + isContainer = "0"; + Profile = "ToolsGuiCheckBoxProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "8 46"; + Extent = "79 16"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + Command = "MaterialEditorGui.updateActiveMaterial(\"subSurface[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());"; + tooltipprofile = "ToolsGuiDefaultProfile"; + ToolTip = "Enables the use of subsurface scattering for this layer."; + hovertime = "1000"; + text = "Sub Surface"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + useInactiveState = "0"; + }; }; }; }; diff --git a/Templates/Empty/game/tools/materialEditor/scripts/materialEditor.ed.cs b/Templates/Empty/game/tools/materialEditor/scripts/materialEditor.ed.cs index c1f01f1a7..b4e85229f 100644 --- a/Templates/Empty/game/tools/materialEditor/scripts/materialEditor.ed.cs +++ b/Templates/Empty/game/tools/materialEditor/scripts/materialEditor.ed.cs @@ -27,12 +27,12 @@ function MaterialEditorGui::establishMaterials(%this) //Cubemap used to preview other cubemaps in the editor. singleton CubemapData( matEdCubeMapPreviewMat ) { - cubeFace[0] = "tools/materialeditor/gui/cube_xNeg"; - cubeFace[1] = "tools/materialeditor/gui/cube_xPos"; - cubeFace[2] = "tools/materialeditor/gui/cube_ZNeg"; - cubeFace[3] = "tools/materialeditor/gui/cube_ZPos"; - cubeFace[4] = "tools/materialeditor/gui/cube_YNeg"; - cubeFace[5] = "tools/materialeditor/gui/cube_YPos"; + cubeFace[0] = "tools/materialEditor/gui/cube_xNeg"; + cubeFace[1] = "tools/materialEditor/gui/cube_xPos"; + cubeFace[2] = "tools/materialEditor/gui/cube_ZNeg"; + cubeFace[3] = "tools/materialEditor/gui/cube_ZPos"; + cubeFace[4] = "tools/materialEditor/gui/cube_YNeg"; + cubeFace[5] = "tools/materialEditor/gui/cube_YPos"; parentGroup = "RootGroup"; }; @@ -40,7 +40,7 @@ function MaterialEditorGui::establishMaterials(%this) singleton Material(materialEd_previewMaterial) { mapTo = "matEd_mappedMat"; - diffuseMap[0] = "tools/materialeditor/gui/matEd_mappedMat"; + diffuseMap[0] = "tools/materialEditor/gui/matEd_mappedMat"; }; singleton CustomMaterial( materialEd_justAlphaMaterial ) @@ -371,32 +371,32 @@ function MaterialEditorGui::updatePreviewObject(%this) { case "sphere": matEd_quickPreview_Popup.selected = %newModel; - matEd_previewObjectView.setModel("tools/materialeditor/gui/spherePreview.dts"); + matEd_previewObjectView.setModel("tools/materialEditor/gui/spherePreview.dts"); matEd_previewObjectView.setOrbitDistance(4); case "cube": matEd_quickPreview_Popup.selected = %newModel; - matEd_previewObjectView.setModel("tools/materialeditor/gui/cubePreview.dts"); + matEd_previewObjectView.setModel("tools/materialEditor/gui/cubePreview.dts"); matEd_previewObjectView.setOrbitDistance(5); case "pyramid": matEd_quickPreview_Popup.selected = %newModel; - matEd_previewObjectView.setModel("tools/materialeditor/gui/pyramidPreview.dts"); + matEd_previewObjectView.setModel("tools/materialEditor/gui/pyramidPreview.dts"); matEd_previewObjectView.setOrbitDistance(5); case "cylinder": matEd_quickPreview_Popup.selected = %newModel; - matEd_previewObjectView.setModel("tools/materialeditor/gui/cylinderPreview.dts"); + matEd_previewObjectView.setModel("tools/materialEditor/gui/cylinderPreview.dts"); matEd_previewObjectView.setOrbitDistance(4.2); case "torus": matEd_quickPreview_Popup.selected = %newModel; - matEd_previewObjectView.setModel("tools/materialeditor/gui/torusPreview.dts"); + matEd_previewObjectView.setModel("tools/materialEditor/gui/torusPreview.dts"); matEd_previewObjectView.setOrbitDistance(4.2); case "knot": matEd_quickPreview_Popup.selected = %newModel; - matEd_previewObjectView.setModel("tools/materialeditor/gui/torusknotPreview.dts"); + matEd_previewObjectView.setModel("tools/materialEditor/gui/torusknotPreview.dts"); } } @@ -802,7 +802,7 @@ function MaterialEditorGui::guiSync( %this, %material ) if((%material).diffuseMap[%layer] $= "") { MaterialEditorPropertiesWindow-->diffuseMapNameText.setText( "None" ); - MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" ); + MaterialEditorPropertiesWindow-->diffuseMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" ); } else { @@ -813,7 +813,7 @@ function MaterialEditorGui::guiSync( %this, %material ) if((%material).normalMap[%layer] $= "") { MaterialEditorPropertiesWindow-->normalMapNameText.setText( "None" ); - MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" ); + MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" ); } else { @@ -824,7 +824,7 @@ function MaterialEditorGui::guiSync( %this, %material ) if((%material).overlayMap[%layer] $= "") { MaterialEditorPropertiesWindow-->overlayMapNameText.setText( "None" ); - MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" ); + MaterialEditorPropertiesWindow-->overlayMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" ); } else { @@ -835,7 +835,7 @@ function MaterialEditorGui::guiSync( %this, %material ) if((%material).detailMap[%layer] $= "") { MaterialEditorPropertiesWindow-->detailMapNameText.setText( "None" ); - MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" ); + MaterialEditorPropertiesWindow-->detailMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" ); } else { @@ -846,7 +846,7 @@ function MaterialEditorGui::guiSync( %this, %material ) if((%material).detailNormalMap[%layer] $= "") { MaterialEditorPropertiesWindow-->detailNormalMapNameText.setText( "None" ); - MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" ); + MaterialEditorPropertiesWindow-->detailNormalMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" ); } else { @@ -857,7 +857,7 @@ function MaterialEditorGui::guiSync( %this, %material ) if((%material).lightMap[%layer] $= "") { MaterialEditorPropertiesWindow-->lightMapNameText.setText( "None" ); - MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" ); + MaterialEditorPropertiesWindow-->lightMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" ); } else { @@ -868,7 +868,7 @@ function MaterialEditorGui::guiSync( %this, %material ) if((%material).toneMap[%layer] $= "") { MaterialEditorPropertiesWindow-->toneMapNameText.setText( "None" ); - MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" ); + MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" ); } else { @@ -879,7 +879,7 @@ function MaterialEditorGui::guiSync( %this, %material ) if((%material).specularMap[%layer] $= "") { MaterialEditorPropertiesWindow-->specMapNameText.setText( "None" ); - MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap( "tools/materialeditor/gui/unknownImage" ); + MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" ); } else { @@ -1141,7 +1141,7 @@ function MaterialEditorGui::updateTextureMap( %this, %type, %action ) else { %textCtrl.setText("None"); - %bitmapCtrl.setBitmap("tools/materialeditor/gui/unknownImage"); + %bitmapCtrl.setBitmap("tools/materialEditor/gui/unknownImage"); MaterialEditorGui.updateActiveMaterial(%type @ "Map[" @ %layer @ "]",""); } } @@ -1185,7 +1185,7 @@ function MaterialEditorGui::updateSpecMap(%this,%action) else { MaterialEditorPropertiesWindow-->specMapNameText.setText("None"); - MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap("tools/materialeditor/gui/unknownImage"); + MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage"); MaterialEditorGui.updateActiveMaterial("specularMap[" @ %layer @ "]",""); } @@ -1604,12 +1604,12 @@ function MaterialEditorGui::createNewCubemap( %this, %cubemap ) new CubemapData(%cubemap) { - cubeFace[0] = "tools/materialeditor/gui/cube_xNeg"; - cubeFace[1] = "tools/materialeditor/gui/cube_xPos"; - cubeFace[2] = "tools/materialeditor/gui/cube_ZNeg"; - cubeFace[3] = "tools/materialeditor/gui/cube_ZPos"; - cubeFace[4] = "tools/materialeditor/gui/cube_YNeg"; - cubeFace[5] = "tools/materialeditor/gui/cube_YPos"; + cubeFace[0] = "tools/materialEditor/gui/cube_xNeg"; + cubeFace[1] = "tools/materialEditor/gui/cube_xPos"; + cubeFace[2] = "tools/materialEditor/gui/cube_ZNeg"; + cubeFace[3] = "tools/materialEditor/gui/cube_ZPos"; + cubeFace[4] = "tools/materialEditor/gui/cube_YNeg"; + cubeFace[5] = "tools/materialEditor/gui/cube_YPos"; parentGroup = RootGroup; }; diff --git a/Templates/Empty/game/tools/particleEditor/ParticleEditor.ed.gui b/Templates/Empty/game/tools/particleEditor/ParticleEditor.ed.gui index 3ec447504..a2c87457e 100644 --- a/Templates/Empty/game/tools/particleEditor/ParticleEditor.ed.gui +++ b/Templates/Empty/game/tools/particleEditor/ParticleEditor.ed.gui @@ -1862,7 +1862,7 @@ $PE_guielement_ext_colorpicker = "18 18"; canSave = "1"; Visible = "1"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl() { @@ -2343,6 +2343,52 @@ $PE_guielement_ext_colorpicker = "18 18"; Extent = $PE_guielement_ext_value; altCommand = "$ThisControl.getParent().updateFromChild($ThisControl); PE_ParticleEditor.updateParticle( \"dragCoefficient\", $ThisControl.getText());"; }; + }; //End Particle Drag + new GuiControl(){ // Particle Wind + class = "AggregateControl"; + isContainer = "1"; + HorizSizing = "width"; + VertSizing = "bottom"; + Position = $PE_guielement_pos_single_container ; + Extent = $PE_guielement_ext_single_container ; + + new GuiTextCtrl() { + Profile = "ToolsGuiTextProfile"; + HorizSizing = "width"; + VertSizing = "bottom"; + position = $PE_guielement_pos_name; + Extent = $PE_guielement_ext_name; + text = "Wind Coeff"; + }; + new GuiSliderCtrl(PEP_windCoefficient) { + internalName = "PEP_windCoefficient_slider"; + canSaveDynamicFields = "0"; + Enabled = "1"; + isContainer = "0"; + Profile = "ToolsGuiSliderProfile"; + HorizSizing = "left"; + VertSizing = "bottom"; + position = $PE_guielement_pos_slider; + Extent = $PE_guielement_ext_slider; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + Command = "PE_ParticleEditor.updateParticle( \"windCoefficient\", $ThisControl.getValue(), true, true );"; + altCommand = "$ThisControl.getParent().updateFromChild($ThisControl); PE_ParticleEditor.updateParticle( \"windCoefficient\", $ThisControl.getValue(), true, false );"; + hovertime = "1000"; + range = "0 1"; + ticks = "0"; + value = "0.298143"; + }; + new GuiTextEditCtrl() { + internalName = "PEP_windCoefficient_textEdit"; + Profile = "ToolsGuiTextEditProfile"; + HorizSizing = "left"; + VertSizing = "bottom"; + position = $PE_guielement_pos_value; + Extent = $PE_guielement_ext_value; + altCommand = "$ThisControl.getParent().updateFromChild($ThisControl); PE_ParticleEditor.updateParticle( \"windCoefficient\", $ThisControl.getText());"; + }; }; }; // end stack }; // end "motion" rollout @@ -2548,6 +2594,151 @@ $PE_guielement_ext_colorpicker = "18 18"; }; }; // end stack }; // end "Spin" rollout + new GuiRolloutCtrl() { + class = "BehaviorQuickEditRollout"; + superclass = LBQuickEditRollout; + Profile = "GuiRolloutProfile"; + HorizSizing = "width"; + VertSizing = "bottom"; + Position = "0 0"; + Extent = "197 0"; + Caption = "Animation"; + Margin = "4 4 4 0"; + DragSizable = false; + container = true; + parentRollout = %this.rollout; + object = %behavior; + + new GuiStackControl() { + StackingType = "Vertical"; + HorizStacking = "Left to Right"; + VertStacking = "Top to Bottom"; + Padding = "0"; + canSaveDynamicFields = "0"; + Enabled = "1"; + isContainer = "1"; + Profile = "ToolsGuiDefaultProfile"; + HorizSizing = "width"; + VertSizing = "bottom"; + Position = "1 3"; + Extent = "197 16"; + MinExtent = "16 16"; + canSave = "1"; + isDecoy = "0"; + Visible = "1"; + tooltipprofile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + + new GuiCheckBoxCtrl() { + internalName = "PEP_animateTexture"; + HorizSizing = "width"; + VertSizing = "bottom"; + position = "55 14"; + Extent = "84 18"; + MinExtent = "8 2"; + text = "Animate Texture"; + command = "PE_ParticleEditor.updateParticle( \"animateTexture\", $ThisControl.getValue());"; + }; + new GuiControl(){ // Particle framesPerSec + class = "AggregateControl"; + isContainer = "1"; + HorizSizing = "width"; + VertSizing = "bottom"; + Position = $PE_guielement_pos_single_container ; + Extent = $PE_guielement_ext_single_container ; + + new GuiTextCtrl() { + Profile = "ToolsGuiTextProfile"; + HorizSizing = "width"; + VertSizing = "bottom"; + position = $PE_guielement_pos_name; + Extent = $PE_guielement_ext_name; + text = "framesPerSec"; + }; + new GuiSliderCtrl(PEP_framesPerSec) { + internalName = "PEP_framesPerSec_slider"; + canSaveDynamicFields = "0"; + Enabled = "1"; + isContainer = "0"; + Profile = "ToolsGuiSliderProfile"; + HorizSizing = "left"; + VertSizing = "bottom"; + position = $PE_guielement_pos_slider; + Extent = $PE_guielement_ext_slider; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + hovertime = "1000"; + range = "0 60"; + ticks = "0"; + value = "0"; + Command = "PE_ParticleEditor.updateParticle( \"framesPerSec\", $ThisControl.getValue(), true, true );"; + altCommand = "$ThisControl.getParent().updateFromChild($ThisControl); PE_ParticleEditor.updateParticle( \"framesPerSec\", $ThisControl.getValue(), true, false );"; + }; + new GuiTextEditCtrl() { + internalName = "PEP_framesPerSec_textEdit"; + Profile = "ToolsGuiTextEditProfile"; + HorizSizing = "left"; + VertSizing = "bottom"; + position = $PE_guielement_pos_value; + Extent = $PE_guielement_ext_value; + altCommand = "$ThisControl.getParent().updateFromChild($ThisControl); PE_ParticleEditor.updateParticle( \"framesPerSec\", $ThisControl.getText());"; + }; + }; // end framesPerSec + new GuiControl(){ // Particle animTexFramesList + class = "AggregateControl"; + isContainer = "1"; + HorizSizing = "width"; + VertSizing = "bottom"; + Position = $PE_guielement_pos_single_container; + Extent = $PE_guielement_ext_single_container; + + new GuiTextCtrl() { + Profile = "ToolsGuiTextProfile"; + HorizSizing = "width"; + VertSizing = "bottom"; + position = $PE_guielement_pos_name; + Extent = $PE_guielement_ext_name; + text = "animTexFrames"; + }; + new GuiTextEditCtrl() { + internalName = "PEP_animTexFramesList_textEdit"; + Profile = "ToolsGuiTextEditProfile"; + HorizSizing = "left"; + VertSizing = "bottom"; + position = $PE_guielement_pos_textedit; + Extent = $PE_guielement_ext_textedit; + altCommand = "$ThisControl.getParent().updateFromChild($ThisControl); PE_ParticleEditor.updateParticle( \"animTexFrames\", $ThisControl.getText());"; + }; + }; // end animTexFramesList + new GuiControl(){ // Particle animTileCount + class = "AggregateControl"; + isContainer = "1"; + HorizSizing = "width"; + VertSizing = "bottom"; + Position = $PE_guielement_pos_single_container; + Extent = $PE_guielement_ext_single_container; + + new GuiTextCtrl() { + Profile = "ToolsGuiTextProfile"; + HorizSizing = "width"; + VertSizing = "bottom"; + position = $PE_guielement_pos_name; + Extent = $PE_guielement_ext_name; + text = "TileCount (X Y)"; + }; + new GuiTextEditCtrl() { + internalName = "PEP_animTileCount_textEdit"; + Profile = "ToolsGuiTextEditProfile"; + HorizSizing = "left"; + VertSizing = "bottom"; + position = $PE_guielement_pos_value; + Extent = $PE_guielement_ext_value; + altCommand = "$ThisControl.getParent().updateFromChild($ThisControl); PE_ParticleEditor.updateParticle( \"animTexTiling\", $ThisControl.getText());"; + }; + }; // end animTileCount + }; // end stack + }; // end "Anim" rollout new GuiRolloutCtrl() { class = "BehaviorQuickEditRollout"; superclass = LBQuickEditRollout; diff --git a/Templates/Empty/game/tools/particleEditor/particleParticleEditor.ed.cs b/Templates/Empty/game/tools/particleEditor/particleParticleEditor.ed.cs index 373e69de3..00a27e5d4 100644 --- a/Templates/Empty/game/tools/particleEditor/particleParticleEditor.ed.cs +++ b/Templates/Empty/game/tools/particleEditor/particleParticleEditor.ed.cs @@ -91,6 +91,9 @@ function PE_ParticleEditor::guiSync( %this ) PE_ParticleEditor-->PEP_dragCoefficient_slider.setValue( %data.dragCoefficient ); PE_ParticleEditor-->PEP_dragCoefficient_textEdit.setText( %data.dragCoefficient ); + PE_ParticleEditor-->PEP_windCoefficient_slider.setValue( %data.windCoefficient ); + PE_ParticleEditor-->PEP_windCoefficient_textEdit.setText( %data.windCoefficient ); + PE_ParticleEditor-->PEP_spinRandomMin_slider.setValue( %data.spinRandomMin ); PE_ParticleEditor-->PEP_spinRandomMin_textEdit.setText( %data.spinRandomMin ); @@ -131,6 +134,17 @@ function PE_ParticleEditor::guiSync( %this ) PE_ParticleEditor-->PEP_pointTime_slider3.setValue( %data.times[ 3 ] ); PE_ParticleEditor-->PEP_pointTime_textEdit3.setText( %data.times[ 3 ] ); + + //particle animation + PE_ParticleEditor-->PEP_animateTexture.setValue( %data.animateTexture ); + + PE_ParticleEditor-->PEP_framesPerSec_slider.setValue( %data.framesPerSec ); + PE_ParticleEditor-->PEP_framesPerSec_textEdit.setText( %data.framesPerSec ); + + PE_ParticleEditor-->PEP_animTexFramesList_textEdit.setText( %data.animTexFrames ); + + PE_ParticleEditor-->PEP_animTileCount_textEdit.setText( %data.animTexTiling ); + } //--------------------------------------------------------------------------------------------- diff --git a/Templates/Empty/game/tools/worldEditor/gui/GeneralSettingsTab.ed.gui b/Templates/Empty/game/tools/worldEditor/gui/GeneralSettingsTab.ed.gui index d89ff1a4d..b85e78ae0 100644 --- a/Templates/Empty/game/tools/worldEditor/gui/GeneralSettingsTab.ed.gui +++ b/Templates/Empty/game/tools/worldEditor/gui/GeneralSettingsTab.ed.gui @@ -204,6 +204,77 @@ editorSettingsWrite = "EditorGui.writeWorldEditorSettings();"; }; }; + new GuiControl() { + position = "0 0"; + extent = "430 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { + text = "New Game Objects"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "5 1"; + extent = "70 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextRightProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + text = "scripts/server/gameObjects"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "81 0"; + extent = "345 17"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "1"; + class = "ESettingsWindowTextEdit"; + editorSettingsRead = "EditorGui.readWorldEditorSettings();"; + editorSettingsValue = "WorldEditor/newGameObjectDir"; + editorSettingsWrite = "EditorGui.writeWorldEditorSettings();"; + }; + }; }; }; }; diff --git a/Templates/Empty/game/tools/worldEditor/gui/ProceduralTerrainPainterGui.gui b/Templates/Empty/game/tools/worldEditor/gui/ProceduralTerrainPainterGui.gui index d25f848f0..c00e31e4f 100644 --- a/Templates/Empty/game/tools/worldEditor/gui/ProceduralTerrainPainterGui.gui +++ b/Templates/Empty/game/tools/worldEditor/gui/ProceduralTerrainPainterGui.gui @@ -402,3 +402,4 @@ function generateProceduralTerrainMask() Canvas.popDialog(ProceduralTerrainPainterGui); ETerrainEditor.autoMaterialLayer($TPPHeightMin, $TPPHeightMax, $TPPSlopeMin, $TPPSlopeMax, $TPPCoverage); } + diff --git a/Templates/Empty/game/tools/worldEditor/gui/TerrainPainterWindow.ed.gui b/Templates/Empty/game/tools/worldEditor/gui/TerrainPainterWindow.ed.gui index b9abec3c3..a08c05841 100644 --- a/Templates/Empty/game/tools/worldEditor/gui/TerrainPainterWindow.ed.gui +++ b/Templates/Empty/game/tools/worldEditor/gui/TerrainPainterWindow.ed.gui @@ -158,7 +158,7 @@ tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; wrap = "0"; - bitmap= "tools/materialeditor/gui/unknownImage"; + bitmap= "tools/materialEditor/gui/unknownImage"; }; new GuiBitmapCtrl(ETerrainMaterialSelectedBorder) { canSaveDynamicFields = "0"; diff --git a/Templates/Empty/game/tools/worldEditor/gui/ToolsPaletteGroups/ForestEditorPalette.ed.gui b/Templates/Empty/game/tools/worldEditor/gui/ToolsPaletteGroups/ForestEditorPalette.ed.gui index 7eecbc9f8..a1cc96ef5 100644 --- a/Templates/Empty/game/tools/worldEditor/gui/ToolsPaletteGroups/ForestEditorPalette.ed.gui +++ b/Templates/Empty/game/tools/worldEditor/gui/ToolsPaletteGroups/ForestEditorPalette.ed.gui @@ -113,7 +113,7 @@ tooltipprofile = "ToolsGuiToolTipProfile"; ToolTip = "Paint (5)"; hovertime = "1000"; - bitmap = "tools/foresteditor/images/paint-forest-btn"; + bitmap = "tools/forestEditor/images/paint-forest-btn"; buttonType = "RadioButton"; useMouseEvents = "0"; }; @@ -134,7 +134,7 @@ tooltipprofile = "ToolsGuiToolTipProfile"; ToolTip = "Erase (6)"; hovertime = "1000"; - bitmap = "tools/foresteditor/images/erase-all-btn"; + bitmap = "tools/forestEditor/images/erase-all-btn"; buttonType = "RadioButton"; useMouseEvents = "0"; }; @@ -156,7 +156,7 @@ tooltipprofile = "ToolsGuiToolTipProfile"; ToolTip = "Erase Selected (7)"; hovertime = "1000"; - bitmap = "tools/foresteditor/images/erase-element-btn"; + bitmap = "tools/forestEditor/images/erase-element-btn"; buttonType = "RadioButton"; useMouseEvents = "0"; }; diff --git a/Templates/Empty/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui b/Templates/Empty/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui index 547dab6fa..09a90ef26 100644 --- a/Templates/Empty/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui +++ b/Templates/Empty/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui @@ -261,7 +261,7 @@ Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiBitmapButtonCtrl() { @@ -358,7 +358,7 @@ MinExtent = "8 2"; canSave = "1"; Visible = "1"; - Command = "TerrainMaterialDlg-->baseTexCtrl.setBitmap(\"tools/materialeditor/gui/unknownImage\");"; + Command = "TerrainMaterialDlg-->baseTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; groupNum = "-1"; @@ -466,7 +466,7 @@ Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiTextCtrl() { @@ -563,7 +563,7 @@ MinExtent = "8 2"; canSave = "1"; Visible = "1"; - Command = "TerrainMaterialDlg-->normTexCtrl.setBitmap(\"tools/materialeditor/gui/unknownImage\");"; + Command = "TerrainMaterialDlg-->normTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; groupNum = "-1"; @@ -662,7 +662,7 @@ canSaveDynamicFields = "0"; new GuiBitmapCtrl() { - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; position = "1 1"; extent = "47 47"; @@ -787,7 +787,7 @@ profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; - command = "TerrainMaterialDlg-->macroTexCtrl.setBitmap(\"tools/materialeditor/gui/unknownImage\");"; + command = "TerrainMaterialDlg-->macroTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; isContainer = "0"; @@ -999,7 +999,7 @@ Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - bitmap = "tools/materialeditor/gui/unknownImage"; + bitmap = "tools/materialEditor/gui/unknownImage"; wrap = "0"; }; new GuiBitmapButtonCtrl() { @@ -1096,7 +1096,7 @@ MinExtent = "8 2"; canSave = "1"; Visible = "1"; - Command = "TerrainMaterialDlg-->detailTexCtrl.setBitmap(\"tools/materialeditor/gui/unknownImage\");"; + Command = "TerrainMaterialDlg-->detailTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; groupNum = "-1"; diff --git a/Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs index 6f80d9206..6321e44aa 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/EditorGui.ed.cs @@ -1619,7 +1619,7 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj ) } // Open context menu if this is a SimGroup - else if( %obj.isMemberOfClass( "SimGroup" ) ) + else if( !%obj.isMemberOfClass( "SceneObject" ) ) { %popup = ETSimGroupContextPopup; if( !isObject( %popup ) ) @@ -1675,9 +1675,23 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj ) object = -1; }; + + if(%obj.isMemberOfClass("Entity")) + { + %popup = ETEntityContextPopup; + if( !isObject( %popup ) ) + %popup = new PopupMenu( ETEntityContextPopup : ETSimGroupContextPopup ) + { + superClass = "MenuBuilder"; + isPopup = "1"; + + item[ 12 ] = "-"; + item[ 13 ] = "Convert to Game Object" TAB "" TAB "EWorldEditor.createGameObject( %this.object );"; + }; + } // Specialized version for ConvexShapes. - if( %obj.isMemberOfClass( "ConvexShape" ) ) + else if( %obj.isMemberOfClass( "ConvexShape" ) ) { %popup = ETConvexShapeContextPopup; if( !isObject( %popup ) ) @@ -2204,6 +2218,155 @@ function EWorldEditor::deleteMissionObject( %this, %object ) EditorTree.buildVisibleTree( true ); } +function EWorldEditor::createGameObject( %this, %entity ) +{ + if(!isObject(GameObjectBuilder)) + { + new GuiControl(GameObjectBuilder, EditorGuiGroup) { + profile = "ToolsGuiDefaultProfile"; + horizSizing = "right"; + vertSizing = "bottom"; + position = "0 0"; + extent = "800 600"; + minExtent = "8 8"; + visible = "1"; + setFirstResponder = "0"; + modal = "1"; + helpTag = "0"; + + new GuiWindowCtrl(GameObjectBuilderTargetWindow) { + profile = "ToolsGuiWindowProfile"; + horizSizing = "center"; + vertSizing = "center"; + position = "384 205"; + extent = "256 102"; + minExtent = "256 8"; + visible = "1"; + setFirstResponder = "0"; + modal = "1"; + helpTag = "0"; + resizeWidth = "1"; + resizeHeight = "1"; + canMove = "1"; + canClose = "0"; + canMinimize = "0"; + canMaximize = "0"; + minSize = "50 50"; + text = "Create Object"; + + new GuiTextCtrl() { + profile = "GuiCenterTextProfile"; + horizSizing = "right"; + vertSizing = "bottom"; + position = "9 26"; + extent = "84 16"; + minExtent = "8 8"; + visible = "1"; + setFirstResponder = "0"; + modal = "1"; + helpTag = "0"; + text = "Object Name:"; + }; + new GuiTextEditCtrl(GameObjectBuilderObjectName) { + class = ObjectBuilderGuiTextEditCtrl; + profile = "ToolsGuiTextEditProfile"; + horizSizing = "width"; + vertSizing = "bottom"; + position = "78 26"; + extent = "172 18"; + minExtent = "8 8"; + visible = "1"; + setFirstResponder = "0"; + modal = "1"; + helpTag = "0"; + historySize = "0"; + }; + new GuiButtonCtrl(GameObjectBuilderOKButton) { + profile = "ToolsGuiButtonProfile"; + horizSizing = "width"; + vertSizing = "bottom"; + position = "7 250"; + extent = "156 24"; + minExtent = "8 8"; + visible = "1"; + setFirstResponder = "0"; + modal = "1"; + command = "EWorldEditor.buildGameObject();"; + helpTag = "0"; + text = "Create New"; + Accelerator = "return"; + }; + new GuiButtonCtrl(GameObjectBuilderCancelButton) { + profile = "ToolsGuiButtonProfile"; + horizSizing = "left"; + vertSizing = "bottom"; + position = "170 250"; + extent = "80 24"; + minExtent = "8 8"; + visible = "1"; + setFirstResponder = "0"; + modal = "1"; + command = "Canvas.popDialog(GameObjectBuilder);"; + helpTag = "0"; + text = "Cancel"; + Accelerator = "escape"; + }; + }; + }; + + GameObjectBuilderTargetWindow.extent = getWord(GameObjectBuilderTargetWindow.extent, 0) SPC 88; + GameObjectBuilderOKButton.position = getWord(GameObjectBuilderOKButton.position, 0) SPC 57; + GameObjectBuilderCancelButton.position = getWord(GameObjectBuilderCancelButton.position, 0) SPC 57; + } + + GameObjectBuilderObjectName.text = ""; + GameObjectBuilder.selectedEntity = %entity; + + Canvas.pushDialog(GameObjectBuilder); +} + +function EWorldEditor::buildGameObject(%this) +{ + if(GameObjectBuilderObjectName.getText() $= "") + { + error("Attempted to make a new Game Object with no name!"); + Canvas.popDialog(GameObjectBuilder); + return; + } + + %path = EditorSettings.value( "WorldEditor/newGameObjectDir" ); + %className = GameObjectBuilderObjectName.getText(); + GameObjectBuilder.selectedEntity.class = %className; + Inspector.inspect(GameObjectBuilder.selectedEntity); + + %file = new FileObject(); + + if(%file.openForWrite(%path @ "\\" @ %className @ ".cs")) + { + %file.writeline("function " @ %className @ "::onAdd(%this)\n{\n\n}\n"); + %file.writeline("function " @ %className @ "::onRemove(%this)\n{\n\n}\n"); + + //todo, pre-write any event functions of interest + + %file.close(); + } + + //set up the paths + %tamlPath = %path @ "/" @ %className @ ".taml"; + %scriptPath = %path @ "/" @ %className @ ".cs"; + saveGameObject(%className, %tamlPath, %scriptPath); + + //reload it + execGameObjects(); + + //now, add the script file and a ref to the taml into our SGO manifest so we can readily spawn it later. + TamlWrite(GameObjectBuilder.selectedEntity, %tamlpath); + + GameObjectBuilder.selectedEntity = ""; + + Canvas.popDialog(GameObjectBuilder); +} + function EWorldEditor::selectAllObjectsInSet( %this, %set, %deselect ) { if( !isObject( %set ) ) diff --git a/Templates/Empty/game/tools/worldEditor/scripts/editorPrefs.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/editorPrefs.ed.cs index 0cc14bff0..1704e06ad 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/editorPrefs.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/editorPrefs.ed.cs @@ -34,6 +34,7 @@ EditorSettings.setDefaultValue( "orthoFOV", "50" ); EditorSettings.setDefaultValue( "orthoShowGrid", "1" ); EditorSettings.setDefaultValue( "currentEditor", "WorldEditorInspectorPlugin" ); EditorSettings.setDefaultValue( "newLevelFile", "tools/levels/BlankRoom.mis" ); +EditorSettings.setDefaultValue( "newGameObjectDir", "scripts/server/gameObjects" ); if( isFile( "C:/Program Files/Torsion/Torsion.exe" ) ) EditorSettings.setDefaultValue( "torsionPath", "C:/Program Files/Torsion/Torsion.exe" ); diff --git a/Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs index 43d4fb65c..9dbfb91bb 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs @@ -46,7 +46,7 @@ function EWCreatorWindow::init( %this ) %this.registerMissionObject( "SFXEmitter", "Sound Emitter" ); %this.registerMissionObject( "Precipitation" ); %this.registerMissionObject( "ParticleEmitterNode", "Particle Emitter" ); - %this.registerMissionObject( "VolumetricFog", "Volumetric Fog" ); + %this.registerMissionObject( "VolumetricFog", "Volumetric Fog" ); %this.registerMissionObject( "RibbonNode", "Ribbon" ); // Legacy features. Users should use Ground Cover and the Forest Editor. @@ -85,6 +85,7 @@ function EWCreatorWindow::init( %this ) %this.registerMissionObject( "SFXSpace", "Sound Space" ); %this.registerMissionObject( "OcclusionVolume", "Occlusion Volume" ); %this.registerMissionObject( "AccumulationVolume", "Accumulation Volume" ); + %this.registerMissionObject( "Entity", "Entity" ); %this.endGroup(); @@ -303,6 +304,36 @@ function EWCreatorWindow::navigate( %this, %address ) %this.addShapeIcon( %obj ); } } + + //Add a separate folder for Game Objects + if(isClass("Entity")) + { + if(%address $= "") + { + %this.addFolderIcon("GameObjects"); + } + else + { + //find all GameObjectAssets + %assetQuery = new AssetQuery(); + if(!AssetDatabase.findAssetType(%assetQuery, "GameObjectAsset")) + return 0; //if we didn't find ANY, just exit + + %count = %assetQuery.getCount(); + + for(%i=0; %i < %count; %i++) + { + %assetId = %assetQuery.getAsset(%i); + + %gameObjectAsset = AssetDatabase.acquireAsset(%assetId); + + if(isFile(%gameObjectAsset.TAMLFilePath)) + { + %this.addGameObjectIcon( %gameObjectAsset.gameObjectName ); + } + } + } + } } if ( %this.tab $= "Meshes" ) @@ -319,7 +350,7 @@ function EWCreatorWindow::navigate( %this, %address ) %fullPath = makeRelativePath( %fullPath, getMainDotCSDir() ); %splitPath = strreplace( %fullPath, " ", "_" ); - %splitPath = strreplace( %splitPath, "/", " " ); + %splitPath = strreplace( %splitPath, "/", " " ); if( getWord(%splitPath, 0) $= "tools" ) { %fullPath = findNextFileMultiExpr( getFormatExtensions() ); @@ -737,6 +768,22 @@ function EWCreatorWindow::addPrefabIcon( %this, %fullPath ) %this.contentCtrl.addGuiControl( %ctrl ); } +function EWCreatorWindow::addGameObjectIcon( %this, %gameObjectName ) +{ + %ctrl = %this.createIcon(); + + %ctrl.altCommand = "spawnGameObject( \"" @ %gameObjectName @ "\", true );"; + %ctrl.iconBitmap = EditorIconRegistry::findIconByClassName( "Prefab" ); + %ctrl.text = %gameObjectName; + %ctrl.class = "CreatorGameObjectIconBtn"; + %ctrl.tooltip = "Spawn the " @ %gameObjectName @ " GameObject"; + + %ctrl.buttonType = "radioButton"; + %ctrl.groupNum = "-1"; + + %this.contentCtrl.addGuiControl( %ctrl ); +} + function CreatorPopupMenu::onSelect( %this, %id, %text ) { %split = strreplace( %text, "/", " " ); diff --git a/Templates/Empty/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs index a83ddfb8a..2ec8e17f3 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs @@ -218,7 +218,7 @@ function TerrainMaterialDlg::changeBase( %this ) if( %ctrl.bitmap !$= "" ) %file = %ctrl.bitmap; else - %file = "tools/materialeditor/gui/unknownImage"; + %file = "tools/materialEditor/gui/unknownImage"; } %file = makeRelativePath( %file, getMainDotCsDir() ); @@ -240,7 +240,7 @@ function TerrainMaterialDlg::changeDetail( %this ) if( %ctrl.bitmap !$= "" ) %file = %ctrl.bitmap; else - %file = "tools/materialeditor/gui/unknownImage"; + %file = "tools/materialEditor/gui/unknownImage"; } %file = makeRelativePath( %file, getMainDotCsDir() ); @@ -262,7 +262,7 @@ function TerrainMaterialDlg::changeMacro( %this ) if( %ctrl.bitmap !$= "" ) %file = %ctrl.bitmap; else - %file = "tools/materialeditor/gui/unknownImage"; + %file = "tools/materialEditor/gui/unknownImage"; } %file = makeRelativePath( %file, getMainDotCsDir() ); @@ -285,7 +285,7 @@ function TerrainMaterialDlg::changeNormal( %this ) if( %ctrl.bitmap !$= "" ) %file = %ctrl.bitmap; else - %file = "tools/materialeditor/gui/unknownImage"; + %file = "tools/materialEditor/gui/unknownImage"; } %file = makeRelativePath( %file, getMainDotCsDir() ); @@ -376,22 +376,22 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat ) %this-->matNameCtrl.setText( %mat.internalName ); if (%mat.diffuseMap $= ""){ - %this-->baseTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" ); + %this-->baseTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" ); }else{ %this-->baseTexCtrl.setBitmap( %mat.diffuseMap ); } if (%mat.detailMap $= ""){ - %this-->detailTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" ); + %this-->detailTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" ); }else{ %this-->detailTexCtrl.setBitmap( %mat.detailMap ); } if (%mat.macroMap $= ""){ - %this-->macroTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" ); + %this-->macroTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" ); }else{ %this-->macroTexCtrl.setBitmap( %mat.macroMap ); } if (%mat.normalMap $= ""){ - %this-->normTexCtrl.setBitmap( "tools/materialeditor/gui/unknownImage" ); + %this-->normTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" ); }else{ %this-->normTexCtrl.setBitmap( %mat.normalMap ); } @@ -428,22 +428,22 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat ) %newName = %this-->matNameCtrl.getText(); - if (%this-->baseTexCtrl.bitmap $= "tools/materialeditor/gui/unknownImage"){ + if (%this-->baseTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){ %newDiffuse = ""; }else{ %newDiffuse = %this-->baseTexCtrl.bitmap; } - if (%this-->normTexCtrl.bitmap $= "tools/materialeditor/gui/unknownImage"){ + if (%this-->normTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){ %newNormal = ""; }else{ %newNormal = %this-->normTexCtrl.bitmap; } - if (%this-->detailTexCtrl.bitmap $= "tools/materialeditor/gui/unknownImage"){ + if (%this-->detailTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){ %newDetail = ""; }else{ %newDetail = %this-->detailTexCtrl.bitmap; } - if (%this-->macroTexCtrl.bitmap $= "tools/materialeditor/gui/unknownImage"){ + if (%this-->macroTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){ %newMacro = ""; }else{ %newMacro = %this-->macroTexCtrl.bitmap; diff --git a/Templates/Empty/game/tools/worldEditor/scripts/menuHandlers.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/menuHandlers.ed.cs index 8ee4f27ff..61f214151 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/menuHandlers.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/menuHandlers.ed.cs @@ -485,6 +485,7 @@ function EditorOpenMission(%filename) function EditorExportToCollada() { + %dlg = new SaveFileDialog() { Filters = "COLLADA Files (*.dae)|*.dae|"; @@ -517,6 +518,7 @@ function EditorExportToCollada() function EditorMakePrefab() { + %dlg = new SaveFileDialog() { Filters = "Prefab Files (*.prefab)|*.prefab|"; @@ -768,6 +770,15 @@ function EditorCameraSpeedMenu::setupGuiControls(%this) // Set up min/max camera slider range eval("CameraSpeedDropdownCtrlContainer-->Slider.range = \"" @ %minSpeed @ " " @ %maxSpeed @ "\";"); } + +////////////////////////////////////////////////////////////////////////// +// Tools Menu Handler +////////////////////////////////////////////////////////////////////////// +function EditorUtilitiesMenu::onSelectItem(%this, %id, %text) +{ + return Parent::onSelectItem(%this, %id, %text); +} + ////////////////////////////////////////////////////////////////////////// // World Menu Handler Object Menu ////////////////////////////////////////////////////////////////////////// diff --git a/Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs b/Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs index 1e378ae11..0916a0065 100644 --- a/Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs +++ b/Templates/Empty/game/tools/worldEditor/scripts/menus.ed.cs @@ -252,6 +252,19 @@ function EditorGui::buildMenus(%this) // last menu items in EditorLightingMenu::onAdd(). }; %this.menuBar.insert(%lightingMenu, %this.menuBar.getCount()); + + // Tools Menu + %toolsMenu = new PopupMenu() + { + superClass = "MenuBuilder"; + class = "EditorUtilitiesMenu"; + + barTitle = "Tools"; + + item[0] = "Network Graph" TAB "n" TAB "toggleNetGraph();"; + item[1] = "Profiler" TAB "ctrl F2" TAB "showMetrics(true);"; + }; + %this.menuBar.insert(%toolsMenu, %this.menuBar.getCount()); // Help Menu %helpMenu = new PopupMenu()