mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-25 07:04:45 +00:00
- Overhauls the material editor to simplify and streamline the logic behind it since the inspector does most of the work - Tweak a few order positions of materialdefinition fields to work better - Sets AO, Rough and Metal channel fields to use an enum type for human readability - Updates the MaterialPreview gui control to work with assetIds - MatEd now supports setting of parent material to inherit from - Creating a new material now can prompt selecting an existing material to inherit from - Can now edit the mapTo value of a material in the matEd - New standalone Composite Texture Editor window for convering AO, Roughness and Metalness maps in a material to an ORMMap - Can also star the creation of a composite texture via RMB context menu in AB on an image asset - Moved logic of CubemapEditor from MatEd to it's own stuff - Made ImageAsset fields now be more clear when they have nothing assigned, and also have a clear button to empty the field's value so it's consistent across the board - Reorganized the layout of the gui and image files for the MatEd to be easier to navigate - MaterialEditor now overlays the EditorGUI instead of being forcefully embedded in it, allowing easy editing of the MatEd Gui via the Gui editor
55 lines
1.4 KiB
C++
55 lines
1.4 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 = NULL;
|
|
GuiBitmapButtonCtrl* mPreviewBorderButton = NULL;
|
|
GuiBitmapCtrl* mPreviewImage = NULL;
|
|
GuiBitmapButtonCtrl* mEditButton = NULL;
|
|
|
|
bool mIsDeleteButtonVisible;
|
|
|
|
DECLARE_CONOBJECT(GuiInspectorTypeImageAssetPtr);
|
|
static void consoleInit();
|
|
|
|
GuiControl* constructEditControl() override;
|
|
bool updateRects() override;
|
|
bool renderTooltip(const Point2I& hoverPos, const Point2I& cursorPos, const char* tipText = NULL);
|
|
|
|
void updateValue() override;
|
|
|
|
void updatePreviewImage();
|
|
void setPreviewImage(StringTableEntry assetId);
|
|
|
|
/// 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);
|
|
}
|
|
};
|
|
|
|
class GuiInspectorTypeImageAssetId : public GuiInspectorTypeImageAssetPtr
|
|
{
|
|
typedef GuiInspectorTypeImageAssetPtr Parent;
|
|
public:
|
|
|
|
DECLARE_CONOBJECT(GuiInspectorTypeImageAssetId);
|
|
static void consoleInit();
|
|
};
|
|
#endif
|