Updates the behavior and layout of the ImageAsset, MaterialAsset and ShapeAsset inspector field types to be clearer, with previews and obvious edit buttons

Also fixes drag-n-drop behavior from the AB into the image and shape fields to ensure they update as expected.
This commit is contained in:
Areloch 2022-12-08 20:00:55 -06:00
parent fc1bbabe46
commit 6162c5da05
11 changed files with 422 additions and 108 deletions

View file

@ -57,6 +57,7 @@
#include "materials/customMaterialDefinition.h"
#include "materials/materialManager.h"
#include "assetMacroHelpers.h"
#include <gui/controls/guiBitmapCtrl.h>
//-----------------------------------------------------------------------------
class MaterialAsset : public AssetBase
@ -140,13 +141,21 @@ class GuiInspectorTypeMaterialAssetPtr : public GuiInspectorTypeFileName
typedef GuiInspectorTypeFileName Parent;
public:
GuiBitmapButtonCtrl* mEditButton;
GuiTextCtrl* mLabel;
GuiBitmapButtonCtrl* mPreviewBorderButton;
GuiBitmapCtrl* mPreviewImage;
GuiButtonCtrl* mEditButton;
DECLARE_CONOBJECT(GuiInspectorTypeMaterialAssetPtr);
static void consoleInit();
virtual GuiControl* constructEditControl();
virtual bool updateRects();
virtual void updateValue();
void updatePreviewImage();
void setPreviewImage(StringTableEntry assetId);
};
class GuiInspectorTypeMaterialAssetId : public GuiInspectorTypeMaterialAssetPtr