Fleshes out remaining missing editor settings entries/categories

Makes GUIAssets exec scripts before the gui file to allow onAdd methods to work
Adds missing getForestPath and getNavmeshPath methods and updates asset move logic to utilize them
This commit is contained in:
JeffR 2022-04-05 00:29:58 -05:00
parent 3b9414b5f9
commit 6b28f1f151
13 changed files with 112 additions and 24 deletions

View file

@ -115,28 +115,28 @@ void GUIAsset::copyTo(SimObject* object)
void GUIAsset::initializeAsset()
{
mGUIPath = getOwned() ? expandAssetFilePath(mGUIFile) : mGUIPath;
if (Torque::FS::IsScriptFile(mGUIPath))
Con::executeFile(mGUIPath, false, false);
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
if (Torque::FS::IsScriptFile(mScriptPath))
Con::executeFile(mScriptPath, false, false);
mGUIPath = getOwned() ? expandAssetFilePath(mGUIFile) : mGUIPath;
if (Torque::FS::IsScriptFile(mGUIPath))
Con::executeFile(mGUIPath, false, false);
}
void GUIAsset::onAssetRefresh()
{
mGUIPath = getOwned() ? expandAssetFilePath(mGUIFile) : mGUIPath;
if (Torque::FS::IsScriptFile(mGUIPath))
Con::executeFile(mGUIPath, false, false);
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
if (Torque::FS::IsScriptFile(mScriptPath))
Con::executeFile(mScriptPath, false, false);
mGUIPath = getOwned() ? expandAssetFilePath(mGUIFile) : mGUIPath;
if (Torque::FS::IsScriptFile(mGUIPath))
Con::executeFile(mGUIPath, false, false);
}
void GUIAsset::setGUIFile(const char* pScriptFile)

View file

@ -391,6 +391,20 @@ DefineEngineMethod(LevelAsset, getDecalsPath, const char*, (), ,
return object->getDecalsPath();
}
DefineEngineMethod(LevelAsset, getForestPath, const char*, (), ,
"Gets the full path of the asset's defined forest file.\n"
"@return The string result of the forest path")
{
return object->getForestPath();
}
DefineEngineMethod(LevelAsset, getNavmeshPath, const char*, (), ,
"Gets the full path of the asset's defined navmesh file.\n"
"@return The string result of the navmesh path")
{
return object->getNavmeshPath();
}
DefineEngineMethod(LevelAsset, loadDependencies, void, (), ,
"Initiates the loading of asset dependencies for this level.")
{

View file

@ -120,11 +120,12 @@ function AssetBrowser::moveLevelAsset(%this, %assetDef, %destination)
if(%newAssetPath $= "")
return false;
moveAssetLooseFile(%assetDef.getLevelPath(), %destination);
moveAssetLooseFile(%assetDef.getLevelPath(), %destination);
moveAssetLooseFile(%assetDef.getPreviewImagePath(), %destination);
moveAssetLooseFile(%assetDef.getPostFXPresetPath(), %destination);
moveAssetLooseFile(%assetDef.getDecalsPath(), %destination);
moveAssetLooseFile(%assetDef.getForestPath(), %destination);
moveAssetLooseFile(%assetDef.getNavmeshPath(), %destination);
AssetDatabase.removeDeclaredAsset(%assetDef.getAssetId());
AssetDatabase.addDeclaredAsset(%targetModule, %newAssetPath);

View file

@ -247,4 +247,12 @@ function ConvexEditorDefaultMaterialBtn::gotMaterialName(%this, %name)
ConvexEditorOptionsWindow.activeShape.setMaterial(%name);
ConvexEditorGui.updateShape();
}
}
function ESettingsWindow::getConvexEditorSettings(%this)
{
SettingsInspector.startGroup("Defaults");
SettingsInspector.addSettingsField("ConvexEditor/MaterialName", "Default Material", "string",
"The default material when creating a convexShape");
SettingsInspector.endGroup();
}

View file

@ -19,12 +19,14 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
function ESettingsWindow::startup( %this )
function ESettingsWindow::onAdd(%this)
{
new ArrayObject(EditorSettingsPageList);
new ArrayObject(GameSettingsPageList);
}
function ESettingsWindow::startup( %this )
{
%this.addEditorSettingsPage("Axis", "Axis Gizmo");
%this.addEditorSettingsPage("General", "General Settings");
%this.addEditorSettingsPage("Camera", "Camera Settings");
@ -303,13 +305,6 @@ function ESettingsWindow::getGeneralSettings(%this)
//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();
SettingsInspector.startGroup("Layout");
/*SettingsInspector.addSettingsField("WorldEditor/Layout/LayoutMode", "Editor Layout Mode", "list", "This dictates which layout style the editor should use." @
"WARNING - Modern layout is highlight experimental." @
@ -327,7 +322,7 @@ function ESettingsWindow::getCameraSettings(%this)
//Based on currently loaded level(rootScene)
SettingsInspector.startGroup(EditorSettings.value("WorldEditor/newLevelFile") @ " Camera");
SettingsInspector.addSettingsField("Camera/cameraMinSpeed", "Camera Speed Min", "float", "");
SettingsInspector.addSettingsField("Camera/cameraMaxSpeed", "Camera Speed Max", "200", "");
SettingsInspector.addSettingsField("Camera/cameraMaxSpeed", "Camera Speed Max", "float", "");
SettingsInspector.endGroup();
}
@ -365,7 +360,8 @@ function ESettingsWindow::getSceneEditorSettings(%this)
SettingsInspector.startGroup("Misc");
//SettingsInspector.addSettingsField("WorldEditor/forceLoadDAE", "Force Load DAE", "bool", "");
SettingsInspector.addSettingsField("WorldEditor/forceLoadDAE", "Force Load DAE", "bool", "");
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterScalar", "Screen Center Scalar", "string", "");
SettingsInspector.addSettingsField("WorldEditor/Tools/dropAtScreenCenterMax", "Screen Center Max", "string", "");
SettingsInspector.endGroup();
SettingsInspector.startGroup("Layout");
@ -444,6 +440,9 @@ function ESettingsWindow::getPostFXSettings(%this)
SettingsInspector.endGroup();
}
function ESettingsWindow::getObjectEditorSettings(%this)
{
}
//
// COMMON GAME SETTINGS
//

View file

@ -82,6 +82,8 @@ function MeshRoadEditorPlugin::onWorldEditorStartup( %this )
// Add ourselves to the Editor Settings window
exec( "./meshRoadEditorSettingsTab.gui" );
//ESettingsWindow.addTabPage( EMeshRoadEditorSettingsPage );
ESettingsWindow.addEditorSettingsPage("MeshRoadEditor", "Mesh Road Editor");
}
function MeshRoadEditorPlugin::onActivated( %this )

View file

@ -211,6 +211,24 @@ function MeshRoadEditorGui::prepSelectionMode( %this )
ToolsPaletteArray-->MeshRoadEditorSelectMode.setStateOn(1);
}
//------------------------------------------------------------------------------
function ESettingsWindow::getMeshRoadEditorSettings(%this)
{
SettingsInspector.startGroup("Defaults");
SettingsInspector.addSettingsField("MeshRoadEditor/DefaultWidth", "Width", "string", "");
SettingsInspector.addSettingsField("MeshRoadEditor/DefaultDepth", "Depth", "string", "");
SettingsInspector.addSettingsField("MeshRoadEditor/DefaultNormal", "Normal", "string", "");
SettingsInspector.addSettingsField("MeshRoadEditor/TopMaterialName", "Top Material", "string", "");
SettingsInspector.addSettingsField("MeshRoadEditor/BottomMaterialName", "Bottom Material", "string", "");
SettingsInspector.addSettingsField("MeshRoadEditor/SideMaterialName", "Side Material", "string", "");
SettingsInspector.endGroup();
SettingsInspector.startGroup("Colors");
SettingsInspector.addSettingsField("MeshRoadEditor/HoverSplineColor", "Hover Spline", "colorI", "");
SettingsInspector.addSettingsField("MeshRoadEditor/SelectedSplineColor", "Selected Spline", "colorI", "");
SettingsInspector.endGroup();
}
//------------------------------------------------------------------------------
function EMeshRoadEditorSelectModeBtn::onClick(%this)
{

View file

@ -82,6 +82,8 @@ function RiverEditorPlugin::onWorldEditorStartup( %this )
// Add ourselves to the Editor Settings window
exec( "./RiverEditorSettingsTab.gui" );
//ESettingsWindow.addTabPage( ERiverEditorSettingsPage );
ESettingsWindow.addEditorSettingsPage("RiverEditor", "River Editor");
}
function RiverEditorPlugin::onActivated( %this )

View file

@ -214,6 +214,20 @@ function RiverEditorGui::prepSelectionMode( %this )
ToolsPaletteArray-->RiverEditorSelectMode.setStateOn(1);
}
//------------------------------------------------------------------------------
function ESettingsWindow::getRiverEditorSettings(%this)
{
SettingsInspector.startGroup("Defaults");
SettingsInspector.addSettingsField("RiverEditor/DefaultWidth", "Width", "string", "");
SettingsInspector.addSettingsField("RiverEditor/DefaultDepth", "Depth", "string", "");
SettingsInspector.addSettingsField("RiverEditor/DefaultNormal", "Normal", "string", "");
SettingsInspector.endGroup();
SettingsInspector.startGroup("Colors");
SettingsInspector.addSettingsField("RiverEditor/HoverSplineColor", "Hover Spline", "colorI", "");
SettingsInspector.addSettingsField("RiverEditor/SelectedSplineColor", "Selected Spline", "colorI", "");
SettingsInspector.endGroup();
}
//------------------------------------------------------------------------------
function ERiverEditorSelectModeBtn::onClick(%this)
{

View file

@ -81,6 +81,8 @@ function RoadEditorPlugin::onWorldEditorStartup( %this )
// Add ourselves to the Editor Settings window
exec( "./RoadEditorSettingsTab.gui" );
//ESettingsWindow.addTabPage( ERoadEditorSettingsPage );
ESettingsWindow.addEditorSettingsPage("RoadEditor", "Road Editor");
}
function RoadEditorPlugin::onActivated( %this )

View file

@ -212,6 +212,20 @@ function RoadEditorGui::prepSelectionMode( %this )
%this.setMode( "RoadEditorSelectMode" );
ToolsPaletteArray-->RoadEditorSelectMode.setStateOn(1);
}
//------------------------------------------------------------------------------
function ESettingsWindow::getRoadEditorSettings(%this)
{
SettingsInspector.startGroup("Defaults");
SettingsInspector.addSettingsField("RoadEditor/DefaultWidth", "Width", "string", "");
SettingsInspector.addSettingsField("RoadEditor/MaterialName", "Material", "string", "");
SettingsInspector.endGroup();
SettingsInspector.startGroup("Colors");
SettingsInspector.addSettingsField("RoadEditor/HoverSplineColor", "Hover Spline", "colorI", "");
SettingsInspector.addSettingsField("RoadEditor/SelectedSplineColor", "Selected Spline", "colorI", "");
SettingsInspector.endGroup();
}
//------------------------------------------------------------------------------
function ERoadEditorSelectModeBtn::onClick(%this)
{

View file

@ -156,8 +156,8 @@ function EditorGui::init(%this)
// Editor Settings Window
if( !isObject( %this-->EditorSettingsWindow ) )
{
exec("tools/gui/EditorSettingsWindow.ed.gui");
exec("tools/gui/editorSettingsWindow.ed." @ $TorqueScriptFileExtension);
exec("tools/gui/EditorSettingsWindow.ed.gui");
// Start the standard settings tabs pages
/*exec( "~/worldEditor/gui/GeneralSettingsTab.ed.gui" );

View file

@ -29,6 +29,8 @@ function TerrainEditor::init( %this )
%this.setBrushSize( 9, 9 );
new PersistenceManager( ETerrainPersistMan );
ESettingsWindow.addEditorSettingsPage("TerrainEditor", "Terrain Editor");
}
///
@ -356,6 +358,18 @@ function TerrainEditor::onMaterialUndo( %this )
EPainter.updateLayers();
}
function ESettingsWindow::getTerrainEditorSettings(%this)
{
SettingsInspector.startGroup("Tool Values");
SettingsInspector.addSettingsField("TerrainEditor/ActionValues/adjustHeightVal", "Raise/Lower Height", "string",
"The amount of height adjustment for raising/lowering terrain");
SettingsInspector.addSettingsField("TerrainEditor/ActionValues/smoothFactor", "Smooth Factor", "string",
"The amount of smoothing when raising/lowering terrain");
SettingsInspector.addSettingsField("TerrainEditor/ActionValues/noiseFactor", "Noise Factor", "string",
"The amount of noise when raising/lowering terrain");
SettingsInspector.endGroup();
}
//------------------------------------------------------------------------------
// Functions
//------------------------------------------------------------------------------