mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
Added refactor of Editor Settings window
Various fixes for asset handling. WIP of crash tracking
This commit is contained in:
parent
691d3f501e
commit
ff871f37e3
30 changed files with 662 additions and 273 deletions
201
Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui
Normal file
201
Templates/BaseGame/game/tools/gui/EditorSettingsWindow.ed.gui
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
%guiContent = new GuiControl(EditorSettingsWindow,EditorGuiGroup) {
|
||||
position = "0 0";
|
||||
extent = "1024 768";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
|
||||
new GuiWindowCollapseCtrl(ESettingsWindow) {
|
||||
text = "Editor Settings";
|
||||
resizeWidth = "0";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
canCollapse = "1";
|
||||
closeCommand = "ESettingsWindow.hideDialog();";
|
||||
edgeSnap = "1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "34 48";
|
||||
extent = "958 671";
|
||||
minExtent = "319 100";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiWindowProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "EditorSettingsWindow";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiSplitContainer() {
|
||||
orientation = "Vertical";
|
||||
splitterSize = "2";
|
||||
splitPoint = "182 100";
|
||||
fixedPanel = "None";
|
||||
fixedSize = "100";
|
||||
docking = "None";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 24";
|
||||
extent = "958 647";
|
||||
minExtent = "64 64";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiPanel() {
|
||||
docking = "Client";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "0 0";
|
||||
extent = "180 647";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "GuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "Panel1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
lockHorizScroll = "0";
|
||||
lockVertScroll = "0";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
mouseWheelScrollSpeed = "-1";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "3 3";
|
||||
extent = "177 643";
|
||||
minExtent = "100 50";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "ToolsGuiScrollProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiTextListCtrl(ESettingsWindowList) {
|
||||
columns = "0";
|
||||
fitParentWidth = "0";
|
||||
clipColumnText = "0";
|
||||
position = "1 1";
|
||||
extent = "9 2";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "ToolsGuiListBoxProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
new GuiPanel() {
|
||||
docking = "Client";
|
||||
margin = "0 0 0 0";
|
||||
padding = "0 0 0 0";
|
||||
anchorTop = "1";
|
||||
anchorBottom = "0";
|
||||
anchorLeft = "1";
|
||||
anchorRight = "0";
|
||||
position = "184 0";
|
||||
extent = "774 647";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiDefaultProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
internalName = "panel2";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiVariableInspector(SettingsInspector) {
|
||||
dividerMargin = "5";
|
||||
showCustomFields = "1";
|
||||
stackingType = "Vertical";
|
||||
horizStacking = "Left to Right";
|
||||
vertStacking = "Top to Bottom";
|
||||
padding = "1";
|
||||
dynamicSize = "1";
|
||||
dynamicNonStackExtent = "0";
|
||||
dynamicPos = "0";
|
||||
changeChildSizeToFit = "1";
|
||||
changeChildPosition = "1";
|
||||
position = "0 0";
|
||||
extent = "773 643";
|
||||
minExtent = "16 16";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
profile = "GuiInspectorProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
202
Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs
Normal file
202
Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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 ESettingsWindow::startup( %this )
|
||||
{
|
||||
}
|
||||
|
||||
function ESettingsWindow::onWake( %this )
|
||||
{
|
||||
new ArrayObject(SettingsPageList);
|
||||
%this.addSettingsPage("Axis", "Axis Gizmo");
|
||||
%this.addSettingsPage("General", "General Settings");
|
||||
%this.addSettingsPage("Camera", "Camera Settings");
|
||||
%this.addSettingsPage("SceneEditor", "Scene Editor");
|
||||
%this.addSettingsPage("ShapeEditor", "Shape Editor");
|
||||
%this.addSettingsPage("NavEditor", "Navigation Editor");
|
||||
|
||||
ESettingsWindowList.setSelectedById( 1 );
|
||||
}
|
||||
|
||||
function ESettingsWindow::hideDialog( %this )
|
||||
{
|
||||
%this.setVisible(false);
|
||||
}
|
||||
|
||||
function ESettingsWindow::ToggleVisibility()
|
||||
{
|
||||
if ( ESettingsWindow.visible )
|
||||
{
|
||||
ESettingsWindow.setVisible(false);
|
||||
EditorSettings.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
ESettingsWindow.setVisible(true);
|
||||
ESettingsWindow.selectWindow();
|
||||
ESettingsWindow.setCollapseGroup(false);
|
||||
}
|
||||
|
||||
ESettingsWindowList.setSelectedById( 1 );
|
||||
}
|
||||
|
||||
/*function ESettingsWindow::addTabPage( %this, %page )
|
||||
{
|
||||
ESettingsWindowTabBook.add( %page );
|
||||
ESettingsWindowList.addRow( ESettingsWindowTabBook.getSelectedPage(), %page.text );
|
||||
ESettingsWindowList.sort(0);
|
||||
}*/
|
||||
|
||||
function ESettingsWindow::addSettingsPage(%this, %settingsPageName, %settingsPageText)
|
||||
{
|
||||
SettingsPageList.add(%settingsPageName, %settingsPageText);
|
||||
|
||||
ESettingsWindowList.addRow( SettingsPageList.count(), %settingsPageText );
|
||||
ESettingsWindowList.sort(0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function ESettingsWindowList::onSelect( %this, %id, %text )
|
||||
{
|
||||
SettingsInspector.clearFields();
|
||||
%pageName = SettingsPageList.getKey(SettingsPageList.getIndexFromValue(%text));
|
||||
eval("ESettingsWindow.get" @ %pageName @ "Settings();");
|
||||
}
|
||||
|
||||
function ESettingsWindow::getAxisSettings(%this)
|
||||
{
|
||||
SettingsInspector.startGroup("Gizmo");
|
||||
SettingsInspector.addSettingsField("AxisGizmo/mouseRotateScalar", "Rotate Scalar", "float", "");
|
||||
SettingsInspector.addSettingsField("AxisGizmo/mouseScaleScalar", "Scale Scalar", "float", "");
|
||||
SettingsInspector.addSettingsField("AxisGizmo/renderWhenUsed", "Render When Manipulated", "bool", "");
|
||||
SettingsInspector.addSettingsField("AxisGizmo/renderInfoText", "Render Tool Text", "bool", "");
|
||||
SettingsInspector.endGroup();
|
||||
|
||||
SettingsInspector.startGroup("Grid");
|
||||
SettingsInspector.addSettingsField("AxisGizmo/Grid/renderPlane", "Render Plane", "bool", "");
|
||||
SettingsInspector.addSettingsField("AxisGizmo/Grid/renderPlaneHashes", "Render Plane Hashes", "bool", "");
|
||||
SettingsInspector.addSettingsField("AxisGizmo/Grid/planeDim", "Plane Size", "float", "");
|
||||
SettingsInspector.addSettingsField("AxisGizmo/Grid/gridColor", "Plane Color", "colorI", "");
|
||||
SettingsInspector.endGroup();
|
||||
}
|
||||
|
||||
function ESettingsWindow::getGeneralSettings(%this)
|
||||
{
|
||||
SettingsInspector.startGroup("Paths");
|
||||
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "New Level", "filename", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/torsionPath", "Torsion Path", "filename", "");
|
||||
SettingsInspector.endGroup();
|
||||
|
||||
SettingsInspector.startGroup("Theme");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Theme/backgroundColor", "Background Color", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Theme/windowTitleBGColor", "Window Title Color", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Theme/windowTitleFontColor", "Window Title Text Color", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Theme/mainTextColor", "Main Text Color", "colorI", "");
|
||||
SettingsInspector.endGroup();
|
||||
}
|
||||
|
||||
function ESettingsWindow::getCameraSettings(%this)
|
||||
{
|
||||
SettingsInspector.startGroup("Mouse Control");
|
||||
SettingsInspector.addSettingsField("Camera/invertYAxis", "Invert Y Axis", "bool", "");
|
||||
SettingsInspector.addSettingsField("Camera/invertXAxis", "Invert X Axis", "bool", "");
|
||||
SettingsInspector.endGroup();
|
||||
|
||||
//Based on currently loaded level(rootScene)
|
||||
SettingsInspector.startGroup(EditorSettings.value("WorldEditor/newLevelFile") @ " Camera");
|
||||
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "Camera Speed Min", "float", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/torsionPath", "Camera Speed Max", "200", "");
|
||||
SettingsInspector.endGroup();
|
||||
}
|
||||
|
||||
function ESettingsWindow::getNavEditorSettings(%this)
|
||||
{
|
||||
SettingsInspector.startGroup("Test Spawn");
|
||||
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "Spawn Class", "list", "", "AIPlayer");
|
||||
SettingsInspector.addSettingsField("WorldEditor/torsionPath", "Datablock", "string", "");
|
||||
SettingsInspector.endGroup();
|
||||
|
||||
SettingsInspector.startGroup("Colors");
|
||||
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "Hover Spline", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/torsionPath", "Select Spline", "colorI", "");
|
||||
SettingsInspector.endGroup();
|
||||
}
|
||||
|
||||
function ESettingsWindow::getSceneEditorSettings(%this)
|
||||
{
|
||||
SettingsInspector.startGroup("Render");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Render/renderObjHandle", "Object Icons", "bool", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Render/renderObjText", "Object Text", "bool", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Render/showMousePopupInfo", "Mouse Popup Info", "bool", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Render/renderPopupBackground", "Popup Menu Background", "bool", "");
|
||||
SettingsInspector.endGroup();
|
||||
|
||||
SettingsInspector.startGroup("Colors");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Grid/gridColor", "Grid Major", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Grid/gridMinorColor", "Grid Minor", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Grid/gridOriginColor", "Grid Origin", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Color/dragRectColor", "Drag Rect", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Color/objectTextColor", "Object Text", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Color/popupTextColor", "Popup Text", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Color/popupBackgroundColor", "Popup Back", "colorI", "");
|
||||
SettingsInspector.endGroup();
|
||||
|
||||
SettingsInspector.startGroup("Misc");
|
||||
SettingsInspector.addSettingsField("WorldEditor/forceLoadDAE", "Force Load DAE", "bool", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterScalar", "Screen Center Scalar", "float", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterMax", "Screen Center Max", "float", "");
|
||||
SettingsInspector.endGroup();
|
||||
}
|
||||
|
||||
function ESettingsWindow::getShapeEditorSettings(%this)
|
||||
{
|
||||
SettingsInspector.startGroup("Colors");
|
||||
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "Sun Diffuse", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "Sun Ambient", "colorI", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "Background", "colorI", "");
|
||||
SettingsInspector.endGroup();
|
||||
|
||||
SettingsInspector.startGroup("Grid");
|
||||
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "Grid Size", "float", "");
|
||||
SettingsInspector.addSettingsField("WorldEditor/newLevelFile", "Grid Dimension", "vector2", "");
|
||||
SettingsInspector.endGroup();
|
||||
}
|
||||
|
||||
//Read/write field functions
|
||||
function SettingsInspector::addSettingsField(%this, %settingsFieldName, %labelText, %fieldType, %tooltip, %fieldData)
|
||||
{
|
||||
%moddedSettingsFieldName = strreplace(%settingsFieldName, "/", "-");
|
||||
%this.addCallbackField(%moddedSettingsFieldName, %labelText, %fieldType, "", EditorSettings.value(%settingsFieldName), %fieldData, "changeEditorSetting");
|
||||
}
|
||||
|
||||
function SettingsInspector::changeEditorSetting(%this, %varName, %value)
|
||||
{
|
||||
%varName = strreplace(%varName, "-", "/");
|
||||
|
||||
echo("Set " @ %varName @ " to be " @ %value);
|
||||
|
||||
EditorSettings.setValue(%varName, %value);
|
||||
|
||||
%id = ESettingsWindowList.getSelectedRow();
|
||||
ESettingsWindowList.setSelectedRow(%id);
|
||||
}
|
||||
|
|
@ -37,8 +37,8 @@ new GuiControlProfile (ToolsGuiDefaultProfile)
|
|||
mouseOverSelected = false;
|
||||
|
||||
// fill color
|
||||
opaque = false;
|
||||
fillColor = "48 48 48";
|
||||
opaque = true;
|
||||
fillColor = "50 50 50";
|
||||
fillColorHL = "91 101 116";
|
||||
fillColorSEL = "91 101 116";
|
||||
fillColorNA = "255 0 255 ";
|
||||
|
|
@ -154,11 +154,11 @@ new GuiControlProfile (ToolsGuiWindowProfile)
|
|||
{
|
||||
opaque = false;
|
||||
border = 1;
|
||||
fillColor = "48 48 48";
|
||||
fillColorHL = "42 42 42";
|
||||
fillColorNA = "42 42 42";
|
||||
fontColor = "215 215 215";
|
||||
fontColorHL = "215 215 215";
|
||||
fillColor = EditorSettings.value("WorldEditor/Theme/windowTitleBGColor");
|
||||
fillColorHL = EditorSettings.value("WorldEditor/Theme/windowTitleBGHLColor");
|
||||
fillColorNA = EditorSettings.value("WorldEditor/Theme/windowTitleBGNAColor");
|
||||
fontColor = EditorSettings.value("WorldEditor/Theme/windowTitleFontColor");
|
||||
fontColorHL = EditorSettings.value("WorldEditor/Theme/windowTitleFontHLColor");
|
||||
bevelColorHL = "255 255 255";
|
||||
bevelColorLL = "0 0 0";
|
||||
text = "untitled";
|
||||
|
|
@ -548,6 +548,12 @@ new GuiControlProfile( ToolsGuiPopUpMenuEditProfile : ToolsGuiPopUpMenuDefault )
|
|||
if( !isObject( ToolsGuiListBoxProfile ) )
|
||||
new GuiControlProfile( ToolsGuiListBoxProfile )
|
||||
{
|
||||
fillColorHL = "100 100 100";
|
||||
fillColorNA = "150 150 150";
|
||||
fontColor = "215 215 215";
|
||||
fontColorHL = "215 215 215";
|
||||
fontColorNA = "50 50 50";
|
||||
|
||||
tab = true;
|
||||
canKeyFocus = true;
|
||||
category = "Tools";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue