v1.0.2.2: Fix ColorUtils.GetColorByScale crash that prevented hotbars from showing

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-01-31 02:49:34 -05:00
parent 481f1cd45a
commit 1011d126d8
6 changed files with 26 additions and 11 deletions
-1
View File
@@ -373,7 +373,6 @@ namespace HSUI.Config
if (!IsFreshInstall())
{
LoadConfigurations();
// gotta save after initial load store possible version update changes right away
SaveConfigurations(true);
}
+3 -3
View File
@@ -9,9 +9,9 @@
<PropertyGroup>
<AssemblyName>HSUI</AssemblyName>
<AssemblyVersion>1.0.2.1</AssemblyVersion>
<FileVersion>1.0.2.1</FileVersion>
<InformationalVersion>1.0.2.1</InformationalVersion>
<AssemblyVersion>1.0.2.2</AssemblyVersion>
<FileVersion>1.0.2.2</FileVersion>
<InformationalVersion>1.0.2.2</InformationalVersion>
</PropertyGroup>
<PropertyGroup>
+1 -1
View File
@@ -2,7 +2,7 @@
"Author": "Knack117",
"Name": "HSUI",
"InternalName": "HSUI",
"AssemblyVersion": "1.0.2.1",
"AssemblyVersion": "1.0.2.2",
"Description": "HSUI provides a highly configurable HUD replacement for FFXIV, recreated from DelvUI using KamiToolKit, FFXIVClientStructs, and Dalamud. Features unit frames, castbars, job gauges, nameplates, party frames, status effects, enemy list, configurable hotbars with drag-and-drop, and profiles.",
"ApplicableVersion": "any",
"RepoUrl": "https://github.com/Knack117/HSUI",
+14 -1
View File
@@ -47,6 +47,12 @@ namespace HSUI.Helpers
//min and max are used for color thresholds. for instance return colorLeft if i < min or return ColorRight if i > max
public static PluginConfigColor GetColorByScale(float i, float min, float max, PluginConfigColor colorLeft, PluginConfigColor colorRight, PluginConfigColor colorMax, bool useMaxColor, BlendMode blendMode)
{
try
{
// Guard against null/invalid config (can happen with corrupted or migrated config)
if (colorLeft == null || colorRight == null || colorMax == null)
return PluginConfigColor.FromHex(0xFF808080);
//Set our thresholds where the ratio is the range of values we will use for interpolation.
//Values outside this range will either return colorLeft or colorRight
float ratio = i;
@@ -63,7 +69,8 @@ namespace HSUI.Helpers
else
{
float range = max - min;
ratio = (i - min) / range;
if (MathF.Abs(range) < 0.0001f) ratio = 1; // avoid divide-by-zero when min==max
else ratio = (i - min) / range;
}
}
@@ -224,6 +231,12 @@ namespace HSUI.Helpers
}
}
return new(Vector4.One);
}
catch (Exception ex)
{
Plugin.Logger.Warning($"[HSUI] GetColorByScale failed (config may be corrupted): {ex.Message}");
return PluginConfigColor.FromHex(0xFF808080);
}
}
public static PluginConfigColor ColorForActor(IGameObject? actor)
+3
View File
@@ -1,3 +1,6 @@
# 1.0.2.2
- **Critical fix**: ColorUtils.GetColorByScale was throwing (corrupted config or divide-by-zero), causing Party Frames to crash the draw loop and preventing Hotbars and later elements from rendering. Added null checks, divide-by-zero guard, and try-catch fallback.
# 1.0.2.1
- **Release fix**: Include all required files in release zip (Assets, Colourful, Newtonsoft.Json, SixLabors.ImageSharp). Fixes hotbars and other features not working when installed from release vs dev plugin.
+5 -5
View File
@@ -4,9 +4,9 @@
"Name": "HSUI",
"Punchline": "A modern HUD replacement built for customization.",
"Description": "HSUI provides a highly configurable HUD replacement for FFXIV, recreated from DelvUI using KamiToolKit, FFXIVClientStructs, and Dalamud. Features unit frames, castbars, job gauges, nameplates, party frames, status effects, enemy list, configurable hotbars with drag-and-drop, and profiles.",
"Changelog": "Hotfix: Complete release zip (Assets, DLLs). Restore Hotbar Layout, config right-click fix.",
"Changelog": "Fix: ColorUtils crash that prevented hotbars from showing. Null/divide-by-zero guards in GetColorByScale.",
"InternalName": "HSUI",
"AssemblyVersion": "1.0.2.1",
"AssemblyVersion": "1.0.2.2",
"RepoUrl": "https://github.com/Knack117/HSUI",
"ApplicableVersion": "any",
"Tags": ["UI", "HUD", "Unit Frames", "Nameplates", "Party Frames", "Hotbars"],
@@ -14,10 +14,10 @@
"DalamudApiLevel": 14,
"IconUrl": "https://raw.githubusercontent.com/Knack117/HSUI/main/Media/Images/icon.png",
"ImageUrls": [],
"DownloadLinkInstall": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.0/latest.zip",
"DownloadLinkInstall": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.2/latest.zip",
"IsHide": false,
"IsTestingExclusive": false,
"DownloadLinkTesting": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.1/latest.zip",
"DownloadLinkUpdate": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.1/latest.zip"
"DownloadLinkTesting": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.2/latest.zip",
"DownloadLinkUpdate": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.2/latest.zip"
}
]