This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Classic compatibility was apparently dropped in LibUIDropDownMenu-4.0 versus earlier versions (-2.0).
If you wish to restore compatibility, the following changes will get you part of the way there...
local function creatre_DropDownList(name, parent)
-- leave everything up to the OnShow script...
f:SetScript("OnShow", function(self) -- leave everything currently in the OnShow script... -- at the bottom of the OnShow script, insert the following if (not UIDropDownMenu_HandleGlobalMouseEvent) then self.hideTimer = self.hideTimer or C_Timer.NewTicker(L_UIDROPDOWNMENU_SHOW_TIME, function() if (GetMouseFocus() ~= self) then self:Hide(); end end) end end)
f:SetScript("OnHide", function(self) -- leave everything currently in the OnShow script...
-- at the bottom of the OnHide script, insert the following if (self.hideTimer) then self.hideTimer:Cancel(); self.hideTimer = nil; end end) return fend
-- hooking UIDropDownMenu_HandleGlobalMouseEventdo if lib and UIDropDownMenu_HandleGlobalMouseEvent then hooksecurefunc("UIDropDownMenu_HandleGlobalMouseEvent", function(button, event) lib:UIDropDownMenu_HandleGlobalMouseEvent(button, event) end) endend
Hi DahkCeles, there was some problem with curseforge so my early release (v4.01) was never sent out. I did implemented some codes to handle the global mouse event, although not exactly the same way like your implementations (I didn't add those codes in OnShow / OnHide). Could you help to check if those are still suggested in the latest revision?
I don't actually use the Lib any more in my own addon, so I'll have to wait until one of the other addons updates to test for this specific issue.
Meanwhile, I glanced over the code in 4.03 here on curse and found the following change you might want to consider. This will simplify the differences between Classic Era, Burning Crusade Classic and Shadowlands.
Line 136
-- ColorSwatch local fcw -- if WoWClassic then -- fcw = CreateFrame("Button", name.."ColorSwatch", f) -- else -- fcw = CreateFrame("Button", name.."ColorSwatch", f, BackdropTemplateMixin and "ColorSwatchTemplate" or nil) -- end fcw = CreateFrame("Button", name.."ColorSwatch", f, BackdropTemplateMixin and DropDownMenuButtonMixin and "BackdropTemplate,ColorSwatchTemplate" or BackdropTemplateMixin and "BackdropTemplate" or nil); fcw:SetPoint("RIGHT", f, -6, 0) fcw:Hide() -- if WoWClassic then if not DropDownMenuButtonMixin then fcw:SetSize(16, 16) fcw.SwatchBg = fcw:CreateTexture(name.."ColorSwatchSwatchBg", "BACKGROUND") fcw.SwatchBg:SetVertexColor(1, 1, 1) fcw.SwatchBg:SetWidth(14) fcw.SwatchBg:SetHeight(14) fcw.SwatchBg:SetPoint("CENTER", fcw, 0, 0) local button1NormalTexture = fcw:CreateTexture(name.."ColorSwatchNormalTexture") button1NormalTexture:SetTexture("Interface\\ChatFrame\\ChatFrameColorSwatch") button1NormalTexture:SetAllPoints() fcw:SetNormalTexture(button1NormalTexture) end
Implemented
I use the StartCounting / StopCounting mechanism which was on early version of WoW to implement the show/hide features. Looks to be working more smoothly.
To post a comment, please login or register a new account.