Combuctor icon indicating copy to clipboard operation
Combuctor copied to clipboard

Bag will not autoclose in combat engagement. I am unable to close the addon in combat with the X button either.

Open Coffeechan opened this issue 3 years ago • 3 comments

Running Software (issues missing this information will be deleted):

  • Addon version: 2.5.1
  • Server patch: [e.g. Build 8.0.1.27178]

Have you read the changelog? (please don't waste our time) Mark if read.

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behaviour:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behaviour A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Error Logs Type /console scriptErrors 1 in the chat and reload the game. If an error window appears, write here the message with ID: 1 (labelled 1/X). This is generally NOT the message that the window shows by default.

Additional context Add any other context about the problem here.

Coffeechan avatar Jun 29 '21 14:06 Coffeechan

I know the problem is because HideUIPanel() is protected and cannot be called during combat.

Patch 8.2.0/API changes

  • ShowUIPanel() and HideUIPanel() are now protected, they can no longer be called by addons while in combat.

I couldn't find a normal solution because I can't find how HideUIPanel() is triggered. But I found a workaround with it. Add this code to any Lua file and the problem will disappear:

hooksecurefunc("HideUIPanel", function(ui)
    if InCombatLockdown() and type(ui) == 'table' and ui.bagToggle then
        ui:Hide()
    end
end)

It will use the ui:Hide() method to close the bag in battle, which is not affected by the combat lockdown.

SwimmingTiger avatar Jul 06 '21 19:07 SwimmingTiger

Thanks

On Tue, Jul 6, 2021, 2:05 PM 老虎会游泳 @.***> wrote:

I know the problem is because HideUIPanel() is protected and cannot be called during combat.

Patch 8.2.0/API changes https://wowpedia.fandom.com/wiki/Patch_8.2.0/API_changes

  • ShowUIPanel() and HideUIPanel() are now protected, they can no longer be called by addons while in combat.

I couldn't find a normal solution because I can't find how HideUIPanel() is triggered, but I found a workaround. Add this code to any Lua file and the problem will disappear:

hooksecurefunc("HideUIPanel", function(ui) if InCombatLockdown() and type(ui) == 'table' and ui.bagToggle then ui:Hide() end end)

It will use the ui:Hide() method to close the bag in battle, which is not affected by the combat lockdown.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tullamods/Combuctor/issues/163#issuecomment-875011233, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUVIPY2KXEJSLK2KIW2N46TTWNHZHANCNFSM47QKKPMQ .

Coffeechan avatar Jul 07 '21 19:07 Coffeechan

I know the problem is because HideUIPanel() is protected and cannot be called during combat.

Patch 8.2.0/API changes

  • ShowUIPanel() and HideUIPanel() are now protected, they can no longer be called by addons while in combat.

I couldn't find a normal solution because I can't find how HideUIPanel() is triggered. But I found a workaround with it. Add this code to any Lua file and the problem will disappear:

hooksecurefunc("HideUIPanel", function(ui)
    if InCombatLockdown() and type(ui) == 'table' and ui.bagToggle then
        ui:Hide()
    end
end)

It will use the ui:Hide() method to close the bag in battle, which is not affected by the combat lockdown.

Could you explain what "Add this code to any Lua file and the problem will disappear:" means? Just add id to "every" of the 20+ LUA files? Just add it to the end of every LUA file?

Sorry I don't know a thing about grogramming.

Genetic91 avatar Jul 10 '21 06:07 Genetic91