diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/checkbox.png b/Templates/BaseGame/game/tools/assetBrowser/art/checkbox.png new file mode 100644 index 000000000..46e0ac959 Binary files /dev/null and b/Templates/BaseGame/game/tools/assetBrowser/art/checkbox.png differ diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/datablockIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/datablockIcon.png new file mode 100644 index 000000000..5a6910453 Binary files /dev/null and b/Templates/BaseGame/game/tools/assetBrowser/art/datablockIcon.png differ diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/folderIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/folderIcon.png index ba9452fe4..2a528419e 100644 Binary files a/Templates/BaseGame/game/tools/assetBrowser/art/folderIcon.png and b/Templates/BaseGame/game/tools/assetBrowser/art/folderIcon.png differ diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/gameObjectIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/gameObjectIcon.png index 6b285daae..9d6f7328f 100644 Binary files a/Templates/BaseGame/game/tools/assetBrowser/art/gameObjectIcon.png and b/Templates/BaseGame/game/tools/assetBrowser/art/gameObjectIcon.png differ diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/genericAssetIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/genericAssetIcon.png new file mode 100644 index 000000000..5337b0bcc Binary files /dev/null and b/Templates/BaseGame/game/tools/assetBrowser/art/genericAssetIcon.png differ diff --git a/Templates/BaseGame/game/tools/assetBrowser/art/looseFileIcon.png b/Templates/BaseGame/game/tools/assetBrowser/art/looseFileIcon.png new file mode 100644 index 000000000..09f0f85ed Binary files /dev/null and b/Templates/BaseGame/game/tools/assetBrowser/art/looseFileIcon.png differ diff --git a/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml b/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml index 3bbd75af6..c8a5afeda 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml +++ b/Templates/BaseGame/game/tools/assetBrowser/assetImportConfigs.xml @@ -1,137 +1,138 @@ - - - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - TrailingNumber - 0 - 0 - 0 - Z_AXIS - 0 - - - _NORMAL,_NORM - _AO,_AMBIENT,_AMBIENTOCCLUSION - _METAL,_MET,_METALNESS,_METALLIC - _COMP,_COMPOSITE - _ROUGH,_ROUGHNESS - N/A - 1 - 1.0 - Bilinear - 0 - _ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL - 1 - _SMOOTH,_SMOOTHNESS - 1 - - - AutoPrune - 0 - 0 - 1 - - - Col - LOS - 1 - 1 - CollisionMesh - CollisionMesh - + 1 - Seconds - 2 1 - - 1.0 - 1.0 - 0 - - - + 1 _METAL,_MET,_METALNESS,_METALLIC + _AO,_AMBIENT,_AMBIENTOCCLUSION 0 Bilinear - _SMOOTH,_SMOOTHNESS - 1 + _ROUGH,_ROUGHNESS + 1 _ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL,_baseColor,_a, - _AO,_AMBIENT,_AMBIENTOCCLUSION + _SMOOTH,_SMOOTHNESS _COMP,_COMPOSITE 1.0 - 1 _NORMAL,_NORM - _ROUGH,_ROUGHNESS - 1 + 1 N/A - 1 + 1 - - CollisionMesh - LOS - Col - CollisionMesh - 1 - 1 + + 0 + 0 + 0 + Z_AXIS + 0 + 1 + 1 + 0 + 0.01 + 0 + 0 + TrailingNumber 0 - 1.0 1.0 + 1.0 - - AutoPrune - - - 1 - 0 - 0 - 0 - 0 - 1 - TrailingNumber - 0 - Z_AXIS - 0 - 0.01 - 0 + + CollisionMesh + LOS + Col + 1 + CollisionMesh + 1 ColorEffect*, - 1 - 1 1 - 0 + 1 1 + 1 + 0 + 1 + + + AutoPrune + + + + + _AO,_AMBIENT,_AMBIENTOCCLUSION + 1 + _ALBEDO,_DIFFUSE,_ALB,_DIF,_COLOR,_COL + _SMOOTH,_SMOOTHNESS + _NORMAL,_NORM + N/A + 0 + _ROUGH,_ROUGHNESS + 1.0 + _METAL,_MET,_METALNESS,_METALLIC + 1 + _COMP,_COMPOSITE + Bilinear + 1 + + + 0 + 0 + 0 + 0 + Z_AXIS + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + TrailingNumber + + + 1 + Col + LOS + 1 + CollisionMesh + CollisionMesh - 1 1 + 1 + Seconds + 2 + + + 1 + 0 + 0 + AutoPrune + + + 1.0 + 0 + 1.0 + + + 1 + 1 + 1 + 1 + 1 diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui index 05b81844a..6b2c57a8e 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui @@ -12,20 +12,7 @@ hovertime = "1000"; isContainer = "1"; canSave = "1"; - canSaveDynamicFields = "1"; - AddNewArtAssetPopup = "18110"; - AddNewAssetPopup = "18112"; - AddNewCppAssetPopup = "18111"; - AddNewScriptAssetPopup = "18109"; - coreModulesFilter = "0"; - currentPreviewPage = "0"; - Enabled = "1"; - navigationHistoryIdx = "0"; - onlyShowModulesWithAssets = "0"; - previewData = "19953"; - previewSize = "80"; - templateFilesPath = "tools/assetBrowser/scripts/templateFiles/"; - totalPages = "1"; + canSaveDynamicFields = "0"; new GuiWindowCtrl(AssetBrowser_addFilterWindow) { text = "Create New Tag"; @@ -167,8 +154,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "256 107"; - extent = "512 554"; + position = "204 80"; + extent = "615 608"; minExtent = "383 274"; horizSizing = "center"; vertSizing = "center"; @@ -181,108 +168,22 @@ canSave = "1"; canSaveDynamicFields = "0"; - new GuiButtonCtrl(CreateAssetButton) { - text = "New"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "3 22"; - extent = "45 19"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiButtonProfile"; - visible = "1"; - active = "1"; - tooltipProfile = "GuiToolTipProfile"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiButtonCtrl(ImportAssetButton) { - text = "Import"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "52 22"; - extent = "45 19"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiButtonProfile"; - visible = "1"; - active = "1"; - tooltipProfile = "GuiToolTipProfile"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiBitmapButtonCtrl(AssetBrowser_NavigateBackBtn) { - bitmap = "tools/gui/images/folderUp.png"; - bitmapMode = "Centered"; - autoFitExtents = "0"; - useModifiers = "0"; - useStates = "1"; - masked = "0"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "98 21"; - extent = "22 22"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "GuiDefaultProfile"; - visible = "1"; - active = "1"; - command = "AssetBrowser.navigateHistoryBack();"; - tooltipProfile = "GuiToolTipProfile"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiBitmapButtonCtrl(AssetBrowser_NavigateForwardBtn) { - bitmap = "tools/gui/images/folderDown.png"; - bitmapMode = "Centered"; - autoFitExtents = "0"; - useModifiers = "0"; - useStates = "1"; - masked = "0"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "120 21"; - extent = "22 22"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "GuiDefaultProfile"; - visible = "1"; - active = "1"; - command = "AssetBrowser.navigateHistoryForward();"; - tooltipProfile = "GuiToolTipProfile"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiStackControl(AssetBrowser_BreadcrumbBar) { - stackingType = "Horizontal"; - horizStacking = "Left to Right"; - vertStacking = "Top to Bottom"; - padding = "0"; + new GuiDynamicCtrlArrayControl() { + colCount = "20"; + colSize = "30"; + rowCount = "1"; + rowSize = "30"; + rowSpacing = "0"; + colSpacing = "0"; + frozen = "0"; + autoCellSize = "0"; + fillRowFirst = "1"; dynamicSize = "0"; - dynamicNonStackExtent = "0"; - dynamicPos = "0"; - changeChildSizeToFit = "0"; - changeChildPosition = "1"; - position = "156 21"; - extent = "326 23"; - minExtent = "16 16"; - horizSizing = "width"; + padding = "0 0 0 0"; + position = "0 24"; + extent = "615 30"; + minExtent = "8 2"; + horizSizing = "right"; vertSizing = "bottom"; profile = "GuiDefaultProfile"; visible = "1"; @@ -290,41 +191,188 @@ tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "1"; + internalName = "topBar"; canSave = "1"; canSaveDynamicFields = "0"; - }; - new GuiBitmapButtonCtrl(AssetBrowser_VisibilityOptions) { - bitmap = "tools/gui/images/visible"; - bitmapMode = "Centered"; - autoFitExtents = "0"; - useModifiers = "0"; - useStates = "1"; - masked = "0"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "487 21"; - extent = "23 23"; - minExtent = "8 2"; - horizSizing = "left"; - vertSizing = "bottom"; - profile = "ToolsGuiSolidDefaultProfile"; - visible = "1"; - active = "1"; - command = "AssetBrowser.showVisibiltyOptions();"; - tooltipProfile = "GuiToolTipProfile"; - tooltip = "Visibility Options"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; + + new GuiIconButtonCtrl() { + buttonMargin = "4 4"; + iconBitmap = "tools/gui/images/stencilIcons/phone.png"; + iconLocation = "Left"; + sizeIconToButton = "1"; + makeIconSquare = "1"; + textLocation = "Left"; + textMargin = "4"; + autoSize = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 0"; + extent = "30 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Controls for layout and window mode."; + hovertime = "1000"; + isContainer = "0"; + internalName = "windowOptionsButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiIconButtonCtrl() { + buttonMargin = "4 4"; + iconBitmap = "tools/gui/images/stencilIcons/plus.png"; + iconLocation = "Left"; + sizeIconToButton = "1"; + makeIconSquare = "1"; + textLocation = "Center"; + textMargin = "4"; + autoSize = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "30 0"; + extent = "30 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Create a new asset in the current directory"; + hovertime = "1000"; + isContainer = "0"; + internalName = "CreateAssetButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiIconButtonCtrl() { + buttonMargin = "4 4"; + iconBitmap = "tools/gui/images/stencilIcons/import.png"; + iconLocation = "Left"; + sizeIconToButton = "1"; + makeIconSquare = "1"; + textLocation = "Center"; + textMargin = "4"; + autoSize = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "60 0"; + extent = "30 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Import a file to be a new asset in the current directory"; + hovertime = "1000"; + isContainer = "0"; + internalName = "ImportAssetButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiIconButtonCtrl() { + buttonMargin = "4 4"; + iconBitmap = "tools/gui/images/stencilIcons/filter.png"; + iconLocation = "Left"; + sizeIconToButton = "1"; + makeIconSquare = "1"; + textLocation = "Center"; + textMargin = "4"; + autoSize = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "90 0"; + extent = "30 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.showVisibiltyOptions();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Visibility and filter modes."; + hovertime = "1000"; + isContainer = "0"; + internalName = "filterAssetsButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiIconButtonCtrl() { + buttonMargin = "4 4"; + iconBitmap = "tools/gui/images/stencilIcons/return.png"; + iconLocation = "Left"; + sizeIconToButton = "1"; + makeIconSquare = "1"; + textLocation = "Center"; + textMargin = "4"; + autoSize = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "120 0"; + extent = "30 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.refreshDatabases();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Refresh Asset and Module databases."; + hovertime = "1000"; + isContainer = "0"; + internalName = "refreshDatabasesButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiIconButtonCtrl() { + buttonMargin = "4 4"; + iconBitmap = "tools/gui/images/stencilIcons/warning.png"; + iconLocation = "Left"; + sizeIconToButton = "1"; + makeIconSquare = "1"; + textLocation = "Center"; + textMargin = "4"; + autoSize = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "150 0"; + extent = "30 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.autoImportSimpleLooseFiles();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Find all loose files that are of a \"simple\" type and automatically import them."; + hovertime = "1000"; + isContainer = "0"; + internalName = "AutoImportAssetButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; }; new GuiSplitContainer(AssetBrowser_MainSplit) { orientation = "Vertical"; splitterSize = "2"; - splitPoint = "149 100"; + splitPoint = "190 100"; fixedPanel = "None"; - fixedSize = "356"; + fixedSize = "468"; docking = "None"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -332,8 +380,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "3 42"; - extent = "505 509"; + position = "3 56"; + extent = "608 532"; minExtent = "64 64"; horizSizing = "relative"; vertSizing = "height"; @@ -355,7 +403,7 @@ anchorLeft = "1"; anchorRight = "0"; position = "0 0"; - extent = "147 509"; + extent = "188 532"; minExtent = "0 0"; horizSizing = "right"; vertSizing = "bottom"; @@ -376,8 +424,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "0 0"; - extent = "147 31"; + position = "0 -4"; + extent = "188 25"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "bottom"; @@ -396,7 +444,7 @@ sinkAllKeyEvents = "0"; password = "0"; passwordMask = "*"; - text = "Search Folders..."; + placeholderText = "Search Folders..."; maxLength = "1024"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -404,8 +452,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "0 0"; - extent = "148 18"; + position = "0 3"; + extent = "189 18"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; @@ -418,10 +466,11 @@ class = "AssetBrowserSearchFilterTxt"; canSave = "1"; canSaveDynamicFields = "0"; + command="AssetBrowserFolderSearchFilter.onEdited();"; }; - new GuiBitmapButtonCtrl(AssetBrowser_ClearFolderFilterBtn) { - bitmap = "tools/gui/images/clear-icon"; - bitmapMode = "Centered"; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/stencilIcons/zoom.png"; + bitmapMode = "Stretched"; autoFitExtents = "0"; useModifiers = "0"; useStates = "1"; @@ -429,7 +478,7 @@ groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "132 0"; + position = "173 4"; extent = "15 15"; minExtent = "8 2"; horizSizing = "left"; @@ -440,6 +489,8 @@ tooltipProfile = "GuiToolTipProfile"; hovertime = "1000"; isContainer = "0"; + internalName = "folderSearchBtn"; + class = "AssetBrowserFolderSearchBtn"; canSave = "1"; canSaveDynamicFields = "0"; }; @@ -452,7 +503,7 @@ anchorLeft = "1"; anchorRight = "0"; position = "0 17"; - extent = "147 493"; + extent = "188 516"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; @@ -482,7 +533,7 @@ anchorLeft = "1"; anchorRight = "0"; position = "0 0"; - extent = "147 493"; + extent = "188 516"; minExtent = "8 8"; horizSizing = "width"; vertSizing = "height"; @@ -518,7 +569,7 @@ canRenameObjects = "1"; renameInternal = "0"; position = "1 1"; - extent = "145 147"; + extent = "186 2"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; @@ -543,8 +594,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "151 0"; - extent = "354 509"; + position = "192 0"; + extent = "416 532"; minExtent = "16 16"; horizSizing = "right"; vertSizing = "bottom"; @@ -565,8 +616,135 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "1 0"; - extent = "354 19"; + position = "0 0"; + extent = "418 20"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapButtonCtrl(AssetBrowser_NavigateBackBtn) { + bitmap = "tools/gui/images/folderUp.png"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 0"; + extent = "22 22"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.navigateHistoryBack();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Navigate Back in history"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl(AssetBrowser_NavigateForwardBtn) { + bitmap = "tools/gui/images/folderDown.png"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "22 0"; + extent = "22 22"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.navigateHistoryForward();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Navigate forward in history"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiStackControl(AssetBrowser_BreadcrumbBar) { + stackingType = "Horizontal"; + horizStacking = "Left to Right"; + vertStacking = "Top to Bottom"; + padding = "0"; + dynamicSize = "0"; + dynamicNonStackExtent = "0"; + dynamicPos = "0"; + changeChildSizeToFit = "0"; + changeChildPosition = "1"; + position = "52 0"; + extent = "365 23"; + minExtent = "16 16"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "48 0"; + extent = "369 18"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "NavPath"; + class = "assetBrowserNavPath"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiContainer() { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "1 20"; + extent = "416 19"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "bottom"; @@ -579,13 +757,39 @@ canSave = "1"; canSaveDynamicFields = "0"; + new GuiBitmapButtonCtrl(AssetBrowser_VisibilityOptions) { + bitmap = "tools/gui/images/visible"; + bitmapMode = "Centered"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 0"; + extent = "23 23"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiSolidDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.showVisibiltyOptions();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Visibility Options"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; new GuiTextEditCtrl(AssetBrowserSearchFilter) { historySize = "0"; tabComplete = "0"; sinkAllKeyEvents = "0"; password = "0"; passwordMask = "*"; - text = "Search Assets..."; + placeHolderText = "Search Assets..."; maxLength = "1024"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -593,8 +797,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "21 1"; - extent = "314 18"; + position = "22 1"; + extent = "375 18"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "bottom"; @@ -607,9 +811,10 @@ class = "AssetBrowserSearchFilterTxt"; canSave = "1"; canSaveDynamicFields = "0"; + command="AssetBrowserSearchFilter.onEdited();"; }; - new GuiBitmapButtonCtrl(AssetBrowser_ClearAssetFilterBtn) { - bitmap = "tools/gui/images/clear-icon"; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/stencilIcons/zoom.png"; bitmapMode = "Stretched"; autoFitExtents = "0"; useModifiers = "0"; @@ -618,7 +823,7 @@ groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "321 1"; + position = "383 1"; extent = "15 15"; minExtent = "8 2"; horizSizing = "left"; @@ -627,40 +832,15 @@ visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; - tooltip = "Create New Asset"; hovertime = "1000"; isContainer = "0"; + internalName = "assetSearchBtn"; + class = "AssetBrowserAssetSearchBtn"; canSave = "1"; canSaveDynamicFields = "0"; }; - new GuiBitmapButtonCtrl(AssetBrowser_ToggleFolderPanel) { - bitmap = "tools/gui/images/iconList.png"; - bitmapMode = "Centered"; - autoFitExtents = "0"; - useModifiers = "0"; - useStates = "1"; - masked = "0"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "1 1"; - extent = "15 15"; - minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsGuiSolidDefaultProfile"; - visible = "1"; - active = "1"; - command = "AssetBrowser.toggleFolderCollapseButton();"; - tooltipProfile = "GuiToolTipProfile"; - tooltip = "Toggles the display of the folders panel"; - hovertime = "1000"; - isContainer = "0"; - canSave = "1"; - canSaveDynamicFields = "0"; - }; - new GuiBitmapButtonCtrl(AssetBrowser_FilterOptionsBtn) { - bitmap = "tools/gui/images/filter.png"; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/save-icon"; bitmapMode = "Stretched"; autoFitExtents = "0"; useModifiers = "0"; @@ -669,7 +849,7 @@ groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - position = "337 1"; + position = "399 1"; extent = "15 15"; minExtent = "8 2"; horizSizing = "left"; @@ -677,11 +857,12 @@ profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; - command = "AssetBrowser.showFilterOptions();"; + command = "Canvas.pushDialog(CreateNewCollectionSetCtrl);"; tooltipProfile = "GuiToolTipProfile"; - tooltip = "Filter Options"; + tooltip = "Save current search parameters as a collectionset"; hovertime = "1000"; isContainer = "0"; + internalName = "saveSearchAsCollectionBtn"; canSave = "1"; canSaveDynamicFields = "0"; }; @@ -693,8 +874,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "1"; - position = "1 17"; - extent = "354 487"; + position = "1 37"; + extent = "416 495"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; @@ -724,7 +905,7 @@ anchorLeft = "1"; anchorRight = "0"; position = "0 0"; - extent = "354 467"; + extent = "416 479"; minExtent = "8 8"; horizSizing = "width"; vertSizing = "height"; @@ -739,8 +920,8 @@ new GuiMouseEventCtrl(AssetListPanelInputs) { lockMouse = "0"; - position = "1 0"; - extent = "339 467"; + position = "1 1"; + extent = "414 472"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; @@ -763,8 +944,8 @@ dynamicPos = "0"; changeChildSizeToFit = "1"; changeChildPosition = "0"; - position = "2 1"; - extent = "339 124"; + position = "2 2"; + extent = "414 120"; minExtent = "16 16"; horizSizing = "width"; vertSizing = "bottom"; @@ -778,10 +959,10 @@ canSaveDynamicFields = "0"; new GuiDynamicCtrlArrayControl() { - colCount = "3"; + colCount = "4"; colSize = "100"; rowCount = "1"; - rowSize = "124"; + rowSize = "120"; rowSpacing = "2"; colSpacing = "2"; frozen = "0"; @@ -790,7 +971,7 @@ dynamicSize = "1"; padding = "0 0 0 0"; position = "3 0"; - extent = "339 124"; + extent = "414 120"; minExtent = "8 8"; horizSizing = "width"; vertSizing = "bottom"; @@ -814,8 +995,8 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "0 467"; - extent = "354 20"; + position = "0 479"; + extent = "416 16"; minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; @@ -830,6 +1011,7 @@ canSaveDynamicFields = "0"; }; new GuiTextCtrl(AssetBrowser_FooterText) { + text = "0 Assets"; maxLength = "1024"; margin = "0 0 0 0"; padding = "0 0 0 0"; @@ -837,7 +1019,7 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "0 470"; + position = "0 475"; extent = "269 23"; minExtent = "8 2"; horizSizing = "right"; @@ -851,31 +1033,82 @@ canSave = "1"; canSaveDynamicFields = "0"; }; - }; - new GuiButtonCtrl() { - text = "Select"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - position = "301 488"; - extent = "53 19"; - minExtent = "8 2"; - horizSizing = "left"; - vertSizing = "top"; - profile = "ToolsGuiButtonProfile"; - visible = "0"; - active = "1"; - command = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );"; - tooltipProfile = "GuiToolTipProfile"; - hovertime = "1000"; - isContainer = "0"; - internalName = "SelectButton"; - hidden = "1"; - canSave = "1"; - canSaveDynamicFields = "0"; + new GuiBitmapButtonCtrl(AssetBrowser_ToggleFolderPanel) { + bitmap = "tools/gui/images/stencilIcons/previous.png"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "-2 200"; + extent = "18 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "center"; + profile = "ToolsGuiSolidDefaultProfile"; + visible = "1"; + active = "1"; + command = "AssetBrowser.toggleFolderCollapseButton();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Toggles the display of the folders panel"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; }; }; }; + new GuiButtonCtrl() { + text = "Select"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "559 588"; + extent = "53 19"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "0"; + active = "1"; + command = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "SelectButton"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiSliderCtrl() { + range = "0 2"; + ticks = "5"; + snap = "1"; + value = "1"; + useFillBar = "0"; + fillBarColor = "255 255 255 255"; + renderTicks = "0"; + position = "8 588"; + extent = "75 20"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "top"; + profile = "GuiSliderProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Controls the asset preview size. At minimum, it will render items as a list."; + hovertime = "1000"; + isContainer = "0"; + internalName = "previewSlider"; + class = "assetBrowserPreviewSlider"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; }; }; //--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSet.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSet.gui new file mode 100644 index 000000000..faa48bd6e --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/createNewCollectionSet.gui @@ -0,0 +1,124 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(CreateNewCollectionSetCtrl) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultNonModalProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + Enabled = "1"; + + new GuiWindowCtrl() { + text = "Name New Collection Set"; + resizeWidth = "1"; + resizeHeight = "0"; + canMove = "1"; + canClose = "1"; + canMinimize = "0"; + canMaximize = "0"; + canCollapse = "0"; + edgeSnap = "1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "362 334"; + extent = "355 99"; + minExtent = "48 92"; + horizSizing = "center"; + vertSizing = "center"; + profile = "ToolsGuiWindowProfile"; + visible = "1"; + active = "1"; + closeCommand = "Canvas.popDialog(CreateNewCollectionSetCtrl);"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiButtonCtrl() { + text = "Select"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "207 68"; + extent = "71 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.popDialog(CreateNewCollectionSetCtrl); AssetBrowser.saveCurrentFiltersAsCollection();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Cancel"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "284 68"; + extent = "64 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.popDialog(CreateNewCollectionSetCtrl);"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "8 38"; + extent = "341 18"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + internalName="collectionSetName"; + }; + }; +}; +//--- OBJECT WRITE END --- + +function CreateNewCollectionSetCtrl::onWake(%this) +{ + %this-->collectionSetName.setText(""); +} diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui index ba2e61540..180b4b5d7 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui @@ -1,7 +1,7 @@ //--- OBJECT WRITE BEGIN --- %guiContent = new GuiControl(AssetBrowser_editAsset) { position = "0 0"; - extent = "1920 1080"; + extent = "1024 768"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; @@ -13,7 +13,7 @@ isContainer = "1"; canSave = "1"; canSaveDynamicFields = "1"; - enabled = "1"; + Enabled = "1"; new GuiWindowCtrl(AssetBrowser_editAssetWindow) { text = "Asset Properties"; @@ -32,7 +32,7 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "710 375"; + position = "262 219"; extent = "500 329"; minExtent = "48 92"; horizSizing = "center"; @@ -48,7 +48,7 @@ new GuiScrollCtrl() { willFirstRespond = "1"; - hScrollBar = "alwaysOff"; + hScrollBar = "dynamic"; vScrollBar = "dynamic"; lockHorizScroll = "0"; lockVertScroll = "0"; @@ -64,9 +64,9 @@ position = "1 21"; extent = "498 283"; minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "Tools"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiScrollProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -88,9 +88,9 @@ changeChildSizeToFit = "1"; changeChildPosition = "1"; position = "1 1"; - extent = "481 101"; + extent = "493 101"; minExtent = "16 16"; - horizSizing = "right"; + horizSizing = "width"; vertSizing = "bottom"; profile = "GuiInspectorProfile"; visible = "1"; @@ -110,9 +110,9 @@ position = "402 305"; extent = "45 22"; minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; - profile = "ToolsuiButtonProfile"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; visible = "1"; active = "1"; command = "AssetBrowser_editAsset.saveAsset();"; @@ -130,8 +130,8 @@ position = "450 305"; extent = "45 22"; minExtent = "8 2"; - horizSizing = "right"; - vertSizing = "bottom"; + horizSizing = "left"; + vertSizing = "top"; profile = "ToolsGuiButtonProfile"; visible = "1"; active = "1"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui index 23d0fd616..18927399f 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui @@ -1,7 +1,7 @@ //--- OBJECT WRITE BEGIN --- %guiContent = new GuiControl(AssetBrowser_editModule) { position = "0 0"; - extent = "1920 1080"; + extent = "1024 768"; minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; @@ -13,7 +13,7 @@ isContainer = "1"; canSave = "1"; canSaveDynamicFields = "1"; - enabled = "1"; + Enabled = "1"; new GuiWindowCtrl(AssetBrowser_editModuleWindow) { text = "Module Properties"; @@ -32,7 +32,7 @@ anchorBottom = "0"; anchorLeft = "1"; anchorRight = "0"; - position = "710 375"; + position = "262 219"; extent = "500 329"; minExtent = "48 92"; horizSizing = "center"; @@ -110,7 +110,7 @@ position = "402 305"; extent = "45 22"; minExtent = "8 2"; - horizSizing = "right"; + horizSizing = "left"; vertSizing = "top"; profile = "ToolsGuiButtonProfile"; visible = "1"; @@ -130,7 +130,7 @@ position = "450 305"; extent = "45 22"; minExtent = "8 2"; - horizSizing = "right"; + horizSizing = "left"; vertSizing = "top"; profile = "ToolsGuiButtonProfile"; visible = "1"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/main.cs b/Templates/BaseGame/game/tools/assetBrowser/main.cs index 5f1ad1b4e..a47aeaa73 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/main.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/main.cs @@ -24,6 +24,7 @@ function initializeAssetBrowser() echo(" % - Initializing Asset Browser"); $AssetBrowser::importConfigsFile = "tools/assetBrowser/assetImportConfigs.xml"; + $AssetBrowser::collectionSetsFile = "tools/assetBrowser/searchCollectionSets.xml"; $AssetBrowser::currentImportConfig = ""; if(!isObject(AssetFilterTypeList)) @@ -50,6 +51,8 @@ function initializeAssetBrowser() AssetFilterTypeList.add("TerrainMaterialAsset"); } + exec("./scripts/profiles.cs"); + exec("./guis/assetBrowser.gui"); exec("./guis/addModuleWindow.gui"); exec("./guis/gameObjectCreator.gui"); @@ -67,6 +70,7 @@ function initializeAssetBrowser() exec("./guis/assetImportLog.gui"); exec("./guis/looseFileAudit.gui"); exec("./guis/assetNameEdit.gui"); + exec("./guis/createNewCollectionSet.gui"); exec("./scripts/assetBrowser.cs"); exec("./scripts/popupMenus.cs"); @@ -102,6 +106,8 @@ function initializeAssetBrowser() exec("./scripts/assetTypes/terrain.cs"); exec("./scripts/assetTypes/terrainMaterial.cs"); exec("./scripts/assetTypes/datablockObjects.cs"); + exec("./scripts/assetTypes/looseFiles.cs"); + exec("./scripts/assetTypes/prefab.cs"); new ScriptObject( AssetBrowserPlugin ) { @@ -123,19 +129,34 @@ function initializeAssetBrowser() ImportAssetWindow.reloadImportOptionConfigs(); + //CollectionSets + if(!isObject(AssetBrowserCollectionSets)) + { + new Settings(AssetBrowserCollectionSets) + { + file = $AssetBrowser::collectionSetsFile; + }; + } + AssetBrowserCollectionSets.read(); + if(!isObject(ImportAssetWindow.importTempDirHandler)) ImportAssetWindow.importTempDirHandler = makedirectoryHandler(0, "", ""); if(!isObject(ImportActivityLog)) new ArrayObject(ImportActivityLog); + if(!isObject(AssetSearchTerms)) + new ArrayObject(AssetSearchTerms); + ImportAssetWindow.importingFilesArray = new ArrayObject(); - if(!isObject(SessionImportAssetItems)) - new ArrayObject(SessionImportAssetItems); + //if(!isObject(SessionImportAssetItems)) + // new ArrayObject(SessionImportAssetItems); - if(!isObject(ImportAssetItems)) - new ArrayObject(ImportAssetItems); + //if(!isObject(ImportAssetItems)) + // new ArrayObject(ImportAssetItems); + + ImportAssetWindow.importer = new AssetImporter(); AssetBrowser.buildPopupMenus(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs index 7c0692ee6..61b671922 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/addModuleWindow.cs @@ -19,6 +19,11 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- +function AssetBrowser_addModuleWindow::onWake(%this) +{ + %this-->ModuleName.setText(""); +} + function AssetBrowser_addModuleWindow::onGainFirstResponder(%this) { %this-->moduleName.setFirstResponder(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs index 80668cfde..b8e8bf077 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs @@ -3,7 +3,7 @@ new SimGroup(AssetBrowserPreviewCache); //AssetBrowser.addToolbarButton function AssetBrowser::addToolbarButton(%this) { - %filename = expandFilename("tools/gui/images/iconOpen"); + %filename = expandFilename("tools/gui/images/stencilIcons/menuGrid"); %button = new GuiBitmapButtonCtrl() { canSaveDynamicFields = "0"; internalName = AssetBrowserBtn; @@ -22,7 +22,7 @@ function AssetBrowser::addToolbarButton(%this) ToolTip = "Asset Browser"; hovertime = "750"; bitmap = %filename; - bitmapMode = "Centered"; + bitmapMode = "Stretched"; buttonType = "PushButton"; groupNum = "0"; useMouseEvents = "0"; @@ -61,11 +61,26 @@ function AssetBrowser::onWake(%this) //First, build our our list of active modules %modulesList = ModuleDatabase.findModules(true); - %this.setPreviewSize(EditorSettings.value("Assets/Browser/previewTileSize", "small")); + AssetBrowser-->previewSlider.setValue(EditorSettings.value("Assets/Browser/previewTileSize", "1.0")); AssetBrowser.toggleAssetTypeFilter(0); } +function contentTreeTabBook::onTabSelected(%this, %tabText, %tabIndex) +{ + if(%tabText $= "Content") + { + //Force it to navigate to current active directory, which also rebuilds the + //tree + AssetBrowser.dirHandler.navigateTo(AssetBrowser.dirHandler.currentAddress); + } + else + { + AssetBrowser-->filterTree.clear(); + AssetBrowser-->filterTree.buildVisibleTree(true); + } +} + //Filters function AssetBrowser::showFilterPopup(%this) { @@ -184,6 +199,37 @@ function AssetBrowser::toggleAssetTypeFilter(%this, %assetTypeIdx) } } + //Update the displayed search text! + //First, clear out the old type search term + for(%i=0; %i < AssetSearchTerms.count(); %i++) + { + %action = AssetSearchTerms.getKey(%i); + + if(%action $= "type") + { + AssetSearchTerms.erase(%i); + %i--; + } + } + + //Update our search terms + %newSearchPhrase = ""; + for(%i=0; %i < AssetFilterTypeList.Count() + 1; %i++) + { + %isChecked = AssetTypeListPopup.isItemChecked(%i); + + if(!%isChecked) + continue; + + %itemText = AssetTypeListPopup.getItemText(%i); + if(%itemText $= "All") + continue; + + AssetSearchTerms.add("type", %itemText); + } + + %this.updateSearchTextFromFilter(); + %this.rebuildAssetArray(); } @@ -315,6 +361,38 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName ) %assetDesc = %assetName; %assetDesc.assetType = %assetType; } + else if(%assetType $= "LooseFile") + { + %fullPath = %moduleName !$= "" ? %moduleName @ "/" @ %assetName : %assetName; + %fullPath = strreplace(%fullPath, "/", "_"); + %fullPath = strreplace(%fullPath, ".", "-"); + + if(isObject(%fullPath)) + %assetDesc = %fullPath; + else + %assetDesc = new ScriptObject(%fullPath); + + %assetDesc.dirPath = %moduleName; + %assetDesc.assetName = %assetName; + %assetDesc.description = %moduleName @ "/" @ %assetName; + %assetDesc.assetType = %assetType; + } + else if(%assetType $= "Prefab") + { + %fullPath = %moduleName !$= "" ? %moduleName @ "/" @ %assetName : %assetName; + %fullPath = strreplace(%fullPath, "/", "_"); + %fullPath = strreplace(%fullPath, ".", "-"); + + if(isObject(%fullPath)) + %assetDesc = %fullPath; + else + %assetDesc = new ScriptObject(%fullPath); + + %assetDesc.dirPath = %moduleName; + %assetDesc.assetName = %assetName; + %assetDesc.description = %moduleName @ "/" @ %assetName; + %assetDesc.assetType = %assetType; + } } /*%fullPath = %moduleName !$= "" ? %moduleName @ "/" @ %assetName : %assetName; %fullPath = strreplace(%fullPath, "/", "_"); @@ -333,29 +411,65 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName ) //%assetType = "Folder"; } - %previewSize = %this.previewSize SPC %this.previewSize; + %previewSize = 100 SPC 100; %previewBounds = 20; %tooltip = %assetName; %doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );"; - if(%assetType $= "ShapeAsset") + /*if(%assetType $= "ShapeAsset") { %previewButton = AssetPreviewButtonsTemplate-->ShapeAssetPreviewButton.deepClone(); } else { %previewButton = AssetPreviewButtonsTemplate-->GeneralAssetPreviewButton.deepClone(); + }*/ + + %textBottomPad = 20; + + %previewButton = new GuiIconButtonCtrl() + { + class = "AssetBrowserPreviewButton"; + useMouseEvents = true; + iconLocation = "Center"; + sizeIconToButton = true; + makeIconSquare = true; + textLocation = "Bottom"; + extent = %previewSize.x SPC %previewSize.y + %textBottomPad; + buttonType = "RadioButton"; + profile = ToolsGuiDefaultProfile; + }; + + %previewScaleSize = AssetBrowser-->previewSlider.getValue(); + + if(%previewScaleSize $= "") + { + %previewScaleSize = 1; + AssetBrowser-->previewSlider.setValue(1); } - %previewButton.extent = %previewSize.x + %previewBounds SPC %previewSize.y + %previewBounds + 24; + if(%previewScaleSize == 0) + { + %previewButton.iconLocation = "Left"; + %previewButton.textLocation = "Right"; + %previewButton.extent = "120 20"; + } + else + { + %size = %previewSize.x * %previewScaleSize; + %previewButton.extent.x = %size; + %previewButton.extent.y = %size + %textBottomPad; + } + + //%previewButton.extent = %previewSize.x + %previewBounds SPC %previewSize.y + %previewBounds + 24; %previewButton.assetName = %assetName; %previewButton.moduleName = %moduleName; %previewButton.assetType = %assetType; //Build out the preview - %buildCommand = %this @ ".build" @ %assetType @ "Preview(" @ %assetDesc @ "," @ %this.previewData @ ");"; + %buildCommand = %this @ ".build" @ %assetType @ "Preview(\"" @ %assetDesc @ "\"," @ %this.previewData @ ");"; eval(%buildCommand); //debug dump @@ -364,34 +478,42 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName ) %previewImage = %this.previewData.previewImage; %doubleClickCommand = %this.previewData.doubleClickCommand; - %previewButton-->button.assetName = %assetName; - %previewButton-->button.moduleName = %moduleName; - %previewButton-->button.assetType = %assetType; + %previewButton.assetName = %assetName; + %previewButton.moduleName = %moduleName; + %previewButton.assetType = %assetType; if(%assetType $= "ShapeAsset") { - %previewButton-->shapeAssetView.setModel(%previewImage); - %previewButton-->shapeAssetView.extent = %previewSize; + %previewButton.iconBitmap = "tools/assetBrowser/art/genericAssetIcon"; + //%previewButton.profile = AssetBrowserPreviewShapeAsset; + //%previewButton-->shapeAssetView.setModel(%previewImage); + //%previewButton-->shapeAssetView.extent = %previewSize; + } else { - %previewButton-->assetPreviewImage.bitmap = %this.previewData.previewImage; - %previewButton-->assetPreviewImage.extent = %previewSize; + %previewButton.iconBitmap = %this.previewData.previewImage; + //%previewButton-->assetPreviewImage.extent = %previewSize; } - %previewButton-->AssetPreviewBorderButton.extent = %previewSize; + %previewButton.profile = "AssetBrowserPreview" @ %previewButton.assetType; + + //%previewButton-->AssetPreviewBorderButton.extent = %previewSize; //%previewButton-->AssetPreviewButton.internalName = %this.previewData.assetName@"Border"; - %previewButton-->Button.extent = %previewSize.x + %previewBounds SPC %previewSize.y + 24; - %previewButton-->Button.tooltip = %this.previewData.tooltip; - %previewButton-->Button.Command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );"; - %previewButton-->Button.altCommand = %doubleClickCommand; + //%previewButton-->Button.extent = %previewSize.x + %previewBounds SPC %previewSize.y + 24; + %previewButton.tooltip = %this.previewData.tooltip; + %previewButton.Command = "AssetBrowser.updateSelection( $ThisControl.getParent().assetName, $ThisControl.getParent().moduleName );"; + %previewButton.altCommand = %doubleClickCommand; //%previewButton-->AssetPreviewButton.icon = %this.previewData.previewImage; - %previewButton-->AssetNameLabel.position = 0 SPC %previewSize.y + %previewBounds - 16; - %previewButton-->AssetNameLabel.extent = %previewSize.x + %previewBounds SPC 16; - %previewButton-->AssetNameLabel.text = %this.previewData.assetName; - %previewButton-->AssetNameLabel.originalAssetName = %this.previewData.assetName; + %previewButton.text = %this.previewData.assetName; + %previewButton.text.originalAssetName = %this.previewData.assetName; + + //%previewButton-->AssetNameLabel.position = 0 SPC %previewSize.y + %previewBounds - 16; + //%previewButton-->AssetNameLabel.extent = %previewSize.x + %previewBounds SPC 16; + //%previewButton-->AssetNameLabel.text = %this.previewData.assetName; + //%previewButton-->AssetNameLabel.originalAssetName = %this.previewData.assetName; // add to the gui control array AssetBrowser-->assetList.add(%previewButton); @@ -439,26 +561,44 @@ function AssetPreviewButton::onDoubleClick(%this) // // +function assetBrowserPreviewSlider::onMouseDragged(%this) +{ + EditorSettings.setValue("Assets/Browser/previewTileSize", %this.getValue()); + AssetBrowser.refresh(); +} + function AssetBrowser::loadDirectories( %this ) { AssetBrowser-->filterTree.clear(); %dataItem = AssetBrowser-->filterTree.insertItem(0, "Content"); + AssetBrowser-->filterTree.collectionsIdx = AssetBrowser-->filterTree.insertItem(1, "Collections"); + + AssetBrowser-->filterTree.modulesIdx = AssetBrowser-->filterTree.insertItem(1, "Modules"); + + %dataItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "Data"); + AssetBrowser-->filterTree.tagsIdx = AssetBrowser-->filterTree.insertItem(1, "Tags"); + AssetBrowser-->filterTree.creatorIdx = AssetBrowser-->filterTree.insertItem(1, "Creator"); - %dataItem = AssetBrowser-->filterTree.insertItem(1, "Data"); %this.dirHandler.loadFolders("Data", %dataItem); + %this.loadCollectionSets(); + + %this.loadTags(); + + %this.loadCreatorClasses(); + //If set to, show core if(%this.coreModulesFilter) { - %coreItem = AssetBrowser-->filterTree.insertItem(1, "Core"); + %coreItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "Core"); %this.dirHandler.loadFolders("Core", %coreItem); } //If set to, show tools if(%this.toolsModulesFilter) { - %toolsItem = AssetBrowser-->filterTree.insertItem(1, "Tools"); + %toolsItem = AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.modulesIdx, "Tools"); %this.dirHandler.loadFolders("Tools", %toolsItem); } @@ -575,6 +715,198 @@ function AssetBrowser::updateSelection( %this, %asset, %moduleName ) %this.prevSelectedMaterialHL = %asset; } +function AssetBrowser::loadCollectionSets(%this) +{ + //Process any datablocks and populate their lists categories as tags as well + %collectionsItem = AssetBrowser-->filterTree.collectionsIdx; + + %collectionsCount = AssetBrowserCollectionSets.value("CollectionSetCount", 0); + + for ( %i = 0; %i < %collectionsCount; %i++ ) + { + %collection = AssetBrowserCollectionSets.value("Collection"@%i, ""); + %collectionName = getField(%collection, 0); + %collectionTerm = getField(%collection, 1); + + AssetBrowser-->filterTree.insertItem(%collectionsItem, %collectionName, %collectionTerm); + } +} + +function AssetBrowser::setCollectionSetActive(%this, %collectionSet) +{ + AssetBrowserSearchFilter.setText(%collectionSet); + AssetBrowserSearchFilter.onReturn(); +} + +function AssetBrowser::loadTags(%this) +{ + //Process any datablocks and populate their lists categories as tags as well + %dataGroup = "DataBlockGroup"; + %tagItem = AssetBrowser-->filterTree.tagsIdx; + + for ( %i = 0; %i < %dataGroup.getCount(); %i++ ) + { + %obj = %dataGroup.getObject(%i); + // echo ("Obj: " @ %obj.getName() @ " - " @ %obj.category ); + + if ( %obj.category $= "" && %obj.category == 0 ) + continue; + + %tagChildItem = AssetBrowser-->filterTree.findChildItemByName(%tagItem, %obj.category); + if(%tagChildItem == 0) + { + //Didn't already exist, so register it in + AssetBrowser-->filterTree.insertItem(%tagItem, %obj.category); + } + } +} + +function AssetBrowser::setTagActive(%this, %tag) +{ + %found = false; + + for(%i=0; %i < AssetSearchTerms.count(); %i++) + { + %action = AssetSearchTerms.getKey(%i); + %word = AssetSearchTerms.getValue(%i); + + if(%action $= "tag" && %word $= %tag) + { + //If we found it, we just remove it from our list, toggling it off + AssetSearchTerms.erase(%i); + %found = true; + } + } + + //If we didn't find it, we're going to add it into our list + if(!%found) + { + AssetSearchTerms.add("tag", %tag); + } + + %this.updateSearchTextFromFilter(); + + %this.rebuildAssetArray(); +} + +function AssetBrowser::loadCreatorClasses(%this) +{ + // Just so we can recall this method for testing changes + // without restarting. + if ( isObject( %this.creatorClassArray ) ) + %this.creatorClassArray.delete(); + + %this.creatorClassArray = new ArrayObject(); + %this.creatorClassArray.caseSensitive = true; + //%this.setListView( true ); + + %this.beginCreatorGroup( "Environment" ); + + /*// Removed Prefab as there doesn't really seem to be a point in creating a blank one + //%this.registerMissionObject( "Prefab", "Prefab" ); + %this.registerMissionObject( "SkyBox", "Sky Box" ); + %this.registerMissionObject( "CloudLayer", "Cloud Layer" ); + %this.registerMissionObject( "BasicClouds", "Basic Clouds" ); + %this.registerMissionObject( "ScatterSky", "Scatter Sky" ); + %this.registerMissionObject( "Sun", "Basic Sun" ); + %this.registerMissionObject( "Lightning" ); + %this.registerMissionObject( "WaterBlock", "Water Block" ); + %this.registerMissionObject( "SFXEmitter", "Sound Emitter" ); + %this.registerMissionObject( "Precipitation" ); + %this.registerMissionObject( "ParticleEmitterNode", "Particle Emitter" ); + + // Legacy features. Users should use Ground Cover and the Forest Editor. + //%this.registerMissionObject( "fxShapeReplicator", "Shape Replicator" ); + //%this.registerMissionObject( "fxFoliageReplicator", "Foliage Replicator" ); + + %this.registerMissionObject( "PointLight", "Point Light" ); + %this.registerMissionObject( "SpotLight", "Spot Light" ); + %this.registerMissionObject( "GroundCover", "Ground Cover" ); + %this.registerMissionObject( "TerrainBlock", "Terrain Block" ); + %this.registerMissionObject( "GroundPlane", "Ground Plane" ); + %this.registerMissionObject( "WaterPlane", "Water Plane" ); + %this.registerMissionObject( "PxCloth", "Cloth" ); + %this.registerMissionObject( "ForestWindEmitter", "Wind Emitter" ); + + %this.registerMissionObject( "DustEmitter", "Dust Emitter" ); + %this.registerMissionObject( "DustSimulation", "Dust Simulation" ); + %this.registerMissionObject( "DustEffecter", "Dust Effecter" );*/ + + %this.endCreatorGroup(); + + %this.beginCreatorGroup( "Level" ); + + /*%this.registerMissionObject( "MissionArea", "Mission Area" ); + %this.registerMissionObject( "Path" ); + %this.registerMissionObject( "Marker", "Path Node" ); + %this.registerMissionObject( "Trigger" ); + %this.registerMissionObject( "PhysicalZone", "Physical Zone" ); + %this.registerMissionObject( "Camera" ); + %this.registerMissionObject( "LevelInfo", "Level Info" ); + %this.registerMissionObject( "TimeOfDay", "Time of Day" ); + %this.registerMissionObject( "Zone", "Zone" ); + %this.registerMissionObject( "Portal", "Zone Portal" ); + %this.registerMissionObject( "SpawnSphere", "Player Spawn Sphere", "PlayerDropPoint" ); + %this.registerMissionObject( "SpawnSphere", "Observer Spawn Sphere", "ObserverDropPoint" ); + %this.registerMissionObject( "SFXSpace", "Sound Space" ); + %this.registerMissionObject( "OcclusionVolume", "Occlusion Volume" );*/ + + %this.endCreatorGroup(); + + %this.beginCreatorGroup( "System" ); + + //%this.registerMissionObject( "SimGroup" ); + //%this.registerMissionObject( "AIPathGroup" ); + + %this.endCreatorGroup(); + + %this.beginCreatorGroup( "ExampleObjects" ); + + //%this.registerMissionObject( "RenderObjectExample" ); + //%this.registerMissionObject( "RenderMeshExample" ); + //%this.registerMissionObject( "RenderShapeExample" ); + + %this.endCreatorGroup(); + + %this.creatorClassArray.sortk(); +} + +function AssetBrowser::beginCreatorGroup(%this, %group) +{ + %this.currentCreatorGroup = %group; + + AssetBrowser-->filterTree.insertItem(AssetBrowser-->filterTree.creatorIdx, %group); +} + +function AssetBrowser::endCreatorGroup(%this, %group) +{ + %this.currentCreatorGroup = ""; +} + +function AssetBrowser::addCreatorClass(%this, %class, %name, %buildfunc) +{ + if( !isClass(%class) ) + return; + + if ( %name $= "" ) + %name = %class; + + if ( %this.currentCreatorGroup !$= "" && %group $= "" ) + %group = %this.currentCreatorGroup; + + if ( %class $= "" || %group $= "" ) + { + warn( "AssetBrowser::addCreatorClass, invalid parameters!" ); + return; + } + + %args = new ScriptObject(); + %args.val[0] = %class; + %args.val[1] = %name; + %args.val[2] = %buildfunc; + + %this.creatorClassArray.push_back( %group, %args ); +} // //needs to be deleted with the persistence manager and needs to be blanked out of the matmanager //also need to update instances... i guess which is the tricky part.... @@ -777,12 +1109,12 @@ function AssetBrowser::reImportAsset(%this) // // // RMB context popups -function AssetPreviewButton::onRightClick(%this) +function AssetBrowserPreviewButton::onRightClick(%this) { - AssetBrowser.selectedAssetPreview = %this.getParent(); - EditAssetPopup.assetId = %this.getParent().moduleName @ ":" @ %this.getParent().assetName; - EditAssetPopup.assetType = %this.getParent().assetType; - %assetType = %this.getParent().assetType; + AssetBrowser.selectedAssetPreview = %this; + EditAssetPopup.assetId = %this.moduleName @ ":" @ %this.assetName; + EditAssetPopup.assetType = %this.assetType; + %assetType = %this.assetType; //Do some enabling/disabling of options depending on asset type EditAssetPopup.enableItem(0, true); @@ -806,7 +1138,7 @@ function AssetPreviewButton::onRightClick(%this) EditLevelAssetPopup.showPopup(Canvas); else if(%assetType $= "Folder") { - EditFolderPopup.dirPath = %this.getParent().moduleName @ "/" @ %this.getParent().assetName; + EditFolderPopup.dirPath = %this.moduleName @ "/" @ %this.assetName; EditFolderPopup.showPopup(Canvas); } else @@ -814,7 +1146,7 @@ function AssetPreviewButton::onRightClick(%this) if(%assetType $= "Folder") { - EditAssetPopup.assetId = %this.getParent().moduleName @ "/" @ %this.getParent().assetName; + EditAssetPopup.assetId = %this.moduleName @ "/" @ %this.assetName; } } @@ -829,88 +1161,129 @@ function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId) %count = %this.getSelectedItemsCount(); %itemText = %this.getItemText(%itemId); - if( %this.getSelectedItemsCount() > 0 && (%itemText !$= "Data" && %itemText !$= "Core" && %itemText !$= "Tools")) + %parentItem = %this.getParentItem(%itemId); + if(%parentItem == %this.tagsIdx) { - //AddNewAssetPopup.showPopup(Canvas); - - //We have something clicked, so figure out if it's a sub-filter or a module filter, then push the correct - //popup menu - %parentItem = %this.getParentItem(%itemId); - if(%this.getItemText(%parentItem) $= "Data") //if it's a data module, continue + } + else if(%parentItem == %this.collectionsIdx) + { + EditCollectionSets.showPopup(Canvas); + AssetBrowser.selectedCollectionSet = %itemText; + } + else if(%parentItem == %this.creatorIdx) + { + } + else + { + if( %this.getSelectedItemsCount() > 0 && (%itemText !$= "Data" && %itemText !$= "Core" && %itemText !$= "Tools")) { - //find out if it's a folder or a module! - if(ModuleDatabase.findModule(%itemText)) + //AddNewAssetPopup.showPopup(Canvas); + + //We have something clicked, so figure out if it's a sub-filter or a module filter, then push the correct + //popup menu + %parentItem = %this.getParentItem(%itemId); + if(%this.getItemText(%parentItem) $= "Data") //if it's a data module, continue { - //yep, module, push the all-inclusive popup - EditModulePopup.showPopup(Canvas); - //also set the module value for creation info - AssetBrowser.selectedModule = %itemText; + //find out if it's a folder or a module! + if(ModuleDatabase.findModule(%itemText)) + { + //yep, module, push the all-inclusive popup + EditModulePopup.showPopup(Canvas); + //also set the module value for creation info + AssetBrowser.selectedModule = %itemText; + } + else + { + EditNonModulePopup.showPopup(Canvas); + EditNonModulePopup.targetFolder = %itemText; + } } else { - EditNonModulePopup.showPopup(Canvas); - EditNonModulePopup.targetFolder = %itemText; + EditFolderPopup.showPopup(Canvas); + EditFolderPopup.assetType = "Folder"; } } - else + else if(%itemText $= "Data") { - EditFolderPopup.showPopup(Canvas); - EditFolderPopup.assetType = "Folder"; + AddNewModulePopup.showPopup(Canvas); + } + else if(%itemText $= "Tools") + { + AddNewToolPopup.showPopup(Canvas); } - } - else if(%itemText $= "Data") - { - AddNewModulePopup.showPopup(Canvas); - } - else if(%itemText $= "Tools") - { - AddNewToolPopup.showPopup(Canvas); } } // // // +function AssetBrowser::refreshDatabases(%this) +{ + //ModuleDatabase.scanModules( "data", false ); + //ModuleDatabase.unloadGroup( "Game" ); + //ModuleDatabase.LoadGroup( "Game" ); +} + function AssetBrowser::showVisibiltyOptions(%this) { BrowserVisibilityPopup.showPopup(Canvas); } -function AssetBrowser::showFilterOptions(%this) +function AssetBrowser::saveCurrentFiltersAsCollection(%this) { + %colSetName = CreateNewCollectionSetCtrl-->collectionSetName.getText(); + if(%colSetName $= "") + { + error("Collection Sets require a name!"); + } + + %collectionsCount = AssetBrowserCollectionSets.value("CollectionSetCount", 0); + %collectionsCount += 1; + + AssetBrowserCollectionSets.setValue("CollectionSetCount", %collectionsCount); + + %collection = %colSetName TAB AssetBrowserSearchFilter.getText(); + + AssetBrowserCollectionSets.setValue("Collection"@%collectionsCount-1, %collection); + + %success = AssetBrowserCollectionSets.write(); + + AssetBrowser.loadDirectories(); } -// -// -// Preview tile handling -function AssetBrowser::setPreviewSize(%this, %size) +function AssetBrowser::deleteCollectionSet(%this) { - AssetPreviewSizePopup.checkItem(0, false); - AssetPreviewSizePopup.checkItem(1, false); - AssetPreviewSizePopup.checkItem(2, false); + %collectionsCount = AssetBrowserCollectionSets.value("CollectionSetCount", 0); + %tempCollectionListCount = 0; - %this.previewSize = 80; //default to small - - if(%size $= "Small") + %found = false; + for ( %i = 0; %i < %collectionsCount; %i++ ) { - %this.previewSize = 80; - AssetPreviewSizePopup.checkItem(0, true); - } - else if(%size $= "Medium") - { - %this.previewSize = 120; - AssetPreviewSizePopup.checkItem(1, true); - } - else if(%size $= "Large") - { - %this.previewSize = 160; - AssetPreviewSizePopup.checkItem(2, true); - } - - EditorSettings.setValue("Assets/Browser/previewTileSize", %size); + %collection = AssetBrowserCollectionSets.value("Collection"@%i, ""); + %collectionName = getField(%collection, 0); + %collectionTerm = getField(%collection, 1); - %this.rebuildAssetArray(); + if(AssetBrowser.selectedCollectionSet !$= %collectionName) + { + %tempCollectionList[%tempCollectionListCount] = %collection; + %tempCollectionListCount++; + } + } + + AssetBrowserCollectionSets.setValue("CollectionSetCount", %tempCollectionListCount); + for(%i=0; %i < %collectionsCount; %i++) + { + if(%i < %tempCollectionListCount) + AssetBrowserCollectionSets.setValue("Collection"@%i, %tempCollectionList[%i]); + else + AssetBrowserCollectionSets.remove("Collection"@%i); + } + + AssetBrowserCollectionSets.write(); + + %this.loadDirectories(); } function AssetBrowser::refreshPreviews(%this) @@ -924,21 +1297,56 @@ function AssetBrowserFilterTree::onSelect(%this, %itemId) //can't select root return; - //Make sure we have an actual module selected! - %parentId = %this.getParentItem(%itemId); - - %name = %this.getItemText(%itemId); - - %breadcrumbPath = %this.getItemValue(%itemId); - if(%breadcrumbPath !$= "") - %breadcrumbPath = %breadcrumbPath @ "/" @ %this.getItemText(%itemId); + //process special cases + %parentItem = %this.getParentItem(%itemId); + if(%parentItem == %this.tagsIdx) + { + //we selected a tag, so deal with that + AssetBrowser.setTagActive(%this.getItemText(%itemId)); + } + else if(%parentItem == %this.collectionsIdx) + { + //A collection set was selected + AssetBrowser.setCollectionSetActive(%this.getItemValue(%itemId)); + } + else if(%parentItem == %this.creatorIdx) + { + //One of the creator folders was selected + %creatorGroup = %this.getItemText(%itemId); + for ( %i = 0; %i < %this.creatorClassArray.count(); %i++ ) + { + %group = %array.getKey( %i ); + + if ( %group $= %creatorGroup ) + { + %args = %array.getValue( %i ); + %class = %args.val[0]; + %name = %args.val[1]; + %func = %args.val[2]; + + //%this.addMissionObjectIcon( %class, %name, %func ); + echo("Populating Creator Group! " @ %group @ " for class: " @ %class); + } + } + } else - %breadcrumbPath = %this.getItemText(%itemId); + { + //Make sure we have an actual module selected! + %parentId = %this.getParentItem(%itemId); - if(%breadcrumbPath $= "") - %breadcrumbPath = AssetBrowser.dirHandler.currentAddress; + %name = %this.getItemText(%itemId); - AssetBrowser.navigateTo(%breadcrumbPath); + %breadcrumbPath = %this.getItemValue(%itemId); + if(%breadcrumbPath !$= "") + %breadcrumbPath = %breadcrumbPath @ "/" @ %this.getItemText(%itemId); + else + %breadcrumbPath = %this.getItemText(%itemId); + + if(%breadcrumbPath $= "") + %breadcrumbPath = AssetBrowser.dirHandler.currentAddress; + + AssetBrowser.navigateTo(%breadcrumbPath); + } } function AssetBrowser::rebuildAssetArray(%this) @@ -972,9 +1380,6 @@ function AssetBrowser::doRebuildAssetArray(%this) %finalAssetCount = 0; - %searchText = AssetBrowserSearchFilter.getText(); - %searchFilterActive = %searchText !$= "Search Assets..."; - //now, we'll iterate through, and find the assets that are in this module, and this category for( %i=0; %i < %numAssetsFound; %i++) { @@ -986,7 +1391,8 @@ function AssetBrowser::doRebuildAssetArray(%this) //clean up the path %assetBasePath = strreplace(%assetBasePath, "//", "/"); - if(%assetBasePath $= %breadcrumbPath || (%searchFilterActive && startsWith(%assetBasePath,%breadcrumbPath))) + %searchActive = AssetSearchTerms.count() != 0; + if(%assetBasePath $= %breadcrumbPath || (%searchActive && startsWith(%assetBasePath,%breadcrumbPath))) { //first, get the asset's module, as our major categories %module = AssetDatabase.getAssetModule(%assetId); @@ -999,7 +1405,7 @@ function AssetBrowser::doRebuildAssetArray(%this) %assetType = AssetDatabase.getAssetType(%assetId); } - %validType = false; + /*%validType = false; if(AssetBrowser.assetTypeFilter $= "") { @@ -1038,34 +1444,32 @@ function AssetBrowser::doRebuildAssetArray(%this) { if(%assetType !$= AssetBrowser.assetTypeFilter) continue; - } + }*/ - /*if(%this.getItemText(%itemId) $= %assetType || (%assetType $= "" && %this.getItemText(%itemId) $= "Misc") - || %moduleItemId == 1) - {*/ - //stop adding after previewsPerPage is hit - %assetName = AssetDatabase.getAssetName(%assetId); - - if(%searchFilterActive) - { - if(strstr(strlwr(%assetName), strlwr(%searchText)) != -1) - { - %assetArray.add( %moduleName, %assetId); - - if(%assetType !$= "Folder") - %finalAssetCount++; - } - } - else - { - //got it. - %assetArray.add( %moduleName, %assetId ); - - if(%assetType !$= "Folder") - %finalAssetCount++; - } - //} - } + //stop adding after previewsPerPage is hit + %assetName = AssetDatabase.getAssetName(%assetId); + + if(%searchActive) + { + if(matchesSearch(%assetName, %assetType)) + { + %assetArray.add( %moduleName, %assetId); + + if(%assetType !$= "Folder") + %finalAssetCount++; + + continue; + } + } + else + { + //got it. + %assetArray.add( %moduleName, %assetId ); + + if(%assetType !$= "Folder") + %finalAssetCount++; + } + } } //Add folders @@ -1076,11 +1480,14 @@ function AssetBrowser::doRebuildAssetArray(%this) { %folderName = getField(%folders, %f); - %searchText = AssetBrowserSearchFilter.getText(); - if(%searchText !$= "Search Assets...") + %searchActive = AssetSearchTerms.count() != 0; + if(%searchActive) { - if(strstr(strlwr(%folderName), strlwr(%searchText)) != -1) - %assetArray.add( %breadcrumbPath, "Folder" TAB %folderName ); + if(matchesSearch(%folderName, "Folder", "")) + { + %assetArray.add( %breadcrumbPath, "Folder" TAB %folderName ); + continue; + } } else { @@ -1105,10 +1512,22 @@ function AssetBrowser::doRebuildAssetArray(%this) %dbFilename = %obj.getFileName(); %dbFilePath = filePath(%dbFilename); - if(%breadcrumbPath $= %dbFilePath) + %searchActive = AssetSearchTerms.count() != 0; + if(%searchActive) + { + if(startsWith(%dbFilePath, %breadcrumbPath)) + { + %dbName = %obj.getName(); + if(matchesSearch(%dbName, "Datablock")) + { + %assetArray.add( %dbFilename, "Datablock" TAB %dbName ); + } + } + } + else if(%dbFilePath $= %breadcrumbPath) { %dbName = %obj.getName(); - %assetArray.add( %breadcrumbPath, "Datablock" TAB %dbName ); + %assetArray.add( %dbFilename, "Datablock" TAB %dbName ); /*%catItem = AssetBrowser-->filterTree.findItemByName(%obj.category); @@ -1120,14 +1539,47 @@ function AssetBrowser::doRebuildAssetArray(%this) %this.addFolderIcon( %obj.category ); }*/ } - /*else if ( %breadcrumbPath $= %obj.category ) - { - AssetBrowser-->filterTree.insertItem(%scriptedItem, %obj.getName()); - }*/ + } + + %this.getLooseFilesInDir(); + + %looseFiles = ABLooseFileArray.count(); + for( %i=0; %i < %looseFiles; %i++) + { + %looseFileFullPath = ABLooseFileArray.getKey(%i); + %looseFilePath = filePath(%looseFileFullPath); + %looseFileName = fileName(%looseFileFullPath); + + %assetArray.add( %looseFilePath, "LooseFile" TAB %looseFileName ); } - AssetBrowser.currentPreviewPage = 0; - AssetBrowser.totalPages = 1; + //Prefabs + %expr = "*.prefab"; + %fullPrefabPath = findFirstFile( %breadcrumbPath @ "/" @ %expr ); + + while ( %fullPrefabPath !$= "" ) + { + %prefabPath = filePath(%fullPrefabPath); + %prefabName = fileName(%fullPrefabPath); + + %searchActive = AssetSearchTerms.count() != 0; + if(%searchActive) + { + if(startsWith(%prefabPath, %breadcrumbPath)) + { + if(matchesSearch(%prefabName, "Prefab")) + { + %assetArray.add( %prefabPath, "Prefab" TAB %prefabName ); + } + } + } + else if(%prefabPath $= %breadcrumbPath) + { + %assetArray.add( %prefabPath, "Prefab" TAB %prefabName ); + } + + %fullPrefabPath = findNextFile( %breadcrumbPath @ "/" @ %expr ); + } for(%i=0; %i < %assetArray.count(); %i++) AssetBrowser.buildAssetPreview( %assetArray.getValue(%i), %assetArray.getKey(%i) ); @@ -1154,9 +1606,6 @@ function AssetBrowser::doRebuildAssetArray(%this) } } } - - //if(!%validType) - // continue; } else { @@ -1169,6 +1618,141 @@ function AssetBrowser::doRebuildAssetArray(%this) %this.previewArrayDirty = false; } +// +// +// Search +function AssetBrowser::updateSearchTextFromFilter(%this) +{ + AssetSearchTerms.sortk(); + + //Update the displayed search text! + %newSearchPhrase = ""; + %currentAction = ""; + %actionCount = 0; + for(%i=0; %i < AssetSearchTerms.count(); %i++) + { + %action = AssetSearchTerms.getKey(%i); + %word = AssetSearchTerms.getValue(%i); + + if(%action !$= %currentAction) + { + if(%actionCount != 0) + { + if(%action !$= "") + %newSearchPhrase = %newSearchPhrase @ ";" @ %action @ ":" @ %word; + else + %newSearchPhrase = %newSearchPhrase @ ";" @ %word; + } + else + { + if(%action !$= "") + %newSearchPhrase = %action @ ":" @ %word; + else + %newSearchPhrase = %word; + } + + %actionCount++; + } + else + { + %newSearchPhrase = %newSearchPhrase @ "," @ %word; + } + + %currentAction = %action; + } + + AssetBrowserSearchFilter.setText(%newSearchPhrase); +} + +function AssetBrowser::processSearchFilter(%this) +{ + AssetSearchTerms.empty(); + + %searchText = AssetBrowserSearchFilter.getText(); + + %termCount = getTokenCount(%searchText, ";"); + for(%s=0; %s < %termCount; %s++) + { + %term = getToken(%searchText, ";", %s); + + %phraseCount = getTokenCount(%term, ":"); + + if(%phraseCount == 2) + { + //action/words split + %action = getToken(%term, ":", 0); + %words = getToken(%term, ":", 1); + } + else + { + %action = ""; + %words = getToken(%term, ":", 0); + } + + %wordCount = getTokenCount(%words, ","); + for(%w=0; %w < %wordCount; %w++) + { + %word = getToken(%words, ",", %w); + AssetSearchTerms.add(%action, %word); + } + } +} + +//Takes an item and compares it against the parsed search language +//This is written to be inclusive, rather than exclusive +function matchesSearch(%assetName, %assetType) +{ + if(AssetSearchTerms.count() == 0) + return true; + + %matchTags = false; + %matchType = false; + %matchName = false; + + %needsTag = false; + %needsType = false; + %needsName = false; + for(%i=0; %i < AssetSearchTerms.count(); %i++) + { + %action = AssetSearchTerms.getKey(%i); + %word = AssetSearchTerms.getValue(%i); + + if(%action $= "tag" && %matchTags == false) + { + %needsTag = true; + if(%assetType $= "Datablock") + { + if(%assetName.category $= %word) + %matchTags = true; + } + else + { + if(%assetName.tags !$= %word) + %matchTags = true; + } + } + else if(%action $= "type" && %matchType == false) + { + %needsType = true; + if(%assetType $= %word) + %matchType = true; + } + else if(%action $= "" && %matchName == false) + { + %needsName = true; + if(strstr(strlwr(%assetName), strlwr(%word)) != -1) + %matchName = true; + } + } + + if(((%needsTag && %matchTags) || !%needsTag) && + ((%needsType && %matchType) || !%needsType) && + ((%needsName && %matchName) || !%needsName)) + return true; + else + return false; +} + // // // Search Filters @@ -1197,37 +1781,74 @@ function AssetBrowserFolderSearchFilter::onReturn( %this ) AssetBrowser.refresh(); } +function AssetBrowserFolderSearchFilter::onEdited(%this) +{ + if(AssetBrowserFolderSearchFilter.getText() $= "") + { + AssetBrowser-->folderSearchBtn.setBitmap("tools/gui/images/stencilIcons/zoom.png"); + } + else + { + AssetBrowser-->folderSearchBtn.setBitmap("tools/gui/images/stencilIcons/cross.png"); + } +} + +function AssetBrowserSearchFilter::onEdited(%this) +{ + AssetBrowserSearchFilter.updateButton(); +} + function AssetBrowserSearchFilter::onReturn( %this ) { %text = %this.getText(); if( %text $= "" ) %this.reset(); + + AssetBrowserSearchFilter.updateButton(); + + AssetBrowser.processSearchFilter(); AssetBrowser.rebuildAssetArray(); } +function AssetBrowserSearchFilter::updateButton(%this) +{ + if(%this.getText() $= "") + { + AssetBrowser-->assetSearchBtn.setBitmap("tools/gui/images/stencilIcons/zoom.png"); + } + else + { + AssetBrowser-->assetSearchBtn.setBitmap("tools/gui/images/stencilIcons/cross.png"); + } +} + function AssetBrowserFolderSearchFilter::reset( %this ) { - %this.setText( "Search Folders..." ); - - AssetBrowser.refresh(); + %this.setText( "" ); + AssetBrowser-->folderSearchBtn.setBitmap("tools/gui/images/stencilIcons/zoom.png"); + //AssetBrowser.refresh(); } function AssetBrowserSearchFilter::reset( %this ) { - %this.setText( "Search Assets..." ); - - AssetBrowser.rebuildAssetArray(); + %this.setText( "" ); + AssetBrowser-->assetSearchBtn.setBitmap("tools/gui/images/stencilIcons/zoom.png"); + //AssetBrowser.rebuildAssetArray(); } -function AssetBrowser_ClearFolderFilterBtn::onClick( %this ) +function AssetBrowserFolderSearchBtn::onClick( %this ) { AssetBrowserFolderSearchFilter.reset(); + AssetBrowser.refresh(); } -function AssetBrowser_ClearAssetFilterBtn::onClick( %this ) +function AssetBrowserAssetSearchBtn::onClick( %this ) { AssetBrowserSearchFilter.reset(); + AssetBrowser.processSearchFilter(); + + AssetBrowser.rebuildAssetArray(); } // @@ -1240,7 +1861,10 @@ function AssetBrowser::navigateTo(%this, %address, %historyNav) { AssetBrowser.dirHandler.navigateTo(%address, %historyNav); - %this.updateNavigationBreadcrumb(%address); + //%this.updateNavigationBreadcrumb(%address); + + AssetBrowser.lastValidNavPath = %address; + AssetBrowser-->navPath.setText(%address); %module = AssetBrowser.dirHandler.getModuleFromAddress(%address); if(%module !$= "") @@ -1248,6 +1872,15 @@ function AssetBrowser::navigateTo(%this, %address, %historyNav) //legit module, so set it as current target AssetBrowser.SelectedModule = %module.moduleId; } + + if(%this.hasLooseFilesInDir()) + { + %this-->AutoImportAssetButton.visible = true; + } + else + { + %this-->AutoImportAssetButton.visible = false; + } } %this.rebuildAssetArray(); @@ -1346,6 +1979,20 @@ function AssetBrowser::updateNavigationBreadcrumb(%this, %address) AssetBrowser_NavigateForwardBtn.tooltip = %foreButtonHistory; } +function assetBrowserNavPath::onReturn(%this) +{ + %newPath = %this.getText(); + if(isDirectory(%newPath)) + { + AssetBrowser.lastValidNavPath = %newPath; + AssetBrowser.navigateTo(%newPath); + } + else + { + %this.setText(AssetBrowser.lastValidNavPath); + AssetBrowser.navigateTo(AssetBrowser.lastValidNavPath); + } +} // // // @@ -1403,9 +2050,13 @@ function AssetBrowser::toggleFolderCollapseButton(%this) // // // Drag n drop -function AssetPreviewButton::onMouseDragged(%this) +function AssetBrowserPreviewButton::onMouseDragged(%this) { - %payload = new GuiBitmapButtonCtrl(); + %payload = %this.clone(); + %payload.position = "0 0"; + //%payload.class = "AssetPreviewControl"; + + /*%payload = new GuiBitmapButtonCtrl(); //%payload.assignFieldsFrom( %this ); %payload.assetName = %this.assetName; %payload.assetType = %this.assetType ; @@ -1415,7 +2066,7 @@ function AssetPreviewButton::onMouseDragged(%this) %payload.dragSourceControl = %this; %payload.bitmap = %this.icon; %payload.extent.x /= 2; - %payload.extent.y /= 2; + %payload.extent.y /= 2;*/ %xOffset = getWord( %payload.extent, 0 ) / 2; %yOffset = getWord( %payload.extent, 1 ) / 2; @@ -1470,14 +2121,16 @@ function AssetPreviewButton::onMouseDragged(%this) Canvas.pushDialog(EditorDragAndDropLayer); %ctrl.startDragging( %xOffset, %yOffset ); + + Canvas.repaint(); } -function AssetPreviewButton::onControlDragCancelled(%this) +function AssetBrowserPreviewButton::onControlDragCancelled(%this) { Canvas.popDialog(EditorDragAndDropLayer); } -function AssetPreviewButton::onControlDropped( %this, %payload, %position ) +function AssetBrowserPreviewButton::onControlDropped( %this, %payload, %position ) { Canvas.popDialog(EditorDragAndDropLayer); @@ -1490,9 +2143,9 @@ function AssetPreviewButton::onControlDropped( %this, %payload, %position ) if( %payload.dragSourceControl == %this ) return; - %assetType = %payload.dragSourceControl.parentGroup.assetType; - %assetName = %payload.dragSourceControl.parentGroup.assetName; - %moduleName = %payload.dragSourceControl.parentGroup.moduleName; + %assetType = %payload.assetType; + %assetName = %payload.assetName; + %moduleName = %payload.moduleName; %targetAssetName = %this.assetName; %targetAssetType = %this.assetType; @@ -1543,16 +2196,23 @@ function EWorldEditor::onControlDropped( %this, %payload, %position ) if( %payload.dragSourceControl == %this ) return; - %assetType = %payload.dragSourceControl.parentGroup.assetType; + %assetType = %payload.assetType; %pos = EWCreatorWindow.getCreateObjectPosition(); //LocalClientConnection.camera.position; - %module = %payload.dragSourceControl.parentGroup.moduleName; - %asset = %payload.dragSourceControl.parentGroup.assetName; + %module = %payload.moduleName; + %asset = %payload.assetName; if(AssetBrowser.isMethod("on" @ %assetType @ "EditorDropped")) { - %assetDef = AssetDatabase.acquireAsset(%module @ ":" @ %asset); - %buildCommand = AssetBrowser @ ".on" @ %assetType @ "EditorDropped(" @ %assetDef @ ",\"" @ %position @ "\");"; + if(%assetType $= "Datablock") + { + %buildCommand = AssetBrowser @ ".on" @ %assetType @ "EditorDropped(" @ %asset @ ",\"" @ %position @ "\");"; + } + else + { + %assetDef = AssetDatabase.acquireAsset(%module @ ":" @ %asset); + %buildCommand = AssetBrowser @ ".on" @ %assetType @ "EditorDropped(" @ %assetDef @ ",\"" @ %position @ "\");"; + } eval(%buildCommand); } @@ -1639,9 +2299,9 @@ function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position ) if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) ) return; - %assetType = %payload.dragSourceControl.parentGroup.assetType; - %assetName = %payload.dragSourceControl.parentGroup.assetName; - %moduleName = %payload.dragSourceControl.parentGroup.moduleName; + %assetType = %payload.assetType; + %assetName = %payload.assetName; + %moduleName = %payload.moduleName; echo("DROPPED A " @ %assetType @ " ON THE ASSET BROWSER NAVIGATION TREE!"); @@ -1694,6 +2354,105 @@ function AssetBrowserFilterTree::onDragDropped( %this ) %asdgadfhg =true; } +function AssetBrowser::hasLooseFilesInDir(%this) +{ + //First, wipe out any files inside the folder first + %file = findFirstFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*", false); + + %aq = new AssetQuery(); + + while( %file !$= "" ) + { + if(!strIsMatchExpr("*.asset.taml", %file) && !strIsMatchExpr("*.taml", %file) && !strIsMatchExpr("*.cached.dts", %file)) + { + %assetsFound = AssetDatabase.findAssetLooseFile(%aq, %file); + + if(%assetsFound == 0) + { + %ext = fileExt(%file); + if(isShapeFormat(%ext) || isImageFormat(%ext) || isSoundFormat(%ext)) + { + %aq.delete(); + return true; + } + } + } + + %file = findNextFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*" ); + } + + %aq.delete(); + return false; +} + +function AssetBrowser::autoImportSimpleLooseFiles(%this) +{ + %importer = new AssetImporter(); + + //First, wipe out any files inside the folder first + %file = findFirstFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*", false); + + %aq = new AssetQuery(); + + while( %file !$= "" ) + { + if(!strIsMatchExpr("*.asset.taml", %file) && !strIsMatchExpr("*.taml", %file) && !strIsMatchExpr("*.cached.dts", %file)) + { + %assetsFound = AssetDatabase.findAssetLooseFile(%aq, %file); + + if(%assetsFound == 0) + { + %ext = fileExt(%file); + if(isShapeFormat(%ext) || isImageFormat(%ext) || isSoundFormat(%ext)) + { + %assetId = %importer.autoImportFile(%file); + } + } + } + + %file = findNextFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*" ); + } + + %aq.delete(); + %importer.delete(); + + %this.refresh(); +} + +function AssetBrowser::getLooseFilesInDir(%this) +{ + if(!isObject(ABLooseFileArray)) + new ArrayObject(ABLooseFileArray); + + ABLooseFileArray.empty(); + + %showLooseFiles = EditorSettings.value("Assets/Browser/showLooseFiles", false); + if(%showLooseFiles == false) + return; + + //First, wipe out any files inside the folder first + %file = findFirstFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*", false); + + %aq = new AssetQuery(); + + while( %file !$= "" ) + { + if(!strIsMatchExpr("*.asset.taml", %file) && !strIsMatchExpr("*.taml", %file) && !strIsMatchExpr("*.cached.dts", %file)) + { + %assetsFound = AssetDatabase.findAssetLooseFile(%aq, %file); + + if(%assetsFound == 0) + { + ABLooseFileArray.add(%file); + } + } + + %file = findNextFileMultiExpr( %this.dirHandler.currentAddress @ "/*.*" ); + } + + %aq.delete(); + return false; +} // // function AssetBrowser::importLooseFiles(%this) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs index 163ddaa7b..4203072d7 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs @@ -24,8 +24,10 @@ function ImportAssetWindow::showDialog(%this) { //prep the import control Canvas.pushDialog(AssetImportCtrl); - AssetImportCtrl.setHidden(true); - + AssetImportCtrl.setHidden(false); + + ImportAssetWindow.allowAutoImport = true; //special-case override for if we want to force a manual import process + ImportAssetWindow.assetHeirarchyChanged = false; %defaultConfig = EditorSettings.value("Assets/AssetImporDefaultConfig", ""); @@ -45,14 +47,15 @@ function ImportAssetWindow::showDialog(%this) function ImportAssetWindow::Close(%this) { //Some cleanup - ImportAssetWindow.importingFilesArray.empty(); + ImportAssetWindow.importer.resetImportSession(true); + //ImportAssetWindow.importingFilesArray.empty(); %this.importTempDirHandler.deleteFolder("tools/assetBrowser/importTemp/*/"); if(ImportAssetWindow.isAwake()) ImportAssetWindow.refresh(); - ImportAssetItems.empty(); + //ImportAssetItems.empty(); Canvas.popDialog(); } @@ -124,7 +127,6 @@ function getImageInfo(%file) //This lets us go and look for a image at the importing directory as long as it matches the material name function findImageFile(%path, %materialName, %type) { - if(isFile(%path @ "/" @ %materialName @ ".jpg")) return %path @ "/" @ %materialName @ ".jpg"; else if(isFile(%path @ "/" @ %materialName @ ".png")) @@ -173,7 +175,9 @@ function AssetBrowser::onDropFile( %this, %filePath ) if(!%this.isVisible()) return; - %fileExt = fileExt( %filePath ); + ImportAssetWindow.importer.addImportingFile(%filePath); + + /*%fileExt = fileExt( %filePath ); //add it to our array! if(isImageFormat(%fileExt)) %assetItem = %this.addImportingAsset("ImageAsset", %filePath); @@ -194,13 +198,13 @@ function AssetBrowser::onDropFile( %this, %filePath ) { SessionImportAssetItems.add(%assetItem); ImportAssetItems.add(%assetItem); - } + }*/ //Used to keep tabs on what files we were trying to import, used mainly in the event of //adjusting configs and needing to completely reprocess the import //ensure we're not doubling-up on files by accident - if(ImportAssetWindow.importingFilesArray.getIndexFromKey(%filePath) == -1) - ImportAssetWindow.importingFilesArray.add(%filePath); + //if(ImportAssetWindow.importingFilesArray.getIndexFromKey(%filePath) == -1) + // ImportAssetWindow.importingFilesArray.add(%filePath); } function AssetBrowser::onDropZipFile(%this, %filePath) @@ -334,8 +338,10 @@ function AssetBrowser::addImportingAsset( %this, %assetType, %filePath, %parentA %moduleName = AssetBrowser.SelectedModule; ImportAssetModuleList.text = %moduleName; + %assetName = strreplace( %assetName, " ", "_" ); + //Add to our main list - %assetItem = new ScriptObject() + %assetItem = new AssetImportObject() { assetType = %assetType; filePath = %filePath; @@ -350,33 +356,9 @@ function AssetBrowser::addImportingAsset( %this, %assetType, %filePath, %parentA skip = false; processed = false; generatedAsset = false; - childAssetItems = new ArrayObject(){}; }; - if(%parentAssetItem !$= "") - { - ImportActivityLog.add("Added Child Importing Asset to " @ %parentAssetItem.assetName); - } - else - { - ImportActivityLog.add("Added Importing Asset"); - } - - ImportActivityLog.add(" Asset Info: Name: " @ %assetName @ " | Type: " @ %assetType); - - if(%filePath !$= "") - ImportActivityLog.add(" File: " @ %filePath); - - if(%parentAssetItem $= "") - { - %asd = true; - } - else - { - %parentAssetItem.childAssetItems.add(%assetItem); - } - - ImportAssetWindow.refresh(); + ImportAssetWindow.importer.addImportingAssetItem(%assetItem, %parentAssetItem); return %assetItem; } @@ -426,7 +408,7 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this) } // -function importLooseFile(%filePath, %forceAutoImport) +/*function importLooseFile(%filePath, %forceAutoImport) { %assetType = getAssetTypeByFilename(%filePath); @@ -480,7 +462,7 @@ function importLooseFile(%filePath, %forceAutoImport) $importedLooseFileAsset = %assetItem.moduleName @ ":" @ %assetItem.assetName; return true; -} +}*/ // function assetImportUpdatePath(%newPath) @@ -491,7 +473,7 @@ function assetImportUpdatePath(%newPath) } // -function ImportAssetWindow::processImportAssets(%this, %assetItem) +/*function ImportAssetWindow::processImportAssets(%this, %assetItem) { if(!isObject(%assetItem)) { @@ -573,7 +555,7 @@ function ImportAssetWindow::processImportAssets(%this, %assetItem) //so we'll loop back through again until everything has been processed if(ImportAssetWindow.assetHeirarchyChanged) %this.processImportAssets(); -} +}*/ function ImportAssetWindow::findImportingAssetByName(%this, %assetName, %assetItem) { @@ -642,16 +624,19 @@ function ImportAssetWindow::doRefresh(%this) %this.autoRenamedAssets = 0; //Go through and process any newly, unprocessed assets - %this.processImportAssets(); + ImportAssetWindow.importer.processImportingAssets(); + //%this.processImportAssets(); - ImportAssetWindow.hasImportIssues = %this.validateAssets(); + //ImportAssetWindow.hasImportIssues = %this.validateAssets(); + + ImportAssetWindow.importer.validateImportingAssets(); AssetImportCtrl-->NewAssetsTree.clear(); AssetImportCtrl-->NewAssetsTree.insertItem(0, "Importing Assets"); - for(%i=0; %i < ImportAssetItems.count(); %i++) + for(%i=0; %i < ImportAssetWindow.importer.getAssetItemCount(); %i++) { - %assetItem = ImportAssetItems.getKey(%i); + %assetItem = ImportAssetWindow.importer.getAssetItem(%i); %this.refreshAssetItem(%assetItem); } @@ -687,16 +672,17 @@ function ImportAssetWindow::doRefresh(%this) //bother showing the window. //If any of these conditions fail, we'll display the import window so it can be handled //by the user - if(ImportAssetWindow.importConfigsList.count() != 0 && - EditorSettings.value("Assets/AssetImporDefaultConfig") !$= "" && - EditorSettings.value("Assets/AutoImport", false) == true - && ImportAssetWindow.hasImportIssues == false) + if(ImportAssetWindow.importConfigsList.count() != 0 + && EditorSettings.value("Assets/AssetImporDefaultConfig") !$= "" + && EditorSettings.value("Assets/AutoImport", false) == true + && ImportAssetWindow.hasImportIssues == false + && ImportAssetWindow.allowAutoImport) { AssetImportCtrl.setHidden(true); ImportAssetWindow.visible = false; //Go ahead and check if we have any issues, and if not, run the import! - ImportAssetWindow.ImportAssets(); + ImportAssetWindow.importer.ImportAssets(); } else { @@ -723,7 +709,7 @@ function ImportAssetWindow::doRefresh(%this) %this.dirty = false; } -function ImportAssetWindow::refreshAssetItem(%this, %assetItem) +function ImportAssetWindow::refreshAssetItem(%this, %assetItem, %parentTreeIdx) { if(!isObject(%assetItem) || %assetItem.skip) return; @@ -733,7 +719,7 @@ function ImportAssetWindow::refreshAssetItem(%this, %assetItem) %assetName = %assetItem.assetName; //Once validated, attempt any fixes for issues - %this.resolveIssue(%assetItem); + ImportAssetWindow.importer.resolveAssetItemIssues(%assetItem); //create! %toolTip = ""; @@ -783,16 +769,15 @@ function ImportAssetWindow::refreshAssetItem(%this, %assetItem) %iconIdx = 7; } - %parentTreeIdx = %assetItem.parentAssetItem.treeIdx; if(%parentTreeIdx $= "") %parentTreeIdx = 1; %assetItem.treeIdx = AssetImportCtrl-->NewAssetsTree.insertItem(%parentTreeIdx, %assetName, %assetItem, "", %iconIdx, %iconIdx+1); - for(%i=0; %i < %assetItem.childAssetItems.count(); %i++) + for(%i=0; %i < ImportAssetWindow.importer.getAssetItemChildCount(%assetItem); %i++) { - %childAssetItem = %assetItem.childAssetItems.getKey(%i); - %this.refreshAssetItem(%childAssetItem); + %childAssetItem = ImportAssetWindow.importer.getAssetItemChild(%assetItem, %i); + %this.refreshAssetItem(%childAssetItem, %assetItem.treeIdx); } } @@ -818,6 +803,8 @@ function NewAssetsViewTree::onSelect(%this, %itemId) //AssetImportCtrl-->NewAssetsInspector.addField("assetName", "Asset Name", "string", "", %assetItem.assetName, "", %assetItem); AssetImportCtrl-->NewAssetsInspector.addField("status", "Status", "string", "", %assetItem.status, "", %assetItem); + AssetImportCtrl-->NewAssetsInspector.addField("statusInfo", "Status Info", "string", "", %assetItem.statusInfo, "", %assetItem); + AssetImportCtrl-->NewAssetsInspector.endGroup(); AssetImportCtrl-->NewAssetsInspector.setFieldEnabled("assetType", false); @@ -890,7 +877,7 @@ function ImportAssetWindow::removeImportingAsset(%this) { ImportActivityLog.add("Removing Asset from Import"); - %this.deleteImportingAsset(ImportAssetActions.assetItem); + %this.importer.deleteImportingAsset(ImportAssetActions.assetItem); //ImportAssetWindow.refresh(); } @@ -937,6 +924,11 @@ function ImportAssetWindow::addNewImportingAsset(%this, %filterType) //AssetBrowser.onDropFile( %path ); %fileExt = fileExt( %filePath ); + %fileName = fileName(%filePath); + + if(%fileExt $= ".dts" && endsWith(%fileName, ".cached")) + return ""; + //add it to our array! if(isImageFormat(%fileExt)) %type = "ImageAsset"; @@ -969,292 +961,9 @@ function ImportAssetWindow::addMaterialMap(%this, %map) %newAssetItem.ImageType = %map; } -// -function ImportAssetWindow::importResolution(%this, %assetItem) -{ - if(%assetItem.status !$= "Error" && %assetItem.status !$= "Warning") - { - //If nothing's wrong, we just edit it - ImportAssetOptionsWindow.editImportSettings(%assetItem); - return; - } - else - { - ImportAssetResolutionsPopup.assetItem = %assetItem; - if(%assetItem.statusType $= "DuplicateAsset" || %assetItem.statusType $= "DuplicateImportAsset") - { - ImportAssetResolutionsPopup.enableItem(3, false); //Rename - ImportAssetResolutionsPopup.enableItem(5, false); //Find Missing - } - else if(%assetItem.statusType $= "MissingFile") - { - ImportAssetResolutionsPopup.enableItem(0, false); //Use Orig - ImportAssetResolutionsPopup.enableItem(1, false); //Use Dupe - ImportAssetResolutionsPopup.enableItem(3, false); //Rename - } - } - - ImportAssetResolutionsPopup.showPopup(Canvas); -} - -function ImportAssetWindow::validateAssets(%this, %assetItem) -{ - ImportAssetWindow.importIssues = false; - - //Clear any status - %this.resetAssetsValidationStatus(); - - for(%i=0; %i < ImportAssetItems.count(); %i++) - { - %assetItem = ImportAssetItems.getKey(%i); - - %this.validateAsset(%assetItem); - } - - if(ImportAssetWindow.importIssues == false) - return false; - else - return true; -} - -function ImportAssetWindow::validateAsset(%this, %assetItem) -{ - %moduleName = AssetImportTargetModule.getText(); - - if(!isObject(%assetItem) || %assetItem.skip) - { - return; - } - - //First, check the obvious: name collisions. We should have no asset that shares a similar name. - //If we do, prompt for it be renamed first before continuing - %hasCollision = %this.checkAssetsForCollision(%assetItem); - - //Ran into a problem, so end checks on this one and move on - if(%hasCollision) - return; - - //No collisions of for this name in the importing assets. Now, check against the existing assets in the target module - if(!AssetBrowser.isAssetReImport) - { - %assetQuery = new AssetQuery(); - - %numAssetsFound = AssetDatabase.findAllAssets(%assetQuery); - - %foundCollision = false; - for( %f=0; %f < %numAssetsFound; %f++) - { - %assetId = %assetQuery.getAsset(%f); - - //first, get the asset's module, as our major categories - %module = AssetDatabase.getAssetModule(%assetId); - - %testModuleName = %module.moduleId; - - //These are core, native-level components, so we're not going to be messing with this module at all, skip it - if(%moduleName !$= %testModuleName) - continue; - - %testAssetName = AssetDatabase.getAssetName(%assetId); - - if(%testAssetName $= %assetItem.assetName) - { - %foundCollision = true; - - %assetItem.status = "error"; - %assetItem.statusType = "DuplicateAsset"; - %assetItem.statusInfo = "Duplicate asset names found with the target module!\nAsset \"" @ - %assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" has a matching name.\nPlease rename it and try again!"; - - ImportActivityLog.add("Error! Asset " @ %assetItem.assetName @ " has an identically named asset in the target module"); - - break; - } - } - - if(%foundCollision == true) - { - //yup, a collision, prompt for the change and bail out - /*MessageBoxOK( "Error!", "Duplicate asset names found with the target module!\nAsset \"" @ - %assetItemA.assetName @ "\" of type \"" @ %assetItemA.assetType @ "\" has a matching name.\nPlease rename it and try again!");*/ - - //%assetQuery.delete(); - //return false; - } - - //Clean up our queries - %assetQuery.delete(); - } - - //Check if we were given a file path(so not generated) but somehow isn't a valid file - if(%assetItem.filePath !$= "" && !%assetItem.generatedAsset && !isFile(%assetItem.filePath)) - { - %assetItem.status = "error"; - %assetItem.statusType = "MissingFile"; - %assetItem.statusInfo = "Unable to find file to be imported. Please select asset file."; - - ImportActivityLog.add("Error! Asset " @ %assetItem.filePath @ " was not found"); - } - - if(%assetItem.status $= "Warning") - { - if(getAssetImportConfigValue("General/WarningsAsErrors", "0") == 1) - { - %assetItem.status = "error"; - - ImportActivityLog.add("Warnings treated as errors!"); - } - } - - if(%assetItem.status $= "error") - ImportAssetWindow.importIssues = true; - - for(%i=0; %i < %assetItem.childAssetItems.count(); %i++) - { - %childAssetItem = %assetItem.childAssetItems.getKey(%i); - - %this.validateAsset(%childAssetItem); - } -} -// - -function ImportAssetWindow::resetAssetsValidationStatus(%this, %assetItem) -{ - if(!isObject(%assetItem)) - { - for(%i=0; %i < ImportAssetItems.count(); %i++) - { - %assetItem = ImportAssetItems.getKey(%i); - - if(!isObject(%assetItem) || %assetItem.skip) - continue; - - %assetItem.status = ""; - %assetItem.statusType = ""; - %assetItem.statusInfo = ""; - - if(%assetItem.childAssetItems.count() != 0) - %this.resetAssetsValidationStatus(%assetItem); - } - } - else - { - for(%i=0; %i < %assetItem.childAssetItems.count(); %i++) - { - %childAssetItem = %assetItem.childAssetItems.getKey(%i); - - if(!isObject(%childAssetItem) || %childAssetItem.skip) - continue; - - %childAssetItem.status = ""; - %childAssetItem.statusType = ""; - %childAssetItem.statusInfo = ""; - - if(%childAssetItem.childAssetItems.count() != 0) - %this.resetAssetsValidationStatus(%childAssetItem); - } - } -} - -function ImportAssetWindow::checkAssetsForCollision(%this, %assetItemToCheck, %assetItem) -{ - %result = false; - - if(!isObject(%assetItem)) - { - for(%i=0; %i < ImportAssetItems.count(); %i++) - { - %assetItem = ImportAssetItems.getKey(%i); - - if(!isObject(%assetItem) || %assetItem.skip) - continue; - - if( (%assetItemToCheck.assetName $= %assetItem.assetName) && (%assetItemToCheck.getId() != %assetItem.getId()) ) - { - //yup, a collision, prompt for the change and bail out - %assetItemToCheck.status = "Warning"; - %assetItemToCheck.statusType = "DuplicateImportAsset"; - %assetItemToCheck.statusInfo = "Duplicate asset names found with importing assets!\nAsset \"" @ - %assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" and \"" @ - %assetItemToCheck.assetName @ "\" of type \"" @ %assetItemToCheck.assetType @ "\" have matching names.\nPlease rename one of them and try again!"; - - ImportActivityLog.add("Warning! Asset " @ %assetItemToCheck.assetName @ ", type " @ %assetItemToCheck.assetType @ " has a naming collisions with asset " @ %assetItem.assetName @ ", type " @ %assetItem.assetType); - - return true; - } - - if(%assetItem.childAssetItems.count() != 0) - { - //recurse! - %result = %this.checkAssetsForCollision(%assetItemToCheck, %assetItem); - } - - if(%result) - return %result; - } - } - else - { - for(%i=0; %i < %assetItem.childAssetItems.count(); %i++) - { - %childAssetItem = %assetItem.childAssetItems.getKey(%i); - - if(!isObject(%childAssetItem) || %childAssetItem.skip) - continue; - - if( (%assetItemToCheck.assetName $= %childAssetItem.assetName) && (%assetItemToCheck.getId() != %childAssetItem.getId()) ) - { - //yup, a collision, prompt for the change and bail out - %assetItemToCheck.status = "Warning"; - %assetItemToCheck.statusType = "DuplicateImportAsset"; - %assetItemToCheck.statusInfo = "Duplicate asset names found with importing assets!\nAsset \"" @ - %childAssetItem.assetName @ "\" of type \"" @ %childAssetItem.assetType @ "\" and \"" @ - %assetItemToCheck.assetName @ "\" of type \"" @ %assetItemToCheck.assetType @ "\" have matching names.\nPlease rename one of them and try again!"; - - ImportActivityLog.add("Warning! Asset " @ %assetItemToCheck.assetName @ ", type " @ %assetItemToCheck.assetType @ " has a naming collisions with asset " @ %childAssetItem.assetName @ ", type " @ %childAssetItem.assetType); - - return true; - } - - if(%childAssetItem.childAssetItems.count() != 0) - { - //recurse! - %result = %this.checkAssetsForCollision(%assetItemToCheck, %childAssetItem); - } - - if(%result) - return %result; - } - } - - return %result; -} - -// -function ImportAssetWindow::deleteImportingAsset(%this, %assetItem) -{ - if(%assetItem.parentAssetItem !$= "") - { - %idx = %assetItem.parentAssetItem.childAssetItems.getIndexFromKey(%assetItem); - %assetItem.parentAssetItem.childAssetItems.erase(%idx); - - ImportActivityLog.add("Deleting Importing Asset " @ %assetItem.assetName @ " from it's parent item: " @ %assetItem.parentAssetItem); - } - - ImportActivityLog.add("Deleting Importing Asset " @ %assetItem.assetName @ " and all it's child items"); - - %idx = ImportAssetItems.getIndexFromKey(%assetItem); - ImportAssetItems.erase(%idx); - - schedule(10, 0, "refreshImportAssetWindow"); -} - // function ImportAssetWindow::ImportAssets(%this) { - //do the actual importing, now! - %assetCount = ImportAssetItems.count(); - //get the selected module data %moduleName = AssetImportTargetModule.getText(); @@ -1266,255 +975,34 @@ function ImportAssetWindow::ImportAssets(%this) return; } - %this.doImportAssets(); + Canvas.pushDialog( EditorLoadingGui ); + Canvas.repaint(); + + %this.importer.targetModuleId = %moduleName; + %this.importer.targetPath = AssetImportTargetAddress.getText(); + + %this.importer.importAssets(); //force an update of any and all modules so we have an up-to-date asset list AssetBrowser.refresh(); Canvas.popDialog(AssetImportCtrl); AssetBrowser.isAssetReImport = false; -} - -function ImportAssetWindow::doImportAssets(%this, %assetItem) -{ - %moduleName = AssetImportTargetModule.getText(); - if(%assetItem $= "") - { - for(%i=0; %i < ImportAssetItems.count(); %i++) - { - %assetItem = ImportAssetItems.getKey(%i); - - if(!isObject(%assetItem) || %assetItem.skip) - continue; - - %assetType = %assetItem.AssetType; - %filePath = %assetItem.filePath; - %assetName = %assetItem.assetName; - %assetImportSuccessful = false; - %assetId = %moduleName@":"@%assetName; - - %command = "AssetBrowser.import" @ %assetType @ "(" @ %assetItem @ ");"; - eval(%command); - - //recurse if needed - %this.doImportAssets(%assetItem); - } - } - else - { - for(%i=0; %i < %assetItem.childAssetItems.count(); %i++) - { - %childAssetItem = %assetItem.childAssetItems.getKey(%i); - - if(!isObject(%childAssetItem) || %childAssetItem.skip) - continue; - - %assetType = %childAssetItem.AssetType; - %filePath = %childAssetItem.filePath; - %assetName = %childAssetItem.assetName; - %assetImportSuccessful = false; - %assetId = %moduleName@":"@%assetName; - - %command = "AssetBrowser.import" @ %assetType @ "(" @ %childAssetItem @ ");"; - eval(%command); - - //recurse if needed - %this.doImportAssets(%childAssetItem); - } - } -} - -function ImportAssetWindow::doImportAsset(%this, %assetItem) -{ - %assetItem = ImportAssetTree.getItemObject(%id); - - if(!isObject(%assetItem) || %assetItem.skip) - { - %id = ImportAssetTree.getNextSibling(%id); - continue; - } + %this.importer.resetImportSession(true); - %assetType = %assetItem.AssetType; - %filePath = %assetItem.filePath; - %assetName = %assetItem.assetName; - %assetImportSuccessful = false; - %assetId = %moduleName@":"@%assetName; + Canvas.popDialog( EditorLoadingGui ); - if(%assetType $= "ImageAsset") - { - AssetBrowser.importImageAsset(%assetItem); - } - else if(%assetType $= "ShapeAsset") - { - AssetBrowser.importShapeAsset(%assetItem); - } - else if(%assetType $= "AnimationAsset") - { - %assetPath = "data/" @ %moduleName @ "/ShapeAnimations"; - %assetFullPath = %assetPath @ "/" @ fileName(%filePath); - - %newAsset = new ShapeAnimationAsset() - { - assetName = %assetName; - versionId = 1; - fileName = %assetFullPath; - originalFilePath = %filePath; - animationFile = %assetFullPath; - animationName = %assetName; - startFrame = 0; - endFrame = -1; - padRotation = false; - padTransforms = false; - }; + //do the actual importing, now! + /*%assetCount = ImportAssetItems.count(); - %assetImportSuccessful = TAMLWrite(%newAsset, %assetPath @ "/" @ %assetName @ ".asset.taml"); - - //and copy the file into the relevent directory - %doOverwrite = !AssetBrowser.isAssetReImport; - if(!pathCopy(%filePath, %assetFullPath, %doOverwrite)) - { - error("Unable to import asset: " @ %filePath); - } - } - else if(%assetType $= "SoundAsset") - { - %assetPath = "data/" @ %moduleName @ "/Sounds"; - %assetFullPath = %assetPath @ "/" @ fileName(%filePath); - - %newAsset = new SoundAsset() - { - assetName = %assetName; - versionId = 1; - fileName = %assetFullPath; - originalFilePath = %filePath; - }; - - %assetImportSuccessful = TAMLWrite(%newAsset, %assetPath @ "/" @ %assetName @ ".asset.taml"); - - //and copy the file into the relevent directory - %doOverwrite = !AssetBrowser.isAssetReImport; - if(!pathCopy(%filePath, %assetFullPath, %doOverwrite)) - { - error("Unable to import asset: " @ %filePath); - } - } - else if(%assetType $= "MaterialAsset") - { - AssetBrowser.importMaterialAsset(%assetItem); - } - else if(%assetType $= "ScriptAsset") - { - %assetPath = "data/" @ %moduleName @ "/Scripts"; - %assetFullPath = %assetPath @ "/" @ fileName(%filePath); - - %newAsset = new ScriptAsset() - { - assetName = %assetName; - versionId = 1; - scriptFilePath = %assetFullPath; - isServerSide = true; - originalFilePath = %filePath; - }; - - %assetImportSuccessful = TAMLWrite(%newAsset, %assetPath @ "/" @ %assetName @ ".asset.taml"); - - //and copy the file into the relevent directory - %doOverwrite = !AssetBrowser.isAssetReImport; - if(!pathCopy(%filePath, %assetFullPath, %doOverwrite)) - { - error("Unable to import asset: " @ %filePath); - } - } - else if(%assetType $= "GUIAsset") - { - %assetPath = "data/" @ %moduleName @ "/GUIs"; - %assetFullPath = %assetPath @ "/" @ fileName(%filePath); - - %newAsset = new GUIAsset() - { - assetName = %assetName; - versionId = 1; - GUIFilePath = %assetFullPath; - scriptFilePath = ""; - originalFilePath = %filePath; - }; - - %assetImportSuccessful = TAMLWrite(%newAsset, %assetPath @ "/" @ %assetName @ ".asset.taml"); - - //and copy the file into the relevent directory - %doOverwrite = !AssetBrowser.isAssetReImport; - if(!pathCopy(%filePath, %assetFullPath, %doOverwrite)) - { - error("Unable to import asset: " @ %filePath); - } - } - if(%assetImportSuccessful) - { - %moduleDef = ModuleDatabase.findModule(%moduleName,1); - - if(!AssetBrowser.isAssetReImport) - AssetDatabase.addDeclaredAsset(%moduleDef, %assetPath @ "/" @ %assetName @ ".asset.taml"); - else - AssetDatabase.refreshAsset(%assetId); - } - if(ImportAssetTree.isParentItem(%id)) - { - %childItem = ImportAssetTree.getChild(%id); - - //recurse! - %this.doImportAssets(%childItem); - } - - %id = ImportAssetTree.getNextSibling(%id); -} - -function ImportAssetWindow::resolveIssue(%this, %assetItem) -{ - //Ok, we actually have a warning, so lets resolve - if(%assetItem.statusType $= "DuplicateImportAsset" || %assetItem.statusType $= "DuplicateAsset") - { - %resolutionAction = getAssetImportConfigValue("General/DuplicatAutoResolution", "AutoPrune"); - - %humanReadableStatus = %assetItem.statusType $= "DuplicateImportAsset" ? "Duplicate Import Asset" : "Duplicate Asset"; - - if(%resolutionAction $= "AutoPrune") - { - %this.deleteImportingAsset(%assetItem); - %this.prunedDuplicateAssets++; - - ImportActivityLog.add("Asset " @ %assetItem.assetName @ " was Autopruned due to " @ %humanReadableStatus); - } - else if(%resolutionAction $= "AutoRename") - { - ImportActivityLog.add("Asset " @ %assetItem.assetName @ " was Auto-Renamed due to " @ %humanReadableStatus); - - %noNum = stripTrailingNumber(%assetItem.assetName); - %num = getTrailingNumber(%assetItem.assetName); - - if(%num == -1) - { - %assetItem.assetName = %noNum @ "1"; - } - else - { - %num++; - %assetItem.assetName = %noNum @ %num; - } - - ImportActivityLog.add(" New name is " @ %assetItem.assetName); - - %this.autoRenamedAssets++; - } - } - else if(%assetItem.statusType $= "MissingFile") - { - if(getAssetImportConfigValue("General/AutomaticallyPromptMissingFiles", "0") == 1) - { - %this.findMissingFile(%assetItem); - } - } + %this.doImportAssets(); + + //force an update of any and all modules so we have an up-to-date asset list + AssetBrowser.refresh(); + Canvas.popDialog(AssetImportCtrl); + AssetBrowser.isAssetReImport = false;*/ } function ImportAssetWindow::findMissingFile(%this, %assetItem) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs index 52268c88a..62fcf8b7d 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImportConfig.cs @@ -10,11 +10,18 @@ function ImportAssetConfigList::onSelect( %this, %id, %text ) ImportActivityLog.add(""); ImportAssetWindow.activeImportConfigIndex = %id; - ImportAssetWindow.activeImportConfig = ImportAssetWindow.importConfigsList.getKey(%id); + //ImportAssetWindow.activeImportConfig = ImportAssetWindow.importConfigsList.getKey(%id); + + if(!isObject(%this.activeImporConfig)) + %this.activeImporConfig = new AssetImportConfig(); + + %this.activeImporConfig.loadImportConfig(AssetImportSettings, ImportAssetWindow.importConfigsList.getKey(%id)); //If we were trying to import anything, refresh it with the new config - if( ImportAssetWindow.importingFilesArray.count() != 0) - AssetBrowser.reloadImportingFiles(); + ImportAssetWindow.importer.resetImportSession(); + + //if( ImportAssetWindow.importingFilesArray.count() != 0) + // AssetBrowser.reloadImportingFiles(); } function setupImportConfigSettingsList() diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs index 49b47324c..44f6e56c0 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/cubemap.cs @@ -95,14 +95,14 @@ function GuiInspectorTypeCubemapAssetPtr::onControlDropped( %this, %payload, %po if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) ) return; - %assetType = %payload.dragSourceControl.parentGroup.assetType; + %assetType = %payload.assetType; if(%assetType $= "CubemapAsset") { echo("DROPPED A CUBEMAP ON A CUBEMAP ASSET COMPONENT FIELD!"); - %module = %payload.dragSourceControl.parentGroup.moduleName; - %asset = %payload.dragSourceControl.parentGroup.assetName; + %module = %payload.moduleName; + %asset = %payload.assetName; %targetComponent = %this.object; %targetComponent.CubemapAsset = %module @ ":" @ %asset; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.cs index cf144c05d..7adffaeb2 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/datablockObjects.cs @@ -42,15 +42,26 @@ function AssetBrowser::doCreateNewDatablock(%this) function AssetBrowser::buildDatablockPreview(%this, %assetDef, %previewData) { - %previewData.assetName = %assetDef.assetName; - %previewData.assetPath = %assetDef.dirPath; + %previewData.assetName = %assetDef; + %previewData.assetPath = ""; - %previewData.previewImage = "tools/assetBrowser/art/scriptIcon"; + %previewData.previewImage = "tools/assetBrowser/art/datablockIcon"; //%previewData.assetFriendlyName = %assetDef.assetName; - %previewData.assetDesc = %assetDef.description; - %previewData.tooltip = %assetDef.dirPath; - %previewData.doubleClickCommand = "AssetBrowser.schedule(10, \"navigateTo\",\""@ %assetDef.dirPath @ "/" @ %assetDef.assetName @"\");";//browseTo %assetDef.dirPath / %assetDef.assetName + %previewData.assetDesc = %assetDef; + %previewData.tooltip = %assetDef; + %previewData.doubleClickCommand = "AssetBrowser.schedule(10, \"spawnDatablockObject\",\""@ %assetDef @"\");";//browseTo %assetDef.dirPath / %assetDef.assetName +} + +function spawnDatablockObject(%datablock) +{ + %name = %datablock.getName(); + %class = %datablock.getClassName(); + %cmd = %class @ "::create(" @ %name @ ");"; + + %shapePath = ( %datablock.shapeFile !$= "" ) ? %datablock.shapeFile : %datablock.shapeName; + %createCmd = "EWCreatorWindow.createObject( \\\"" @ %cmd @ "\\\" );"; + return eval("showImportDialog( \"" @ %shapePath @ "\", \"" @ %createCmd @ "\" );"); } function AssetBrowser::renameDatablock(%this, %folderPath, %newFolderName) @@ -124,4 +135,25 @@ function AssetBrowser::deleteDatablock(%this, %folderPath) %this.dirHandler.deleteDatablock(%folderPath); %this.refresh(); +} + +function AssetBrowser::onDatablockEditorDropped(%this, %assetDef, %position) +{ + %targetPosition = EWorldEditor.unproject(%position SPC 1000); + %camPos = LocalClientConnection.camera.getPosition(); + %rayResult = containerRayCast(%camPos, %targetPosition, -1); + + %pos = EWCreatorWindow.getCreateObjectPosition(); + + if(%rayResult != 0) + { + %pos = getWords(%rayResult, 1, 3); + } + else + { + %pos = "0 0 0"; + } + + %newObj = spawnDatablockObject(%assetDef); + %newObj.position = %pos; } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs index ac9a0bf8e..f96db3a18 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs @@ -261,7 +261,7 @@ function GuiInspectorTypeImageAssetPtr::onControlDropped( %this, %payload, %posi if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) ) return; - %assetType = %payload.dragSourceControl.parentGroup.assetType; + %assetType = %payload.assetType; if(%assetType $= "ImageAsset") { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.cs index 8d117e65e..eeeb6e5c9 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/level.cs @@ -7,6 +7,10 @@ function AssetBrowser::setupCreateNewLevelAsset(%this) NewAssetPropertiesInspector.endGroup(); } +function AssetImporter::importLevelAsset(%this, %assetItem) +{ +} + function AssetBrowser::createLevelAsset(%this) { %moduleName = AssetBrowser.newAssetSettings.moduleName; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/looseFiles.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/looseFiles.cs new file mode 100644 index 000000000..d209e2f06 --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/looseFiles.cs @@ -0,0 +1,14 @@ +function AssetBrowser::buildLooseFilePreview(%this, %assetDef, %previewData) +{ + %fullPath = %assetDef.dirPath @ "/" @ %assetDef.assetName; + %previewData.assetName = %assetDef.assetName; + %previewData.assetPath = %fullPath; + + %previewData.previewImage = "tools/assetBrowser/art/looseFileIcon"; + + //%previewData.assetFriendlyName = %assetDef.assetName; + %previewData.assetDesc = %assetDef.description; + %previewData.tooltip = %fullPath; + //%previewData.doubleClickCommand = "AssetBrowser.schedule(10, \"navigateTo\",\""@ %assetDef.dirPath @ "/" @ %assetDef.assetName @"\");";//browseTo %assetDef.dirPath / %assetDef.assetName + %previewData.doubleClickCommand = "AssetBrowser.autoImportFile(\"" @ %fullPath @ "\");"; +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs index 1b53e65c8..cfc890133 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs @@ -432,7 +432,7 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem) function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData) { - %previewData.assetName = %assetDef.materialDefinitionName; + %previewData.assetName = %assetDef.assetName; %previewData.assetPath = %assetDef.scriptFile; //Lotta prepwork @@ -501,9 +501,9 @@ function GuiInspectorTypeMaterialAssetPtr::onControlDropped( %this, %payload, %p if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) ) return; - %assetType = %payload.dragSourceControl.parentGroup.assetType; - %module = %payload.dragSourceControl.parentGroup.moduleName; - %assetName = %payload.dragSourceControl.parentGroup.assetName; + %assetType = %payload.assetType; + %module = %payload.moduleName; + %assetName = %payload.assetName; if(%assetType $= "MaterialAsset") { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.cs index e69de29bb..ff271b9c1 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/prefab.cs @@ -0,0 +1,14 @@ +function AssetBrowser::buildPrefabPreview(%this, %assetDef, %previewData) +{ + %fullPath = %assetDef.dirPath @ "/" @ %assetDef.assetName; + %previewData.assetName = %assetDef.assetName; + %previewData.assetPath = %fullPath; + + %previewData.previewImage = "tools/assetBrowser/art/genericAssetIcon"; + + //%previewData.assetFriendlyName = %assetDef.assetName; + %previewData.assetDesc = %assetDef.description; + %previewData.tooltip = %fullPath; + //%previewData.doubleClickCommand = "AssetBrowser.schedule(10, \"navigateTo\",\""@ %assetDef.dirPath @ "/" @ %assetDef.assetName @"\");";//browseTo %assetDef.dirPath / %assetDef.assetName + %previewData.doubleClickCommand = "AssetBrowser.autoImportFile(\"" @ %fullPath @ "\");"; +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs index 483b9b0c7..8274b1cf7 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs @@ -270,6 +270,10 @@ function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position) { %pos = getWords(%rayResult, 1, 3); } + else + { + %pos = "0 0 0"; + } %assetId = %assetDef.getAssetId(); @@ -296,17 +300,17 @@ function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %posi if( !%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ) ) return; - %assetType = %payload.dragSourceControl.parentGroup.assetType; + %assetType = %payload.assetType; if(%assetType $= "ShapeAsset") { //echo("DROPPED A SHAPE ON A SHAPE ASSET COMPONENT FIELD!"); - %module = %payload.dragSourceControl.parentGroup.moduleName; - %asset = %payload.dragSourceControl.parentGroup.assetName; + %module = %payload.moduleName; + %asset = %payload.assetName; %targetComponent = %this.targetObject; - %targetComponent.MeshAsset = %module @ ":" @ %asset; + %targetComponent.shapeAsset = %module @ ":" @ %asset; //Inspector.refresh(); } diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.cs index dc54e6521..f073ba6c6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/directoryHandling.cs @@ -58,7 +58,7 @@ function directoryHandler::loadFolders(%this, %path, %parentId) // %iconIdx = 1; %searchFoldersText = %this.searchFilter; - if(%searchFoldersText !$= "Search Folders...") + if(%searchFoldersText !$= "") { if(strstr(strlwr(%folderName), strlwr(%searchFoldersText)) != -1) { @@ -123,7 +123,7 @@ function directoryHandler::navigateTo(%this, %address, %historyNav, %selectionNa //find our folder tree and action on it tree %folderId = %this.getFolderTreeItemFromAddress(%address); - + %this.oldAddress = %this.currentAddress; %this.currentAddress = %address; %this.selectedItem = %folderId; @@ -197,7 +197,15 @@ function directoryHandler::getFolderTreeItemFromAddress(%this, %address) //break down the address %folderCount = getTokenCount(%address, "/"); - %curItem = 0; + if(startsWith(%address, "Data/") || startsWith(%address, "Tools/") || startsWith(%address, "Core/")) + { + %curItem = %this.treeCtrl.findChildItemByName(1, "Modules"); + } + else + { + %curItem = 1; + } + %rebuiltPath = ""; for(%f=0; %f < %folderCount; %f++) { @@ -214,7 +222,15 @@ function directoryHandler::expandTreeToAddress(%this, %address) %folderCount = getTokenCount(%address, "/"); %this.treeCtrl.expandItem(0); - %curItem = 0; + if(startsWith(%address, "Data/") || startsWith(%address, "Tools/") || startsWith(%address, "Core/")) + { + %curItem = %this.treeCtrl.findChildItemByName(1, "Modules"); + } + else + { + %curItem = 1; + } + %rebuiltPath = ""; for(%f=0; %f < %folderCount; %f++) { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/editModule.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/editModule.cs index 4a08e84bb..80739e8af 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/editModule.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/editModule.cs @@ -15,7 +15,40 @@ function AssetBrowser::CreateNewModule(%this) Canvas.pushDialog(AssetBrowser_AddModule); AssetBrowser_addModuleWindow.selectWindow(); - AssetBrowser_addModuleWindow.callbackFunction = "AssetBrowser.loadDirectories();"; + AssetBrowser_addModuleWindow.callbackFunction = "AssetBrowser.promptNewModuleFolders();"; +} + +function AssetBrowser::promptNewModuleFolders(%this) +{ + MessageBoxYesNo("Create Folders?", + "Do you want to create some common folders for organization of your new Module?", + "AssetBrowser.makeModuleFolders();", //if yes, make the foldesr + "AssetBrowser.loadDirectories();"); //if no, just refresh +} + +function AssetBrowser::makeModuleFolders(%this) +{ + %moduleId = AssetBrowser.newModuleId; + %moduleDef = ModuleDatabase.findModule(%moduleId); + %modulePath = %moduleDef.ModulePath; + + %count = 0; + %defaultModuleFolders[%count++] = "datablocks"; + %defaultModuleFolders[%count++] = "terrains"; + %defaultModuleFolders[%count++] = "postFXs"; + %defaultModuleFolders[%count++] = "levels"; + %defaultModuleFolders[%count++] = "shapes"; + %defaultModuleFolders[%count++] = "guis"; + %defaultModuleFolders[%count++] = "scripts"; + %defaultModuleFolders[%count++] = "scripts/client"; + %defaultModuleFolders[%count++] = "scripts/server"; + + for(%i=0; %i <= %count; %i++) + { + %this.dirHandler.createFolder(%modulePath @ "/" @ %defaultModuleFolders[%i]); + } + + AssetBrowser.loadDirectories(); } function AssetBrowser::createNewEditorTool(%this) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/looseFileAudit.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/looseFileAudit.cs index 0cdd00029..adba15edb 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/looseFileAudit.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/looseFileAudit.cs @@ -215,6 +215,8 @@ function LooseFileAuditWindow::importGUI(%this) if(!ImportAssetWindow.isAwake()) ImportAssetWindow.showDialog(); + ImportAssetWindow.allowAutoImport = false; + AssetBrowser.addImportingAsset("GUIAsset", LooseFileList.itemPath, "", ""); LooseFileList.removeItem(LooseFileList.selectedItem, false); LooseFileList.buildVisibleTree(true); @@ -226,6 +228,8 @@ function LooseFileAuditWindow::importLevel(%this) if(!ImportAssetWindow.isAwake()) ImportAssetWindow.showDialog(); + ImportAssetWindow.allowAutoImport = false; + AssetBrowser.addImportingAsset("LevelAsset", LooseFileList.itemPath, "", ""); LooseFileList.removeItem(LooseFileList.selectedItem, false); LooseFileList.buildVisibleTree(true); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs index e576b2f11..cbe5c528e 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs @@ -87,9 +87,9 @@ function AssetBrowser::buildPopupMenus(%this) class = "EditorWorldMenu"; //isPopup = true; - item[ 0 ] = "Create Component" TAB AddNewComponentAssetPopup; - item[ 1 ] = "Create Script" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ScriptAsset\", AssetBrowser.selectedModule);"; - item[ 2 ] = "Create State Machine" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"StateMachineAsset\", AssetBrowser.selectedModule);"; + //item[ 0 ] = "Create Component" TAB AddNewComponentAssetPopup; + item[ 0 ] = "Create Script" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ScriptAsset\", AssetBrowser.selectedModule);"; + item[ 1 ] = "Create State Machine" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"StateMachineAsset\", AssetBrowser.selectedModule);"; //item[ 3 ] = "-"; //item[ 3 ] = "Create Game Object" TAB "" TAB "AssetBrowser.createNewGameObjectAsset(\"NewGameObject\", AssetBrowser.selectedModule);"; }; @@ -239,22 +239,6 @@ function AssetBrowser::buildPopupMenus(%this) }; } - //Asset Preview size presets - if( !isObject( AssetPreviewSizePopup ) ) - { - new PopupMenu( AssetPreviewSizePopup ) - { - superClass = "MenuBuilder"; - class = "EditorWorldMenu"; - - item[ 0 ] = "Small" TAB "" TAB "AssetBrowser.setPreviewSize(\"Small\");"; - item[ 1 ] = "Medium" TAB "" TAB "AssetBrowser.setPreviewSize(\"Medium\");"; - Item[ 2 ] = "Large" TAB "" TAB "AssetBrowser.setPreviewSize(\"Large\");"; - }; - - AssetPreviewSizePopup.checkItem(0, true); - } - if( !isObject( AssetTypeListPopup ) ) { new PopupMenu( AssetTypeListPopup ) @@ -295,8 +279,6 @@ function AssetBrowser::buildPopupMenus(%this) item[ 7 ] = "Filter by Asset Type" TAB AssetTypeListPopup; item[ 8 ] = "-"; item[ 9 ] = "Enable Auto-refresh" TAB "" TAB "AssetBrowser.toggleAutorefresh();"; - Item[ 10 ] = "-"; - Item[ 11 ] = "Asset Preview Size" TAB AssetPreviewSizePopup; }; BrowserVisibilityPopup.enableItem(5, false); @@ -408,6 +390,18 @@ function AssetBrowser::buildPopupMenus(%this) AddNewModulePopup.enableItem(1, false); } + + if( !isObject( EditCollectionSets ) ) + { + new PopupMenu( EditCollectionSets ) + { + superClass = "MenuBuilder"; + class = "EditorWorldMenu"; + //isPopup = true; + + item[ 0 ] = "Delete Collection Set" TAB "" TAB "AssetBrowser.deleteCollectionSet();"; + }; + } } function AddNewScriptAssetPopupMenu::onSelectItem(%this, %id, %text) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/profiles.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/profiles.cs new file mode 100644 index 000000000..5010d6cd0 --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/profiles.cs @@ -0,0 +1,27 @@ +singleton GuiControlProfile(AssetBrowserPreviewImageAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + //fillColorNA = "230 126 0 255"; //fill color default + + border = true; + borderColor = "230 126 0 255"; + borderColorNA = "230 126 0 255"; +}; + +singleton GuiControlProfile(AssetBrowserPreviewMaterialAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + + border = true; + borderColor = "0 100 0 255"; + borderColorNA = "0 100 0 255"; +}; + +singleton GuiControlProfile(AssetBrowserPreviewShapeAsset : ToolsGuiDefaultProfile) +{ + fillColor = "128 128 128 255"; //hovered/selected + + border = true; + borderColor = "0 0 200 255"; + borderColorNA = "0 0 200 255"; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/base/menuBar/menuBuilder.ed.cs b/Templates/BaseGame/game/tools/base/menuBar/menuBuilder.ed.cs index 183eef7eb..883c32bf9 100644 --- a/Templates/BaseGame/game/tools/base/menuBar/menuBuilder.ed.cs +++ b/Templates/BaseGame/game/tools/base/menuBar/menuBuilder.ed.cs @@ -120,6 +120,7 @@ function MenuBuilder::addItem(%this, %pos, %item) %name = getField(%item, 0); %accel = getField(%item, 1); %cmd = getField(%item, 2); + %bitmapIdx = getField(%item, 3); // We replace the [this] token with our object ID %cmd = strreplace( %cmd, "[this]", %this ); @@ -132,7 +133,7 @@ function MenuBuilder::addItem(%this, %pos, %item) } else { - %this.insertItem(%pos, %name !$= "-" ? %name : "", %accel, %cmd); + %this.insertItem(%pos, %name !$= "-" ? %name : "", %accel, %cmd, %bitmapIdx $= "" ? -1 : %bitmapIdx); } } diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs index 0dd8727f4..17155174f 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs @@ -485,6 +485,7 @@ function ESettingsWindow::getAssetEditingSettings(%this) SettingsInspector.addSettingsField("Assets/Browser/showFolders", "Show Folders in Tiles view in Asset Browser", "bool", ""); SettingsInspector.addSettingsField("Assets/Browser/showEmptyFolders", "Show Empty Folders in Tiles view in Asset Browser", "bool", ""); SettingsInspector.addSettingsField("Assets/Browser/previewTileSize", "Asset Preview Tile Size", "bool", ""); + SettingsInspector.addSettingsField("Assets/Browser/showLooseFiles", "Show Loose Files when viewing in Asset Browser", "bool", ""); SettingsInspector.addSettingsField("AssetManagement/Assets/promptOnRename", "Prompt on Rename", "bool", ""); SettingsInspector.endGroup(); } diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/cross.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/cross.png new file mode 100644 index 000000000..e21d5ac10 Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/cross.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/filter.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/filter.png new file mode 100644 index 000000000..f9e2864a6 Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/filter.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/import.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/import.png new file mode 100644 index 000000000..1a1278fe5 Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/import.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/menuGrid.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/menuGrid.png new file mode 100644 index 000000000..3e92b499b Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/menuGrid.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/phone.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/phone.png new file mode 100644 index 000000000..3580a6e1b Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/phone.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/plus.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/plus.png new file mode 100644 index 000000000..3f5cf3712 Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/plus.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/previous.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/previous.png new file mode 100644 index 000000000..2720365ec Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/previous.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/return.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/return.png new file mode 100644 index 000000000..139b39afc Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/return.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/warning.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/warning.png new file mode 100644 index 000000000..5869f57f7 Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/warning.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/stencilIcons/zoom.png b/Templates/BaseGame/game/tools/gui/images/stencilIcons/zoom.png new file mode 100644 index 000000000..6485b489f Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/stencilIcons/zoom.png differ diff --git a/Templates/BaseGame/game/tools/gui/profiles.ed.cs b/Templates/BaseGame/game/tools/gui/profiles.ed.cs index cd45141bd..5f9adbf33 100644 --- a/Templates/BaseGame/game/tools/gui/profiles.ed.cs +++ b/Templates/BaseGame/game/tools/gui/profiles.ed.cs @@ -305,7 +305,7 @@ new GuiControlProfile( ToolsGuiTextEditProfile ) fontColor = EditorSettings.value("Theme/fieldTextColor"); fontColorSEL = EditorSettings.value("Theme/fieldBGSELColor"); fontColorHL = EditorSettings.value("Theme/fieldTextSELColor"); - fontColorNA = EditorSettings.value("Theme/fieldTextSELColor"); + fontColorNA = EditorSettings.value("Theme/fieldTextNAColor"); textOffset = "4 2"; autoSizeWidth = false; autoSizeHeight = true; @@ -651,6 +651,8 @@ new GuiControlProfile( ToolsGuiTreeViewProfile ) opaque = false; border = false; category = "Tools"; + + fontColors[9] = "0 128 128"; //for active/selection of elements }; if( !isObject( ToolsGuiTextPadProfile ) )