From f519cff6ff932a71cfc0564b0d86cc82b8939d96 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Sat, 21 Dec 2024 23:02:23 +0000 Subject: [PATCH] gui types using image_asset --- Engine/source/gui/controls/guiBitmapCtrl.cpp | 209 +++++++++--------- Engine/source/gui/controls/guiBitmapCtrl.h | 66 +++--- .../gui/controls/guiGameSettingsCtrl.cpp | 27 +-- .../source/gui/controls/guiGameSettingsCtrl.h | 13 +- Engine/source/gui/core/guiTypes.cpp | 15 +- Engine/source/gui/core/guiTypes.h | 5 +- .../source/gui/game/guiChunkedBitmapCtrl.cpp | 18 +- Engine/source/gui/game/guiChunkedBitmapCtrl.h | 5 +- .../source/gui/game/guiProgressBitmapCtrl.cpp | 3 +- .../source/gui/game/guiProgressBitmapCtrl.h | 11 +- .../source/gui/worldEditor/guiMissionArea.cpp | 10 +- .../source/gui/worldEditor/guiMissionArea.h | 5 +- Engine/source/gui/worldEditor/worldEditor.cpp | 18 +- Engine/source/gui/worldEditor/worldEditor.h | 13 +- .../game/data/gameUI/GUIs/playGui.gui | 2 +- .../guis/assetPreviewButtonsTemplate.gui | 6 +- .../assetBrowser/scripts/assetBrowser.tscript | 2 +- .../game/tools/gui/materialSelector.ed.gui | 4 +- .../guiEditor/gui/EditorChooseGUI.ed.gui | 2 +- .../materialEditor/gui/Profiles.ed.tscript | 4 +- .../gui/guiMaterialPropertiesWindow.ed.gui | 2 +- .../guiMaterialPropertiesWindow.ed.gui.orig | 2 +- .../game/tools/navEditor/NavEditorToolbar.gui | 2 +- .../gui/EditorChooseLevelGui.ed.gui | 2 +- .../tools/worldEditor/gui/EditorGui.ed.gui | 4 +- 25 files changed, 184 insertions(+), 266 deletions(-) diff --git a/Engine/source/gui/controls/guiBitmapCtrl.cpp b/Engine/source/gui/controls/guiBitmapCtrl.cpp index 783942d08..58ec91ba9 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.cpp +++ b/Engine/source/gui/controls/guiBitmapCtrl.cpp @@ -34,15 +34,15 @@ IMPLEMENT_CONOBJECT(GuiBitmapCtrl); -ConsoleDocClass( GuiBitmapCtrl, +ConsoleDocClass(GuiBitmapCtrl, "@brief A gui control that is used to display an image.\n\n" - + "The image is stretched to the constraints of the control by default. However, the control can also\n" "tile the image as well.\n\n" "The image itself is stored inside the GuiBitmapCtrl::bitmap field. The boolean value that decides\n" "whether the image is stretched or tiled is stored inside the GuiBitmapCtrl::wrap field.\n" - + "@tsexample\n" "// Create a tiling GuiBitmapCtrl that displays \"myImage.png\"\n" "%bitmapCtrl = new GuiBitmapCtrl()\n" @@ -51,101 +51,87 @@ ConsoleDocClass( GuiBitmapCtrl, " wrap = \"true\";\n" "};\n" "@endtsexample\n\n" - + "@ingroup GuiControls" ); GuiBitmapCtrl::GuiBitmapCtrl(void) - : mStartPoint( 0, 0 ), + : mStartPoint(0, 0), mColor(ColorI::WHITE), mAngle(0), - mWrap( false ) + mWrap(false), + mBitmap(NULL), + mBitmapName(StringTable->EmptyString()) { - INIT_ASSET(Bitmap); -} - -bool GuiBitmapCtrl::setBitmapName( void *object, const char *index, const char *data ) -{ - // Prior to this, you couldn't do bitmap.bitmap = "foo.jpg" and have it work. - // With protected console types you can now call the setBitmap function and - // make it load the image. - static_cast( object )->setBitmap( data ); - - // Return false because the setBitmap method will assign 'mBitmapName' to the - // argument we are specifying in the call. - return false; } void GuiBitmapCtrl::initPersistFields() { docsURL; - addGroup( "Bitmap" ); + addGroup("Bitmap"); - addField("Bitmap", TypeImageFilename, Offset(mBitmapName, GuiBitmapCtrl), assetDoc(Bitmap, docs), AbstractClassRep::FIELD_HideInInspectors); - addField("BitmapAsset", TypeImageAssetId, Offset(mBitmapAssetId, GuiBitmapCtrl), assetDoc(Bitmap, asset docs.)); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiBitmapCtrl, "The bitmap to render in this BitmapCtrl.") - addField("color", TypeColorI, Offset(mColor, GuiBitmapCtrl),"color mul"); - addField( "wrap", TypeBool, Offset( mWrap, GuiBitmapCtrl ), - "If true, the bitmap is tiled inside the control rather than stretched to fit." ); + addField("color", TypeColorI, Offset(mColor, GuiBitmapCtrl), "color mul"); + addField("wrap", TypeBool, Offset(mWrap, GuiBitmapCtrl), + "If true, the bitmap is tiled inside the control rather than stretched to fit."); - addField("angle", TypeF32, Offset(mAngle, GuiBitmapCtrl), "rotation"); - - endGroup( "Bitmap" ); + addField("angle", TypeF32, Offset(mAngle, GuiBitmapCtrl), "rotation"); + + endGroup("Bitmap"); Parent::initPersistFields(); } bool GuiBitmapCtrl::onWake() { - if (! Parent::onWake()) + if (!Parent::onWake()) return false; setActive(true); - if (mBitmapName != StringTable->insert("texhandle")) - setBitmap(getBitmap()); return true; } void GuiBitmapCtrl::onSleep() { - if ( mBitmapName != StringTable->insert("texhandle") ) - mBitmap = NULL; - Parent::onSleep(); } //------------------------------------- void GuiBitmapCtrl::inspectPostApply() { - //This is a little bit of a 'special case' handling for this class - //Because we don't do the normal protectedField setup for the bitmapName/bitmapAsset fields - //which would automatically update the internal values and bound content, we'll do it here manually - //to ensure it's updated before we force a refresh, which would thrash the new values - if (mBitmapName != StringTable->insert("texhandle")) - { - _setBitmap(mBitmapAssetId); - } - else - { - setBitmap(getBitmap()); - } - // if the extent is set to (0,0) in the gui editor and appy hit, this control will // set it's extent to be exactly the size of the bitmap (if present) Parent::inspectPostApply(); - if (!mWrap && (getExtent().x == 0) && (getExtent().y == 0) && mBitmap) + if (!mWrap && (getExtent().x == 0) && (getExtent().y == 0) && mBitmapAsset.notNull()) { - setExtent( mBitmap->getWidth(), mBitmap->getHeight()); + setExtent(mBitmap->getWidth(), mBitmap->getHeight()); } } -void GuiBitmapCtrl::setBitmap( const char *name, bool resize ) +void GuiBitmapCtrl::setBitmap(const char* name, bool resize) { - _setBitmap(StringTable->insert(name)); - - if (mBitmap && resize) + // coming in here we are probably getting a filename. + if (AssetDatabase.isDeclaredAsset(name)) { + _setBitmap(StringTable->insert(name)); + } + else + { + StringTableEntry assetId = ImageAsset::getAssetIdByFilename(StringTable->insert(name)); + + if (assetId != StringTable->EmptyString()) + _setBitmap(assetId); + else + return; + } + + mBitmap = mBitmapAsset->getTexture(&GFXDefaultGUIProfile); + + if (mBitmapAsset.notNull() && resize) + { + setExtent(mBitmap->getWidth(), mBitmap->getHeight()); updateSizing(); } @@ -153,15 +139,6 @@ void GuiBitmapCtrl::setBitmap( const char *name, bool resize ) setUpdate(); } -void GuiBitmapCtrl::updateSizing() -{ - if(!getParent()) - return; - // updates our bounds according to our horizSizing and verSizing rules - RectI fakeBounds( getPosition(), getParent()->getExtent()); - parentResized( fakeBounds, fakeBounds); -} - void GuiBitmapCtrl::setBitmapHandle(GFXTexHandle handle, bool resize) { mBitmap = handle; @@ -169,46 +146,58 @@ void GuiBitmapCtrl::setBitmapHandle(GFXTexHandle handle, bool resize) mBitmapName = StringTable->insert("texhandle"); // Resize the control to fit the bitmap - if (resize) + if (resize) { setExtent(mBitmap->getWidth(), mBitmap->getHeight()); updateSizing(); } } -void GuiBitmapCtrl::onRender(Point2I offset, const RectI &updateRect) +void GuiBitmapCtrl::updateSizing() { + if (!getParent()) + return; + // updates our bounds according to our horizSizing and verSizing rules + RectI fakeBounds(getPosition(), getParent()->getExtent()); + parentResized(fakeBounds, fakeBounds); +} + +void GuiBitmapCtrl::onRender(Point2I offset, const RectI& updateRect) +{ + if (mBitmap.isNull() && mBitmapAsset.notNull()) + mBitmap = getBitmap(); + if (mBitmap) { GFX->getDrawUtil()->clearBitmapModulation(); GFX->getDrawUtil()->setBitmapModulation(mColor); - if(mWrap) - { + if (mWrap) + { // We manually draw each repeat because non power of two textures will // not tile correctly when rendered with GFX->drawBitmapTile(). The non POT // bitmap will be padded by the hardware, and we'll see lots of slack // in the texture. So... lets do what we must: draw each repeat by itself: - GFXTextureObject* texture = mBitmap; - RectI srcRegion; - RectI dstRegion; - F32 xdone = ((F32)getExtent().x/(F32)texture->mBitmapSize.x)+1; - F32 ydone = ((F32)getExtent().y/(F32)texture->mBitmapSize.y)+1; + GFXTextureObject* texture = mBitmap; + RectI srcRegion; + RectI dstRegion; + F32 xdone = ((F32)getExtent().x / (F32)texture->mBitmapSize.x) + 1; + F32 ydone = ((F32)getExtent().y / (F32)texture->mBitmapSize.y) + 1; - S32 xshift = mStartPoint.x%texture->mBitmapSize.x; - S32 yshift = mStartPoint.y%texture->mBitmapSize.y; - for(S32 y = 0; y < ydone; ++y) - for(S32 x = 0; x < xdone; ++x) - { - srcRegion.set(0,0,texture->mBitmapSize.x,texture->mBitmapSize.y); - dstRegion.set( ((texture->mBitmapSize.x*x)+offset.x)-xshift, - ((texture->mBitmapSize.y*y)+offset.y)-yshift, - texture->mBitmapSize.x, - texture->mBitmapSize.y); + S32 xshift = mStartPoint.x % texture->mBitmapSize.x; + S32 yshift = mStartPoint.y % texture->mBitmapSize.y; + for (S32 y = 0; y < ydone; ++y) + for (S32 x = 0; x < xdone; ++x) + { + srcRegion.set(0, 0, texture->mBitmapSize.x, texture->mBitmapSize.y); + dstRegion.set(((texture->mBitmapSize.x * x) + offset.x) - xshift, + ((texture->mBitmapSize.y * y) + offset.y) - yshift, + texture->mBitmapSize.x, + texture->mBitmapSize.y); GFX->getDrawUtil()->drawBitmapStretchSR(texture, dstRegion, srcRegion, GFXBitmapFlip_None, GFXTextureFilterLinear, mAngle); - } + } - } - else + } + else { RectI rect(offset, getExtent()); GFX->getDrawUtil()->drawBitmapStretch(mBitmap, rect, GFXBitmapFlip_None, GFXTextureFilterLinear, false, mAngle); @@ -226,21 +215,21 @@ void GuiBitmapCtrl::onRender(Point2I offset, const RectI &updateRect) void GuiBitmapCtrl::setValue(S32 x, S32 y) { - if (mBitmap) + if (mBitmapAsset.notNull()) { - x += mBitmap->getWidth() / 2; - y += mBitmap->getHeight() / 2; - } - while (x < 0) - x += 256; - mStartPoint.x = x % 256; + x += mBitmapAsset->getTextureBitmapWidth() / 2; + y += mBitmapAsset->getTextureBitmapHeight() / 2; + } + while (x < 0) + x += 256; + mStartPoint.x = x % 256; - while (y < 0) - y += 256; - mStartPoint.y = y % 256; + while (y < 0) + y += 256; + mStartPoint.y = y % 256; } -DefineEngineMethod( GuiBitmapCtrl, setValue, void, ( S32 x, S32 y ),, +DefineEngineMethod(GuiBitmapCtrl, setValue, void, (S32 x, S32 y), , "Set the offset of the bitmap within the control.\n" "@param x The x-axis offset of the image.\n" "@param y The y-axis offset of the image.\n") @@ -257,7 +246,7 @@ static ConsoleDocFragment _sGuiBitmapCtrlSetBitmap1( "@param filename The filename of the image.\n" "@param resize Optional parameter. If true, the GUI will resize to fit the image.", "GuiBitmapCtrl", // The class to place the method in; use NULL for functions. - "void setBitmap( String filename, bool resize );" ); // The definition string. + "void setBitmap( String filename, bool resize );"); // The definition string. static ConsoleDocFragment _sGuiBitmapCtrlSetBitmap2( "@brief Assign an image to the control.\n\n" @@ -265,42 +254,42 @@ static ConsoleDocFragment _sGuiBitmapCtrlSetBitmap2( "@param filename The filename of the image.\n" "@param resize A boolean value that decides whether the ctrl refreshes or not.", "GuiBitmapCtrl", // The class to place the method in; use NULL for functions. - "void setBitmap( String filename );" ); // The definition string. + "void setBitmap( String filename );"); // The definition string. //"Set the bitmap displayed in the control. Note that it is limited in size, to 256x256." -DefineEngineMethod( GuiBitmapCtrl, setBitmap, void, ( const char * fileRoot, bool resize), ( false), +DefineEngineMethod(GuiBitmapCtrl, setBitmap, void, (const char* fileRoot, bool resize), (false), "( String filename | String filename, bool resize ) Assign an image to the control.\n\n" - "@hide" ) + "@hide") { char filename[1024]; Con::expandScriptFilename(filename, sizeof(filename), fileRoot); - object->setBitmap(filename, resize ); + object->setBitmap(filename, resize); } -DefineEngineMethod(GuiBitmapCtrl, getBitmap, const char*, (),, +DefineEngineMethod(GuiBitmapCtrl, getBitmap, const char*, (), , "Gets the current bitmap set for this control.\n\n" "@hide") { - return object->getBitmap(); + return object->_getBitmap(); } -DefineEngineMethod( GuiBitmapCtrl, setNamedTexture, bool, (String namedtexture),, +DefineEngineMethod(GuiBitmapCtrl, setNamedTexture, bool, (String namedtexture), , "@brief Set a texture as the image.\n\n" "@param namedtexture The name of the texture (NamedTexTarget).\n" - "@return true if the texture exists." ) + "@return true if the texture exists.") { GFXTexHandle theTex; - NamedTexTarget *namedTarget = NULL; + NamedTexTarget* namedTarget = NULL; namedTarget = NamedTexTarget::find(namedtexture.c_str()); - if ( namedTarget ) + if (namedTarget) { - theTex = namedTarget->getTexture( 0 ); + theTex = namedTarget->getTexture(0); } - - if ( theTex.isValid() ) + + if (theTex.isValid()) { - object->setBitmapHandle( theTex , false ); + object->setBitmapHandle(theTex, false); return true; //a new texture was set correctly } return false; //we couldn't change the texture diff --git a/Engine/source/gui/controls/guiBitmapCtrl.h b/Engine/source/gui/controls/guiBitmapCtrl.h index b641fd5a2..c953fb3b1 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.h +++ b/Engine/source/gui/controls/guiBitmapCtrl.h @@ -31,51 +31,47 @@ /// Renders a bitmap. class GuiBitmapCtrl : public GuiControl { - public: - - typedef GuiControl Parent; +public: - protected: - - /// Name of the bitmap file. If this is 'texhandle' the bitmap is not loaded - /// from a file but rather set explicitly on the control. - DECLARE_IMAGEASSET(GuiBitmapCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile); - DECLARE_ASSET_SETGET(GuiBitmapCtrl, Bitmap); - - Point2I mStartPoint; - ColorI mColor; - F32 mAngle; + typedef GuiControl Parent; - /// If true, bitmap tiles inside control. Otherwise stretches. - bool mWrap; +protected: - static bool setBitmapName( void *object, const char *index, const char *data ); - static const char *getBitmapName( void *obj, const char *data ); + /// Name of the bitmap file. If this is 'texhandle' the bitmap is not loaded + /// from a file but rather set explicitly on the control. + DECLARE_IMAGEASSET_REFACTOR(GuiBitmapCtrl, Bitmap, GFXDefaultGUIProfile) - void onImageChanged() {} + Point2I mStartPoint; + ColorI mColor; + F32 mAngle; - public: - - GuiBitmapCtrl(); - static void initPersistFields(); + /// If true, bitmap tiles inside control. Otherwise stretches. + bool mWrap; - void setBitmap(const char *name,bool resize = false); - void setBitmapHandle(GFXTexHandle handle, bool resize = false); +public: + GFXTexHandle mBitmap; + StringTableEntry mBitmapName; - // GuiControl. - bool onWake() override; - void onSleep() override; - void inspectPostApply() override; + GuiBitmapCtrl(); + static void initPersistFields(); - void updateSizing(); + // GuiControl. + bool onWake() override; + void onSleep() override; + void inspectPostApply() override; - void onRender(Point2I offset, const RectI &updateRect) override; - void setValue(S32 x, S32 y); + void setBitmap(const char* name, bool resize = true); + void setBitmapHandle(GFXTexHandle handle, bool resize = false); - DECLARE_CONOBJECT( GuiBitmapCtrl ); - DECLARE_CATEGORY( "Gui Images" ); - DECLARE_DESCRIPTION( "A control that displays a single, static image from a file.n" - "The bitmap can either be tiled or stretched inside the control." ); + void updateSizing(); + + void onRender(Point2I offset, const RectI& updateRect) override; + void setValue(S32 x, S32 y); + + DECLARE_CONOBJECT(GuiBitmapCtrl); + DECLARE_CATEGORY("Gui Images"); + DECLARE_DESCRIPTION("A control that displays a single, static image from a file.n" + "The bitmap can either be tiled or stretched inside the control."); }; #endif diff --git a/Engine/source/gui/controls/guiGameSettingsCtrl.cpp b/Engine/source/gui/controls/guiGameSettingsCtrl.cpp index fff03c24b..ef68c38ca 100644 --- a/Engine/source/gui/controls/guiGameSettingsCtrl.cpp +++ b/Engine/source/gui/controls/guiGameSettingsCtrl.cpp @@ -59,10 +59,6 @@ GuiGameSettingsCtrl::GuiGameSettingsCtrl() : mCallbackOnB = mCallbackOnA; mCallbackOnX = mCallbackOnA; mCallbackOnY = mCallbackOnA; - - INIT_ASSET(KeybindBitmap); - INIT_ASSET(PreviousBitmap); - INIT_ASSET(NextBitmap); } GuiGameSettingsCtrl::~GuiGameSettingsCtrl() @@ -193,7 +189,7 @@ void GuiGameSettingsCtrl::onRenderListOption(Point2I currentOffset) arrowOffset.y = currentOffset.y + arrowOffsetY; drawer->clearBitmapModulation(); - drawer->drawBitmapStretch(mPreviousBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false); + drawer->drawBitmapStretch(getPreviousBitmap(), RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false); } else { @@ -214,7 +210,7 @@ void GuiGameSettingsCtrl::onRenderListOption(Point2I currentOffset) arrowOffset.y = currentOffset.y + arrowOffsetY; drawer->clearBitmapModulation(); - drawer->drawBitmapStretch(mNextBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false); + drawer->drawBitmapStretch(getNextBitmap(), RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false); } else { @@ -376,7 +372,7 @@ void GuiGameSettingsCtrl::onRenderKeybindOption(Point2I currentOffset) { RectI rect(button, buttonSize); drawer->clearBitmapModulation(); - drawer->drawBitmapStretch(mKeybindBitmap, rect, GFXBitmapFlip_None, GFXTextureFilterLinear, false); + drawer->drawBitmapStretch(getKeybindBitmap(), rect, GFXBitmapFlip_None, GFXTextureFilterLinear, false); } //drawer->drawRectFill(button, ColorI::BLUE); @@ -454,22 +450,11 @@ bool GuiGameSettingsCtrl::onWake() if( !Parent::onWake() ) return false; - _setNextBitmap(getNextBitmap()); - _setPreviousBitmap(getPreviousBitmap()); - _setKeybindBitmap(getKeybindBitmap()); - return true; } void GuiGameSettingsCtrl::onSleep() { - if (mNextBitmapAsset.notNull()) - mNextBitmap = NULL; - if (mPreviousBitmapAsset.notNull()) - mPreviousBitmap = NULL; - if (mKeybindBitmapAsset.notNull()) - mKeybindBitmap = NULL; - Parent::onSleep(); } @@ -840,9 +825,9 @@ IMPLEMENT_CALLBACK(GuiGameSettingsCtrl, onAxisEvent, void, (const char* device, void GuiGameSettingsCtrl::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET(KeybindBitmap, GuiGameSettingsCtrl, "Bitmap used to display the bound key for this keybind option."); - INITPERSISTFIELD_IMAGEASSET(PreviousBitmap, GuiGameSettingsCtrl, "Bitmap used for the previous button when in list mode."); - INITPERSISTFIELD_IMAGEASSET(NextBitmap, GuiGameSettingsCtrl, "Bitmap used for the next button when in list mode."); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(KeybindBitmap, GuiGameSettingsCtrl, "Bitmap used to display the bound key for this keybind option."); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(PreviousBitmap, GuiGameSettingsCtrl, "Bitmap used for the previous button when in list mode."); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(NextBitmap, GuiGameSettingsCtrl, "Bitmap used for the next button when in list mode."); addField("arrowSize", TypeS32, Offset(mArrowSize, GuiGameSettingsCtrl), "Size of the arrow buttons' extents"); diff --git a/Engine/source/gui/controls/guiGameSettingsCtrl.h b/Engine/source/gui/controls/guiGameSettingsCtrl.h index 737761745..dbcdc5efc 100644 --- a/Engine/source/gui/controls/guiGameSettingsCtrl.h +++ b/Engine/source/gui/controls/guiGameSettingsCtrl.h @@ -72,14 +72,9 @@ protected: Point2F mRange; ///< When working as a slider, this sets our min/max range //Keybind option - DECLARE_IMAGEASSET(GuiGameSettingsCtrl, KeybindBitmap, changeBitmap, GFXDefaultGUIProfile); - DECLARE_ASSET_SETGET(GuiGameSettingsCtrl, KeybindBitmap); - - DECLARE_IMAGEASSET(GuiGameSettingsCtrl, PreviousBitmap, changeBitmap, GFXDefaultGUIProfile); - DECLARE_ASSET_SETGET(GuiGameSettingsCtrl, PreviousBitmap); - - DECLARE_IMAGEASSET(GuiGameSettingsCtrl, NextBitmap, changeBitmap, GFXDefaultGUIProfile); - DECLARE_ASSET_SETGET(GuiGameSettingsCtrl, NextBitmap); + DECLARE_IMAGEASSET_REFACTOR(GuiGameSettingsCtrl, KeybindBitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET_REFACTOR(GuiGameSettingsCtrl, PreviousBitmap, GFXDefaultGUIProfile) + DECLARE_IMAGEASSET_REFACTOR(GuiGameSettingsCtrl, NextBitmap, GFXDefaultGUIProfile) S32 mArrowSize; S32 mColumnSplit; //Padding between the leftmost edge of the control, and the left side of the 'option'. @@ -89,8 +84,6 @@ protected: bool mSelected; public: - void changeBitmap() {} - /// Sets the control as selected . Only controls that are enabled can be selected. virtual void setSelected(); diff --git a/Engine/source/gui/core/guiTypes.cpp b/Engine/source/gui/core/guiTypes.cpp index 5c1e11359..db85c628a 100644 --- a/Engine/source/gui/core/guiTypes.cpp +++ b/Engine/source/gui/core/guiTypes.cpp @@ -78,8 +78,6 @@ GuiCursor::GuiCursor() mHotSpot.set(0,0); mRenderOffset.set(0.0f,0.0f); mExtent.set(1,1); - - INIT_ASSET(Bitmap); } GuiCursor::~GuiCursor() @@ -92,8 +90,7 @@ void GuiCursor::initPersistFields() addField("hotSpot", TypePoint2I, Offset(mHotSpot, GuiCursor), "The location of the cursor's hot spot (which pixel carries the click)."); addField("renderOffset",TypePoint2F, Offset(mRenderOffset, GuiCursor), "Offset of the bitmap, where 0 signifies left edge of the bitmap, 1, the right. Similarly for the Y-component."); - addProtectedField("bitmapName", TypeImageFilename, Offset(mBitmapName, GuiCursor), _setBitmapData, &defaultProtectedGetFn, "File name of the bitmap for the cursor."); - INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiCursor, "name of the bitmap for the cursor."); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiCursor, "name of the bitmap for the cursor."); Parent::initPersistFields(); } @@ -114,21 +111,21 @@ void GuiCursor::onRemove() void GuiCursor::render(const Point2I &pos) { - if (mBitmap) + if (mBitmapAsset.notNull()) { - mExtent.set(mBitmap->getWidth(), mBitmap->getHeight()); + mExtent.set(getBitmap()->getWidth(), getBitmap()->getHeight()); } // Render the cursor centered according to dimensions of texture - S32 texWidth = mBitmap.getWidth(); - S32 texHeight = mBitmap.getHeight(); + S32 texWidth = getBitmap()->getWidth(); + S32 texHeight = getBitmap()->getHeight(); Point2I renderPos = pos; renderPos.x -= (S32)( texWidth * mRenderOffset.x ); renderPos.y -= (S32)( texHeight * mRenderOffset.y ); GFX->getDrawUtil()->clearBitmapModulation(); - GFX->getDrawUtil()->drawBitmap(mBitmap, renderPos); + GFX->getDrawUtil()->drawBitmap(getBitmap(), renderPos); } //------------------------------------------------------------------------------ diff --git a/Engine/source/gui/core/guiTypes.h b/Engine/source/gui/core/guiTypes.h index 759b857bc..7acb37fd7 100644 --- a/Engine/source/gui/core/guiTypes.h +++ b/Engine/source/gui/core/guiTypes.h @@ -348,8 +348,7 @@ class GuiCursor : public SimObject private: typedef SimObject Parent; - DECLARE_IMAGEASSET(GuiCursor, Bitmap, onImageChanged, GFXGuiCursorProfile); - DECLARE_ASSET_SETGET(GuiCursor, Bitmap); + DECLARE_IMAGEASSET_REFACTOR(GuiCursor, Bitmap, GFXGuiCursorProfile) Point2I mHotSpot; Point2F mRenderOffset; @@ -367,8 +366,6 @@ public: bool onAdd(void) override; void onRemove() override; void render(const Point2I &pos); - - void onImageChanged() {} }; /// A GuiControlProfile is used by every GuiObject and is akin to a diff --git a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp index 4aab2a247..07883e246 100644 --- a/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiChunkedBitmapCtrl.cpp @@ -67,7 +67,7 @@ void GuiChunkedBitmapCtrl::initPersistFields() { docsURL; addGroup("GuiChunkedBitmapCtrl"); - INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiChunkedBitmapCtrl, "This is the bitmap to render to the control."); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiChunkedBitmapCtrl, "This is the bitmap to render to the control."); addField( "useVariable", TypeBool, Offset( mUseVariable, GuiChunkedBitmapCtrl ), "This decides whether to use the \"bitmap\" file " "or a bitmap stored in \"variable\""); @@ -88,8 +88,6 @@ DefineEngineMethod( GuiChunkedBitmapCtrl, setBitmap, void, (const char* filename GuiChunkedBitmapCtrl::GuiChunkedBitmapCtrl() { - INIT_ASSET(Bitmap); - mUseVariable = false; mTile = false; } @@ -112,16 +110,6 @@ bool GuiChunkedBitmapCtrl::onWake() if(!Parent::onWake()) return false; - if( !mBitmap - && ( ( mBitmapName && mBitmapName[ 0 ] ) - || ( mUseVariable && mConsoleVariable && mConsoleVariable[ 0 ] ) ) ) - { - if ( mUseVariable ) - mBitmap.set( Con::getVariable( mConsoleVariable ), &GFXDefaultGUIProfile, avar("%s() - mTexHandle (line %d)", __FUNCTION__, __LINE__) ); - else - mBitmap.set( mBitmapName, &GFXDefaultGUIProfile, avar("%s() - mTexHandle (line %d)", __FUNCTION__, __LINE__) ); - } - return true; } @@ -167,10 +155,10 @@ void GuiChunkedBitmapCtrl::renderRegion(const Point2I &offset, const Point2I &ex void GuiChunkedBitmapCtrl::onRender(Point2I offset, const RectI &updateRect) { - if( mBitmap ) + if( mBitmapAsset.notNull() ) { RectI boundsRect( offset, getExtent()); - GFX->getDrawUtil()->drawBitmapStretch(mBitmap, boundsRect, GFXBitmapFlip_None, GFXTextureFilterLinear ); + GFX->getDrawUtil()->drawBitmapStretch(getBitmap(), boundsRect, GFXBitmapFlip_None, GFXTextureFilterLinear); } renderChildControls(offset, updateRect); diff --git a/Engine/source/gui/game/guiChunkedBitmapCtrl.h b/Engine/source/gui/game/guiChunkedBitmapCtrl.h index 08db54166..077087991 100644 --- a/Engine/source/gui/game/guiChunkedBitmapCtrl.h +++ b/Engine/source/gui/game/guiChunkedBitmapCtrl.h @@ -17,8 +17,7 @@ private: protected: - DECLARE_IMAGEASSET(GuiChunkedBitmapCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile); - DECLARE_ASSET_SETGET(GuiChunkedBitmapCtrl, Bitmap); + DECLARE_IMAGEASSET_REFACTOR(GuiChunkedBitmapCtrl, Bitmap, GFXDefaultGUIProfile) bool mUseVariable; bool mTile; @@ -38,6 +37,4 @@ public: void setBitmap(const char *name); void onRender(Point2I offset, const RectI &updateRect) override; - - void onImageChanged() {} }; diff --git a/Engine/source/gui/game/guiProgressBitmapCtrl.cpp b/Engine/source/gui/game/guiProgressBitmapCtrl.cpp index 0d85213e1..7cdda0f03 100644 --- a/Engine/source/gui/game/guiProgressBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiProgressBitmapCtrl.cpp @@ -124,7 +124,6 @@ GuiProgressBitmapCtrl::GuiProgressBitmapCtrl() mNumberOfBitmaps(0), mDim(0) { - INIT_ASSET(Bitmap); } //----------------------------------------------------------------------------- @@ -132,7 +131,7 @@ GuiProgressBitmapCtrl::GuiProgressBitmapCtrl() void GuiProgressBitmapCtrl::initPersistFields() { docsURL; - INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiProgressBitmapCtrl, "Bitmap file to use for rendering the progress bar.\n\n" + INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiProgressBitmapCtrl, "Bitmap file to use for rendering the progress bar.\n\n" "If the profile assigned to the control already has a bitmap assigned, this property need not be " "set in which case the bitmap from the profile is used."); diff --git a/Engine/source/gui/game/guiProgressBitmapCtrl.h b/Engine/source/gui/game/guiProgressBitmapCtrl.h index 54c702f19..6d8f1bd52 100644 --- a/Engine/source/gui/game/guiProgressBitmapCtrl.h +++ b/Engine/source/gui/game/guiProgressBitmapCtrl.h @@ -47,21 +47,12 @@ class GuiProgressBitmapCtrl : public GuiTextCtrl F32 mProgress; - DECLARE_IMAGEASSET(GuiProgressBitmapCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile); - DECLARE_ASSET_SETGET(GuiProgressBitmapCtrl, Bitmap); + DECLARE_IMAGEASSET_REFACTOR(GuiProgressBitmapCtrl, Bitmap, GFXDefaultGUIProfile) bool mUseVariable; bool mTile; S32 mNumberOfBitmaps; S32 mDim; - - static bool _setBitmap( void* object, const char* index, const char* data ) - { - static_cast< GuiProgressBitmapCtrl* >( object )->setBitmap( data ); - return false; - } - - void onImageChanged() {} public: diff --git a/Engine/source/gui/worldEditor/guiMissionArea.cpp b/Engine/source/gui/worldEditor/guiMissionArea.cpp index 9302c12b0..c951ea8b9 100644 --- a/Engine/source/gui/worldEditor/guiMissionArea.cpp +++ b/Engine/source/gui/worldEditor/guiMissionArea.cpp @@ -59,8 +59,6 @@ ConsoleDocClass( GuiMissionAreaCtrl, GuiMissionAreaCtrl::GuiMissionAreaCtrl() { - INIT_ASSET(HandleBitmap); - mHandleTextureSize = Point2I::Zero; mHandleTextureHalfSize = Point2F::Zero; @@ -90,7 +88,7 @@ void GuiMissionAreaCtrl::initPersistFields() docsURL; addField( "squareBitmap", TypeBool, Offset(mSquareBitmap, GuiMissionAreaCtrl)); - INITPERSISTFIELD_IMAGEASSET(HandleBitmap, GuiMissionAreaCtrl, "Bitmap for the mission area handles.\n"); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(HandleBitmap, GuiMissionAreaCtrl, "Bitmap for the mission area handles.\n"); addField( "missionBoundsColor", TypeColorI, Offset(mMissionBoundsColor, GuiMissionAreaCtrl)); addField( "cameraColor", TypeColorI, Offset(mCameraColor, GuiMissionAreaCtrl)); @@ -114,9 +112,9 @@ bool GuiMissionAreaCtrl::onAdd() desc.setBlend(true, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha); mBlendStateBlock = GFX->createStateBlock( desc ); - if (!mHandleBitmap.isNull()) + if (!mHandleBitmapAsset.isNull()) { - mHandleTextureSize = Point2I(mHandleBitmap->getWidth(), mHandleBitmap->getHeight() ); + mHandleTextureSize = Point2I(getHandleBitmap()->getWidth(), getHandleBitmap()->getHeight()); mHandleTextureHalfSize = Point2F(mHandleTextureSize.x, mHandleTextureSize.y) * 0.5f; } else @@ -418,7 +416,7 @@ void GuiMissionAreaCtrl::setArea(const RectI & area) void GuiMissionAreaCtrl::drawHandle(const Point2F & pos) { Point2F pnt(pos.x-mHandleTextureHalfSize.x, pos.y-mHandleTextureHalfSize.y); - GFX->getDrawUtil()->drawBitmap(mHandleBitmap, pnt); + GFX->getDrawUtil()->drawBitmap(getHandleBitmap(), pnt); } void GuiMissionAreaCtrl::drawHandles(RectI & box) diff --git a/Engine/source/gui/worldEditor/guiMissionArea.h b/Engine/source/gui/worldEditor/guiMissionArea.h index 97c9013c5..6400e248d 100644 --- a/Engine/source/gui/worldEditor/guiMissionArea.h +++ b/Engine/source/gui/worldEditor/guiMissionArea.h @@ -63,8 +63,7 @@ protected: GFXStateBlockRef mBlendStateBlock; GFXStateBlockRef mSolidStateBlock; - DECLARE_IMAGEASSET(GuiMissionAreaCtrl, HandleBitmap, onHandleBitmapChanged, GFXDefaultGUIProfile); - DECLARE_ASSET_SETGET(GuiMissionAreaCtrl, HandleBitmap); + DECLARE_IMAGEASSET_REFACTOR(GuiMissionAreaCtrl, HandleBitmap, GFXDefaultGUIProfile) Point2I mHandleTextureSize; Point2F mHandleTextureHalfSize; @@ -110,8 +109,6 @@ protected: bool testWithinHandle(const Point2I & testPoint, S32 handleX, S32 handleY); S32 getHitHandles(const Point2I & mousePnt, const RectI & box); - void onHandleBitmapChanged() {} - public: GuiMissionAreaCtrl(); virtual ~GuiMissionAreaCtrl(); diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index a67b4ec7d..5b1ab494d 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -1817,9 +1817,9 @@ WorldEditor::WorldEditor() mPopupBackgroundColor.set(100,100,100); mPopupTextColor.set(255,255,0); - mSelectHandleAssetId = StringTable->insert("ToolsModule:SelectHandle"); - mDefaultHandleAssetId = StringTable->insert("ToolsModule:DefaultHandle"); - mLockedHandleAssetId = StringTable->insert("ToolsModule:LockedHandle"); + mSelectHandleAsset = StringTable->insert("ToolsModule:SelectHandle_image"); + mDefaultHandleAsset = StringTable->insert("ToolsModule:DefaultHandle_image"); + mLockedHandleAsset = StringTable->insert("ToolsModule:LockedHandle_image"); mObjectTextColor.set(255,255,255); mObjectsUseBoxCenter = true; @@ -1905,9 +1905,9 @@ bool WorldEditor::onAdd() // create the default class entry mDefaultClassEntry.mName = 0; mDefaultClassEntry.mIgnoreCollision = false; - mDefaultClassEntry.mDefaultHandle = mDefaultHandle; - mDefaultClassEntry.mSelectHandle = mSelectHandle; - mDefaultClassEntry.mLockedHandle = mLockedHandle; + mDefaultClassEntry.mDefaultHandle = getDefaultHandle(); + mDefaultClassEntry.mSelectHandle = getSelectHandle(); + mDefaultClassEntry.mLockedHandle = getLockedHandle(); if(!(mDefaultClassEntry.mDefaultHandle && mDefaultClassEntry.mSelectHandle && mDefaultClassEntry.mLockedHandle)) return false; @@ -2839,9 +2839,9 @@ void WorldEditor::initPersistFields() addField( "renderObjHandle", TypeBool, Offset(mRenderObjHandle, WorldEditor) ); addField( "renderSelectionBox", TypeBool, Offset(mRenderSelectionBox, WorldEditor) ); - INITPERSISTFIELD_IMAGEASSET(SelectHandle, WorldEditor, ""); - INITPERSISTFIELD_IMAGEASSET(DefaultHandle, WorldEditor, ""); - INITPERSISTFIELD_IMAGEASSET(LockedHandle, WorldEditor, ""); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(SelectHandle, WorldEditor, ""); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(DefaultHandle, WorldEditor, ""); + INITPERSISTFIELD_IMAGEASSET_REFACTOR(LockedHandle, WorldEditor, ""); endGroup( "Rendering" ); diff --git a/Engine/source/gui/worldEditor/worldEditor.h b/Engine/source/gui/worldEditor/worldEditor.h index 3cac2d0ce..f11e23c1a 100644 --- a/Engine/source/gui/worldEditor/worldEditor.h +++ b/Engine/source/gui/worldEditor/worldEditor.h @@ -328,12 +328,9 @@ class WorldEditor : public EditTSCtrl ColorI mPopupBackgroundColor; ColorI mPopupTextColor; - DECLARE_IMAGEASSET(WorldEditor, SelectHandle, onSelectHandleChanged, GFXStaticTextureSRGBProfile); - DECLARE_ASSET_SETGET(WorldEditor, SelectHandle); - DECLARE_IMAGEASSET(WorldEditor, DefaultHandle, onDefaultHandleChanged, GFXStaticTextureSRGBProfile); - DECLARE_ASSET_SETGET(WorldEditor, DefaultHandle); - DECLARE_IMAGEASSET(WorldEditor, LockedHandle, onLockedHandleChanged, GFXStaticTextureSRGBProfile); - DECLARE_ASSET_SETGET(WorldEditor, LockedHandle); + DECLARE_IMAGEASSET_REFACTOR(WorldEditor, SelectHandle, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET_REFACTOR(WorldEditor, DefaultHandle, GFXStaticTextureSRGBProfile) + DECLARE_IMAGEASSET_REFACTOR(WorldEditor, LockedHandle, GFXStaticTextureSRGBProfile) ColorI mObjectTextColor; bool mObjectsUseBoxCenter; @@ -425,10 +422,6 @@ class WorldEditor : public EditTSCtrl void setEditorTool(EditorTool*); EditorTool* getActiveEditorTool() { return mActiveEditorTool; } - - void onSelectHandleChanged() {} - void onDefaultHandleChanged() {} - void onLockedHandleChanged() {} }; typedef WorldEditor::DropType WorldEditorDropType; diff --git a/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui index 4783b51a7..faeea23b5 100644 --- a/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui +++ b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui @@ -28,7 +28,7 @@ $guiContent = new GameTSCtrl(PlayGui) { noCursor = "1"; new GuiBitmapCtrl(LagIcon) { - bitmap = "data/ui/art/lagIcon.png"; + bitmapAsset = "UI:lagIcon_image"; color = "255 255 255 255"; wrap = "0"; position = "572 3"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui index 803f71ba5..53dc12dcb 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui @@ -68,7 +68,7 @@ $guiContent = new GuiControl(AssetPreviewButtonsTemplate) { canSaveDynamicFields = "0"; new GuiBitmapButtonCtrl() { - bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapAsset = "ToolsModule:cubemapBtnBorder_n_image"; bitmapMode = "Stretched"; autoFitExtents = "0"; useModifiers = "0"; @@ -163,7 +163,7 @@ $guiContent = new GuiControl(AssetPreviewButtonsTemplate) { canSaveDynamicFields = "0"; new GuiBitmapButtonCtrl() { - bitmap = "Data/Blockout_Basics/Walls/WallGrid2x2_Albedo.png"; + bitmapAsset = "Data/Blockout_Basics/Walls/WallGrid2x2_Albedo.png"; bitmapMode = "Stretched"; autoFitExtents = "0"; useModifiers = "0"; @@ -188,7 +188,7 @@ $guiContent = new GuiControl(AssetPreviewButtonsTemplate) { canSaveDynamicFields = "0"; new GuiBitmapButtonCtrl() { - bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapAsset = "ToolsModule:cubemapBtnBorder_n_image"; bitmapMode = "Stretched"; autoFitExtents = "0"; useModifiers = "0"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript index 2575fb772..1fc3b3efd 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.tscript @@ -2565,7 +2565,7 @@ function GuiEditor::onControlDropped(%this, %payload, %position) { %cmd = "return new guiBitmapCtrl();"; %ctrl = eval( %cmd ); - %ctrl.bitmap = %assetId; + %ctrl.bitmapAsset = %assetId; } } } diff --git a/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui b/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui index a1e263b2a..3575f4148 100644 --- a/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui +++ b/Templates/BaseGame/game/tools/gui/materialSelector.ed.gui @@ -136,7 +136,7 @@ new GuiControl(MaterialSelectorOverlay, EditorGuiGroup) { Command = "MaterialSelector.createNewMaterial();"; hovertime = "1000"; tooltip = "Create New Unmapped Material"; - bitmap = "tools/gui/images/new"; + bitmapAsset = "ToolsModule:new_n_image"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; @@ -1649,7 +1649,7 @@ function MaterialSelector::createNewMaterial( %this ) position = "7 4"; extent = "64 64"; buttonType = "PushButton"; - bitmap = "core/images/warnmat"; + bitmapAsset = "CoreModule:warnMat_image"; Command = ""; text = "Loading..."; useStates = false; diff --git a/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui b/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui index 212cbf94a..80a2f75f1 100644 --- a/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui +++ b/Templates/BaseGame/game/tools/guiEditor/gui/EditorChooseGUI.ed.gui @@ -13,7 +13,7 @@ $guiContent = new GuiChunkedBitmapCtrl(EditorChooseGUI, EditorGuiGroup) { Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - bitmap = "data/ui/images/background.png"; + bitmapAsset = "UI:background_image"; useVariable = "0"; tile = "0"; diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/Profiles.ed.tscript b/Templates/BaseGame/game/tools/materialEditor/gui/Profiles.ed.tscript index a9f67ad6a..a8d2eb36e 100644 --- a/Templates/BaseGame/game/tools/materialEditor/gui/Profiles.ed.tscript +++ b/Templates/BaseGame/game/tools/materialEditor/gui/Profiles.ed.tscript @@ -24,7 +24,7 @@ singleton GuiControlProfile (GuiMatEdSliderProfile) { - bitmap = "./matEdSlider"; + bitmapAsset = "ToolsModule:slider_image"; category = "Editor"; }; @@ -47,9 +47,7 @@ singleton GuiControlProfile(GuiMatEdPopUpMenuProfile) mouseOverSelected = true; textOffset = "3 3"; border = 1; - /*borderThickness = 1;*/ fixedExtent = true; - //bitmap = "./images/scrollbar"; bitmapAsset = "ToolsModule:scroll_image"; hasBitmapArray = true; profileForChildren = GuiControlListPopupProfile; diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui index 953da034f..0404faebe 100644 --- a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui +++ b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui @@ -4821,7 +4821,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { tooltipprofile = "ToolsGuiToolTipProfile"; buttonType = "PushButton"; useMouseEvents = "0"; - bitmap = "ToolsModule:new_n_image"; + bitmapAsset = "ToolsModule:new_n_image"; }; // Save Button new GuiBitmapButtonCtrl() { diff --git a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui.orig b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui.orig index f7365bbc4..5f02923f1 100644 --- a/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui.orig +++ b/Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui.orig @@ -4846,7 +4846,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) { tooltipprofile = "ToolsGuiToolTipProfile"; buttonType = "PushButton"; useMouseEvents = "0"; - bitmap = "ToolsModule:new_n_image"; + bitmapAsset = "ToolsModule:new_n_image"; }; // Save Button new GuiBitmapButtonCtrl() { diff --git a/Templates/BaseGame/game/tools/navEditor/NavEditorToolbar.gui b/Templates/BaseGame/game/tools/navEditor/NavEditorToolbar.gui index cdee55fb9..38c86f678 100644 --- a/Templates/BaseGame/game/tools/navEditor/NavEditorToolbar.gui +++ b/Templates/BaseGame/game/tools/navEditor/NavEditorToolbar.gui @@ -40,7 +40,7 @@ $guiContent = new GuiControl(NavEditorToolbar,EditorGuiGroup) { canSaveDynamicFields = "0"; }; new GuiBitmapCtrl() { - bitmap = "core/gui/images/separator-h.png"; + bitmapAsset = "ToolsModule:separator_h_image"; wrap = "0"; position = "90 3"; extent = "2 26"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui index 6ca9dd503..a7e7b2626 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/EditorChooseLevelGui.ed.gui @@ -28,7 +28,7 @@ $guiContent = new GuiContainer(EditorChooseLevelGui, EditorGuiGroup) { Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - bitmap = "data/ui/images/background.png"; + bitmapAsset = "UI:background_image"; useVariable = "0"; tile = "0"; }; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui index 002f4b4fa..810a923d4 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui @@ -115,8 +115,8 @@ $guiContent = new GuiContainer(EditorGui,EditorGuiGroup) { selectionBoxColor = "255 255 0 255"; selectionLocked = "0"; toggleIgnoreList = "0"; - selectHandle = "ToolsModule:SelectHandle_image"; - defaultHandle = "ToolsModule:DefaultHandle_image"; + selectHandleAsset = "ToolsModule:SelectHandle_image"; + defaultHandleAsset = "ToolsModule:DefaultHandle_image"; lockedHandleAsset = "ToolsModule:LockedHandle_image"; }; new TerrainEditor(ETerrainEditor) {