Kiatra / BlizzMove

World of Warcraft add-on to make the default windows movable via drag & drop.
23 stars 9 forks source link

(v3.0.0-alpha2-classic) Can't move 'Talents' window #34

Closed tuftelien closed 3 years ago

tuftelien commented 4 years ago

It's movable in version 2.1.6-classic.

zaCade commented 4 years ago

Went ahead and tested this, with both alpha2 and alpha3 i can move the talent frame. You sure you havent accidentally disabled it in the options?

Or do you maybe have other addons that might affect that frame?

syntruth commented 3 years ago

Same in 3.0.1. Upon logging in, I am unable to move the Talents window. It is checked in the Blizzard_TalentUI panel, and toggling it back and forth allows the Talents panel to be dragged again. No errors are thrown that I am seeing, etc.

zaCade commented 3 years ago

@tuftelien does toggling the talentframe in the options also make it draggable for you?

Also, could both of you try if this behavior also happens if only blizzmove is loaded? If it doesn't happen with just blizzmove loaded, it might be an other addon breaking something. So try loading your addons one by one untill it breaks, and let me know wich one it is. That way we can look into a workaround to fix this issue.

tuftelien commented 3 years ago

I finally got around to debug this, and found that DejaClassicStats is interfering with BlizzMove. More specifically, it hooks into the OnShow and OnHide of the talent frame:

DCS_BLIZZ_SKILL_PANELS = {
    "TradeSkill",
    "Craft",
    "Talent",
}

local DejaClassicStatsExpandEventFrame = CreateFrame("Frame", "DejaClassicStatsExpandEventFrame", UIParent)
DejaClassicStatsExpandEventFrame:RegisterEvent("ADDON_LOADED")

DejaClassicStatsExpandEventFrame:SetScript("OnEvent", function(self, event, arg1)
    if event == "ADDON_LOADED" and arg1 == "DejaClassicStats" then
        self:UnregisterEvent("ADDON_LOADED")
        for k, v in ipairs(DCS_BLIZZ_SKILL_PANELS) do
            if _G[v.."Frame"] == nil then
                if _G[v.."Frame"] == "DetailsFrame" then return
                else
                    LoadAddOn("Blizzard_"..v.."UI")
                    _G[v.."Frame"]:HookScript("OnShow", function(self)
                        if PaperDollFrame:IsVisible() then
                            local checked = gdbprivate.gdb.gdbdefaults.dejacharacterstatsExpandChecked.ExpandSetChecked
                            if checked == true then
                                DCS_CharacterFrame_Collapse()
                            end
                        end
                    end)
                    _G[v.."Frame"]:HookScript("OnHide", function(self)
                        if TradeSkillFrame:IsVisible() or CraftFrame:IsVisible() or TalentFrame:IsVisible() then return
                        else
                            local checked = gdbprivate.gdb.gdbdefaults.dejacharacterstatsExpandChecked.ExpandSetChecked
                            if checked == true then
                                DCS_CharacterFrame_Expand()
                            end
                        end
                    end)
                end
            end
        end
    end
end)

Toggling the setting enables the frame to be moved (though breaking DejaClassicStats' auto-hide) until a reload.

zaCade commented 3 years ago

Seems its because some addons forceload load on demand addons, and when they got loaded between two certain moments during loading, they would go unnoticed as being loaded in our addon, added a loop that should prevent this in v3.0.8.