diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua index 7ad3739..af90859 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/modules/Registry.lua @@ -915,6 +915,39 @@ local Core_NewScript = function(self, fn) end end +local Core_NewSubClass = function(self, schema, header) + if(self[schema]) then return end + + AllowedIndexes[schema] = schema + + local addonName = ("SVUI [%s]"):format(schema) + + local obj = { + NameID = addonName, + TitleID = header, + Schema = schema, + initialized = false, + CombatLocked = false, + ChangeDBVar = changeDBVar, + RegisterEvent = registerEvent, + UnregisterEvent = unregisterEvent, + RegisterUpdate = registerUpdate, + UnregisterUpdate = unregisterUpdate + } + + local addonmeta = {} + local oldmeta = getmetatable(obj) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end + end + addonmeta.__tostring = rootstring + setmetatable( obj, addonmeta ) + + self[schema] = obj + + return self[schema] +end + local Core_NewPackage = function(self, schema, header) if(self[schema]) then return end @@ -1018,6 +1051,7 @@ function lib:NewCore(gfile, efile, pfile, cfile) CoreObject.NewCallback = Core_NewCallback CoreObject.NewScript = Core_NewScript CoreObject.NewPackage = Core_NewPackage + CoreObject.NewSubClass = Core_NewSubClass CoreObject.ResetData = Core_ResetData CoreObject.db = tablesplice(CoreObject.configs, {}) diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index c5b8ceb..8182579 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -711,8 +711,8 @@ do local tabText = _G[name.."TabText"] _modifyChat(chat, tabText) tab.owner = chat; + chat:SetParent(SV.Dock.Left.Window) if not chat.isDocked and chat:IsShown() then - chat:SetParent(UIParent) chat.Panel:Show() if(not TAB_SKINS) then tab.isDocked = chat.isDocked; @@ -729,13 +729,10 @@ do else chat.Panel:Hide() if id == 1 then - chat:ClearAllPoints() - chat:SetWidth(CHAT_WIDTH) - chat:SetHeight(CHAT_HEIGHT) - chat:SetPoint("BOTTOMRIGHT", SVUI_DockLeftWindow, "BOTTOMRIGHT", 0, 0) FCF_SavePositionAndDimensions(chat) end - chat:SetParent(SVUI_DockLeftWindow) + chat:ClearAllPoints() + chat:SetAllPoints(SV.Dock.Left.Window) if(not TAB_SKINS) then tab.owner = chat; tab.isDocked = chat.isDocked; @@ -968,8 +965,6 @@ 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) diff --git a/Interface/AddOns/SVUI/system/docks.lua b/Interface/AddOns/SVUI/system/docks.lua index 99c7e63..b53e326 100644 --- a/Interface/AddOns/SVUI/system/docks.lua +++ b/Interface/AddOns/SVUI/system/docks.lua @@ -93,7 +93,7 @@ local HEARTH_SPELLS = {556,50977,18960,126892} DOCKING ########################################################## ]]-- -local Dock = SV:NewPackage("Dock", L["Screen Docks"]); +local Dock = SV:NewSubClass("Dock", L["Docks"]); Dock.Docklets = { Windows = {}, @@ -182,6 +182,9 @@ local ToggleDockletWindow = function(self, button) end window:Show() + if(Dock.AddonButton:IsShown()) then + Dock.AddonButton:Deactivate() + end button:Activate() else button:Deactivate() @@ -322,12 +325,6 @@ local DockletButton_OnClick = function(self, button) SetFilterMenu(self); else if self.PostClickFunction then - if(self:GetAttribute("isActive")) then - self:Deactivate() - self.Parent:GetDefault() - else - self:Activate() - end self:PostClickFunction() else self.Parent:Toggle(self) @@ -365,6 +362,7 @@ local AddonDockletToggle = function(self) addonDock1:Show() end self:Deactivate() + self.Parent:Refresh() end if SV.db.Dock.docklets.enableExtra and addonDock2.FrameName and _G[addonDock2.FrameName] then if not _G[addonDock2.FrameName]:IsShown() then @@ -387,6 +385,7 @@ local AddonDockletToggle = function(self) addonDock1:Hide() end self:Deactivate() + self.Parent:Refresh() end else addonDock2.FrameName = "None" @@ -512,19 +511,19 @@ local function SetSuperDockStyle(dock) 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: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: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: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) @@ -603,7 +602,7 @@ function Dock:CreateDockPanels() 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.BarLeft.ExtraBar:Size(leftWidth, buttonsize) self.Left:SetParent(SV.Screen) self.Left:SetPoint("BOTTOMLEFT", self.BarLeft, "TOPLEFT", 0, 12) @@ -632,6 +631,8 @@ function Dock:CreateDockPanels() self.BarRight.Button:RegisterForClicks("AnyUp") self.BarRight.ToolBar:Point("RIGHT", self.BarRight.Button, "LEFT", -spacing, 0) self.BarRight.ToolBar:Height(buttonsize) + self.BarRight.ExtraBar:Point("RIGHT", self.BarRight.ToolBar, "LEFT", -spacing, 0) + self.BarRight.ExtraBar:Size(rightWidth, buttonsize) self.Right:SetParent(SV.Screen) self.Right:Point("BOTTOMRIGHT", self.BarRight, "TOPRIGHT", 0, 12) @@ -845,7 +846,7 @@ do hearth.Icon:SetTexCoord(0,0.5,0,1) hearth:RegisterForClicks("AnyUp") hearth:SetAttribute("type", "item") - hearth:SetAttribute("item", L["Hearthstone"]) + hearth:SetAttribute("item", GetItemInfo(6948)) hearth.CustomTooltip = SetHearthTooltip hearth:SetPanelColor("default") diff --git a/Interface/AddOns/SVUI/xml/framework.xml b/Interface/AddOns/SVUI/xml/framework.xml index a5b355c..5c4753c 100644 --- a/Interface/AddOns/SVUI/xml/framework.xml +++ b/Interface/AddOns/SVUI/xml/framework.xml @@ -70,7 +70,7 @@ <Frame name="$parentExtraBar" parentKey="ExtraBar"> <Size x="1" y="22"/> <Anchors> - <Anchor point="BOTTOMLEFT" relativeTo="$parentToolBar" relativePoint="BOTTOMRIGHT" x="-4" y="0" /> + <Anchor point="BOTTOMLEFT" relativeTo="$parentToolBar" relativePoint="BOTTOMRIGHT" x="4" y="0" /> </Anchors> </Frame> </Frames> @@ -88,8 +88,8 @@ <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> <Size y="1"/> <Anchors> - <Anchor point="BOTTOMLEFT" /> - <Anchor point="BOTTOMRIGHT" /> + <Anchor point="BOTTOMLEFT" x="0" y="4" /> + <Anchor point="BOTTOMRIGHT" x="0" y="4" /> </Anchors> </Frame> <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND"> @@ -162,8 +162,8 @@ <Frame name="$parentAlert" parentKey="Alert" frameStrata="BACKGROUND"> <Size y="1"/> <Anchors> - <Anchor point="BOTTOMRIGHT" /> - <Anchor point="BOTTOMLEFT" /> + <Anchor point="BOTTOMRIGHT" x="0" y="4" /> + <Anchor point="BOTTOMLEFT" x="0" y="4" /> </Anchors> </Frame> <Frame name="$parentWindow" parentKey="Window" frameStrata="BACKGROUND">