Pawn arrow sometimes not displayed w/ patch
Drachenkaetzchen opened this issue · 7 comments
This is a follow-up to #503.
I have installed the latest GIT version to test out pawn support. The arrow sometimes isn't displayed, an error is not thrown. I have verified that the arrow displays on the same item with the stock bags UI.
This seems to happen primarily on new items. Maybe there's some kind of item cache which gets filled before the pawn information is applied?
Here's an example:
I just got Mondsohlenschuhe, which should have the arrow displayed:
Here I removed an item which I had prior applying the latest GIT:
As you can see, the arrow is displayed properly.
I have double-checked that itemIsUpgrade
is set to true
for that particular item, and yes, it is.
So basically a call to self.UpgradeIcon:SetShown(true)
results in no arrow for the particular item. So it's a Pawn bug.
I tried to dig into this to potentially identify the issue, but it seems that AdiDebug
doesn't work with 9.0. Any other way I can have debug messages?
AdiBags/widgets/ItemButton.lua
Lines 361 to 366 in abafc31
It uses Pawn's upgrade check function (PawnIsContainerItemAnUpgrade) to determine whether or not to display the upgrade arrow and only falls back to using Blizzard's original function (IsContainerItemAnUpgrade) if it isn't present. If the upgrade arrow isn't being displayed on an item with Pawn loaded, it told AdiBags not to.
If custom bag addons such as AdiBags aren't working as expected with the changes Pawn's author recommended (see below), please inform them about it.
Pawn, Version 2.4.2:
Pawn's bag arrows integration will no longer work by default with custom bag addons.
The game no longer allows customizing that functionality while in combat, so before this change, Pawn's bag arrow integration caused errors while performing certain actions in combat, such as swapping weapons from the character sheet. Disabling support for custom bag addons is unfortunately the only way I can work around this.
To work around this, custom bag addons that call IsContainerItemAnUpgrade directly can use PawnIsContainerItemAnUpgrade when available instead, falling back to IsContainerItemAnUpgrade if it's nil. Then Pawn will control the bag arrows like it did before.
Hey—I'm the author of Pawn. Pawn doesn't change anything about self.UpgradeIcon.SetShown
; it uses it to control the game's built-in arrows, but it doesn't change anything about how they work. If itemIsUpgrade
is true
here, I'd say it's almost certainly not a Pawn bug.
The only thing that comes to mind that might be happening is that both AdiBags's upgrade checking code and the regular code for the game's built-in arrows are both running and they're stomping over each other. If you open up Pawn.lua
and find this block:
hooksecurefunc("ContainerFrameItemButton_UpdateItemUpgradeIcon", function(self)
--...
end)
...and delete that whole block, and the problem still occurs, then it's definitely not a problem with Pawn. (Deleting that block will cause Pawn to no longer integrate with the game's built-in bags.)
...and delete that whole block, and the problem still occurs, then it's definitely not a problem with Pawn. (Deleting that block will cause Pawn to no longer integrate with the game's built-in bags.)
Thank you for your assistance! I can confirm that deleting the block shows the same issue.
However, I have more findings:
- ArkInventory does indeed show the upgrade arrow properly on the item in question, but the arrow is positioned on the lower left side. Maybe ArkInventory uses a custom arrow because of the same issue I'm seeing here?
- The arrow is also shown if I use the stock UI
As much as I wish to, I don't have the knowledge of how FrameXML stuff and Lua works in general, so here are my last findings:
In Blizzard's ContainerFrame.lua there seems to be a timer which checks for an upgrade every 0.5s it seems, but I was unable to figure out if it's actually called.
Maybe a custom upgrade arrow like they do in ArkInventory would be a better method if Pawn is present?
The timer is used when the game can't determine whether an item deserves an arrow yet, but expects it will be able to very soon—typically because you just got the item but the game hasn't finished downloading the item's stats. Immediately after the game updates the arrow normally (based on item level only) in ContainerFrameItemButton_UpdateItemUpgradeIcon
, Pawn runs an exact copy of the same code but using its own upgrade checker instead of the game's.