diff --git a/Interface/AddOns/SVUI/language/chinese_ui.lua b/Interface/AddOns/SVUI/language/chinese_ui.lua index 30304d0..565492e 100644 --- a/Interface/AddOns/SVUI/language/chinese_ui.lua +++ b/Interface/AddOns/SVUI/language/chinese_ui.lua @@ -1,5 +1,6 @@ local L = LibSuperVillain("Linguist"):Lang("zhCN"); if not L then return end +L["Hearthstone"] = true; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "歡迎使用 |cffFFFF1ASupervillain UI|r! 让您的 %s 和你 %s." L["LOGIN_MSG2"] = "|cffAA78FF%s|r 版, 請輸入/sv 進入設定介面." diff --git a/Interface/AddOns/SVUI/language/english_ui.lua b/Interface/AddOns/SVUI/language/english_ui.lua index cb9ca76..6d484b3 100644 --- a/Interface/AddOns/SVUI/language/english_ui.lua +++ b/Interface/AddOns/SVUI/language/english_ui.lua @@ -1,5 +1,6 @@ local L = LibSuperVillain("Linguist"):Lang("enUS", true); if not L then return; end +L["Hearthstone"] = true; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "Welcome to |cffFFFF1ASupervillain UI|r! Keep your %s and your %s." L["LOGIN_MSG2"] = "Version |cffAA78FF%s|r, type /sv to access the in-game configuration menu." diff --git a/Interface/AddOns/SVUI/language/french_ui.lua b/Interface/AddOns/SVUI/language/french_ui.lua index f25b5f9..4c08aaf 100644 --- a/Interface/AddOns/SVUI/language/french_ui.lua +++ b/Interface/AddOns/SVUI/language/french_ui.lua @@ -1,5 +1,6 @@ local L = LibSuperVillain("Linguist"):Lang("frFR"); if not L then return; end +L["Hearthstone"] = true; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "Bienvenue sur |cffFFFF1ASupervillain UI|r! Gardez votre %s et votre %s." L["LOGIN_MSG2"] = "Version |cffAA78FF%s|r, tapez /sv afin d'accéder au menu de configuration en jeu." diff --git a/Interface/AddOns/SVUI/language/german_ui.lua b/Interface/AddOns/SVUI/language/german_ui.lua index ce04b12..04607bf 100644 --- a/Interface/AddOns/SVUI/language/german_ui.lua +++ b/Interface/AddOns/SVUI/language/german_ui.lua @@ -1,5 +1,6 @@ local L = LibSuperVillain("Linguist"):Lang("deDE"); if not L then return end +L["Hearthstone"] = "Ruhestein"; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "Willkommen zu |cffFFFF1ASupervillain UI|r! halten Sie Ihre %s und Ihre %s." L["LOGIN_MSG2"] = "Version |cffAA78FF%s|r, Tippe /sv um das Konfigurationsmenü aufzurufen." diff --git a/Interface/AddOns/SVUI/language/italian_ui.lua b/Interface/AddOns/SVUI/language/italian_ui.lua index b663781..7b5b73f 100644 --- a/Interface/AddOns/SVUI/language/italian_ui.lua +++ b/Interface/AddOns/SVUI/language/italian_ui.lua @@ -1,5 +1,6 @@ local L = LibSuperVillain("Linguist"):Lang("itIT"); if not L then return; end +L["Hearthstone"] = true; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "Benvenuti a |cffFFFF1ASupervillain UI|r! Mantenete il vostro %s e il vostro %s." L["LOGIN_MSG2"] = "versione |cffAA78FF%s|r, Tipo / sv per accedere al menu di configurazione in-game." diff --git a/Interface/AddOns/SVUI/language/korean_ui.lua b/Interface/AddOns/SVUI/language/korean_ui.lua index 386315e..ebb60f9 100644 --- a/Interface/AddOns/SVUI/language/korean_ui.lua +++ b/Interface/AddOns/SVUI/language/korean_ui.lua @@ -1,5 +1,6 @@ local L = LibSuperVillain("Linguist"):Lang("koKR"); if not L then return; end +L["Hearthstone"] = true; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "|cffFFFF1AUI를 악당|r에 오신 것을 환영합니다! 귀하의 유지 %s 당신을 %s." L["LOGIN_MSG2"] = "버전 |cffAA78FF%s|r, 유형 /sv 는 게임의 구성 메뉴에 액세스합니다." diff --git a/Interface/AddOns/SVUI/language/portuguese_ui.lua b/Interface/AddOns/SVUI/language/portuguese_ui.lua index f875f2d..8c33020 100644 --- a/Interface/AddOns/SVUI/language/portuguese_ui.lua +++ b/Interface/AddOns/SVUI/language/portuguese_ui.lua @@ -1,5 +1,6 @@ local L = LibSuperVillain("Linguist"):Lang("ptBR"); if not L then return; end +L["Hearthstone"] = true; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "Bem vindo à |cffFFFF1ASupervillain UI|r! Manter o seu %s e seu %s." L["LOGIN_MSG2"] = "Versão |cffAA78FF%s|r, escreva /sv para acessar o menu de configuração em jogo." diff --git a/Interface/AddOns/SVUI/language/russian_ui.lua b/Interface/AddOns/SVUI/language/russian_ui.lua index d76aa24..9bc2c29 100644 --- a/Interface/AddOns/SVUI/language/russian_ui.lua +++ b/Interface/AddOns/SVUI/language/russian_ui.lua @@ -1,5 +1,6 @@ local L = LibSuperVillain("Linguist"):Lang("ruRU"); if not L then return; end +L["Hearthstone"] = true; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "обро пожаловать в |cffFFFF1ASupervillain UI|r! Держите свои %s и ваши %s." L["LOGIN_MSG2"] = "Версия |cffAA78FF%s|r, наберите /sv для доступа в меню настроек." diff --git a/Interface/AddOns/SVUI/language/spanish_ui.lua b/Interface/AddOns/SVUI/language/spanish_ui.lua index 0e1c185..cd4c210 100644 --- a/Interface/AddOns/SVUI/language/spanish_ui.lua +++ b/Interface/AddOns/SVUI/language/spanish_ui.lua @@ -4,6 +4,7 @@ if not L then L = Localization:Lang("esMX") end if not L then return; end +L["Hearthstone"] = true; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "Bienvenido a |cffFFFF1ASupervillain UI|r! Mantenga su %s y su %s." L["LOGIN_MSG2"] = "Versión |cffAA78FF%s|r, escribe /sv para acceder al menú de configuración." diff --git a/Interface/AddOns/SVUI/language/taiwanese_ui.lua b/Interface/AddOns/SVUI/language/taiwanese_ui.lua index de62e82..a30e5ee 100644 --- a/Interface/AddOns/SVUI/language/taiwanese_ui.lua +++ b/Interface/AddOns/SVUI/language/taiwanese_ui.lua @@ -1,5 +1,6 @@ local L = LibSuperVillain("Linguist"):Lang("zhTW"); if not L then return; end +L["Hearthstone"] = true; --[[LOGIN MESSAGE]]-- L["LOGIN_MSG"] = "歡迎使用 |cffFFFF1ASupervillain UI|r! 让您的 %s 和你 %s." L["LOGIN_MSG2"] = "|cffAA78FF%s|r 版, 請輸入/sv 進入設定介面." diff --git a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua index 812e4fd..ab80479 100644 --- a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua +++ b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua @@ -290,10 +290,10 @@ function MOD:BreakStuffLoader() if not allowed then return end - BreakStuffButton:SetParent(SV.Dock.Right.ToolBar) - local size = SV.Dock.Right.ToolBar:GetHeight() + BreakStuffButton:SetParent(SV.Dock.BarRight.ToolBar) + local size = SV.Dock.BarRight.ToolBar:GetHeight() BreakStuffButton:Size(size, size) - BreakStuffButton:Point("RIGHT", SV.Dock.Right.ToolBar, "LEFT", -6, 0) + BreakStuffButton:Point("RIGHT", SV.Dock.BarRight.ToolBar, "LEFT", -6, 0) BreakStuffButton:Show(); BreakStuffButton:SetFramedButtonTemplate() BreakStuffButton.icon=BreakStuffButton:CreateTexture(nil,"OVERLAY") diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 6b514a0..c5b8ceb 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -436,7 +436,7 @@ do self:Show() if not SV.Dock.Left:IsShown()then SV.Dock.Left.editboxforced = true; - SV.Dock.Left.Button:GetScript("OnEnter")(SV.Dock.Left.Button) + SV.Dock.BarLeft.Button:GetScript("OnEnter")(SV.Dock.BarLeft.Button) end SV.Dock.Left.Alert:Activate(self) @@ -446,7 +446,7 @@ do if SV.Dock.Left.editboxforced then SV.Dock.Left.editboxforced = nil; if SV.Dock.Left:IsShown()then - SV.Dock.Left.Button:GetScript("OnLeave")(SV.Dock.Left.Button) + SV.Dock.BarLeft.Button:GetScript("OnLeave")(SV.Dock.BarLeft.Button) end end self:Hide() @@ -498,13 +498,13 @@ do local lastTab = TabsList[1]; if(lastTab) then lastTab:ClearAllPoints() - lastTab:Point("LEFT", SV.Dock.Left.ToolBar, "LEFT", 3, 0); + lastTab:Point("LEFT", SV.Dock.BarLeft.ExtraBar, "LEFT", 3, 0); end for chatID,frame in pairs(TabsList) do if(frame and chatID ~= 1 and frame.isDocked) then frame:ClearAllPoints() if(not lastTab) then - frame:Point("LEFT", SV.Dock.Left.ToolBar, "LEFT", 3, 0); + frame:Point("LEFT", SV.Dock.BarLeft.ExtraBar, "LEFT", 3, 0); else frame:Point("LEFT", lastTab, "RIGHT", 6, 0); end @@ -536,17 +536,17 @@ do TabSafety[name] = true; TabsList[chatID] = frame frame.chatID = chatID; - frame:SetParent(SV.Dock.Left.ToolBar) + frame:SetParent(SV.Dock.BarLeft.ExtraBar) _repositionDockedTabs() end local function _customTab(tab, chatID, enabled) if(tab.IsStyled) then return end local tabName = tab:GetName(); - local tabSize = SV.Dock.Left.ToolBar:GetHeight(); + local tabSize = SV.Dock.BarLeft.ExtraBar:GetHeight(); local tabText = tab.text:GetText() or "Chat "..chatID; - local holder = CreateFrame("Frame", ("SVUI_ChatTab%s"):format(chatID), SV.Dock.Left.ToolBar) + local holder = CreateFrame("Frame", ("SVUI_ChatTab%s"):format(chatID), SV.Dock.BarLeft.ExtraBar) holder:SetWidth(tabSize * 1.75) holder:SetHeight(tabSize) tab.chatID = chatID; @@ -665,7 +665,7 @@ do chat:SetFading(CHAT_FADING) chat:SetScript("OnHyperlinkClick", SVUI_OnHyperlinkShow) - local alertSize = (SV.Dock.Left.ToolBar:GetHeight()) * 2; + local alertSize = (SV.Dock.BarLeft.ExtraBar:GetHeight()) * 2; local alert = CreateFrame("Frame", nil, tab) alert:SetSize(alertSize, alertSize) alert:SetFrameStrata("DIALOG") @@ -739,7 +739,7 @@ do if(not TAB_SKINS) then tab.owner = chat; tab.isDocked = chat.isDocked; - tab:SetParent(SV.Dock.Left.ToolBar) + tab:SetParent(SV.Dock.BarLeft.ExtraBar) _modifyTab(tab, false) else tab.owner = chat; @@ -825,7 +825,7 @@ do end local _hook_GDMFrameSetPoint = function(self) - self:SetAllPoints(SV.Dock.Left.ToolBar) + self:SetAllPoints(SV.Dock.BarLeft.ExtraBar) end local _hook_GDMScrollSetPoint = function(self, point, anchor, attachTo, x, y) @@ -968,6 +968,8 @@ function MOD:ReLoad() end function MOD:Load() + SV.Dock.BarLeft.ExtraBar:SetWidth(SV.Dock.Left.Window:GetWidth()) + ScrollIndicator:SetParent(SV.Dock.Left.Window) ScrollIndicator:SetSize(20,20) ScrollIndicator:SetPoint("BOTTOMRIGHT", SV.Dock.Left.Window, "BOTTOMRIGHT", 6, 0) @@ -988,9 +990,9 @@ function MOD:Load() self:RefreshChatFrames(true) _G.GeneralDockManagerOverflowButton:ClearAllPoints() - _G.GeneralDockManagerOverflowButton:SetPoint('BOTTOMRIGHT', SV.Dock.Left.ToolBar, 'BOTTOMRIGHT', -2, 2) + _G.GeneralDockManagerOverflowButton:SetPoint('BOTTOMRIGHT', SV.Dock.BarLeft.ExtraBar, 'BOTTOMRIGHT', -2, 2) _G.GeneralDockManagerOverflowButtonList:SetFixedPanelTemplate('Transparent') - _G.GeneralDockManager:SetAllPoints(SV.Dock.Left.ToolBar) + _G.GeneralDockManager:SetAllPoints(SV.Dock.BarLeft.ExtraBar) SetAllChatHooks() diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index a40a011..2f17e84 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -646,7 +646,7 @@ function SV:ToggleHenchman() minion:Show() minion.anim:Play() end - SV.Dock.Right.Button.Icon:SetGradient(unpack(SV.Media.gradient.green)) + SV.Dock.BarRight.Button.Icon:SetGradient(unpack(SV.Media.gradient.green)) else UpdateHenchmanModel(true) for _,frame in pairs(SUBOPTIONS)do @@ -670,7 +670,7 @@ function SV:ToggleHenchman() minion.anim:Finish() minion:Hide() end - SV.Dock.Right.Button.Icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + SV.Dock.BarRight.Button.Icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) end end @@ -953,7 +953,7 @@ BUILD FUNCTION / UPDATE function MOD:Load() local bubble = CreateFrame("Frame", "HenchmenSpeechBubble", SV.Screen) bubble:SetSize(256,128) - bubble:Point("BOTTOMRIGHT", SV.Dock.Right.Button, "TOPLEFT", 0, 0) + bubble:Point("BOTTOMRIGHT", SV.Dock.BarRight.Button, "TOPLEFT", 0, 0) bubble:SetFrameStrata("DIALOG") bubble:SetFrameLevel(24) bubble.bg = bubble:CreateTexture(nil,"BORDER") diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.lua b/Interface/AddOns/SVUI/packages/stats/SVStats.lua index e97c68b..c96ad22 100644 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua @@ -146,7 +146,7 @@ local UpdateAnchor = function() width = anchor:GetWidth() / numPoints - 4; height = anchor:GetHeight() - 4; if(backdrops) then - height = SV.Dock.Right.Button:GetHeight() - 6 + height = SV.Dock.BarRight.Button:GetHeight() - 6 end end @@ -669,7 +669,7 @@ function MOD:UpdateStatSize() local gxWidth = tonumber(rez:match("(%d+)x%d+")); local bw = gxWidth * 0.5 local defaultStatBarWidth = min(bw, 800) - local buttonsize = SV.Dock.Left.ToolBar:GetHeight() + local buttonsize = SV.Dock.BarLeft.ToolBar:GetHeight() local statBarWidth = SV.db.SVStats.dockStatWidth or defaultStatBarWidth _G["SVUI_TopStatsDock"]:Size(statBarWidth - 2, buttonsize - 8) _G["SVUI_StatsBar1"]:Size((statBarWidth * 0.5) - 1, buttonsize - 8) @@ -693,7 +693,7 @@ function MOD:Load() local gxWidth = tonumber(rez:match("(%d+)x%d+")); local bw = gxWidth * 0.5 local defaultStatBarWidth = min(bw, 800) - local buttonsize = SV.Dock.Left.ToolBar:GetHeight() + local buttonsize = SV.Dock.BarLeft.ToolBar:GetHeight() local spacing = SV.Dock.Left:GetAttribute("spacingSize") local statBarWidth = SV.db.SVStats.dockStatWidth or defaultStatBarWidth diff --git a/Interface/AddOns/SVUI/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua index 006fe3a..09b75f8 100644 --- a/Interface/AddOns/SVUI/scripts/questwatch.lua +++ b/Interface/AddOns/SVUI/scripts/questwatch.lua @@ -76,8 +76,8 @@ local QuestFrame_OnEvent = function(self, event) end SV.Dock:CycleDocklets() QuestFrame:Show() - if(QuestFrame.ToolbarButton) then - QuestFrame.ToolbarButton:Activate() + if(QuestFrame.DockButton) then + QuestFrame.DockButton:Activate() end end end diff --git a/Interface/AddOns/SVUI/setup/installer.lua b/Interface/AddOns/SVUI/setup/installer.lua index da661e7..96846fc 100644 --- a/Interface/AddOns/SVUI/setup/installer.lua +++ b/Interface/AddOns/SVUI/setup/installer.lua @@ -427,7 +427,7 @@ function SV.Setup:ChatConfigs(mungs) if not mungs then if SV.Chat then SV.Chat:ReLoad(true) - if SV.Dock.Cache.IsFaded == true then SV.Dock.Left.Button:Click() end + if SV.Dock.Cache.IsFaded == true then SV.Dock.BarLeft.Button:Click() end end SV:SavedPopup() end diff --git a/Interface/AddOns/SVUI/system/configs.lua b/Interface/AddOns/SVUI/system/configs.lua index 15103ce..9ed41f0 100644 --- a/Interface/AddOns/SVUI/system/configs.lua +++ b/Interface/AddOns/SVUI/system/configs.lua @@ -39,6 +39,10 @@ local function safename(id) return n end +local NAMEFONT = "SVUI Name Font"; +if(GetLocale() ~= "enUS") then + NAMEFONT = "Roboto" +end --[[ SYSTEM DATA ]]-- SV.configs = {} @@ -87,7 +91,7 @@ SV.configs["totems"] = { SV.configs["media"] = { ["fonts"] = { ["default"] = "SVUI System Font", - ["name"] = "SVUI Name Font", + ["name"] = NAMEFONT, ["number"] = "SVUI Number Font", ["combat"] = "SVUI Combat Font", ["giant"] = "SVUI Action Font", @@ -564,7 +568,7 @@ SV.configs["SVOverride"] = { SV.configs["SVPlate"] = { ["enable"] = true, ["filter"] = {}, - ["font"] = "SVUI Name Font", + ["font"] = NAMEFONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", ["comboPoints"] = true, @@ -977,7 +981,7 @@ SV.configs["SVUnit"] = { ["tags"] = "[name:color][name:18][smartlevel]", ["xOffset"] = -2, ["yOffset"] = 36, - ["font"] = "SVUI Name Font", + ["font"] = NAMEFONT, ["fontSize"] = 15, ["fontOutline"] = "OUTLINE", }, diff --git a/Interface/AddOns/SVUI/system/docks.lua b/Interface/AddOns/SVUI/system/docks.lua index b854ca3..99c7e63 100644 --- a/Interface/AddOns/SVUI/system/docks.lua +++ b/Interface/AddOns/SVUI/system/docks.lua @@ -69,27 +69,133 @@ local SV = select(2, ...) local L = SV.L --[[ ########################################################## +LOCALS +########################################################## +]]-- +local ICONFILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-BAG-MICRO]]; +local TOOL_DATA = { + [171] = {0,0.25,0,0.25}, -- PRO-ALCHEMY + [794] = {0.25,0.5,0,0.25,80451}, -- PRO-ARCHAELOGY + [164] = {0.5,0.75,0,0.25}, -- PRO-BLACKSMITH + [185] = {0.75,1,0,0.25,818,67097}, -- PRO-COOKING + [333] = {0,0.25,0.25,0.5,13262}, -- PRO-ENCHANTING + [202] = {0.25,0.5,0.25,0.5}, -- PRO-ENGINEERING + [129] = {0.5,0.75,0.25,0.5}, -- PRO-FIRSTAID + [773] = {0,0.25,0.5,0.75,51005}, -- PRO-INSCRIPTION + [755] = {0.25,0.5,0.5,0.75,31252}, -- PRO-JEWELCRAFTING + [165] = {0.5,0.75,0.5,0.75}, -- PRO-LEATHERWORKING + [186] = {0.75,1,0.5,0.75}, -- PRO-MINING + [197] = {0.25,0.5,0.75,1}, -- PRO-TAILORING +} +local HEARTH_SPELLS = {556,50977,18960,126892} +--[[ +########################################################## DOCKING ########################################################## ]]-- local Dock = SV:NewPackage("Dock", L["Screen Docks"]); + +Dock.Docklets = { + Windows = {}, + Buttons = {}, + Registered = {} +}; + Dock.DefaultDocklet = ""; Dock.DockletWindows = {}; Dock.DockletButtons = {}; Dock.HandledDocklets = {}; -Dock.Border = {}; local addonDock1 = CreateFrame("Frame", "SVUI_DockedAddon1", UIParent, "SVUI_DockletWindowTemplate"); local addonDock2 = CreateFrame("Frame", "SVUI_DockedAddon2", UIParent, "SVUI_DockletWindowTemplate"); +Dock.Border = {}; Dock.Addons = {addonDock1, addonDock2}; Dock.Dropdown = CreateFrame("Frame", "SVUI_DockDropdown", UIParent); -- MAIN REGIONS Dock.Left = _G["SVUI_DockLeft"] +Dock.BarLeft = _G["SVUI_DockBarLeft"] +Dock.BarLeft.Docklets = { + Anchor = "LEFT", + Modifier = 1, + Default = "" +}; +Dock.BarLeft.Parent = Dock.Left; + Dock.Right = _G["SVUI_DockRight"] +Dock.BarRight = _G["SVUI_DockBarRight"] +Dock.BarRight.Docklets = { + Anchor = "RIGHT", + Modifier = -1, + Default = "" +}; +Dock.BarRight.Parent = Dock.Right; + Dock.Top = _G["SVUI_DockTop"] +--[[ +########################################################## +SET DOCKBAR FUNCTIONS +########################################################## +]]-- +local RefreshDockButtons = function(self) + local list = Dock.Docklets.Windows + for i=1, #list do + local docklet = list[i] + if(not InCombatLockdown() or (InCombatLockdown() and (docklet.IsProtected and not docklet:IsProtected()))) then + local button = _G[docklet.ToggleName] + if(button) then + button:Deactivate() + end + if docklet.Hide then + docklet:Hide() + end + end + end +end + +Dock.BarLeft.Refresh = RefreshDockButtons +Dock.BarRight.Refresh = RefreshDockButtons + +local GetDefault = function(self) + local window = self.Docklets.Default + if window and _G[window] then + self.Parent.Window.FrameName = window + self.Parent.Window:Show() + end +end + +Dock.BarLeft.GetDefault = GetDefault +Dock.BarRight.GetDefault = GetDefault + +local ToggleDockletWindow = function(self, button) + local frameName = button.FrameName + local window = _G[frameName]; + if(window) then + self.Parent.Window.FrameName = frameName + if(not window:IsShown()) then + self:Refresh() + end + if(not Dock.Right.Window:IsShown()) then + self.Parent.Window:Show() + end + + window:Show() + button:Activate() + else + button:Deactivate() + self:GetDefault() + end +end + +Dock.BarLeft.Toggle = ToggleDockletWindow +Dock.BarRight.Toggle = ToggleDockletWindow +--[[ +########################################################## +SET ALERT FUNCTIONS +########################################################## +]]-- local AlertActivate = function(self, child) local size = SV.db.Dock.buttonSize or 22; self:Height(size) @@ -97,32 +203,32 @@ local AlertActivate = function(self, child) child:SetAllPoints(self) end +Dock.Left.Alert.Activate = AlertActivate +Dock.Right.Alert.Activate = AlertActivate + local AlertDeactivate = function(self) self:Height(1) end -Dock.Left.Alert.Activate = AlertActivate Dock.Left.Alert.Deactivate = AlertDeactivate - -Dock.Right.Alert.Activate = AlertActivate Dock.Right.Alert.Deactivate = AlertDeactivate - -local ICONFILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-BAG-MICRO]]; -local TOOL_DATA = { - [171] = {0,0.25,0,0.25}, -- PRO-ALCHEMY - [794] = {0.25,0.5,0,0.25,80451}, -- PRO-ARCHAELOGY - [164] = {0.5,0.75,0,0.25}, -- PRO-BLACKSMITH - [185] = {0.75,1,0,0.25,818,67097}, -- PRO-COOKING - [333] = {0,0.25,0.25,0.5,13262}, -- PRO-ENCHANTING - [202] = {0.25,0.5,0.25,0.5}, -- PRO-ENGINEERING - [129] = {0.5,0.75,0.25,0.5}, -- PRO-FIRSTAID - [773] = {0,0.25,0.5,0.75,51005}, -- PRO-INSCRIPTION - [755] = {0.25,0.5,0.5,0.75,31252}, -- PRO-JEWELCRAFTING - [165] = {0.5,0.75,0.5,0.75}, -- PRO-LEATHERWORKING - [186] = {0.75,1,0.5,0.75}, -- PRO-MINING - [197] = {0.25,0.5,0.75,1}, -- PRO-TAILORING -} -local HEARTH_SPELLS = {556,50977,18960,126892} +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +_G.HideSuperDocks = function() + GameTooltip:Hide() + if SV.cache.Docks.IsFaded then + SV.cache.Docks.IsFaded = nil; + SV:SecureFadeIn(Dock.Left, 0.2, Dock.Left:GetAlpha(), 1) + SV:SecureFadeIn(Dock.Right, 0.2, Dock.Right:GetAlpha(), 1) + else + SV.cache.Docks.IsFaded = true; + SV:SecureFadeOut(Dock.Left, 0.2, Dock.Left:GetAlpha(), 0, true) + SV:SecureFadeOut(Dock.Right, 0.2, Dock.Right:GetAlpha(), 0, true) + end +end --[[ ########################################################## PRE VARS/FUNCTIONS @@ -146,43 +252,7 @@ local function SetFilterMenu(self) Dock.Dropdown:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -8) ToggleFrame(Dock.Dropdown) end - -local function CycleDocklets() - local list = Dock.DockletWindows - for i=1, #list do - local f = list[i] - if(not InCombatLockdown() or (InCombatLockdown() and (f.IsProtected and not f:IsProtected()))) then - local b = _G[f.ToggleName] - if(b) then - b:Deactivate() - end - if f.Hide then - f:Hide() - end - end - end -end - -local function GetDefaultWindow() - local window = Dock.DefaultDocklet - if window and _G[window] then - Dock.Right.Window.FrameName = window - Dock.Right.Window:Show() - end -end - -local ToggleDocks = function(self) - GameTooltip:Hide() - if SV.cache.Docks.IsFaded then - SV.cache.Docks.IsFaded = nil; - SV:SecureFadeIn(Dock.Left, 0.2, Dock.Left:GetAlpha(), 1) - SV:SecureFadeIn(Dock.Right, 0.2, Dock.Right:GetAlpha(), 1) - else - SV.cache.Docks.IsFaded = true; - SV:SecureFadeOut(Dock.Left, 0.2, Dock.Left:GetAlpha(), 0, true) - SV:SecureFadeOut(Dock.Right, 0.2, Dock.Right:GetAlpha(), 0, true) - end -end +-- CycleDocklets local Docklet_OnShow = function(self) if(_G[Dock.Right.Window.FrameName]) then @@ -207,27 +277,6 @@ local DockButtonDeactivate = function(self) self.Icon:SetGradient(unpack(SV.Media.gradient.icon)) end -local function ToggleDockletWindow(button) - local frameName = button.FrameName - local window = _G[frameName]; - if(window) then - Dock.Right.Window.FrameName = frameName - if(not window:IsShown()) then - CycleDocklets() - end - - if(not Dock.Right.Window:IsShown()) then - Dock.Right.Window:Show() - end - - window:Show() - button:Activate() - else - button:Deactivate() - GetDefaultWindow() - end -end - local DockletButton_OnEnter = function(self, ...) if SV.cache.Docks.IsFaded then Dock.Left:Show() @@ -275,13 +324,13 @@ local DockletButton_OnClick = function(self, button) if self.PostClickFunction then if(self:GetAttribute("isActive")) then self:Deactivate() - GetDefaultWindow() + self.Parent:GetDefault() else self:Activate() end self:PostClickFunction() else - ToggleDockletWindow(self) + self.Parent:Toggle(self) end end end @@ -296,7 +345,7 @@ end local AddonDockletToggle = function(self) if addonDock1.FrameName and _G[addonDock1.FrameName] then if not _G[addonDock1.FrameName]:IsShown() then - CycleDocklets() + self.Parent:Refresh() if not InCombatLockdown() and not addonDock1:IsShown()then addonDock1:Show() end @@ -343,76 +392,63 @@ local AddonDockletToggle = function(self) addonDock2.FrameName = "None" end end - -local function SetSuperDockStyle(dock) - if dock.backdrop then return end - local backdrop = CreateFrame("Frame", nil, dock) - backdrop:SetAllPoints(dock) - backdrop:SetFrameStrata("BACKGROUND") - backdrop.bg = backdrop:CreateTexture(nil, "BORDER") - backdrop.bg:FillInner(backdrop) - backdrop.bg:SetTexture(1, 1, 1, 1) - backdrop.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0.8, 0, 0, 0, 0) - backdrop.left = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.left:SetTexture(1, 1, 1, 1) - backdrop.left:Point("TOPLEFT", 1, -1) - backdrop.left:Point("BOTTOMLEFT", -1, 1) - backdrop.left:Width(4) - backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) - backdrop.right = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.right:SetTexture(1, 1, 1, 1) - backdrop.right:Point("TOPRIGHT", -1, -1) - backdrop.right:Point("BOTTOMRIGHT", -1, 1) - backdrop.right:Width(4) - backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) - backdrop.bottom = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.bottom:SetTexture(0, 0, 0, 1) - backdrop.bottom:Point("BOTTOMLEFT", 1, 1) - backdrop.bottom:Point("BOTTOMRIGHT", -1, 1) - backdrop.bottom:Height(4) - backdrop.top = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.top:SetTexture(0,0,0,0) - backdrop.top:Point("TOPLEFT", 1, -1) - backdrop.top:Point("TOPRIGHT", -1, 1) - backdrop.top:SetAlpha(0) - backdrop.top:Height(1) - return backdrop -end - -Dock.CycleDocklets = CycleDocklets ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -_G.HideSuperDocks = function() - ToggleDocks(LeftDockToggleButton) -end --[[ ########################################################## DOCKLET HELPERS ########################################################## ]]-- -local function AddTool(button) +local AddToDock = function(self, button) local name = button:GetName(); - if Dock.HandledDocklets[name] then return end - Dock.HandledDocklets[name] = true; - local height = Dock.Right.ToolBar:GetHeight(); - local xOffset = #Dock.DockletButtons * (height + 6) + 6 - button:SetPoint("RIGHT", Dock.Right.ToolBar, "RIGHT", (xOffset * -1), 0); - tinsert(Dock.DockletButtons, button) - button.listIndex = #Dock.DockletButtons; + if Dock.Docklets.Registered[name] then return end + Dock.Docklets.Registered[name] = true; + local anchor = self.Docklets.Anchor + local mod = self.Docklets.Modifier + local height = self.ToolBar:GetHeight(); + local xOffset = #Dock.Docklets.Buttons * (height + 6) + 6 + button:SetPoint(anchor, self.ToolBar, anchor, (xOffset * mod), 0); + tinsert(Dock.Docklets.Buttons, button) + button.listIndex = #Dock.Docklets.Buttons; button:Show() + local newWidth = xOffset + (height + 12) + self.ToolBar:SetWidth(newWidth) end -function Dock:ActivateDockletButton(button, clickFunction, tipFunction, isdefault) +Dock.BarLeft.Add = AddToDock +Dock.BarRight.Add = AddToDock + +local RemoveFromDock = function(self, button) + if not button or not button.listIndex then return end + local name = button:GetName(); + if not Dock.Docklets.Registered[name] then return end + Dock.Docklets.Registered[name] = nil; + local index = button.listIndex; + tremove(Dock.Docklets.Buttons, index) + button:Hide() + local height = self.ToolBar:GetHeight(); + local anchor = self.Docklets.Anchor + local mod = self.Docklets.Modifier + local xOffset + for i = 1, #Dock.Docklets.Buttons do + local nextButton = Dock.Docklets.Buttons[i] + xOffset = (i - 1) * (height + 6) + 6 + nextButton:ClearAllPoints() + nextButton:SetPoint(anchor, self.ToolBar, anchor, (xOffset * mod), 0); + end + local newWidth = xOffset + (height + 12) + self.ToolBar:SetWidth(newWidth) +end + +Dock.BarLeft.Remove = RemoveFromDock +Dock.BarRight.Remove = RemoveFromDock + +local ActivateDockletButton = function(self, button, clickFunction, tipFunction, isdefault) button.Activate = DockButtonActivate button.Deactivate = DockButtonDeactivate if(tipFunction and type(tipFunction) == "function") then button.CustomTooltip = tipFunction end - + button.Parent = self button:SetPanelColor("default") button.Icon:SetGradient(unpack(SV.Media.gradient.icon)) button:SetScript("OnEnter", DockletButton_OnEnter) @@ -424,37 +460,81 @@ function Dock:ActivateDockletButton(button, clickFunction, tipFunction, isdefaul end if(isdefault) then - self.DefaultDocklet = button:GetAttribute("ownerFrame") + self.Docklets.Default = button:GetAttribute("ownerFrame") button:Activate() end end -local function CreateBasicToolButton(name, texture, onclick, frameName, isdefault) +Dock.BarLeft.Initialize = ActivateDockletButton +Dock.BarRight.Initialize = ActivateDockletButton + +local CreateBasicToolButton = function(self, name, texture, onclick, frameName, isdefault) local fName = frameName or name; local dockIcon = texture or [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-ADDON]]; - local size = Dock.Right.ToolBar:GetHeight(); - local button = _G[fName .. "_ToolBarButton"] or CreateFrame("Button", ("%s_ToolBarButton"):format(fName), Dock.Right.ToolBar, "SVUI_DockletButtonTemplate") + local size = self.ToolBar:GetHeight(); + local button = _G[fName .. "DockletButton"] or CreateFrame("Button", ("%sDockletButton"):format(fName), self.ToolBar, "SVUI_DockletButtonTemplate") - AddTool(button) + self:Add(button) button:Size(size,size) button:SetFramedButtonTemplate() button.Icon:SetTexture(dockIcon) button:SetAttribute("tipText", "Open " .. name) button:SetAttribute("ownerFrame", fName) + button.IsRegistered = false; button.FrameName = fName - Dock:ActivateDockletButton(button, onclick, nil, isdefault) + self:Initialize(button, onclick, nil, isdefault) - _G[fName].ToggleName = fName.."_ToolBarButton"; + if(_G[fName]) then + _G[fName].ToggleName = fName.."DockletButton"; + end return button end + +Dock.BarLeft.Create = CreateBasicToolButton +Dock.BarRight.Create = CreateBasicToolButton --[[ ########################################################## DOCKS ########################################################## ]]-- +local function SetSuperDockStyle(dock) + if dock.backdrop then return end + local backdrop = CreateFrame("Frame", nil, dock) + backdrop:SetAllPoints(dock) + backdrop:SetFrameStrata("BACKGROUND") + backdrop.bg = backdrop:CreateTexture(nil, "BORDER") + backdrop.bg:FillInner(backdrop) + backdrop.bg:SetTexture(1, 1, 1, 1) + backdrop.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0.8, 0, 0, 0, 0) + backdrop.left = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.left:SetTexture(1, 1, 1, 1) + backdrop.left:Point("TOPLEFT", 1, -1) + backdrop.left:Point("BOTTOMLEFT", -1, 1) + backdrop.left:Width(4) + backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) + backdrop.right = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.right:SetTexture(1, 1, 1, 1) + backdrop.right:Point("TOPRIGHT", -1, -1) + backdrop.right:Point("BOTTOMRIGHT", -1, 1) + backdrop.right:Width(4) + backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0) + backdrop.bottom = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.bottom:SetTexture(0, 0, 0, 1) + backdrop.bottom:Point("BOTTOMLEFT", 1, 1) + backdrop.bottom:Point("BOTTOMRIGHT", -1, 1) + backdrop.bottom:Height(4) + backdrop.top = backdrop:CreateTexture(nil, "OVERLAY") + backdrop.top:SetTexture(0,0,0,0) + backdrop.top:Point("TOPLEFT", 1, -1) + backdrop.top:Point("TOPRIGHT", -1, 1) + backdrop.top:SetAlpha(0) + backdrop.top:Height(1) + return backdrop +end + function Dock:CreateDockPanels() local leftWidth = SV.db.Dock.dockLeftWidth or 350; local leftHeight = SV.db.Dock.dockLeftHeight or 180; @@ -512,58 +592,68 @@ function Dock:CreateDockPanels() -- [[ BOTTOM LEFT DOCK ]] -- + self.BarLeft:SetParent(SV.Screen) + self.BarLeft:Size(leftWidth, buttonsize) + self.BarLeft:SetPoint("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", 2, 2) + self.BarLeft.Button:Size(buttonsize, buttonsize) + self.BarLeft.Button:SetFramedButtonTemplate() + self.BarLeft.Button.Icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\SVUI-EMBLEM]]) + self.BarLeft.Button:SetAttribute("tipText", L["Toggle Docks"]) + self.BarLeft.Button:RegisterForClicks("AnyUp") + self.BarLeft.ToolBar:Point("LEFT", self.BarLeft.Button, "RIGHT", spacing, 0) + self.BarLeft.ToolBar:Height(buttonsize) + self.BarLeft.ExtraBar:Point("LEFT", self.BarLeft.ToolBar, "RIGHT", spacing, 0) + self.BarLeft.ExtraBar:Height(buttonsize) + self.Left:SetParent(SV.Screen) - self.Left:Point("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", 2, 2) + self.Left:SetPoint("BOTTOMLEFT", self.BarLeft, "TOPLEFT", 0, 12) self.Left:Size(leftWidth, leftHeight) self.Left:SetAttribute("buttonSize", buttonsize) self.Left:SetAttribute("spacingSize", spacing) - self.Left.Button:Size(buttonsize, buttonsize) - self.Left.Button:SetFramedButtonTemplate() - self.Left.Button.Icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\SVUI-EMBLEM]]) - self.Left.Button:SetAttribute("tipText", L["Toggle Docks"]) - self.Left.Button:RegisterForClicks("AnyUp") - self.Left.ToolBar:Point("LEFT", self.Left.Button, "RIGHT", spacing, 0) - self.Left.ToolBar:Height(buttonsize) - self.Left.Window:Size(leftWidth, leftHeight - (buttonsize + 4)) + self.Left.Alert.Activate = AlertActivate self.Left.Alert.Deactivate = AlertDeactivate self.Left.backdrop = SetSuperDockStyle(self.Left.Window) - self:ActivateDockletButton(self.Left.Button, ToggleDocks) + self.BarLeft:Initialize(self.BarLeft.Button, HideSuperDocks) + + SV.Mentalo:Add(self.BarLeft, L["Left Dock ToolBar"]) + SV.Mentalo:Add(self.Left, L["Left Dock Window"]) -- [[ BOTTOM RIGHT DOCK ]] -- + self.BarRight:SetParent(SV.Screen) + self.BarRight:Size(rightWidth, buttonsize) + self.BarRight:Point("BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", -2, 2) + self.BarRight.Button:Size(buttonsize, buttonsize) + self.BarRight.Button:SetFramedButtonTemplate() + self.BarRight.Button.Icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-HENCHMAN]]) + self.BarRight.Button:SetAttribute("tipText", "Call Henchman!") + self.BarRight.Button:RegisterForClicks("AnyUp") + self.BarRight.ToolBar:Point("RIGHT", self.BarRight.Button, "LEFT", -spacing, 0) + self.BarRight.ToolBar:Height(buttonsize) + self.Right:SetParent(SV.Screen) - self.Right:Point("BOTTOMRIGHT", SV.Screen, "BOTTOMRIGHT", -2, 2) + self.Right:Point("BOTTOMRIGHT", self.BarRight, "TOPRIGHT", 0, 12) self.Right:Size(rightWidth, rightHeight) self.Right:SetAttribute("buttonSize", buttonsize) self.Right:SetAttribute("spacingSize", spacing) - self.Right.Button:Size(buttonsize, buttonsize) - self.Right.Button:SetFramedButtonTemplate() - self.Right.Button.Icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-HENCHMAN]]) - self.Right.Button:SetAttribute("tipText", "Call Henchman!") - self.Right.Button:RegisterForClicks("AnyUp") - self.Right.ToolBar:Point("RIGHT", self.Right.Button, "LEFT", -spacing, 0) - self.Right.ToolBar:Height(buttonsize) - self.Right.ToolBar.AddonButton:Size(buttonsize, buttonsize) - self.Right.ToolBar.AddonButton:SetFramedButtonTemplate() - self.Right.ToolBar.AddonButton.Icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-ADDON]]) - self.Right.ToolBar.AddonButton:SetAttribute("tipText", "") - self.Right.ToolBar.AddonButton.IsRegistered = false; self.Right.Window:Size(rightWidth, rightHeight - (buttonsize + 4)) self.Right.Alert.Activate = AlertActivate self.Right.Alert.Deactivate = AlertDeactivate self.Right.backdrop = SetSuperDockStyle(self.Right.Window) - self:ActivateDockletButton(self.Right.Button, SV.ToggleHenchman) - self:ActivateDockletButton(self.Right.ToolBar.AddonButton, AddonDockletToggle) + self.BarRight:Initialize(self.BarRight.Button, SV.ToggleHenchman) - SV.Mentalo:Add(self.Left, L["Left Dock Window"]) + SV.Mentalo:Add(self.BarRight, L["Right Dock ToolBar"]) SV.Mentalo:Add(self.Right, L["Right Dock Window"]) - SV:AddToDisplayAudit(self.Right.Window) if SV.cache.Docks.IsFaded then Dock.Left:Hide() Dock.Right:Hide() end + -- [[ ADDON DOCKLET BUTTON ]] -- + + self.AddonButton = self.BarRight:Create("Addon Dock", nil, AddonDockletToggle, "SVUI_DockRightToolBar") + -- [[ TOP LEFT DOCK ]] -- self.Top:SetParent(SV.Screen) @@ -623,7 +713,16 @@ function Dock:CreateDockPanels() self.Dropdown:SetSize(135, 94) self.Dropdown:Hide() + + SV:AddToDisplayAudit(self.Right.Window) SV:AddToDisplayAudit(self.Dropdown) + + self.Right.Window:SetScript("OnShow", Docklet_OnShow) + + if not InCombatLockdown()then + self.BarLeft:Refresh() + self.BarRight:Refresh() + end end local function BorderColorUpdates() @@ -699,9 +798,9 @@ do local function CreateMacroToolButton(proName, proID, itemID, size) local data = TOOL_DATA[proID] if(not data) then return end - local button = CreateFrame("Button", ("%s_MacroBarButton"):format(itemID), Dock.Right.ToolBar, "SecureActionButtonTemplate,SVUI_DockletButtonTemplate") + local button = CreateFrame("Button", ("%s_MacroBarButton"):format(itemID), Dock.BarRight.ToolBar, "SecureActionButtonTemplate,SVUI_DockletButtonTemplate") button:Size(size, size) - AddTool(button) + Dock.BarRight:Add(button) button:SetFramedButtonTemplate() button.Icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\PROFESSIONS]]) button.Icon:SetTexCoord(data[1], data[2], data[3], data[4]) @@ -735,18 +834,18 @@ do end function Dock:LoadToolBarProfessions() - if(SV.ToolBarLoaded) then return end + if(Dock.ToolBarLoaded) then return end if(InCombatLockdown()) then Dock:RegisterEvent("PLAYER_REGEN_ENABLED"); return end - local size = Dock.Right.ToolBar:GetHeight() - local hearth = CreateFrame("Button", "SVUI_HearthButton", Dock.Right.ToolBar, "SecureActionButtonTemplate, SVUI_DockletButtonTemplate") + local size = Dock.BarRight.ToolBar:GetHeight() + local hearth = CreateFrame("Button", "SVUI_HearthButton", Dock.BarRight.ToolBar, "SecureActionButtonTemplate, SVUI_DockletButtonTemplate") hearth:Size(size, size) - AddTool(hearth) + Dock.BarRight:Add(hearth) hearth:SetFramedButtonTemplate() hearth.Icon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\DOCK-HEARTH") hearth.Icon:SetTexCoord(0,0.5,0,1) hearth:RegisterForClicks("AnyUp") hearth:SetAttribute("type", "item") - hearth:SetAttribute("item", "Hearthstone") + hearth:SetAttribute("item", L["Hearthstone"]) hearth.CustomTooltip = SetHearthTooltip hearth:SetPanelColor("default") @@ -789,8 +888,7 @@ do CreateMacroToolButton(proName, proID, prof1, size) end end - - SV.ToolBarLoaded = true + Dock.ToolBarLoaded = true end end --[[ @@ -819,26 +917,7 @@ do tremove(Dock.DockletWindows, i) end - local function RemoveDocklet(button) - if not button or not button.listIndex then return end - local name = button:GetName(); - if not Dock.HandledDocklets[name] then return end - Dock.HandledDocklets[name] = nil; - local index = button.listIndex; - tremove(Dock.DockletButtons, index) - button:Hide() - - local height = Dock.Right.ToolBar:GetHeight(); - - for i = 1, #Dock.DockletButtons do - local nextButton = Dock.DockletButtons[i] - local xOffset = (i - 1) * (height + 6) + 6 - nextButton:ClearAllPoints() - nextButton:SetPoint("RIGHT", Dock.Right.ToolBar, "RIGHT", (xOffset * -1), 0); - end - end - - function Dock:ReloadDocklets(alert) + function Dock:ReloadAddonDocklets(alert) if InCombatLockdown() then return end local frame, i; @@ -849,10 +928,10 @@ do UnregisterDocklet(frame) SV.db.Dock.docklets.MainWindow = "None" end - elseif self.Right.ToolBar.AddonButton.IsRegistered then - RemoveDocklet(self.Right.ToolBar.AddonButton) - self.Right.ToolBar.AddonButton:SetAttribute("tipText", "") - self.Right.ToolBar.AddonButton.IsRegistered = false; + elseif self.AddonButton.IsRegistered then + self.BarRight:Remove(self.AddonButton) + self.AddonButton:SetAttribute("tipText", "") + self.AddonButton.IsRegistered = false; end if self:IsDockletReady("DockletExtra") then frame = SV.db.Dock.docklets.ExtraWindow @@ -881,16 +960,16 @@ do end -function Dock:RegisterDocklet(name, tooltip, texture, onclick, isdefault) +function Dock:RegisterDocklet(name, readableName, texture, onclick, isdefault) local frame = _G[name]; if frame and (frame.IsObjectType and frame:IsObjectType("Frame")) and (frame.IsProtected and not frame:IsProtected()) then frame:ClearAllPoints() frame:SetParent(self.Right.Window) frame:FillInner(self.Right.Window, 4, 4) frame.FrameName = name; - tinsert(self.DockletWindows, frame); - frame.listIndex = #self.DockletWindows; - frame.ToolbarButton = CreateBasicToolButton(tooltip, texture, onclick, name, isdefault) + tinsert(self.Docklets.Windows, frame); + frame.listIndex = #self.Docklets.Windows; + frame.DockButton = self.BarRight:Create(readableName, texture, onclick, name, isdefault) end end @@ -903,11 +982,11 @@ function Dock:RegisterMainDocklet(name) frame:SetParent(addonDock1) frame:SetAllPoints(addonDock1) frame.ToggleName = "SVUI_DockRightToolBarAddonButton"; - tinsert(self.DockletWindows, frame); - frame.listIndex = #self.DockletWindows; - AddTool(self.Right.ToolBar.AddonButton) - self.Right.ToolBar.AddonButton:SetAttribute("tipText", "") - self.Right.ToolBar.AddonButton.IsRegistered = true + tinsert(self.Docklets.Windows, frame); + frame.listIndex = #self.Docklets.Windows; + self.BarRight:Add(self.AddonButton) + self.AddonButton:SetAttribute("tipText", "") + self.AddonButton.IsRegistered = true SV.CurrentlyDocked[name] = true if not InCombatLockdown() and frame:IsShown() then frame:Hide() end end @@ -922,9 +1001,9 @@ function Dock:RegisterExtraDocklet(name) frame:SetParent(addonDock2) frame:SetAllPoints(addonDock2) frame.ToggleName = "SVUI_DockRightToolBarAddonButton"; - tinsert(self.DockletWindows, frame); - frame.listIndex = #self.DockletWindows; - self.Right.ToolBar.AddonButton:SetAttribute("tipText", "") + tinsert(self.Docklets.Windows, frame); + frame.listIndex = #self.Docklets.Windows; + self.AddonButton:SetAttribute("tipText", "") SV.CurrentlyDocked[name] = true; if not InCombatLockdown() and frame:IsShown() then frame:Hide() end end @@ -980,15 +1059,17 @@ function Dock:Refresh() local buttonsize = SV.db.Dock.buttonSize or 22; local spacing = SV.db.Dock.buttonSpacing or 4; + self.BarLeft:Size(leftWidth, buttonsize) self.Left:Size(leftWidth, leftHeight) self.Left.Window:Size(leftWidth, leftHeight - (buttonsize + 4)) + self.BarRight:Size(rightWidth, buttonsize) self.Right:Size(rightWidth, rightHeight) self.Right.Window:Size(rightWidth, rightHeight - (buttonsize + 4)) self:BottomBorderVisibility(); self:TopBorderVisibility(); self:UpdateDockBackdrops(); - self:ReloadDocklets() + self:ReloadAddonDocklets() end function Dock:Initialize() @@ -998,22 +1079,17 @@ function Dock:Initialize() SV.cache.Docks.IsFaded = false end - self:CreateDockPanels() - self.Right.Window:SetScript("OnShow", Docklet_OnShow) - - if not InCombatLockdown()then - CycleDocklets() - end + self:CreateDockPanels() self:UpdateDockBackdrops() addonDock1:SetFrameLevel(self.Right.Window:GetFrameLevel() + 50) addonDock2:SetFrameLevel(self.Right.Window:GetFrameLevel() + 50) - local size = self.Right.ToolBar:GetHeight(); + local size = self.BarRight.ToolBar:GetHeight(); addonDock1:SetScript("OnShow", DockletFrame_OnShow) addonDock2:SetScript("OnShow", DockletFrame_OnShow) - self:ReloadDocklets(true) + self:ReloadAddonDocklets(true) SV.Timers:ExecuteTimer(self.LoadToolBarProfessions, 5) end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/templates.lua b/Interface/AddOns/SVUI/system/templates.lua index 396d0fa..a146d44 100644 --- a/Interface/AddOns/SVUI/system/templates.lua +++ b/Interface/AddOns/SVUI/system/templates.lua @@ -383,7 +383,6 @@ end local function CreateCooldownTimer(frame) local timer = CreateFrame('Frame', nil, frame) - timer:Hide() timer:SetAllPoints() timer:SetScript('OnUpdate', Cooldown_OnUpdate) @@ -392,7 +391,10 @@ local function CreateCooldownTimer(frame) timeText:SetJustifyH("CENTER") timer.text = timeText; + timer:Hide() + frame.timer = timer; + local width, height = frame:GetSize() Cooldown_OnSizeChanged(frame, width, height) frame:SetScript('OnSizeChanged', Cooldown_OnSizeChanged) @@ -420,7 +422,7 @@ local _hook_Cooldown_SetCooldown = function(self, start, duration, elapsed) if self.timer then if elapsed and elapsed > 0 then self.timer:SetAlpha(0) - else + else self.timer:SetAlpha(0.8) end end diff --git a/Interface/AddOns/SVUI/xml/framework.xml b/Interface/AddOns/SVUI/xml/framework.xml index 3a9faf6..a5b355c 100644 --- a/Interface/AddOns/SVUI/xml/framework.xml +++ b/Interface/AddOns/SVUI/xml/framework.xml @@ -1,8 +1,12 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Button name="SVUI_DockletButtonTemplate" virtual="true"> + <Button name="SVUI_DockletButtonTemplate" virtual="true" hidden="true"> <Size x="22" y="22"/> + <Anchors> + <Anchor point="RIGHT" relativePoint="RIGHT" /> + </Anchors> <Attributes> <Attribute name="tipText" type="string" value="" /> + <Attribute name="tipExtraText" type="string" value="" /> <Attribute name="ownerFrame" type="string" value="None" /> <Attribute name="isActive" type="boolean" value="false" /> </Attributes> @@ -25,7 +29,8 @@ </Attributes> </Frame> - <Frame name="SVUI_DockLeft" frameStrata="BACKGROUND"> + <Frame name="SVUI_DockBarLeft" frameStrata="BACKGROUND"> + <Size y="22"/> <Attributes> <Attribute name="spacingSize" type="number" value="4" /> <Attribute name="buttonSize" type="number" value="22" /> @@ -37,7 +42,7 @@ <Button name="$parentButton" parentKey="Button"> <Size x="22" y="22"/> <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="UIParent" relativePoint="BOTTOMLEFT" /> + <Anchor point="BOTTOMLEFT" relativeTo="$parent" /> </Anchors> <Attributes> <Attribute name="tipText" type="string" value="" /> @@ -57,17 +62,34 @@ </Layers> </Button> <Frame name="$parentToolBar" parentKey="ToolBar"> - <Size y="22"/> + <Size x="1" y="22"/> <Anchors> <Anchor point="BOTTOMLEFT" relativeTo="$parentButton" relativePoint="BOTTOMRIGHT" x="4" y="0" /> - <Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT" x="0" y="0" /> </Anchors> </Frame> + <Frame name="$parentExtraBar" parentKey="ExtraBar"> + <Size x="1" y="22"/> + <Anchors> + <Anchor point="BOTTOMLEFT" relativeTo="$parentToolBar" relativePoint="BOTTOMRIGHT" x="-4" y="0" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockLeft" frameStrata="BACKGROUND"> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="1" y="32" /> + </Anchors> + <Frames> <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> <Size y="1"/> <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parentButton" relativePoint="TOPLEFT" x="0" y="4" /> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentToolBar" relativePoint="TOPRIGHT" x="0" y="4" /> + <Anchor point="BOTTOMLEFT" /> + <Anchor point="BOTTOMRIGHT" /> </Anchors> </Frame> <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND"> @@ -81,7 +103,8 @@ </Frames> </Frame> - <Frame name="SVUI_DockRight" frameStrata="BACKGROUND"> + <Frame name="SVUI_DockBarRight" frameStrata="BACKGROUND"> + <Size y="22"/> <Attributes> <Attribute name="spacingSize" type="number" value="4" /> <Attribute name="buttonSize" type="number" value="22" /> @@ -93,7 +116,7 @@ <Button name="$parentButton" parentKey="Button"> <Size x="22" y="22"/> <Anchors> - <Anchor point="BOTTOMRIGHT" relativeTo="UIParent" relativePoint="BOTTOMRIGHT" /> + <Anchor point="BOTTOMRIGHT" relativeTo="$parent" /> </Anchors> <Attributes> <Attribute name="tipText" type="string" value="" /> @@ -113,41 +136,34 @@ </Layers> </Button> <Frame name="$parentToolBar" parentKey="ToolBar"> - <Size y="22"/> + <Size x="1" y="22"/> <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT" x="0" y="0" /> <Anchor point="BOTTOMRIGHT" relativeTo="$parentButton" relativePoint="BOTTOMLEFT" x="-4" y="0" /> </Anchors> - <Frames> - <Button name="$parentAddonButton" parentKey="AddonButton" hidden="true"> - <Size x="22" y="22"/> - <Anchors> - <Anchor point="RIGHT" relativePoint="RIGHT" /> - </Anchors> - <Attributes> - <Attribute name="tipText" type="string" value="" /> - <Attribute name="tipExtraText" type="string" value="" /> - <Attribute name="ownerFrame" type="string" value="None" /> - <Attribute name="isActive" type="boolean" value="false" /> - </Attributes> - <Layers> - <Layer level="OVERLAY"> - <Texture parentKey="Icon" file="Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT"> - <Anchors> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="2" y="-2" /> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-2" y="2" /> - </Anchors> - </Texture> - </Layer> - </Layers> - </Button> - </Frames> </Frame> + <Frame name="$parentExtraBar" parentKey="ExtraBar"> + <Size x="1" y="22"/> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativeTo="$parentToolBar" relativePoint="BOTTOMLEFT" x="-4" y="0" /> + </Anchors> + </Frame> + </Frames> + </Frame> + + <Frame name="SVUI_DockRight" frameStrata="BACKGROUND"> + <Attributes> + <Attribute name="spacingSize" type="number" value="4" /> + <Attribute name="buttonSize" type="number" value="22" /> + </Attributes> + <Anchors> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-1" y="32" /> + </Anchors> + <Frames> <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> <Size y="1"/> <Anchors> - <Anchor point="BOTTOMRIGHT" relativeTo="$parentButton" relativePoint="TOPRIGHT" x="0" y="4" /> - <Anchor point="BOTTOMLEFT" relativeTo="$parentToolBar" relativePoint="TOPLEFT" x="0" y="4" /> + <Anchor point="BOTTOMRIGHT" /> + <Anchor point="BOTTOMLEFT" /> </Anchors> </Frame> <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND"> diff --git a/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua b/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua index ea016a2..9826ea4 100644 --- a/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua +++ b/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua @@ -903,11 +903,11 @@ function PLUGIN:EnableAnsweringService() self:RegisterEvent("CHAT_MSG_IGNORED") self:RegisterUpdate("PhoneTimeUpdate", 4) - local buttonsize = SV.Dock.Left.ToolBar:GetHeight() + local buttonsize = SV.Dock.BarLeft.ToolBar:GetHeight() local docklet = CreateFrame("Button", nil, UIParent) - docklet:SetParent(SV.Dock.Left.ToolBar) - docklet:Point("LEFT", SV.Dock.Left.Button, "RIGHT", 4, 0) + docklet:SetParent(SV.Dock.BarLeft.ToolBar) + docklet:Point("LEFT", SV.Dock.BarLeft.ToolBar, "LEFT", 0, 0) docklet:Size(buttonsize, buttonsize) docklet:SetFramedButtonTemplate() docklet.Icon = docklet:CreateTexture(nil, "OVERLAY") @@ -917,10 +917,8 @@ function PLUGIN:EnableAnsweringService() docklet.TText = L["Show / Hide Phone Lines"] docklet:RegisterForClicks("AnyUp") - SV.Dock:ActivateDockletButton(docklet, AnsweringOnClick) - local width = SV.Dock.Left.ToolBar:GetWidth() - (buttonsize + 4) - SV.Dock.Left.ToolBar:SetWidth(width) - SV.Dock.Left.ToolBar:Point("LEFT", docklet, "RIGHT", 4, 0) + SV.Dock.BarLeft:Initialize(docklet, AnsweringOnClick) + SV.Dock.BarLeft.ToolBar:SetWidth(buttonsize + 4) self.Docklet = docklet diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua index e5b4776..c0c8fbd 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua @@ -275,7 +275,7 @@ SV.Options.args.Dock.args["rightDockGroup"] = { desc = "Select an addon to occupy the primary docklet window", values = function()return GetLiveDockletsA()end, get = function()return SV.db.Dock.docklets.DockletMain end, - set = function(a,value)SV.db.Dock.docklets.DockletMain = value;MOD:ReloadDocklets()end, + set = function(a,value)SV.db.Dock.docklets.DockletMain = value;MOD:ReloadAddonDocklets()end, }, DockletCombatFade = { type = "toggle", @@ -290,7 +290,7 @@ SV.Options.args.Dock.args["rightDockGroup"] = { name = "Split Docklet", desc = "Split the primary docklet window for 2 addons.", get = function()return SV.db.Dock.docklets.enableExtra end, - set = function(a,value)SV.db.Dock.docklets.enableExtra = value;MOD:ReloadDocklets()end, + set = function(a,value)SV.db.Dock.docklets.enableExtra = value;MOD:ReloadAddonDocklets()end, }, DockletExtra = { type = "select", @@ -300,7 +300,7 @@ SV.Options.args.Dock.args["rightDockGroup"] = { disabled = function()return (not SV.db.Dock.docklets.enableExtra or SV.db.Dock.docklets.DockletMain == "None") end, values = function()return GetLiveDockletsB()end, get = function()return SV.db.Dock.docklets.DockletExtra end, - set = function(a,value)SV.db.Dock.docklets.DockletExtra = value;MOD:ReloadDocklets()end, + set = function(a,value)SV.db.Dock.docklets.DockletExtra = value;MOD:ReloadAddonDocklets()end, } } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua index 32d824c..c9fd9be 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua @@ -154,7 +154,7 @@ SV.Options.args.SVPlate = { type = "toggle", order = 1, name = L["Combat Toggle"], - desc = L["Toggle the nameplates to be visible outside of combat and visible inside combat."], + desc = L["Toggle the nameplates to be invisible outside of combat and visible inside combat."], set = function(d,e)MOD:ChangeDBVar(e,d[#d])MOD:CombatToggle()end }, comboPoints = { diff --git a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua index feea122..11ed0f2 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua @@ -270,7 +270,7 @@ function PLUGIN:EndJobModes() self[currentModeKey].Disable() end currentModeKey = false; - if self.Docklet:IsShown() then self.Docklet.ToolbarButton:Click() end + if self.Docklet:IsShown() then self.Docklet.DockButton:Click() end self:ChangeModeGear() self.ModeAlert:Hide(); SendModeMessage("Mode Disabled", CombatText_StandardScroll, 1, 0.35, 0); diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua b/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua index 512cb54..9a23b35 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/components/archaeology.lua @@ -363,7 +363,7 @@ CORE FUNCTIONS ]]-- function PLUGIN.Archaeology:Enable() PLUGIN.Archaeology:Update() - if(not PLUGIN.Docklet:IsShown()) then PLUGIN.Docklet.ToolbarButton:Click() end + if(not PLUGIN.Docklet:IsShown()) then PLUGIN.Docklet.DockButton:Click() end PlaySoundFile("Sound\\Item\\UseSounds\\UseCrinklingPaper.wav") PLUGIN.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/cooking.lua b/Interface/AddOns/SVUI_CraftOMatic/components/cooking.lua index 0b7f3ff..699cca4 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/components/cooking.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/components/cooking.lua @@ -171,7 +171,7 @@ CORE METHODS ]]-- function PLUGIN.Cooking:Enable() PLUGIN.Cooking:Update() - if(not PLUGIN.Docklet:IsShown()) then PLUGIN.Docklet.ToolbarButton:Click() end + if(not PLUGIN.Docklet:IsShown()) then PLUGIN.Docklet.DockButton:Click() end if(PLUGIN.db.cooking.autoequip) then UpdateChefWear(); end diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua index 8395a29..59e8eca 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua @@ -528,7 +528,7 @@ function PLUGIN:PrepareFarmingTools() local BUTTONSPACE = self.db.farming.buttonspacing or 2; ModeLogsFrame = self.LogWindow; - DockButton = self.Docklet.ToolbarButton + DockButton = self.Docklet.DockButton if not self.db.farming.undocked then local bgTex = [[Interface\BUTTONS\WHITE8X8]] diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/fishing.lua b/Interface/AddOns/SVUI_CraftOMatic/components/fishing.lua index 542449f..8002160 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/components/fishing.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/components/fishing.lua @@ -333,7 +333,7 @@ CORE METHODS ]]-- function PLUGIN.Fishing:Enable() PLUGIN:UpdateFishingMode() - if(not PLUGIN.Docklet:IsShown()) then PLUGIN.Docklet.ToolbarButton:Click() end + if(not PLUGIN.Docklet:IsShown()) then PLUGIN.Docklet.DockButton:Click() end UpdateFishingGear(PLUGIN.db.fishing.autoequip); PlaySoundFile("Sound\\Spells\\Tradeskills\\FishCast.wav") PLUGIN.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index bfba374..ffd66cd 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -345,8 +345,8 @@ local RegisterAddonDocklets = function() end end - if(SV.Dock.Right.ToolBar.AddonButton) then - SV.Dock.Right.ToolBar.AddonButton:SetAttribute("tipText", ("%s%s"):format(tipLeft, tipRight)) + if(SV.Dock.AddonButton) then + SV.Dock.AddonButton:SetAttribute("tipText", ("%s%s"):format(tipLeft, tipRight)) end end --[[ @@ -383,8 +383,8 @@ function PLUGIN:Load() alert:Hide(); self.Alert = alert; - NewHook(SV.Dock, "ReloadDocklets", RegisterAddonDocklets); - SV.Dock:ReloadDocklets(); + NewHook(SV.Dock, "ReloadAddonDocklets", RegisterAddonDocklets); + SV.Dock:ReloadAddonDocklets(); self:RegisterEvent("PLAYER_ENTERING_WORLD"); self:RegisterEvent("ADDON_LOADED"); diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua index 9f0a003..998174e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua @@ -225,15 +225,16 @@ local function AuctionStyle() if(button) then if(buttonTex) then buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - buttonTex:FillInner() end button:RemoveTextures() button:SetButtonTemplate() if(buttonItem) then - buttonItem:SetButtonTemplate() - buttonItem.Panel:SetAllPoints() + buttonItem:RemoveTextures() + buttonItem:SetSlotTemplate(true, 2, 0, 0) + buttonTex:SetParent(buttonItem.Panel) + buttonTex:FillInner(buttonItem.Panel, 2, 2) buttonItem:HookScript("OnUpdate", function() buttonItem:GetNormalTexture():Die() end)