mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Merge pull request #306 from Areloch/MiscFixes20200828
Misc Fixes for level saving and selecting asset paths
This commit is contained in:
commit
82f7db3d48
4 changed files with 87 additions and 35 deletions
|
|
@ -12,7 +12,7 @@
|
|||
hovertime = "1000";
|
||||
isContainer = "1";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
|
||||
new GuiWindowCtrl(SelectAssetPathWindow) {
|
||||
text = "Select Path";
|
||||
|
|
@ -250,7 +250,27 @@
|
|||
isContainer = "0";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
command="SelectAssetPath.selectPath();";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
text = "New Folder";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
useMouseEvents = "0";
|
||||
position = "3 414";
|
||||
extent = "85 24";
|
||||
minExtent = "8 2";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
profile = "ToolsGuiButtonProfile";
|
||||
visible = "1";
|
||||
active = "1";
|
||||
command = "SelectAssetPath.newFolder();";
|
||||
tooltipProfile = "GuiToolTipProfile";
|
||||
hovertime = "1000";
|
||||
isContainer = "0";
|
||||
internalName = "newFolderButton";
|
||||
canSave = "1";
|
||||
canSaveDynamicFields = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,12 +11,21 @@ function AssetBrowser::doCreateNewFolder(%this)
|
|||
if(%newFolderName $= "")
|
||||
%newFolderName = "NewFolder";
|
||||
|
||||
if(SelectAssetPath.isAwake())
|
||||
{
|
||||
%currentAddressPath = SelectAssetPath-->folderTree.getItemValue(SelectAssetPath.selectedTreeItem) @ "/" @ SelectAssetPath-->folderTree.getItemText(SelectAssetPath.selectedTreeItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
%currentAddressPath = AssetBrowser.dirHandler.currentAddress;
|
||||
}
|
||||
|
||||
%newFolderIdx = "";
|
||||
%matched = true;
|
||||
%newFolderPath = "";
|
||||
while(%matched == true)
|
||||
{
|
||||
%newFolderPath = AssetBrowser.dirHandler.currentAddress @ "/" @ %newFolderName @ %newFolderIdx;
|
||||
%newFolderPath = %currentAddressPath @ "/" @ %newFolderName @ %newFolderIdx;
|
||||
if(!isDirectory(%newFolderPath))
|
||||
{
|
||||
%matched = false;
|
||||
|
|
@ -38,6 +47,10 @@ function AssetBrowser::doCreateNewFolder(%this)
|
|||
AssetBrowser.loadDirectories();
|
||||
|
||||
%this.navigateTo(%newFolderPath);
|
||||
|
||||
//On the off chance we're trying to select a path, we'll update the select path window too
|
||||
if(SelectAssetPath.isAwake())
|
||||
SelectAssetPath.showDialog(%newFolderPath, SelectAssetPath.callback);
|
||||
}
|
||||
|
||||
function AssetBrowser::buildFolderPreview(%this, %assetDef, %previewData)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ function SelectAssetPath::showDialog(%this, %startingPath, %callback)
|
|||
%dataItem = SelectAssetPath-->folderTree.insertItem(0, "Data");
|
||||
%this.dirHandler.loadFolders("Data", %dataItem);
|
||||
|
||||
%this.dirHandler.expandTreeToAddress(%startingPath);
|
||||
%id = %this.dirHandler.getFolderTreeItemFromAddress(%startingPath);
|
||||
%this.dirHandler.treeCtrl.clearSelection();
|
||||
%this.dirHandler.treeCtrl.selectItem(%id);
|
||||
|
||||
Canvas.pushDialog(SelectAssetPath);
|
||||
}
|
||||
|
||||
|
|
@ -44,4 +49,10 @@ function SelectAssetPath::selectPath(%this)
|
|||
}
|
||||
|
||||
Canvas.popDialog(SelectAssetPath);
|
||||
}
|
||||
|
||||
function SelectAssetPath::newFolder(%this)
|
||||
{
|
||||
AssetBrowser_newFolderNameTxt.text = "NewFolder";
|
||||
Canvas.pushDialog(AssetBrowser_newFolder);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue