From 0bf38aacf3e99761ec7850eb5748031900ca2cde Mon Sep 17 00:00:00 2001 From: JeffR Date: Tue, 1 Apr 2025 02:10:13 -0500 Subject: [PATCH] Made the Asset Properties inspector ctrl be a regular GuiInspector control Standardized the image asset action menu and editing callbacks while leaving it open for modification/expansion later as needed --- .../tools/assetBrowser/guis/editAsset.gui | 2 +- .../scripts/assetTypes/image.tscript | 42 ++++++------------- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui index 6d30fea61..9ac2e2ef2 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui @@ -75,7 +75,7 @@ $guiContent = new GuiControl(AssetBrowser_editAsset) { canSave = "1"; canSaveDynamicFields = "0"; - new GuiVariableInspector(AssetEditInspector) { + new GuiInspector(AssetEditInspector) { dividerMargin = "5"; showCustomFields = "1"; stackingType = "Vertical"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.tscript index 673652b70..98af1c509 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.tscript @@ -95,38 +95,20 @@ function ImageAsset::generatePreviewImage(%this, %previewButton, %forceRegenerat function ImageAsset::onShowActionMenu(%this) { - if( !isObject( EditImageAssetTypePopup ) ) - { - new PopupMenu( EditImageAssetTypePopup ) - { - superClass = "MenuBuilder"; - class = "EditorWorldMenu"; - - jumpFileName = ""; - jumpLineNumber = ""; - }; - } - - EditImageAssetTypePopup.objectData = %this; - EditImageAssetTypePopup.objectType = "ImageAsset"; - - //Regen the menu so we're fully up and current with options and references - EditImageAssetTypePopup.clearItems(); - - EditImageAssetTypePopup.item[ 0 ] = "Rename Folder" TAB "" TAB $CurrentAssetBrowser @ ".renameAsset();"; - EditImageAssetTypePopup.item[ 1 ] = "Duplicate Folder" TAB "" TAB $CurrentAssetBrowser @ ".duplicateAsset();"; - EditImageAssetTypePopup.item[ 2 ] = "-"; - EditImageAssetTypePopup.item[ 3 ] = "Open File Location" TAB "" TAB $CurrentAssetBrowser @ ".openFolderLocation(" @ filePath(%this.getFilename()) @ ");"; - EditImageAssetTypePopup.item[ 4 ] = "-"; - EditImageAssetTypePopup.item[ 5 ] = "Delete Folder" TAB "" TAB $CurrentAssetBrowser @ ".deleteAsset();"; - - EditImageAssetTypePopup.reloadItems(); - - EditImageAssetTypePopup.showPopup(Canvas); - - $CurrentAssetBrowser.popupMenu = EditImageAssetTypePopup; + GenericAsset::onShowActionMenu(%this); } +function ImageAsset::onEditProperties(%this) +{ + GenericAsset::onEditProperties(%this); +} + +//Called when the AssetType has it's properties saved from the onEditProperties process +function ImageAsset::onSaveProperties(%this) +{ + GenericAsset::onSaveProperties(%this); +} + function GuiInspectorTypeImageAssetPtr::onControlDropped( %this, %payload, %position ) { Canvas.popDialog(EditorDragAndDropLayer);