Luxocracy / NeatPlates

NeatPlates is a continuation of the original Tidy Plates in an attempt to keep it update date in the absence of its authors.
https://wow.curseforge.com/projects/neat-plates
80 stars 20 forks source link

Impossible to turn off DK resource widget #365

Open vladpenkovskiy opened 1 year ago

vladpenkovskiy commented 1 year ago

What version of the game you are experiencing the issue with: WotlK Classic

Describe the bug I have tried to turn off DK rune widget on enemy's nameplates, but it doesn't work.

To Reproduce Steps to reproduce the behavior:

  1. Go to ESC -> Interface -> NeatPlates -> Default profiles.
  2. Scroll down to "Personal resource display" and "Other widgets" sections -> turn off show flags.
  3. Runes on enemies nameplates will not disappear.

Expected behavior It would be good to have an option to turn off this widget.

Screenshots DK_rune_widget_1 DK_rune_widget_2

Luxocracy commented 1 year ago

I am not able to replicate this issue in my own testing. That is, I can disable the feature by setting the Show on option to None.

Since you are editing the Default profile I'm assuming you don't use any other profiles, would that be correct? Because normally when there's an issue like this, that I am unable to replicate, I'd ask that you double check that you are editing the correct profile.

Something else you could try is creating a new profile, at first by copying from the default profile. And if that doesn't work either, you could try creating an entirely new profile. Just that we can rule out the issue being with that specific profile.

ehedbor commented 1 year ago

I started getting this issue in v418, and as of v424 (current latest) it's still happening. So, I decided to do a little investigation.

First of all, the rune display doesn't even show the correct runes most of the time:

WoWScrnShot_103122_220425

I also started getting the same error spammed tens of thousands of times:

NeatPlatesWidgets\ResourceWidget.lua:91: attempt to concatenate local 'runeType' (a nil value) ``` 18572x NeatPlatesWidgets\ResourceWidget.lua:91: attempt to concatenate local 'runeType' (a nil value) [string "@NeatPlatesWidgets\ResourceWidget.lua"]:91: in function [string "=(tail call)"]: ? [string "@NeatPlatesWidgets\ResourceWidget.lua"]:414: in function `UpdatePoints' [string "@NeatPlatesWidgets\ResourceWidget.lua"]:465: in function [string "@NeatPlatesWidgets\ResourceWidget.lua"]:520: in function Locals: self = { GetPower = defined @NeatPlatesWidgets\ResourceWidget.lua:60 POWER = 5 POINT = "DK-Rune-Classic" } points =
{ 1 =
{ } } runeMap =
{ RUNETYPE_CHROMATIC = "Unholy" 3 = "Unholy" RUNETYPE_BLOOD = "Blood" RUNETYPE_FROST = "Frost" 2 = "Frost" RUNETYPE_DEATH = "Death" 1 = "Blood" } runeOrder =
{ 1 = 1 2 = 2 3 = 5 4 = 6 5 = 3 6 = 4 } (for generator) = defined =[C]:-1 (for state) =
{ 1 = 1 2 = 2 3 = 5 4 = 6 5 = 3 6 = 4 } (for control) = 2 _ = 2 i = 2 point =
{ EXPIRATION = 0 ICON = "DK-Rune-Classic" DURATION = 0 STATE = "Off" } start = 15692.570000 duration = 10 runeReady = false expiration = 15702.570000 runeType = nil (*temporary) = "DK-Rune-Classic" (*temporary) = "-" (*temporary) = nil (*temporary) = nil (*temporary) = "attempt to concatenate local 'runeType' (a nil value)" getPointIcon = defined @NeatPlatesWidgets\ResourceWidget.lua:46 ```

I tried making a new profile, as you suggested. Copying the existing profile didn't fix the issue, but making an entirely new profile seems to have it working. However, that caused another bug to get spammed hundreds of times, this time going on about invalid font heights:

NeatPlatesWidgets\ResourceWidget.lua:392: ERROR: :SetFont(): invalid fontHeight: 0, height must be > 0 ``` 471x NeatPlatesWidgets\ResourceWidget.lua:392: ERROR: :SetFont(): invalid fontHeight: 0, height must be > 0 [string "=[C]"]: in function `SetFont' [string "@NeatPlatesWidgets\ResourceWidget.lua"]:392: in function [string "@NeatPlatesWidgets\ResourceWidget.lua"]:428: in function [string "=[C]"]: in function `foreach' [string "@NeatPlatesWidgets\ResourceWidget.lua"]:427: in function `UpdatePoints' [string "@NeatPlatesWidgets\ResourceWidget.lua"]:559: in function `createFunction' [string "@NeatPlatesHub\functions\Widgets.lua"]:626: in function [string "@NeatPlatesHub\functions\Widgets.lua"]:664: in function `OnInitializeWidgets' [string "@NeatPlatesHub\functions\Core.lua"]:531: in function `OnInitialize' [string "@NeatPlates\NeatPlatesCore.lua"]:762: in function [string "@NeatPlates\NeatPlatesCore.lua"]:1623: in function `?' [string "@NeatPlates\NeatPlatesCore.lua"]:1578: in function Locals: (*temporary) = { 0 = } (*temporary) = "FONTS\ARIALN.TTF" (*temporary) = 0 (*temporary) = "OUTLINE" ```

I began to manually copy all of the settings from the original profile to see if any one of them was the culprit. So far so good. Finally, I tried enabling the resource indicator on the new profile. To my surprise, it didn't work at all! Then I thought back to the font height issue. Maybe that was the culprit? Sure enough, the Personal Resource Display > Duration Font Size option was initialized to zero, which is an invalid value. I increased the font size and suddenly started to see lime green boxes instead of runes! I tried disabling all my addons, /reloading and relogging, none of which helped. Oh, and you wanna know what else? I started to get the original error again! Isn't that funny?

why

I did manage to find a fix: changing Personal Resource Display > Style to BlizzLike and back to NeatPlates worked just fine.

One final note: this time, the Personal Resource Display > Show On setting was respected, so at least there's a fix for the original issue.

TL;DR: I had the same issue regarding the DK runes always showing, but fixed it by making a new profile and manually copying the settings from the old one. However, the new profile had some invalid defaults, which led to other bugs. I still have the issue with nil runeType when the resource display is on.

vladpenkovskiy commented 1 year ago

Ty for answers. I managed to fix this problem pretty easily: if i remember right, i swithed from active profile to Default profile (chose it in menu and pressed ok). Runes disappeared. (Strange thing is that i thought that profile already was default, but choosing default helped anyway).

Luxocracy commented 1 year ago

Sorry for taking a while to respond and fix this. And also thank you for the detailed debugging information.

Hopefully most of this is related to #371 as it seems I messed up on the "Death" rune implementation. Because the only reason for the widget to be displayed on two targets would be if it was broken and getting caught midway. The new widget and death knight support is a bit rushed out because the old one didn't support WOTLKC death knights at all. So I am sorry for the inconvenience the widget has caused, as well as me being unable to work on it for some time.

And I've added a simple check to try and make sure that the font size value is actually valid. As for the profile issue, I am really not sure what could have caused it, because it does indeed seem like the profile was not active entirely.

Also the issue with the green boxes most likely means that somehow the styling was set to something that doesn't exist. I've added a check here as well to make sure the given style is a valid one, or it will default to one of them.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 90 days with no activity. If you feel the issue is still relevant, please leave a comment to prevent the issue from being closed in 30 days