mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 06:00:00 +00:00
addonbuttons: add option to show them on login
* use a simpler update throttle * remove usable due to resets during moving * remove unused update interval config
This commit is contained in:
+1
-1
@@ -840,9 +840,9 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("disabled", nil, nil, nil)
|
||||
|
||||
pfUI:UpdateConfig("abuttons", nil, "position", "bottom")
|
||||
pfUI:UpdateConfig("abuttons", nil, "showdefault", "0")
|
||||
pfUI:UpdateConfig("abuttons", nil, "rowsize", "6")
|
||||
pfUI:UpdateConfig("abuttons", nil, "spacing", "2")
|
||||
pfUI:UpdateConfig("abuttons", nil, "updateinterval", "3")
|
||||
pfUI:UpdateConfig("abuttons", nil, "hideincombat", "1")
|
||||
|
||||
pfUI:UpdateConfig("gm", nil, "disable", "1")
|
||||
|
||||
+12
-14
@@ -173,7 +173,6 @@ pfUI:RegisterModule("addonbuttons", function ()
|
||||
pfUI.addonbuttons:SetPoint("TOP", pfUI.minimap, "BOTTOM", 0 , -default_border * 3)
|
||||
pfUI.addonbuttons.minimapbutton.icon:SetTexture("Interface\\AddOns\\pfUI\\img\\down.tga")
|
||||
pfUI.addonbuttons.minimapbutton:SetPoint("BOTTOM", pfUI.minimap, "BOTTOM", 0, 4)
|
||||
|
||||
else
|
||||
pfUI.addonbuttons:SetWidth(ceil((GetNumButtons() > 0 and GetNumButtons() or 1) / tonumber(C.abuttons.rowsize)) * GetStringSize() + tonumber(C.abuttons.spacing))
|
||||
pfUI.addonbuttons:SetHeight(pfUI.minimap:GetHeight())
|
||||
@@ -181,10 +180,6 @@ pfUI:RegisterModule("addonbuttons", function ()
|
||||
pfUI.addonbuttons.minimapbutton.icon:SetTexture("Interface\\AddOns\\pfUI\\img\\left.tga")
|
||||
pfUI.addonbuttons.minimapbutton:SetPoint("LEFT", pfUI.minimap, "LEFT", 4, 0)
|
||||
end
|
||||
UpdateMovable(pfUI.addonbuttons)
|
||||
UpdateMovable(pfUI.addonbuttons.minimapbutton)
|
||||
pfUI.addonbuttons.minimapbutton:Show()
|
||||
|
||||
end
|
||||
|
||||
local function UpdatePanel()
|
||||
@@ -380,13 +375,12 @@ pfUI:RegisterModule("addonbuttons", function ()
|
||||
end
|
||||
|
||||
pfUI.addonbuttons:SetScript("OnUpdate", function()
|
||||
pfUI.addonbuttons.last_updated = pfUI.addonbuttons.last_updated + arg1
|
||||
while (pfUI.addonbuttons.last_updated > tonumber(C.abuttons.updateinterval)) do
|
||||
pfUI.addonbuttons:ProcessButtons()
|
||||
pfUI.addonbuttons.last_updated = pfUI.addonbuttons.last_updated - tonumber(C.abuttons.updateinterval)
|
||||
for k, v in pfUI.addonbuttons.overrides do
|
||||
_G[k] = v
|
||||
end
|
||||
-- throttle updates to once per 3 seconds
|
||||
if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + 3 end
|
||||
|
||||
pfUI.addonbuttons:ProcessButtons()
|
||||
for k, v in pfUI.addonbuttons.overrides do
|
||||
_G[k] = v
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -397,8 +391,12 @@ pfUI:RegisterModule("addonbuttons", function ()
|
||||
end
|
||||
else
|
||||
pfUI.addonbuttons:ProcessButtons()
|
||||
if not pfUI.addonbuttons:IsShown() and GetNumButtons() > 0 and event == "PLAYER_LOGIN" then
|
||||
pfUI.addonbuttons:Show()
|
||||
if event == "PLAYER_LOGIN" then
|
||||
if C.abuttons.showdefault == "1" and GetNumButtons() > 0 then
|
||||
pfUI.addonbuttons:Show()
|
||||
else
|
||||
pfUI.addonbuttons:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -1184,6 +1184,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui.tabs.minimap.tabs.addonbuttons:SetScript("OnShow", function()
|
||||
if not this.setup then
|
||||
CreateConfig(update["addonbuttons"], this, T["Addon Buttons Panel Position"], C.abuttons, "position", "dropdown", pfUI.gui.dropdowns.addonbuttons_position)
|
||||
CreateConfig(update["addonbuttons"], this, T["Show Addon Buttons On Login"], C.abuttons, "showdefault", "checkbox")
|
||||
CreateConfig(update["addonbuttons"], this, T["Number Of Buttons Per Row/Column"], C.abuttons, "rowsize")
|
||||
CreateConfig(update["addonbuttons"], this, T["Button Spacing"], C.abuttons, "spacing")
|
||||
CreateConfig(update["addonbuttons"], this, T["Hide When Entering Combat"], C.abuttons, "hideincombat", "checkbox")
|
||||
|
||||
Reference in New Issue
Block a user