From 12b58dc7ef330a155dea1fcb6a7f4d98bbc02694 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 21 Feb 2021 02:09:40 -0600 Subject: [PATCH] Makes the DB creation process better jive with modules by having you select the destination folder for the managed datablock script file to be saved off into --- .../DatablockEditorTreeWindow.ed.gui | 2 +- .../tools/datablockEditor/datablockEditor.tscript | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui index 62d7de3b8..d07a4158d 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui +++ b/Templates/BaseGame/game/tools/datablockEditor/DatablockEditorTreeWindow.ed.gui @@ -299,7 +299,7 @@ MinExtent = "8 2"; canSave = "1"; Visible = "0"; - Command = "DatablockEditorPlugin.createDatablock();"; + Command = "DatablockEditorPlugin.pickDatablockPath();"; tooltipprofile = "ToolsGuiToolTipProfile"; tooltip = "Create New Datablock"; hovertime = "1000"; diff --git a/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript b/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript index 8d5ac4932..dd7925bbe 100644 --- a/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript +++ b/Templates/BaseGame/game/tools/datablockEditor/datablockEditor.tscript @@ -674,8 +674,19 @@ function DatablockEditorPlugin::createDatablock(%this) } //--------------------------------------------------------------------------------------------- +function DatablockEditorPlugin::pickDatablockPath(%this) +{ + SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, "DatablockEditorPlugin.pickedNewDBPath", "Select New Datablock Path"); + SelectAssetPathWindow.selectWindow(); +} -function DatablockEditorPlugin::createPromptNameCheck(%this) +function DatablockEditorPlugin::pickedNewDBPath(%this, %path) +{ + $DATABLOCK_EDITOR_DEFAULT_FILENAME = %path @ "/managedDatablocks." @ $TorqueScriptFileExtension; + DatablockEditorPlugin.createDatablock(); +} + +function DatablockEditorPlugin::createPromptNameCheck(%this, %path) { %name = DatablockEditorCreatePrompt-->CreateDatablockName.getText(); if( !Editor::validateObjectName( %name, true ) )