torhal / libdialog-1.0 Goto Github PK
View Code? Open in Web Editor NEWLibDialog-1.0 provides methods for creating dialogs similar to Blizzard's default StaticPopup dialogs.
Home Page: https://www.curseforge.com/wow/addons/libdialog-1-0
LibDialog-1.0 provides methods for creating dialogs similar to Blizzard's default StaticPopup dialogs.
Home Page: https://www.curseforge.com/wow/addons/libdialog-1-0
Acquires/anchors a frame which displays an item icon with mouse-over tooltip. Clears anchor/releases when dialog is released.
Originally reported by Arkayenro:
hi,
the MINOR version in the 9.0 file is still 8, should it have been bumped to 9 ?
also _Dialog_OnHide(dialog) doesnt have the same logic checks as _Dialog_OnShow(dialog)
when a null dialog value is passed into the function it barfs when it gets to the line (249) for local delegate = dialog.delegate
LUA error:
1x BetterAddonList/libs/LibDialog-1.0-8.lua:833: attempt to get length of field 'StaticPopup_DisplayedFrames' (a nil value)
[string "@BetterAddonList/libs/LibDialog-1.0-8.lua"]:833: in function Spawn' [string "@BetterAddonList/BetterAddonList.lua"]:472: in function
func'
[string "@Blizzard_SharedXML/Mainline/UIDropDownMenu.lua"]:1019: in function `UIDropDownMenuButton_OnClick'
[string "*UIDropDownMenuTemplates.xml:133_OnClick"]:1: in function <[string "*UIDropDownMenuTemplates.xml:133_OnClick"]:1>
TO FIX:
Change lines 829 to 842 from this
-- Anchor to the bottom of existing dialogs. If none exist, check to see if there are visible default StaticPopupDialogs and anchor to that instead; else, anchor to UIParent.
if #active_dialogs > 0 then
dialog:SetPoint("TOP", active_dialogs[#active_dialogs], "BOTTOM", 0, 0)
else
local default_dialog = _G.StaticPopup_DisplayedFrames[#_G.StaticPopup_DisplayedFrames]
if default_dialog then
dialog:SetPoint("TOP", default_dialog, "BOTTOM", 0, 0)
else
dialog:SetPoint("TOP", _G.UIParent, "TOP", 0, -135)
end
end
active_dialogs[#active_dialogs + 1] = dialog
dialog:Show()
to this:
-- Anchor to the bottom of existing dialogs. If none exist, check to see if there are visible default StaticPopupDialogs and anchor to that instead; else, anchor to UIParent.
if #active_dialogs > 0 then
dialog:SetPoint("TOP", active_dialogs[#active_dialogs], "BOTTOM", 0, 0)
else
if _G.StaticPopup_DisplayedFrames and #_G.StaticPopup_DisplayedFrames > 0 then
local default_dialog = _G.StaticPopup_DisplayedFrames[#_G.StaticPopup_DisplayedFrames]
dialog:SetPoint("TOP", default_dialog, "BOTTOM", 0, 0)
else
dialog:SetPoint("TOP", _G.UIParent, "TOP", 0, -135)
end
end
active_dialogs[#active_dialogs + 1] = dialog
dialog:Show()
StaticPopup_DisplayedFrames
is no longer a public array.
To workaround the issue and keep compatibility with other classic versions I added this helper function
local function _SetupAnchor(dialog)
local default_dialog
if _G.StaticPopup_DisplayedFrames then
default_dialog = _G.StaticPopup_DisplayedFrames[#_G.StaticPopup_DisplayedFrames]
elseif (_G.StaticPopup_HasDisplayedFrames and _G.StaticPopup_IsLastDisplayedFrame) then
if StaticPopup_HasDisplayedFrames() then
for idx = STATICPOPUP_NUMDIALOGS,1,-1 do
local test_dialog = _G["StaticPopup"..idx]
if StaticPopup_IsLastDisplayedFrame(test_dialog) then
default_dialog = test_dialog
end
end
end
end
if default_dialog then
dialog:SetPoint("TOP", default_dialog, "BOTTOM", 0, 0)
else
dialog:SetPoint("TOP", _G.UIParent, "TOP", 0, -135)
end
end
and replaced the
LibDialog-1.0.lua#L151 to LibDialog-1.0.lua#L157
and
LibDialog-1.0.lua#L833 to LibDialog-1.0.lua#L839
with _SetupAnchor(current_dialog)
and _SetupAnchor(dialog)
respectively.
...as the title says.
Originally reported by Kkthnx:
We can not use this currently if we are to show money in the dialog. I could be doing something wrong here but with the default Statics we were able to call hasMoneyFrame though this is not supported through this Lib as of right now.
https://github.com/Kkthnx-WoW/KkthnxUI/blob/master/KkthnxUI/Core/StaticPopups.lua#L119
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.