Torque3D/Engine/source/T3D/assets/ImageAssetInspectors.h
Areloch 6162c5da05 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.
2022-12-08 20:00:55 -06:00

42 lines
1 KiB
C++

#pragma once
#include "ImageAsset.h"
#ifndef _GUI_INSPECTOR_TYPES_H_
#include "gui/editor/guiInspectorTypes.h"
#endif
#include <gui/controls/guiBitmapCtrl.h>
#ifdef TORQUE_TOOLS
class GuiInspectorTypeImageAssetPtr : public GuiInspectorTypeFileName
{
typedef GuiInspectorTypeFileName Parent;
public:
GuiTextCtrl* mLabel;
GuiBitmapButtonCtrl* mPreviewBorderButton;
GuiBitmapCtrl* mPreviewImage;
GuiButtonCtrl* mEditButton;
DECLARE_CONOBJECT(GuiInspectorTypeImageAssetPtr);
static void consoleInit();
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
{
typedef GuiInspectorTypeImageAssetPtr Parent;
public:
DECLARE_CONOBJECT(GuiInspectorTypeImageAssetId);
static void consoleInit();
};
#endif