Kouzukii / ffxiv-characterstatus-refined

FFXIV Character Panel Refined - A Dalamud Plugin
MIT License
16 stars 11 forks source link

Synced stats in item tooltips are not working correctly when "Materia Stats" tweak from simple tweak is active #20

Closed LINKAD0 closed 10 months ago

LINKAD0 commented 10 months ago

Hello, i realized the synced stats are not showing correctly on the item tooltips image this is on A8S Min ilevel, the max stats on accs should be around 41, but it shows the unsynced values. it seems to be a problem with the tweak "materia stats" from simple tweaks, it creates a new line of substat that has a different format than vanilla, depending on your configs

In dalamug.log there is this message:

 [ERR] [AddonLifecycle] Exception in OnRequestedUpdate pre-requestedUpdate invoke.
System.FormatException: The input string '0 [72]' was not in a correct format.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, ReadOnlySpan`1 value, TypeCode type)
   at CharacterPanelRefined.ItemTooltipAugments.RequestedUpdate(AddonEvent type, AddonArgs args) in /work/repo/CharacterPanelRefined/ItemTooltipAugments.cs:line 98
   at Dalamud.Game.Addon.Lifecycle.AddonLifecycle.InvokeListeners(AddonEvent eventType, AddonArgs args) in C:\goatsoft\companysecrets\dalamud\Game\Addon\Lifecycle\AddonLifecycle.cs:line 170
   at Dalamud.Game.Addon.Lifecycle.AddonLifecycle.OnRequestedUpdate(AtkUnitBase* addon, NumberArrayData** numberArrayData, StringArrayData** stringArrayData) in C:\goatsoft\companysecrets\dalamud\Game\Addon\Lifecycle\AddonLifecycle.cs:line 412
LINKAD0 commented 10 months ago

I found that a quick fix around it would be changing:

split[i] = sub.Text!.Split('+');

to

split[i] = sub.Text!.Split('[')[0].Split('+');

at ItemTooltipAugments.cs:line 98, so that the tooltip would be like this: image

Kouzukii commented 10 months ago

I would prefer not to have code specifically tuned to another plugin being installed. For now I will just replace the double.Parse with TryParse to prevent exceptions. In the future I will probably get the item stats directly from it's EXD data, only falling back to parsing the tooltip text for variable stat items (relic weapons).

LINKAD0 commented 10 months ago

Fixed in the commit dbe5532.