Explorar o código

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

JeffR hai 9 meses
pai
achega
0bf38aacf3

+ 1 - 1
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";

+ 11 - 29
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();";
+   GenericAsset::onShowActionMenu(%this);
+}
 
-   EditImageAssetTypePopup.reloadItems();
-   
-   EditImageAssetTypePopup.showPopup(Canvas); 
-   
-   $CurrentAssetBrowser.popupMenu = EditImageAssetTypePopup;
+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);