Adds handling for drag-and-drop import of files even if asset browser is not open. If world or gui editor are the active controls, then it will injest the incoming files and prompt what their destination module and path will be via a new popup window. After clicking OK, import continues into that destination.

Cleaned up commented lines from drag-and-drop functions.
Fixed issue where material icon on buttons in the object creator windows wouldn't display.
Fixed issue where it wasn't correctly binding cloud textures for BasicClouds object or ripple/foam/depth textures for water objects when newly created
Fixed issue where when double-clicking on a datablock type in the datablock editor, wasn't correctly going through the module selection process, making an invalid destination.
Added handling for Trigger object creation via TriggerData class
Standardized double-click handling of datablock entries in AB to respect double click action mode, and properly either open the datablock editor to the given datablock, or spawn it.
Made Create New Datablock prompt window indicate the destination module to be clearer where it's going if force-prompt of module setting is off.
This commit is contained in:
Areloch 2021-09-12 05:32:30 -05:00
parent a30f64506f
commit 5892ff7428
15 changed files with 469 additions and 90 deletions

View file

@ -5,7 +5,6 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
fixedAspectRatio = "0";
profile = "ToolsGuiDefaultProfile";
visible = "1";
active = "1";
@ -14,6 +13,7 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
fixedAspectRatio = "0";
new GuiWindowCtrl() {
text = "Create New Datablock";
@ -32,18 +32,18 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "389 252";
extent = "207 167";
position = "374 252";
extent = "309 167";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
fixedAspectRatio = "0";
profile = "ToolsGuiWindowProfile";
visible = "1";
active = "1";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "promptWindow";
canSave = "1";
canSaveDynamicFields = "0";
@ -61,7 +61,6 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
fixedAspectRatio = "0";
profile = "ToolsGuiTextProfile";
visible = "1";
active = "1";
@ -86,11 +85,10 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
anchorLeft = "1";
anchorRight = "0";
position = "7 45";
extent = "191 17";
extent = "294 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
fixedAspectRatio = "0";
profile = "ToolsGuiTextEditProfile";
visible = "1";
active = "1";
@ -106,12 +104,11 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "7 137";
position = "111 137";
extent = "122 22";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
fixedAspectRatio = "0";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
@ -128,12 +125,11 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "135 137";
position = "239 137";
extent = "63 22";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
fixedAspectRatio = "0";
profile = "ToolsGuiButtonProfile";
visible = "1";
active = "1";
@ -159,7 +155,6 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
fixedAspectRatio = "0";
profile = "ToolsGuiTextProfile";
visible = "1";
active = "1";
@ -182,11 +177,10 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
anchorLeft = "1";
anchorRight = "0";
position = "7 87";
extent = "191 19";
extent = "294 19";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
fixedAspectRatio = "0";
profile = "ToolsGuiPopUpMenuProfile";
visible = "1";
active = "1";
@ -198,7 +192,6 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl() {
useInactiveState = "0";
text = "Client-Side Datablock";
groupNum = "-1";
buttonType = "ToggleButton";
@ -208,10 +201,9 @@ $guiContent = new GuiControl(DatablockEditorCreatePrompt,EditorGuiGroup) {
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
fixedAspectRatio = "0";
profile = "ToolsGuiCheckBoxProfile";
visible = "1";
active = "1";
active = "0";
tooltipProfile = "ToolsGuiToolTipProfile";
hovertime = "1000";
isContainer = "0";

View file

@ -259,7 +259,7 @@ $guiContent = new GuiControl() {
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
altCommand = "DatablockEditorPlugin.createDatablock();";
altCommand = "DatablockEditorPlugin.pickDatablockPath();";
};
};
};

View file

@ -666,6 +666,7 @@ function DatablockEditorPlugin::createDatablock(%this)
// Show the dialog.
canvas.pushDialog( DatablockEditorCreatePrompt, 0, true );
DatablockEditorCreatePrompt-->promptWindow.text = "Create New Datablock in module: " @ DatablockEditorPlugin.targetCreationModule;
}
}
@ -679,6 +680,7 @@ function DatablockEditorPlugin::pickDatablockPath(%this)
function DatablockEditorPlugin::pickedNewDBTargetModule(%this, %module)
{
DatablockEditorPlugin.targetCreationModule = %module;
%moduleDef = ModuleDatabase.findModule(%module);
$DATABLOCK_EDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedDatablocks." @ $TorqueScriptFileExtension;