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
79 stars 20 forks source link

Range Indicator Hiding in Combat #404

Closed Diablolock closed 7 months ago

Diablolock commented 8 months ago

I'm using the lastest version (4.29).

When you have the Range Indicator on, Regardless the Mode, Style or Shown On, right when you enter combat the Icon/Line will disappear and go back when you leave combat.

Diablolock commented 8 months ago

I got intel from WeakAuras discord that Blizzard protected the "IsItemInRange" function. They said the "LibRangeCheck-3.0" should fix this (ElvUI already has it) and also the "IsSpellInRange"is the new way to go for this?

ERROR:

5x [ADDON_ACTION_BLOCKED] AddOn 'NeatPlates' tried to call the protected function 'IsItemInRange()'. [string "@!BugGrabber/BugGrabber.lua"]:481: in function <!BugGrabber/BugGrabber.lua:481>

[string "@NeatPlates/libs/LibRangeCheck-2.0-10000000000001/LibRangeCheck-2.0.lua"]:465: in function `checker' [string "@NeatPlates/libs/LibRangeCheck-2.0-10000000000001/LibRangeCheck-2.0.lua"]:590: in function <...tPlates/libs/LibRangeCheck-2.0/LibRangeCheck-2.0.lua:585>

[string "@NeatPlatesWidgets/RangeWidget.lua"]:67: in function <NeatPlatesWidgets/RangeWidget.lua:65> [string "@NeatPlatesWidgets/RangeWidget.lua"]:167: in function UpdateContext' [string "@NeatPlatesHub/functions/Widgets.lua"]:721: in functionOnContextUpdate' [string "@NeatPlates/NeatPlatesCore.lua"]:962: in function <NeatPlates/NeatPlatesCore.lua:947> [string "@NeatPlates/NeatPlatesCore.lua"]:809: in function <NeatPlates/NeatPlatesCore.lua:800> [string "@NeatPlates/NeatPlatesCore.lua"]:380: in function <NeatPlates/NeatPlatesCore.lua:353>

Locals: _ = Frame { RegisterEvent = defined @!BugGrabber/BugGrabber.lua:487 0 = UnregisterEvent = defined @!BugGrabber/BugGrabber.lua:487 SetScript = defined @!BugGrabber/BugGrabber.lua:487 } event = "ADDON_ACTION_BLOCKED" events =

{ ADDON_ACTION_BLOCKED = defined @!BugGrabber/BugGrabber.lua:553 ADDON_ACTION_FORBIDDEN = defined @!BugGrabber/BugGrabber.lua:553 PLAYER_LOGIN = defined @!BugGrabber/BugGrabber.lua:547 LUA_WARNING = defined @!BugGrabber/BugGrabber.lua:562 ADDON_LOADED = defined @!BugGrabber/BugGrabber.lua:507 }

Luxocracy commented 8 months ago

I've updated the range lib to 3.0 version maintained by WeakAuras. So hopefully this issue should be resolved

Diablolock commented 8 months ago

You have no idea how much joy it brings me just to see you around updating NeatPlates! Tyvm n take care :)

About the fix:

Now, when in combat, the Range Indicator will hide when you are OUTRANGED instead of going "RED". Before the fix when incombat, both would hide.

https://imgur.com/a/Nqu22ht

Diablolock commented 7 months ago

I see you are working on updates for SoD version of the game.

Would you take a look on the range indicador not working properly when outta range? Thx in advance.

Luxocracy commented 7 months ago

Because we are now limited to only using IsSpellInRange, rather than IsItemInRange, I believe it can only check known spells. So if you have your Out of Range distance set to the same range as your longest spell, say 40yds, and you are 42yds away. It cannot find a spell that is in range. Resulting in it returning an empty distance, which I'd say is kind of correct as that is how the old range lib worked as well.

So with this, technically, the range indicator is behaving as expected. As any distance that cannot be measured has always hidden the indicator. But perhaps this now needs to be changed so that if the range cannot be measured, it assumes you are out of range and the indicator is updated accordingly.

Diablolock commented 7 months ago

I appreciate you taking time to explain this and everything you've to keep this great addon updated over the years.

I'd be very happy, and I'm sure everyone else as well, if you'd make this change so the out of range indicador works again.

Take care man!

Diablolock commented 7 months ago

It works perfect now since the fix on v4.33!

Tyvm again, Lux! Take care.