doadin / Plexus

Other
9 stars 2 forks source link

Corner Indicators are covered by extra bar #38

Closed dratr closed 3 years ago

dratr commented 3 years ago

Describe the bug Corner indicators (bottom right with a bottom resource bar at least, that's what I use, but it looks like all overlapping combinations would suffer this) are drawn "behind" the resource/extra bar.

To Reproduce Steps to reproduce the behavior:

  1. Enable extra bar on bottom
  2. Enable some corner indicator (for bottom right as an example)
  3. Disable "Enable separation of corner and extra bar" in Frame->Corner indicator Options
  4. See the indicator "behind" the resource bar.

Expected behavior Resource bar below the indicator. This is easily done by raising the frame level of the corner indicators.

Desktop (please complete the following information):

Additional context I tried using the "enable separation of corner and extra bar" option to work around this; it's not my preference as for space reasons I'd rather be able to use the actual corners, but even still, this option doesn't actually move the indicator by a reasonable amount when using a non-default resource bar thickness (I use a bar thickness of 25%, which results in the indicator appearing not just above the bar, but somewhere around halfway down the width, which can easily be seen why due to the math in Corner indicator code for point setting)

doadin commented 3 years ago

Hello, yes the calculation is wrong. The situation is a two part problem.

  1. The bar size is made based on a percentage of the frame so I can't simply use the size value from the settings.
  2. GetSize() is returning negative numbers for the bar when logging in so some indicators don't get set properly if set based on GetSize of bar + indicator size.

So while the calculation being "easily be seen" as wrong I don't have a solution, do you? Either of those problems could have a workaround made I'm sure but I have not gotten to it.

doadin commented 3 years ago

The indcators getting covered up part i have a fix being pushed out soon.

dratr commented 3 years ago

The indcators getting covered up part i have a fix being pushed out soon.

Updated and now get lua errors when members join/leave/move groups:

112x Plexus\Indicators\ExtraBar.lua:85: attempt to call method 'SetParent' (a nil value) [string "@Plexus\Indicators\ExtraBar.lua"]:85: in function Reset' [string "@Plexus\Frame.lua"]:96: in functionResetAllIndicators' [string "@Plexus\Frame.lua"]:1388: in function UpdateIndicators' [string "@Plexus\Frame.lua"]:1345: in functionUpdateAllFrames' [string "@Plexus\Frame.lua"]:1021: in function <Plexus\Frame.lua:1019>

doadin commented 3 years ago

Does this happen with just plexus enabled?

dratr commented 3 years ago

Yes. Retested today with version 2.1.33 as only addon enabled. I believe it may appear only in raid groups (over 5 people). Seen easily when joining rare kill groups in group finder, for example.

Message: Interface\AddOns\Plexus\Indicators\ExtraBar.lua:85: attempt to call method 'SetParent' (a nil value) Time: Mon Dec 21 15:35:17 2020 Count: 1 Stack: Interface\AddOns\Plexus\Indicators\ExtraBar.lua:85: attempt to call method 'SetParent' (a nil value) [string "@Interface\AddOns\Plexus\Indicators\ExtraBar.lua"]:85: in function Reset' [string "@Interface\AddOns\Plexus\Frame.lua"]:96: in functionResetAllIndicators' [string "@Interface\AddOns\Plexus\Frame.lua"]:1388: in function UpdateIndicators' [string "@Interface\AddOns\Plexus\Frame.lua"]:1370: in function?' [string "@Interface\AddOns\Plexus\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"]:119: in function <...xus\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:119>

[string "@Interface\AddOns\Plexus\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"]:29: in function <...xus\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:25> [string "@Interface\AddOns\Plexus\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"]:64: in function SendMessage' [string "@Interface\AddOns\Plexus\Frame.lua"]:164: in function <Interface\AddOns\Plexus\Frame.lua:163> [string "=[C]"]: in functionShow' [string "@Interface\FrameXML\SecureStateDriver.lua"]:83: in function <Interface\FrameXML\SecureStateDriver.lua:73> [string "@Interface\FrameXML\SecureStateDriver.lua"]:137: in function <Interface\FrameXML\SecureStateDriver.lua:119>

Locals:

Shinrai commented 3 years ago

This is actually a pretty easy fix. The issue stems from the stacking of the elements in the frame. Most are not set to stack and let blizzard decide. Others are set at the frame + 1.

In Indicators\ExtraBar.lua add the following after line 82: self:SetFrameLevel(healthBar:GetFrameLevel() + 1)

In Indicators\Icon.lua replace line 128 with the following: self:SetFrameLevel(frame.indicators.bar:GetFrameLevel() + 2)

In Indicators\Corner.lua replace line 72 with the following: self:SetFrameLevel(self.__owner.indicators.bar:GetFrameLevel() + 3)

Once those 3 items are changes the icons and corner indicators work as you would expect them to. Health bar is below, followed with extra bar then icons then corner indicators.

doadin commented 3 years ago

Thanks @Shinrai, I was trying to find a fix for a some what related error with frames that are not enabled generating an error in spots like Indicators\ExtraBar.lua@140 due to not being able to delete frames.