From 7bca1dba53ed71d23dd2c3956f1b6c1f53a248e5 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 25 Dec 2025 16:04:53 -0600 Subject: [PATCH 1/3] options menu: rem keybind debug spam damagemodel module: ensure it's got a dependency of the UI module so it's called after switch all profiles for damageoverlay over to GuiModelessDialogProfile from default --- .../BaseGame/game/data/DamageModel/DamageModel.module | 4 +++- .../game/data/DamageModel/guis/damageGuiOverlay.gui | 8 ++++---- Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Templates/BaseGame/game/data/DamageModel/DamageModel.module b/Templates/BaseGame/game/data/DamageModel/DamageModel.module index 0bce1ed70..26de8f0dc 100644 --- a/Templates/BaseGame/game/data/DamageModel/DamageModel.module +++ b/Templates/BaseGame/game/data/DamageModel/DamageModel.module @@ -4,7 +4,9 @@ Group="Game" scriptFile="DamageModel.tscript" CreateFunction="onCreate" - DestroyFunction="onDestroy"> + DestroyFunction="onDestroy" + Group="Game" + Dependencies="UI=1"> diff --git a/Templates/BaseGame/game/data/DamageModel/guis/damageGuiOverlay.gui b/Templates/BaseGame/game/data/DamageModel/guis/damageGuiOverlay.gui index f8c78c3aa..52832bb3b 100644 --- a/Templates/BaseGame/game/data/DamageModel/guis/damageGuiOverlay.gui +++ b/Templates/BaseGame/game/data/DamageModel/guis/damageGuiOverlay.gui @@ -4,7 +4,7 @@ $guiContent = new GuiContainer(damageGuiOverlay) { minExtent = "8 8"; horizSizing = "relative"; vertSizing = "relative"; - profile = "GuiDefaultProfile"; + profile = "GuiModelessDialogProfile"; tooltipProfile = "GuiToolTipProfile"; canSaveDynamicFields = "1"; enabled = "1"; @@ -25,7 +25,6 @@ $guiContent = new GuiContainer(damageGuiOverlay) { }; new GuiCrossHairHud(Reticle) { damageOffset = "0 10"; - BitmapAsset = ""; position = "624 344"; extent = "32 32"; minExtent = "8 8"; @@ -64,6 +63,7 @@ $guiContent = new GuiContainer(damageGuiOverlay) { }; new GuiBitmapCtrl(previewImage) { BitmapAsset = "UI:hudfill_image"; + BitmapFile = "data/UI/images/hudfill.png"; position = "8 0"; extent = "108 56"; horizSizing = "width"; @@ -80,7 +80,7 @@ $guiContent = new GuiContainer(damageGuiOverlay) { extent = "120 16"; minExtent = "8 8"; vertSizing = "top"; - profile = "HudTextItalicProfile"; + profile = "GuiModelessDialogProfile"; tooltipProfile = "GuiToolTipProfile"; isContainer = "0"; }; @@ -95,7 +95,7 @@ $guiContent = new GuiContainer(damageGuiOverlay) { position = "5 645"; extent = "72 72"; vertSizing = "top"; - profile = "GuiBigTextProfile"; + profile = "GuiModelessDialogProfile"; tooltipProfile = "GuiToolTipProfile"; }; new GuiControl(DamageHUD) { diff --git a/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript b/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript index 3d6be85a6..f502982ad 100644 --- a/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript +++ b/Templates/BaseGame/game/data/UI/guis/optionsMenu.tscript @@ -1036,7 +1036,7 @@ function OptionsMenu::populateKeybinds(%this,%device, %controlsList) { if($activeRemapControlSet $= "") $activeRemapControlSet = getField(%actionMapList, 0); - echo("============================================"); + //echo("============================================"); for(%am = 0; %am < getFieldCount(%actionMapList); %am++) { @@ -1064,7 +1064,7 @@ function OptionsMenu::populateKeybinds(%this,%device, %controlsList) { %keyMap = buildFullMapString( %i, $RemapActionMap[%i], %device ); %description = $RemapDescription[%i]; - echo("Added ActionMap Entry: " @ %actionMapName @ " | " @ %device @ " | " @ %keymap @ " | " @ %description); + //echo("Added ActionMap Entry: " @ %actionMapName @ " | " @ %device @ " | " @ %keymap @ " | " @ %description); %remapEntry = addActionMapEntry(%actionMapName, %device, %keyMap, %i, %description); %controlsList.add(%remapEntry); @@ -1245,7 +1245,7 @@ function addActionMapEntry(%actionMap, %device, %keyMap, %index, %description) }; %buttonContainer = %entry.findObjectByInternalName("valuesContainer"); - echo("Keymap: " @ %keymap @ " | Keymap word count: " @ getWordCount(getField(%keyMap, 1))); + //echo("Keymap: " @ %keymap @ " | Keymap word count: " @ getWordCount(getField(%keyMap, 1))); if(getWordCount(getField(%keyMap, 1)) == 2) { %modifierBtn = new GuiIconButtonCtrl() { From d50161d296cae39126898152aa30a260e8b7de7b Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 25 Dec 2025 17:47:31 -0600 Subject: [PATCH 2/3] fix GuiBitmapButtonCtrl setBitmap script command it was pointing at the macro method direct, not the bespoke case that *also* calls the macro method. --- .../gui/buttons/guiBitmapButtonCtrl.cpp | 53 ++++++++++++++++++- .../source/gui/buttons/guiBitmapButtonCtrl.h | 20 +------ .../source/gui/buttons/guiIconButtonCtrl.cpp | 8 ++- 3 files changed, 61 insertions(+), 20 deletions(-) diff --git a/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp b/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp index f2ee24d43..d0af7da32 100644 --- a/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp @@ -262,6 +262,51 @@ void GuiBitmapButtonCtrl::setAutoFitExtents( bool state ) } //----------------------------------------------------------------------------- +void GuiBitmapButtonCtrl::_setBitmap(StringTableEntry _in) +{ + if (mBitmapAsset.getAssetId() == _in) + return; + + if (getBitmapFile() == _in) + return; + + if (_in == 0 || !String::compare(_in, _getStringTable()->EmptyString())) + { + mBitmapAsset = 0; + mBitmapFile = ""; + return; + } + if (!AssetDatabase.isDeclaredAsset(_in)) + { + StringTableEntry imageAssetId = _getStringTable()->EmptyString(); + AssetQuery query; + S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, _in); + if (foundAssetcount != 0) + { + imageAssetId = query.mAssetList[0]; + } + else if (Torque::FS::IsFile(_in) || (_in[0] == '$' || _in[0] == '#')) + { + imageAssetId = ImageAsset::getAssetIdByFilename(_in); + if (imageAssetId == ImageAsset::smNoImageAssetFallback) + { + ImageAsset* privateImage = new ImageAsset(); + privateImage->setImageFile(_in); + imageAssetId = AssetDatabase.addPrivateAsset(privateImage); + } + } + else { + Con::warnf("%s::%s: Could not find asset for: %s using fallback", "GuiBitmapButtonCtrl", "Bitmap", _in); + imageAssetId = ImageAsset::smNoImageAssetFallback; + } mBitmapAsset = imageAssetId; + mBitmapFile = _in; + } + else + { + mBitmapAsset = _in; + mBitmapFile = getBitmapFile(); + } +} void GuiBitmapButtonCtrl::setBitmap( StringTableEntry name ) { @@ -669,4 +714,10 @@ bool GuiBitmapButtonCtrl::pointInControl(const Point2I& parentCoordPoint) return Parent::pointInControl(parentCoordPoint); } -DEF_ASSET_BINDS_REFACTOR(GuiBitmapButtonCtrl, Bitmap) +DefineEngineMethod(GuiBitmapButtonCtrl, getBitmap, StringTableEntry, (), , "get name") { + return object->getBitmapFile(); +}DefineEngineMethod(GuiBitmapButtonCtrl, getBitmapAsset, StringTableEntry, (), , assetText(Bitmap, asset reference)) { + return object->_getBitmap(); +}DefineEngineMethod(GuiBitmapButtonCtrl, setBitmap, void, (const char* assetName), , assetText(Bitmap, assignment.first tries asset then flat file.)) { + object->setBitmap(StringTable->insert(assetName)); +} diff --git a/Engine/source/gui/buttons/guiBitmapButtonCtrl.h b/Engine/source/gui/buttons/guiBitmapButtonCtrl.h index ec96e9344..8fb3792d0 100644 --- a/Engine/source/gui/buttons/guiBitmapButtonCtrl.h +++ b/Engine/source/gui/buttons/guiBitmapButtonCtrl.h @@ -122,24 +122,8 @@ private: AssetPtr mBitmapAsset; String mBitmapFile; public: - void _setBitmap(StringTableEntry _in) { - if (_in == NULL || _in == StringTable->EmptyString() || _in == "") - { - mBitmapAsset = NULL; - mBitmapFile = ""; - return; - } - if (mBitmapAsset.getAssetId() == _in) return; if (!AssetDatabase.isDeclaredAsset(_in)) { - StringTableEntry imageAssetId = ImageAsset::smNoImageAssetFallback; AssetQuery query; S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, _in); if (foundAssetcount != 0) { - imageAssetId = query.mAssetList[0]; - } mBitmapAsset = imageAssetId; - } - else { - mBitmapAsset = _in; - mBitmapName = _in; - mBitmap = getBitmap(); - } -}; inline StringTableEntry _getBitmap(void) const { + void _setBitmap(StringTableEntry _in); +inline StringTableEntry _getBitmap(void) const { return mBitmapAsset.getAssetId(); } GFXTexHandle getBitmap() { return mBitmapAsset.notNull() ? mBitmapAsset->getTexture(&GFXDefaultGUIProfile) : 0; diff --git a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp index 813a3a2e2..9c0cd7517 100644 --- a/Engine/source/gui/buttons/guiIconButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiIconButtonCtrl.cpp @@ -464,4 +464,10 @@ void GuiIconButtonCtrl::renderBitmapArray(RectI &bounds, S32 state) } } -DEF_ASSET_BINDS_REFACTOR(GuiIconButtonCtrl, Bitmap) +DefineEngineMethod(GuiIconButtonCtrl, getBitmap, StringTableEntry, (), , "get name") { + return object->getBitmapFile(); +}DefineEngineMethod(GuiIconButtonCtrl, getBitmapAsset, StringTableEntry, (), , assetText(Bitmap, asset reference)) { + return object->_getBitmap(); +}DefineEngineMethod(GuiIconButtonCtrl, setBitmap, void, (const char* assetName), , assetText(Bitmap, assignment.first tries asset then flat file.)) { + object->setBitmap(StringTable->insert(assetName)); +} From 0e4b08ead1b1f36593a85ce039e12c2c219285ac Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Thu, 25 Dec 2025 18:59:03 -0600 Subject: [PATCH 3/3] roll back _setitmap macro-mirroring. seems there was somethin off there --- .../gui/buttons/guiBitmapButtonCtrl.cpp | 45 ------------------- .../source/gui/buttons/guiBitmapButtonCtrl.h | 20 ++++++++- 2 files changed, 18 insertions(+), 47 deletions(-) diff --git a/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp b/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp index d0af7da32..46e4e69c1 100644 --- a/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp +++ b/Engine/source/gui/buttons/guiBitmapButtonCtrl.cpp @@ -262,51 +262,6 @@ void GuiBitmapButtonCtrl::setAutoFitExtents( bool state ) } //----------------------------------------------------------------------------- -void GuiBitmapButtonCtrl::_setBitmap(StringTableEntry _in) -{ - if (mBitmapAsset.getAssetId() == _in) - return; - - if (getBitmapFile() == _in) - return; - - if (_in == 0 || !String::compare(_in, _getStringTable()->EmptyString())) - { - mBitmapAsset = 0; - mBitmapFile = ""; - return; - } - if (!AssetDatabase.isDeclaredAsset(_in)) - { - StringTableEntry imageAssetId = _getStringTable()->EmptyString(); - AssetQuery query; - S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, _in); - if (foundAssetcount != 0) - { - imageAssetId = query.mAssetList[0]; - } - else if (Torque::FS::IsFile(_in) || (_in[0] == '$' || _in[0] == '#')) - { - imageAssetId = ImageAsset::getAssetIdByFilename(_in); - if (imageAssetId == ImageAsset::smNoImageAssetFallback) - { - ImageAsset* privateImage = new ImageAsset(); - privateImage->setImageFile(_in); - imageAssetId = AssetDatabase.addPrivateAsset(privateImage); - } - } - else { - Con::warnf("%s::%s: Could not find asset for: %s using fallback", "GuiBitmapButtonCtrl", "Bitmap", _in); - imageAssetId = ImageAsset::smNoImageAssetFallback; - } mBitmapAsset = imageAssetId; - mBitmapFile = _in; - } - else - { - mBitmapAsset = _in; - mBitmapFile = getBitmapFile(); - } -} void GuiBitmapButtonCtrl::setBitmap( StringTableEntry name ) { diff --git a/Engine/source/gui/buttons/guiBitmapButtonCtrl.h b/Engine/source/gui/buttons/guiBitmapButtonCtrl.h index 8fb3792d0..ec96e9344 100644 --- a/Engine/source/gui/buttons/guiBitmapButtonCtrl.h +++ b/Engine/source/gui/buttons/guiBitmapButtonCtrl.h @@ -122,8 +122,24 @@ private: AssetPtr mBitmapAsset; String mBitmapFile; public: - void _setBitmap(StringTableEntry _in); -inline StringTableEntry _getBitmap(void) const { + void _setBitmap(StringTableEntry _in) { + if (_in == NULL || _in == StringTable->EmptyString() || _in == "") + { + mBitmapAsset = NULL; + mBitmapFile = ""; + return; + } + if (mBitmapAsset.getAssetId() == _in) return; if (!AssetDatabase.isDeclaredAsset(_in)) { + StringTableEntry imageAssetId = ImageAsset::smNoImageAssetFallback; AssetQuery query; S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, _in); if (foundAssetcount != 0) { + imageAssetId = query.mAssetList[0]; + } mBitmapAsset = imageAssetId; + } + else { + mBitmapAsset = _in; + mBitmapName = _in; + mBitmap = getBitmap(); + } +}; inline StringTableEntry _getBitmap(void) const { return mBitmapAsset.getAssetId(); } GFXTexHandle getBitmap() { return mBitmapAsset.notNull() ? mBitmapAsset->getTexture(&GFXDefaultGUIProfile) : 0;