2021-07-19 01:07:08 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "ImageAsset.h"
|
|
|
|
|
|
|
|
|
|
#ifndef _GUI_INSPECTOR_TYPES_H_
|
|
|
|
|
#include "gui/editor/guiInspectorTypes.h"
|
|
|
|
|
#endif
|
2022-12-08 20:00:55 -06:00
|
|
|
#include <gui/controls/guiBitmapCtrl.h>
|
2021-07-19 01:07:08 -05:00
|
|
|
|
2022-06-13 12:38:08 -05:00
|
|
|
#ifdef TORQUE_TOOLS
|
2021-07-19 01:07:08 -05:00
|
|
|
class GuiInspectorTypeImageAssetPtr : public GuiInspectorTypeFileName
|
|
|
|
|
{
|
|
|
|
|
typedef GuiInspectorTypeFileName Parent;
|
|
|
|
|
public:
|
|
|
|
|
|
2023-05-01 10:37:44 -05:00
|
|
|
GuiTextCtrl* mLabel = NULL;
|
|
|
|
|
GuiBitmapButtonCtrl* mPreviewBorderButton = NULL;
|
|
|
|
|
GuiBitmapCtrl* mPreviewImage = NULL;
|
2025-08-03 12:03:02 -05:00
|
|
|
GuiBitmapButtonCtrl* mEditButton = NULL;
|
|
|
|
|
|
|
|
|
|
bool mIsDeleteButtonVisible;
|
2021-07-19 01:07:08 -05:00
|
|
|
|
|
|
|
|
DECLARE_CONOBJECT(GuiInspectorTypeImageAssetPtr);
|
|
|
|
|
static void consoleInit();
|
|
|
|
|
|
2024-03-18 18:13:00 +00:00
|
|
|
GuiControl* constructEditControl() override;
|
|
|
|
|
bool updateRects() override;
|
2021-07-19 01:07:08 -05:00
|
|
|
bool renderTooltip(const Point2I& hoverPos, const Point2I& cursorPos, const char* tipText = NULL);
|
2022-12-08 20:00:55 -06:00
|
|
|
|
2024-03-18 18:13:00 +00:00
|
|
|
void updateValue() override;
|
2022-12-08 20:00:55 -06:00
|
|
|
|
|
|
|
|
void updatePreviewImage();
|
|
|
|
|
void setPreviewImage(StringTableEntry assetId);
|
2025-08-03 12:03:02 -05:00
|
|
|
|
|
|
|
|
/// Sets this control's caption text, usually set within setInspectorField,
|
|
|
|
|
/// this is exposed in case someone wants to override the normal caption.
|
|
|
|
|
void setCaption(StringTableEntry caption) override;
|
|
|
|
|
|
|
|
|
|
void setIsDeleteBtnVisible(const bool& isVisible)
|
|
|
|
|
{
|
|
|
|
|
if (mEditButton)
|
|
|
|
|
mEditButton->setVisible(isVisible);
|
|
|
|
|
}
|
2021-07-19 01:07:08 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class GuiInspectorTypeImageAssetId : public GuiInspectorTypeImageAssetPtr
|
|
|
|
|
{
|
|
|
|
|
typedef GuiInspectorTypeImageAssetPtr Parent;
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
DECLARE_CONOBJECT(GuiInspectorTypeImageAssetId);
|
|
|
|
|
static void consoleInit();
|
|
|
|
|
};
|
2022-06-13 12:38:08 -05:00
|
|
|
#endif
|