From e5c12f4aabd6b5e6a997eab3b70ad01d193b3938 Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 17 Jun 2019 23:48:20 -0500 Subject: [PATCH] Reduce console spam from probe manager when not in debug Added ability to activate height override on inspector fields from script Further refinements of theme usage as well as editor settings --- Engine/source/gui/editor/inspector/field.cpp | 27 +++ Engine/source/gui/editor/inspector/field.h | 2 + .../source/renderInstance/renderProbeMgr.cpp | 4 + .../tools/gui/EditorSettingsWindow.ed.gui | 4 +- .../game/tools/gui/editorSettingsWindow.ed.cs | 87 ++++++++- Templates/BaseGame/game/tools/settings.xml | 174 +++++++++--------- .../tools/worldEditor/scripts/EditorGui.ed.cs | 4 +- 7 files changed, 204 insertions(+), 98 deletions(-) diff --git a/Engine/source/gui/editor/inspector/field.cpp b/Engine/source/gui/editor/inspector/field.cpp index 02046f7a9..ccbb2f55f 100644 --- a/Engine/source/gui/editor/inspector/field.cpp +++ b/Engine/source/gui/editor/inspector/field.cpp @@ -690,6 +690,28 @@ void GuiInspectorField::_setFieldDocs( StringTableEntry docs ) } } +void GuiInspectorField::setHeightOverride(bool useOverride, U32 heightOverride) +{ + mUseHeightOverride = useOverride; + + if (useOverride) + mHeightOverride = heightOverride; + + S32 fieldHeight = 18; + + if (mUseHeightOverride) + fieldHeight = mHeightOverride; + + RectI bnds = getBounds(); + setBounds(bnds.point.x, bnds.point.y, bnds.extent.x, fieldHeight); + + // Calculate Caption and EditCtrl Rects + updateRects(); + + // Force our editField to set it's value + updateValue(); +} + //============================================================================= // Console Methods. //============================================================================= @@ -749,6 +771,11 @@ DefineEngineMethod(GuiInspectorField, setCaption, void, (String newCaption),, "( object->setCaption(StringTable->insert(newCaption.c_str())); } +DefineEngineMethod(GuiInspectorField, setHeightOverride, void, (bool useOverride, U32 heightOverride), , "") +{ + object->setHeightOverride(useOverride, heightOverride); +} + DefineEngineMethod(GuiInspectorField, setEditControl, void, (GuiControl* editCtrl), (nullAsType()), "() - Reset to default value.") { object->setEditControl(editCtrl); diff --git a/Engine/source/gui/editor/inspector/field.h b/Engine/source/gui/editor/inspector/field.h index 3df9f5ece..676269f75 100644 --- a/Engine/source/gui/editor/inspector/field.h +++ b/Engine/source/gui/editor/inspector/field.h @@ -132,6 +132,8 @@ class GuiInspectorField : public GuiControl void setEditControl(GuiControl* editCtrl); + void setHeightOverride(bool useOverride, U32 heightOverride); + virtual void setDocs(String docs) { mFieldDocs = docs; } /// Returns pointer to this InspectorField's edit ctrl. diff --git a/Engine/source/renderInstance/renderProbeMgr.cpp b/Engine/source/renderInstance/renderProbeMgr.cpp index 0b7186f1b..c8b590527 100644 --- a/Engine/source/renderInstance/renderProbeMgr.cpp +++ b/Engine/source/renderInstance/renderProbeMgr.cpp @@ -358,7 +358,9 @@ ProbeRenderInst* RenderProbeMgr::registerProbe() mCubeMapSlots[cubeIndex] = true; mCubeMapCount++; +#ifdef TORQUE_DEBUG Con::warnf("RenderProbeMgr::registerProbe: Registered probe %u to cubeIndex %u", newProbe.mProbeIdx, cubeIndex); +#endif mProbesDirty = true; @@ -495,8 +497,10 @@ void RenderProbeMgr::updateProbeTexture(ProbeRenderInst* probeInfo) mIrradianceArray->updateTexture(probeInfo->mIrradianceCubemap, cubeIndex); mPrefilterArray->updateTexture(probeInfo->mPrefilterCubemap, cubeIndex); +#ifdef TORQUE_DEBUG Con::warnf("UpdatedProbeTexture - probeIdx: %u on cubeIndex %u, Irrad validity: %d, Prefilter validity: %d", probeInfo->mProbeIdx, cubeIndex, probeInfo->mIrradianceCubemap->isInitialized(), probeInfo->mPrefilterCubemap->isInitialized()); +#endif } void RenderProbeMgr::_setupPerFrameParameters(const SceneRenderState *state) diff --git a/Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui b/Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui index 12189376d..1aa190e51 100644 --- a/Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui +++ b/Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui @@ -64,7 +64,7 @@ minExtent = "64 64"; horizSizing = "width"; vertSizing = "bottom"; - profile = "GuiDefaultProfile"; + profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -86,7 +86,7 @@ minExtent = "16 16"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiDefaultProfile"; + profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs index ba15100ee..fd7d40a1b 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs @@ -56,7 +56,7 @@ function ESettingsWindow::hideDialog( %this ) function ESettingsWindow::ToggleVisibility() { - if ( ESettingsWindow.visible ) + if ( ESettingsWindow.visible ) { ESettingsWindow.setVisible(false); } @@ -65,6 +65,8 @@ function ESettingsWindow::ToggleVisibility() ESettingsWindow.setVisible(true); ESettingsWindow.selectWindow(); ESettingsWindow.setCollapseGroup(false); + + ESettingsWindowList.clear(); } ESettingsWindowList.setSelectedById( 1 ); @@ -82,10 +84,10 @@ function ESettingsWindow::toggleProjectSettings(%this) } ESettingsWindowList.sort(0); - ESettingsWindowList.setSelectedById( 1 ); - %this.mode = "Project"; ESettingsWindow.text = "Game Project Settings"; + + ESettingsWindowList.setSelectedById( 1 ); } function ESettingsWindow::toggleEditorSettings(%this) @@ -100,10 +102,10 @@ function ESettingsWindow::toggleEditorSettings(%this) } ESettingsWindowList.sort(0); - ESettingsWindowList.setSelectedById( 1 ); - %this.mode = "Editor"; ESettingsWindow.text = "Editor Settings"; + + ESettingsWindowList.setSelectedById( 1 ); } function ESettingsWindow::addEditorSettingsPage(%this, %settingsPageName, %settingsPageText) @@ -161,6 +163,77 @@ function SettingsInspector::changeEditorSetting(%this, %varName, %value) %success = ProjectSettings.write(); } +function GuiInspectorVariableGroup::buildOptionsSettingField(%this, %fieldName, %fieldLabel, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %ownerObj) +{ + %extent = 200; + + %fieldCtrl = %this.createInspectorField(); + + %fieldCtrl.setHeightOverride(true, 200); + + %extent = %this.stack.getExtent(); + + %width = mRound(%extent/2); + %height = 20; + %inset = 10; + + %editControl = new GuiPopUpMenuCtrl() { + class = "guiInspectorListField"; + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + maxLength = "1024"; + Margin = "0 0 0 0"; + Padding = "0 0 0 0"; + AnchorTop = "1"; + AnchorBottom = "0"; + AnchorLeft = "1"; + AnchorRight = "0"; + isContainer = "0"; + Profile = "ToolsGuiPopUpMenuProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + Position = %fieldCtrl.edit.position; + Extent = %fieldCtrl.edit.extent; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "ToolsGuiToolTipProfile"; + tooltip = %tooltip; + text = %fieldDefaultVal; + hovertime = "1000"; + ownerObject = %ownerObj; + fieldName = %fieldName; + }; + + //set the field value + if(getSubStr(%this.fieldName, 0, 1) $= "$") + { + if(%fieldName $= "") + %editControl.setText(%fieldName); + } + else + { + //regular variable + %setCommand = %editControl @ ".setText(" @ %ownerObj @ "." @ %fieldName @ ");"; + eval(%setCommand); + } + + %listCount = getTokenCount(%fieldDataVals, ","); + + for(%i=0; %i < %listCount; %i++) + { + %entryText = getToken(%fieldDataVals, ",", %i); + %editControl.add(%entryText); + } + + %fieldCtrl.setCaption(%fieldLabel); + %fieldCtrl.setEditControl(%editControl); + + %this.addInspectorField(%fieldCtrl); +} + // // COMMON EDITOR SETTINGS // @@ -345,7 +418,7 @@ function ESettingsWindow::getGameplaySettings(%this) function ESettingsWindow::getGameOptionsSettings(%this) { - SettingsInspector.startGroup("Game Modes"); - SettingsInspector.addSettingsField("Gameplay/GameModes/defaultModeName", "Default Gamemode Name", "string", ""); + SettingsInspector.startGroup("Options Settings"); + SettingsInspector.addSettingsField("Options/optionsList", "OptionsList", "OptionsSetting", ""); SettingsInspector.endGroup(); } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/settings.xml b/Templates/BaseGame/game/tools/settings.xml index 42ff2e063..18cd9e3ec 100644 --- a/Templates/BaseGame/game/tools/settings.xml +++ b/Templates/BaseGame/game/tools/settings.xml @@ -2,141 +2,141 @@ 72 70 68 255 - 234 232 230 255 - 100 98 96 255 - 96 94 92 255 - 59 58 57 255 - 50 49 48 255 - 72 70 68 255 - 50 49 48 255 - 240 240 240 255 - 59 58 57 255 236 234 232 255 - 50 49 48 255 - 37 36 35 255 - 178 175 172 255 - 43 43 43 255 - 17 16 15 255 + 59 58 57 255 + 72 70 68 255 255 255 255 255 + 178 175 172 255 32 31 30 255 + 50 49 48 255 + 17 16 15 255 + 59 58 57 255 + 43 43 43 255 + 240 240 240 255 + 100 98 96 255 + 37 36 35 255 + 96 94 92 255 + 234 232 230 255 + 50 49 48 255 + 50 49 48 255 - tools/gui 1024 768 - - http://www.garagegames.com/products/torque-3d/documentation/user - ../../../Documentation/Torque 3D - Script Manual.chm - ../../../Documentation/Official Documentation.html - - - 1 - 2 - 8 - 1 - 1 - 1 - 0 - 1 - - - 1 - 1 - + tools/gui - 0 0 0 + 0 - - Categorized + + ../../../Documentation/Official Documentation.html + http://www.garagegames.com/products/torque-3d/documentation/user + ../../../Documentation/Torque 3D - Script Manual.chm 0 + + 0 + 1 + 1 + 2 + 1 + 1 + 1 + 8 + + + 1 + 1 + + + Categorized + - 0 - 1 - 0.8 - 100 - 0.8 15 + 0.8 0 + 100 + 0 + 0.8 + 1 - 0 - 0 - 0 - 500 10 10 10 + 500 255 255 255 20 + 0 + 0 + 0 - 0 50 - AssetWork_Debug.exe - 40 - screenCenter 6 - 1 + 0 + screenCenter + 40 WorldEditorInspectorPlugin - - 255 255 0 255 - 255 0 0 255 - 255 255 255 255 - 255 255 0 255 - 0 0 255 255 - 0 255 0 255 - 100 100 100 255 - + AssetWork_Debug.exe + 1 1 + 1 + 0 + 0 100 0 - 0 - 0 - 1 2 + + 0 255 0 255 + 255 255 0 255 + 255 255 255 255 + 255 0 0 255 + 100 100 100 255 + 0 0 255 255 + 255 255 0 255 + + + 0 + 51 51 51 100 + 102 102 102 100 + 1 + 255 255 255 100 + + + http://www.garagegames.com/products/torque-3d/documentation/user + ../../../Documentation/Official Documentation.html + http://www.garagegames.com/products/torque-3d/forums + ../../../Documentation/Torque 3D - Script Manual.chm + - 1 0 255 20 8 + 1 + + + 1 + 1 + 1 + 1 + 1 - 50 50 50 255 - 215 215 215 255 - 48 48 48 255 255 255 255 255 + 48 48 48 255 + 50 50 50 255 180 180 180 255 + 215 215 215 255 tools/worldEditor/images/DefaultHandle tools/worldEditor/images/SelectHandle tools/worldEditor/images/LockedHandle - - 1 - 1 - 1 - 1 - 1 - - - 51 51 51 100 - 0 - 255 255 255 100 - 1 - 102 102 102 100 - - - ../../../Documentation/Official Documentation.html - ../../../Documentation/Torque 3D - Script Manual.chm - http://www.garagegames.com/products/torque-3d/documentation/user - http://www.garagegames.com/products/torque-3d/forums - AIPlayer diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs index 8b34e7942..d7598eedf 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs @@ -147,7 +147,7 @@ function EditorGui::init(%this) ESettingsWindow.setVisible(false); // Start the standard settings tabs pages - exec( "~/worldEditor/gui/GeneralSettingsTab.ed.gui" ); + /*exec( "~/worldEditor/gui/GeneralSettingsTab.ed.gui" ); ESettingsWindow.addTabPage( EGeneralSettingsPage ); exec("~/worldEditor/gui/ObjectEditorSettingsTab.ed.gui"); ESettingsWindow.addTabPage( EObjectEditorSettingsPage ); @@ -156,7 +156,7 @@ function EditorGui::init(%this) exec("~/worldEditor/gui/TerrainEditorSettingsTab.ed.gui"); ESettingsWindow.addTabPage( ETerrainEditorSettingsPage ); exec("~/worldEditor/gui/CameraSettingsTab.ed.gui"); - ESettingsWindow.addTabPage( ECameraSettingsPage ); + ESettingsWindow.addTabPage( ECameraSettingsPage );*/ } // Object Snap Options Window