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:
@@ -373,7 +373,6 @@ namespace HSUI.Config
|
|||||||
if (!IsFreshInstall())
|
if (!IsFreshInstall())
|
||||||
{
|
{
|
||||||
LoadConfigurations();
|
LoadConfigurations();
|
||||||
|
|
||||||
// gotta save after initial load store possible version update changes right away
|
// gotta save after initial load store possible version update changes right away
|
||||||
SaveConfigurations(true);
|
SaveConfigurations(true);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AssemblyName>HSUI</AssemblyName>
|
<AssemblyName>HSUI</AssemblyName>
|
||||||
<AssemblyVersion>1.0.2.1</AssemblyVersion>
|
<AssemblyVersion>1.0.2.2</AssemblyVersion>
|
||||||
<FileVersion>1.0.2.1</FileVersion>
|
<FileVersion>1.0.2.2</FileVersion>
|
||||||
<InformationalVersion>1.0.2.1</InformationalVersion>
|
<InformationalVersion>1.0.2.2</InformationalVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"Author": "Knack117",
|
"Author": "Knack117",
|
||||||
"Name": "HSUI",
|
"Name": "HSUI",
|
||||||
"InternalName": "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.",
|
"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",
|
"ApplicableVersion": "any",
|
||||||
"RepoUrl": "https://github.com/Knack117/HSUI",
|
"RepoUrl": "https://github.com/Knack117/HSUI",
|
||||||
|
|||||||
+14
-1
@@ -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
|
//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)
|
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.
|
//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
|
//Values outside this range will either return colorLeft or colorRight
|
||||||
float ratio = i;
|
float ratio = i;
|
||||||
@@ -63,7 +69,8 @@ namespace HSUI.Helpers
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
float range = max - min;
|
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);
|
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)
|
public static PluginConfigColor ColorForActor(IGameObject? actor)
|
||||||
|
|||||||
@@ -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
|
# 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.
|
- **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
@@ -4,9 +4,9 @@
|
|||||||
"Name": "HSUI",
|
"Name": "HSUI",
|
||||||
"Punchline": "A modern HUD replacement built for customization.",
|
"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.",
|
"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",
|
"InternalName": "HSUI",
|
||||||
"AssemblyVersion": "1.0.2.1",
|
"AssemblyVersion": "1.0.2.2",
|
||||||
"RepoUrl": "https://github.com/Knack117/HSUI",
|
"RepoUrl": "https://github.com/Knack117/HSUI",
|
||||||
"ApplicableVersion": "any",
|
"ApplicableVersion": "any",
|
||||||
"Tags": ["UI", "HUD", "Unit Frames", "Nameplates", "Party Frames", "Hotbars"],
|
"Tags": ["UI", "HUD", "Unit Frames", "Nameplates", "Party Frames", "Hotbars"],
|
||||||
@@ -14,10 +14,10 @@
|
|||||||
"DalamudApiLevel": 14,
|
"DalamudApiLevel": 14,
|
||||||
"IconUrl": "https://raw.githubusercontent.com/Knack117/HSUI/main/Media/Images/icon.png",
|
"IconUrl": "https://raw.githubusercontent.com/Knack117/HSUI/main/Media/Images/icon.png",
|
||||||
"ImageUrls": [],
|
"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,
|
"IsHide": false,
|
||||||
"IsTestingExclusive": false,
|
"IsTestingExclusive": false,
|
||||||
"DownloadLinkTesting": "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.1/latest.zip"
|
"DownloadLinkUpdate": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.2/latest.zip"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user