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

@ -5,6 +5,7 @@
#ifndef _GUI_INSPECTOR_TYPES_H_
#include "gui/editor/guiInspectorTypes.h"
#endif
#include <gui/controls/guiBitmapCtrl.h>
#ifdef TORQUE_TOOLS
class GuiInspectorTypeImageAssetPtr : public GuiInspectorTypeFileName
@ -12,7 +13,10 @@ class GuiInspectorTypeImageAssetPtr : public GuiInspectorTypeFileName
typedef GuiInspectorTypeFileName Parent;
public:
GuiBitmapButtonCtrl* mImageEdButton;
GuiTextCtrl* mLabel;
GuiBitmapButtonCtrl* mPreviewBorderButton;
GuiBitmapCtrl* mPreviewImage;
GuiButtonCtrl* mEditButton;
DECLARE_CONOBJECT(GuiInspectorTypeImageAssetPtr);
static void consoleInit();
@ -20,6 +24,11 @@ public:
virtual GuiControl* constructEditControl();
virtual bool updateRects();
bool renderTooltip(const Point2I& hoverPos, const Point2I& cursorPos, const char* tipText = NULL);
virtual void updateValue();
void updatePreviewImage();
void setPreviewImage(StringTableEntry assetId);
};
class GuiInspectorTypeImageAssetId : public GuiInspectorTypeImageAssetPtr