Browse Source

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

Areloch 6 years ago
parent
commit
e5c12f4aab

+ 27 - 0
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<GuiControl*>()), "() - Reset to default value.")
 {
    object->setEditControl(editCtrl);

+ 2 - 0
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.

+ 4 - 0
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)

+ 2 - 2
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";

+ 80 - 7
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();
 } 

+ 77 - 77
Templates/BaseGame/game/tools/settings.xml

@@ -2,141 +2,141 @@
 <EditorSettings>
     <Group name="Theme">
         <Setting name="tooltipDividerColor">72 70 68 255</Setting>
-        <Setting name="fieldTextHLColor">234 232 230 255</Setting>
-        <Setting name="fieldBGSELColor">100 98 96 255</Setting>
-        <Setting name="dividerLightColor">96 94 92 255</Setting>
+        <Setting name="headerTextColor">236 234 232 255</Setting>
         <Setting name="tabsSELColor">59 58 57 255</Setting>
-        <Setting name="headerColor">50 49 48 255</Setting>
         <Setting name="fieldBGHLColor">72 70 68 255</Setting>
-        <Setting name="tabsHLColor">50 49 48 255</Setting>
-        <Setting name="fieldTextSELColor">240 240 240 255</Setting>
-        <Setting name="fieldBGColor">59 58 57 255</Setting>
-        <Setting name="headerTextColor">236 234 232 255</Setting>
-        <Setting name="dividerMidColor">50 49 48 255</Setting>
-        <Setting name="tabsColor">37 36 35 255</Setting>
-        <Setting name="fieldTextColor">178 175 172 255</Setting>
-        <Setting name="tooltipBGColor">43 43 43 255</Setting>
-        <Setting name="dividerDarkColor">17 16 15 255</Setting>
         <Setting name="tooltipTextColor">255 255 255 255</Setting>
+        <Setting name="fieldTextColor">178 175 172 255</Setting>
         <Setting name="windowBackgroundColor">32 31 30 255</Setting>
+        <Setting name="headerColor">50 49 48 255</Setting>
+        <Setting name="dividerDarkColor">17 16 15 255</Setting>
+        <Setting name="fieldBGColor">59 58 57 255</Setting>
+        <Setting name="tooltipBGColor">43 43 43 255</Setting>
+        <Setting name="fieldTextSELColor">240 240 240 255</Setting>
+        <Setting name="fieldBGSELColor">100 98 96 255</Setting>
+        <Setting name="tabsColor">37 36 35 255</Setting>
+        <Setting name="dividerLightColor">96 94 92 255</Setting>
+        <Setting name="fieldTextHLColor">234 232 230 255</Setting>
+        <Setting name="tabsHLColor">50 49 48 255</Setting>
+        <Setting name="dividerMidColor">50 49 48 255</Setting>
     </Group>
     <Group name="GuiEditor">
-        <Setting name="lastPath">tools/gui</Setting>
         <Setting name="previewResolution">1024 768</Setting>
+        <Setting name="lastPath">tools/gui</Setting>
+        <Group name="EngineDevelopment">
+            <Setting name="showEditorProfiles">0</Setting>
+            <Setting name="toggleIntoEditor">0</Setting>
+            <Setting name="showEditorGuis">0</Setting>
+        </Group>
         <Group name="Help">
+            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
             <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
             <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
-            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
+        </Group>
+        <Group name="Selection">
+            <Setting name="fullBox">0</Setting>
         </Group>
         <Group name="Snapping">
+            <Setting name="snap2Grid">0</Setting>
+            <Setting name="snapToCanvas">1</Setting>
             <Setting name="snapToGuides">1</Setting>
             <Setting name="sensitivity">2</Setting>
-            <Setting name="snap2GridSize">8</Setting>
+            <Setting name="snapToEdges">1</Setting>
             <Setting name="snapToCenters">1</Setting>
             <Setting name="snapToControls">1</Setting>
-            <Setting name="snapToEdges">1</Setting>
-            <Setting name="snap2Grid">0</Setting>
-            <Setting name="snapToCanvas">1</Setting>
+            <Setting name="snap2GridSize">8</Setting>
         </Group>
         <Group name="Rendering">
-            <Setting name="drawGuides">1</Setting>
             <Setting name="drawBorderLines">1</Setting>
-        </Group>
-        <Group name="EngineDevelopment">
-            <Setting name="showEditorGuis">0</Setting>
-            <Setting name="showEditorProfiles">0</Setting>
-            <Setting name="toggleIntoEditor">0</Setting>
+            <Setting name="drawGuides">1</Setting>
         </Group>
         <Group name="Library">
             <Setting name="viewType">Categorized</Setting>
         </Group>
-        <Group name="Selection">
-            <Setting name="fullBox">0</Setting>
-        </Group>
     </Group>
     <Group name="AxisGizmo">
-        <Setting name="snapRotations">0</Setting>
-        <Setting name="renderInfoText">1</Setting>
+        <Setting name="rotationSnap">15</Setting>
         <Setting name="mouseRotateScalar">0.8</Setting>
+        <Setting name="renderWhenUsed">0</Setting>
         <Setting name="axisGizmoMaxScreenLen">100</Setting>
+        <Setting name="snapRotations">0</Setting>
         <Setting name="mouseScaleScalar">0.8</Setting>
-        <Setting name="rotationSnap">15</Setting>
-        <Setting name="renderWhenUsed">0</Setting>
+        <Setting name="renderInfoText">1</Setting>
         <Group name="Grid">
-            <Setting name="snapToGrid">0</Setting>
-            <Setting name="renderPlane">0</Setting>
-            <Setting name="renderPlaneHashes">0</Setting>
-            <Setting name="planeDim">500</Setting>
             <Setting name="gridSize">10 10 10</Setting>
+            <Setting name="planeDim">500</Setting>
             <Setting name="gridColor">255 255 255 20</Setting>
+            <Setting name="renderPlaneHashes">0</Setting>
+            <Setting name="renderPlane">0</Setting>
+            <Setting name="snapToGrid">0</Setting>
         </Group>
     </Group>
     <Group name="WorldEditor">
-        <Setting name="forceLoadDAE">0</Setting>
         <Setting name="orthoFOV">50</Setting>
-        <Setting name="torsionPath">AssetWork_Debug.exe</Setting>
-        <Setting name="undoLimit">40</Setting>
-        <Setting name="dropType">screenCenter</Setting>
         <Setting name="displayType">6</Setting>
-        <Setting name="orthoShowGrid">1</Setting>
+        <Setting name="forceLoadDAE">0</Setting>
+        <Setting name="dropType">screenCenter</Setting>
+        <Setting name="undoLimit">40</Setting>
         <Setting name="currentEditor">WorldEditorInspectorPlugin</Setting>
-        <Group name="Color">
-            <Setting name="selectionBoxColor">255 255 0 255</Setting>
-            <Setting name="objSelectColor">255 0 0 255</Setting>
-            <Setting name="objectTextColor">255 255 255 255</Setting>
-            <Setting name="dragRectColor">255 255 0 255</Setting>
-            <Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
-            <Setting name="objMouseOverColor">0 255 0 255</Setting>
-            <Setting name="popupBackgroundColor">100 100 100 255</Setting>
-        </Group>
+        <Setting name="torsionPath">AssetWork_Debug.exe</Setting>
+        <Setting name="orthoShowGrid">1</Setting>
         <Group name="Tools">
             <Setting name="objectsUseBoxCenter">1</Setting>
+            <Setting name="dropAtScreenCenterScalar">1</Setting>
+            <Setting name="snapGround">0</Setting>
+            <Setting name="snapSoft">0</Setting>
             <Setting name="dropAtScreenCenterMax">100</Setting>
             <Setting name="boundingBoxCollision">0</Setting>
-            <Setting name="snapSoft">0</Setting>
-            <Setting name="snapGround">0</Setting>
-            <Setting name="dropAtScreenCenterScalar">1</Setting>
             <Setting name="snapSoftSize">2</Setting>
         </Group>
+        <Group name="Color">
+            <Setting name="objMouseOverColor">0 255 0 255</Setting>
+            <Setting name="selectionBoxColor">255 255 0 255</Setting>
+            <Setting name="objectTextColor">255 255 255 255</Setting>
+            <Setting name="objSelectColor">255 0 0 255</Setting>
+            <Setting name="popupBackgroundColor">100 100 100 255</Setting>
+            <Setting name="objMouseOverSelectColor">0 0 255 255</Setting>
+            <Setting name="dragRectColor">255 255 0 255</Setting>
+        </Group>
+        <Group name="Grid">
+            <Setting name="gridSnap">0</Setting>
+            <Setting name="gridMinorColor">51 51 51 100</Setting>
+            <Setting name="gridColor">102 102 102 100</Setting>
+            <Setting name="gridSize">1</Setting>
+            <Setting name="gridOriginColor">255 255 255 100</Setting>
+        </Group>
+        <Group name="Docs">
+            <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
+            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
+            <Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
+            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
+        </Group>
         <Group name="ObjectIcons">
-            <Setting name="fadeIcons">1</Setting>
             <Setting name="fadeIconsEndAlpha">0</Setting>
             <Setting name="fadeIconsStartAlpha">255</Setting>
             <Setting name="fadeIconsEndDist">20</Setting>
             <Setting name="fadeIconsStartDist">8</Setting>
+            <Setting name="fadeIcons">1</Setting>
+        </Group>
+        <Group name="Render">
+            <Setting name="renderObjHandle">1</Setting>
+            <Setting name="renderObjText">1</Setting>
+            <Setting name="showMousePopupInfo">1</Setting>
+            <Setting name="renderSelectionBox">1</Setting>
+            <Setting name="renderPopupBackground">1</Setting>
         </Group>
         <Group name="Theme">
-            <Setting name="windowTitleBGColor">50 50 50 255</Setting>
-            <Setting name="windowTitleFontColor">215 215 215 255</Setting>
-            <Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
             <Setting name="windowTitleFontHLColor">255 255 255 255</Setting>
+            <Setting name="windowTitleBGHLColor">48 48 48 255</Setting>
+            <Setting name="windowTitleBGColor">50 50 50 255</Setting>
             <Setting name="windowTitleBGNAColor">180 180 180 255</Setting>
+            <Setting name="windowTitleFontColor">215 215 215 255</Setting>
         </Group>
         <Group name="Images">
             <Setting name="defaultHandle">tools/worldEditor/images/DefaultHandle</Setting>
             <Setting name="selectHandle">tools/worldEditor/images/SelectHandle</Setting>
             <Setting name="lockedHandle">tools/worldEditor/images/LockedHandle</Setting>
         </Group>
-        <Group name="Render">
-            <Setting name="renderObjText">1</Setting>
-            <Setting name="showMousePopupInfo">1</Setting>
-            <Setting name="renderPopupBackground">1</Setting>
-            <Setting name="renderObjHandle">1</Setting>
-            <Setting name="renderSelectionBox">1</Setting>
-        </Group>
-        <Group name="Grid">
-            <Setting name="gridMinorColor">51 51 51 100</Setting>
-            <Setting name="gridSnap">0</Setting>
-            <Setting name="gridOriginColor">255 255 255 100</Setting>
-            <Setting name="gridSize">1</Setting>
-            <Setting name="gridColor">102 102 102 100</Setting>
-        </Group>
-        <Group name="Docs">
-            <Setting name="documentationLocal">../../../Documentation/Official Documentation.html</Setting>
-            <Setting name="documentationReference">../../../Documentation/Torque 3D - Script Manual.chm</Setting>
-            <Setting name="documentationURL">http://www.garagegames.com/products/torque-3d/documentation/user</Setting>
-            <Setting name="forumURL">http://www.garagegames.com/products/torque-3d/forums</Setting>
-        </Group>
     </Group>
     <Group name="NavEditor">
         <Setting name="SpawnClass">AIPlayer</Setting>

+ 2 - 2
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