diff --git a/SVUI_!Core/system/_docklets/garrison.lua b/SVUI_!Core/system/_docklets/garrison.lua index 02816d4..def1440 100644 --- a/SVUI_!Core/system/_docklets/garrison.lua +++ b/SVUI_!Core/system/_docklets/garrison.lua @@ -192,9 +192,7 @@ end local function GetBuildingData() local hasBuildings = false local now = time(); - - GameTooltip:AddLine(" ", 1, 1, 1) - GameTooltip:AddLine("Buildings", 1, 0.7, 0) + local prefixed = false; local buildings = C_Garrison.GetBuildings() for i = 1, #buildings do @@ -202,37 +200,34 @@ local function GetBuildingData() local plotID = buildings[i].plotID local id, name, texPrefix, icon, rank, isBuilding, timeStart, buildTime, canActivate, canUpgrade, isPrebuilt = C_Garrison.GetOwnedBuildingInfoAbbrev(plotID) - - local building = ''; - local remaining + local remaining; if(isBuilding) then - building = ("|cffFFFF00%s|r|cff888888 - |r|cffFF5500%s|r"):format(rank, name); local timeLeft = buildTime - (now - timeStart); if(canActivate or timeLeft < 0) then remaining = L["Complete!"] else remaining = ("Building %s"):format(getColoredString("("..SV:ParseSeconds(timeLeft)..")", "lightgrey")) end - GameTooltip:AddDoubleLine(building, remaining, 0, 1, 0, 1, 1, 1) else local name, texture, shipmentCapacity, shipmentsReady, shipmentsTotal, creationTime, duration, timeleftString, itemName, itemIcon, itemQuality, itemID = C_Garrison.GetLandingPageShipmentInfo(buildingID) if(shipmentsReady and shipmentsReady > 0) then - building = ("|cffFFFF00%s|r|cff888888 - |r|cffFF5500%s|r"):format(rank, name); timeleftString = timeleftString or 'Unknown' remaining = ("Ready: %s, Next: %s"):format(getColoredString(shipmentsReady, "green"), getColoredString(timeleftString, "lightgrey")) elseif(timeleftString) then - building = ("|cffFFFF00%s|r|cff888888 - |r|cffFF5500%s|r"):format(rank, name); remaining = ("Next: %s"):format(getColoredString(timeleftString, "lightgrey")) end - GameTooltip:AddDoubleLine(building, remaining, 0, 1, 0, 1, 1, 1) end - hasBuildings = true - end - - if(not hasBuildings) then - GameTooltip:AddLine("None", 1, 0, 0) + if(remaining) then + if(not prefixed) then + GameTooltip:AddLine(" ", 1, 1, 1) + GameTooltip:AddLine("Buildings", 1, 0.7, 0) + prefixed = true + end + local building = ("|cffFF5500%s|r|cff888888 - |r|cffFFFF00Rank %s|r"):format(name, rank); + GameTooltip:AddDoubleLine(building, remaining, 0, 1, 0, 1, 1, 1) + end end end @@ -240,8 +235,12 @@ local SetGarrisonTooltip = function(self) if(not InCombatLockdown()) then C_Garrison.RequestLandingPageShipmentInfo() end local name, amount, tex, week, weekmax, maxed, discovered = GetCurrencyInfo(824) local texStr = ("\124T%s:12\124t %d"):format(tex, amount) - GameTooltip:AddDoubleLine(name, texStr, 0.23, 0.88, 0.27, 1, 1, 1) - + GameTooltip:AddDoubleLine(name, texStr, 1, 1, 0, 1, 1, 1) + GetActiveMissions() + GetBuildingData() + if(self.StopAlert) then + self:StopAlert() + end local text1 = self:GetAttribute("tipText") local text2 = self:GetAttribute("tipExtraText") GameTooltip:AddLine(" ", 1, 1, 1) @@ -250,13 +249,7 @@ local SetGarrisonTooltip = function(self) if(text2) then local remaining = GetDockCooldown(110560) GameTooltip:AddDoubleLine("[Right Click]", text2, 0, 1, 0, 1, 1, 1) - GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 1, 1, 0, 1, 1) - end - - GetActiveMissions() - GetBuildingData() - if(self.StopAlert) then - self:StopAlert() + GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 0.5, 0, 1, 1, 1) end end diff --git a/SVUI_!Core/system/_docklets/misc.lua b/SVUI_!Core/system/_docklets/misc.lua index 4a2d1d8..b554d5b 100644 --- a/SVUI_!Core/system/_docklets/misc.lua +++ b/SVUI_!Core/system/_docklets/misc.lua @@ -107,16 +107,17 @@ end local SetHearthTooltip = function(self) GameTooltip:AddLine(HELPFRAME_STUCK_HEARTHSTONE_HEADER, 1, 1, 0) + GameTooltip:AddLine(" ", 1, 1, 1) local location = GetBindLocation() GameTooltip:AddDoubleLine(LOCATION_COLON, location, 1, 0.5, 0, 1, 1, 1) + if InCombatLockdown() then return end + local remaining = GetMacroCooldown(6948) + GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 0.5, 0, 1, 1, 1) local text1 = self:GetAttribute("tipText") local text2 = self:GetAttribute("tipExtraText") + GameTooltip:AddLine(" ", 1, 1, 1) GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) - if InCombatLockdown() then return end - local remaining = GetMacroCooldown(6948) - GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 1, 1, 0, 1, 1) if(text2) then - GameTooltip:AddLine(" ", 1, 1, 1) GameTooltip:AddDoubleLine("[Right Click]", text2, 0, 1, 0, 1, 1, 1) end end @@ -146,7 +147,8 @@ local SetSpecSwapTooltip = function(self) local otherSpec = GetSpecialization(false, false, otherGroup); local text2 = otherSpec and select(2, GetSpecializationInfo(otherSpec)) or "None" GameTooltip:AddLine(GARRISON_SWITCH_SPECIALIZATIONS, 1, 1, 0) - GameTooltip:AddDoubleLine(activeText, text1, 1, 1, 0, 1, 1, 1) + GameTooltip:AddLine(" ", 1, 1, 1) + GameTooltip:AddDoubleLine(activeText, text1, 1, 0.5, 0, 1, 1, 1) GameTooltip:AddDoubleLine(otherText, text2, 1, 0.5, 0, 1, 1, 1) end @@ -162,9 +164,10 @@ end local SetPowerButtonTooltip = function(self) GameTooltip:AddLine(OTHER .. " " .. OPTIONS_MENU, 1, 1, 0) + GameTooltip:AddLine(" ", 1, 1, 1) GameTooltip:AddDoubleLine("[Click]", LOGOUT, 0, 1, 0, 1, 1, 1) - GameTooltip:AddDoubleLine("[SHIFT + Left Click]", RELOADUI, 1, 1, 0, 1, 1, 1) - GameTooltip:AddDoubleLine("[SHIFT + Right Click]", EXIT_GAME, 1, 0.5, 0, 1, 1, 1) + GameTooltip:AddDoubleLine("[SHIFT + Left Click]", RELOADUI, 0, 1, 0, 1, 1, 1) + GameTooltip:AddDoubleLine("[SHIFT + Right Click]", EXIT_GAME, 0, 1, 0, 1, 1, 1) end local function LoadMiscTools() diff --git a/SVUI_!Core/system/_docklets/profession.lua b/SVUI_!Core/system/_docklets/profession.lua index 6a8aa35..88d3eb5 100644 --- a/SVUI_!Core/system/_docklets/profession.lua +++ b/SVUI_!Core/system/_docklets/profession.lua @@ -98,6 +98,7 @@ local SetMacroTooltip = function(self) local text1 = self:GetAttribute("tipText") local text2 = self:GetAttribute("tipExtraText") GameTooltip:AddLine(text1, 1, 1, 0) + GameTooltip:AddLine(" ", 1, 1, 1) GameTooltip:AddDoubleLine("[Left-Click]", text1, 0, 1, 0, 1, 1, 1) if(text2) then GameTooltip:AddDoubleLine("[Right-Click]", "Use " .. text2, 0, 1, 0, 1, 1, 1) diff --git a/SVUI_!Core/system/dock.lua b/SVUI_!Core/system/dock.lua index a4888bc..687824e 100644 --- a/SVUI_!Core/system/dock.lua +++ b/SVUI_!Core/system/dock.lua @@ -79,9 +79,9 @@ local DOCK_LOCATIONS = { ["TopLeft"] = {1, "LEFT", false, "ANCHOR_BOTTOMLEFT"}, ["TopRight"] = {-1, "RIGHT", false, "ANCHOR_BOTTOMLEFT"}, }; -DOCK_DROPDOWN_OPTIONS["BottomLeft"] = { text = "To BottomLeft", func = function(button) MOD.BottomLeft.Bar:Add(button) end }; -DOCK_DROPDOWN_OPTIONS["BottomRight"] = { text = "To BottomRight", func = function(button) MOD.BottomRight.Bar:Add(button) end }; -DOCK_DROPDOWN_OPTIONS["TopLeft"] = { text = "To TopLeft", func = function(button) MOD.TopLeft.Bar:Add(button) end }; +DOCK_DROPDOWN_OPTIONS["BottomLeft"] = { text = "To BottomLeft", func = function(button) MOD.BottomLeft.Bar:Add(button); end }; +DOCK_DROPDOWN_OPTIONS["BottomRight"] = { text = "To BottomRight", func = function(button) MOD.BottomRight.Bar:Add(button); end }; +DOCK_DROPDOWN_OPTIONS["TopLeft"] = { text = "To TopLeft", func = function(button) MOD.TopLeft.Bar:Add(button); end }; --DOCK_DROPDOWN_OPTIONS["TopRight"] = { text = "To TopRight", func = function(button) MOD.TopRight.Bar:Add(button) end }; --[[ ########################################################## @@ -360,41 +360,30 @@ SET DOCKBAR FUNCTIONS ########################################################## ]]-- local RefreshDockWindows = function(self) - --print('RefreshDockWindows') - local dd = self.Data.Default - local button = _G[dd] - local default - if(button) then - default = button:GetAttribute("ownerFrame") + local default = ''; + if(_G[self.Data.Default]) then + default = _G[self.Data.Default]:GetAttribute("ownerFrame") end for name,window in pairs(self.Data.Windows) do - if(window ~= default) then - if(window.DockButton) then - window.DockButton:Deactivate() - end + if(name ~= default and window.DockButton) then + --print('RefreshDockWindows:'..default.." ~= "..name) + window.DockButton:Deactivate() end end end local RefreshDockButtons = function(self) - -- if(InCombatLockdown()) then - -- self:RegisterEvent("PLAYER_REGEN_ENABLED") - -- return - -- end for name,docklet in pairs(DOCK_REGISTRY) do - if(docklet) then - if(docklet.DockButton) then - docklet.DockButton:Deactivate() - end + if(docklet and docklet.DockButton) then + docklet.DockButton:Deactivate() end end end local GetDefault = function(self) - --print('GetDefault') local default = self.Data.Default local button = _G[default] - if(button) then + if(button and button.Activate) then local window = button:GetAttribute("ownerFrame") if window and _G[window] then self:Refresh() @@ -402,36 +391,54 @@ local GetDefault = function(self) self.Parent.Window:FadeIn() _G[window]:Show() button:Activate() + --print('GetDefault: ' .. default .. " - " .. window .. " - " .. self.Data.Location) end end end -local OldDefault = function(self) - --print('OldDefault') - local default = self.Data.OriginalDefault - local button = _G[default] - if(button) then - local window = button:GetAttribute("ownerFrame") - if window and _G[window] then - self:Refresh() - self.Parent.Window.FrameLink = _G[window] - self.Parent.Window:FadeIn() - _G[window]:Show() - button:Activate() +local NextDefault = function(self) + print('NextDefault '..self.Data.Location) + for i = 1, #self.Data.Order do + local nextName = self.Data.Order[i]; + print(nextName) + local nextButton = self.Data.Buttons[nextName]; + local button = _G[nextButton] + if(button and button.Activate) then + print('Set NextDefault '..nextName) + local window = button:GetAttribute("ownerFrame") + if window and _G[window] then + print(nextName) + self.Data.Default = nextName; + self:Refresh() + self.Parent.Window.FrameLink = _G[window] + self.Parent.Window:FadeIn() + _G[window]:Show() + _G[window]:FadeIn() + button:Activate() + return + end end end end +local DockButtonMakeDefault = function(self) + local name = self:GetName() + --print('DockButtonMakeDefault' .. name) + self.Parent.Data.Default = self:GetName() + self.Parent:GetDefault() +end + local ToggleDockletWindow = function(self, button) - --print('ToggleDockletWindow') local frame = button.FrameLink + self:Refresh() + self:Cycle() if(frame) then self.Parent.Window.FrameLink = frame self.Parent.Window:FadeIn() - self:Cycle() --frame:FadeIn() button:Activate() else + --print('ToggleDockletWindow Failed:' .. self:GetName()) button:Deactivate() self:GetDefault() end @@ -461,7 +468,7 @@ local Docklet_OnShow = function(self) end local Docklet_OnHide = function(self) - --print('Docklet_OnHide') + --print('Docklet_OnHide:' .. self:GetName()) if(self.FrameLink) then if(not InCombatLockdown()) then self.FrameLink:SetFrameLevel(0) @@ -472,16 +479,7 @@ local Docklet_OnHide = function(self) end end -local DockButtonMakeDefault = function(self) - self.Parent.Data.Default = self:GetName() - self.Parent:GetDefault() - if(not self.Parent.Data.OriginalDefault) then - self.Parent.Data.OriginalDefault = self:GetName() - end -end - local DockButtonActivate = function(self) - --print('DockButtonActivate') self:SetAttribute("isActive", true) self:SetPanelColor("default") self.Icon:SetGradient(unpack(SV.media.gradient.checked)) @@ -490,6 +488,7 @@ local DockButtonActivate = function(self) self.FrameLink:SetFrameLevel(10) end self.FrameLink:FadeIn() + --print('DockButtonActivate:' .. self:GetName()) end end @@ -738,27 +737,25 @@ local RefreshBarLayout = function(self) local count = #self.Data.Order; local offset = 1; local safeIndex = 1; - for i = 1, count do - local nextName = self.Data.Order[i]; - local nextButton = self.Data.Buttons[nextName]; - if(nextButton) then - offset = (safeIndex - 1) * (size + 6) + 6 - nextButton:ClearAllPoints(); - nextButton:SetSize(size, size); - nextButton:SetPoint(anchor, self.ToolBar, anchor, (offset * mod), 0); - if(not nextButton:IsShown()) then - nextButton:Show(); + if(count > 0) then + for i = 1, count do + local nextName = self.Data.Order[i]; + local nextButton = self.Data.Buttons[nextName]; + if(nextButton) then + offset = (safeIndex - 1) * (size + 6) + 6 + nextButton:ClearAllPoints(); + nextButton:SetSize(size, size); + nextButton:SetPoint(anchor, self.ToolBar, anchor, (offset * mod), 0); + if(not nextButton:IsShown()) then + nextButton:Show(); + end + nextButton.OrderIndex = safeIndex; + safeIndex = safeIndex + 1; end - nextButton.OrderIndex = safeIndex; - safeIndex = safeIndex + 1; end end self.ToolBar:SetWidth(offset + size); - - if(SV.Dropdown:IsShown()) then - ToggleFrame(SV.Dropdown) - end end local AddToDock = function(self, button) @@ -772,7 +769,7 @@ local AddToDock = function(self, button) if(registeredLocation) then if(registeredLocation ~= currentLocation) then if(MOD[registeredLocation].Bar.Data.Buttons[name]) then - MOD[registeredLocation].Bar:Remove(button); + MOD[registeredLocation].Bar:Remove(button, true); else MOD[registeredLocation].Bar:Add(button); return @@ -797,13 +794,22 @@ local AddToDock = function(self, button) frame:SetParent(self.Parent.Window) frame:InsetPoints(self.Parent.Window) frame.Parent = self.Parent + frame:FadeIn() + if((not self.Data.Default) or (self.Data.Default == "") or (#self.Data.Order == 1)) then + --print('Set New Default: '..name..', TO: '..currentLocation) + self.Data.Default = name + self:GetDefault() + end + end + + if(#self.Data.Order > 0) then + self.Parent.backdrop:Show() end - -- self:UpdateOrder() self:Update() end -local RemoveFromDock = function(self, button) +local RemoveFromDock = function(self, button, isMoving) if not button then return end local name = button:GetName(); local registeredLocation = MOD.private.Locations[name]; @@ -821,17 +827,28 @@ local RemoveFromDock = function(self, button) end end + if((not self.Data.Default) or (self.Data.Default == "") or (self.Data.Default == name) or (#self.Data.Order > 0)) then + --print('Remove Default: '..name..', FROM: '..currentLocation) + self:NextDefault() + end if(not self.Data.Buttons[name]) then return end button:Hide() + button.OrderIndex = 0; if(button.FrameLink) then local frameName = button.FrameLink:GetName() MOD.private.Locations[frameName] = nil; - button.FrameLink:FadeOut(0.2, 1, 0, true) + if(not isMoving) then + button.FrameLink:FadeOut(0.2, 1, 0, true) + end self.Data.Windows[frameName] = nil; end - button.OrderIndex = 0; + if(#self.Data.Order == 0) then + self.Data.Default = ""; + self.Parent.backdrop:Hide() + end + self.Data.Buttons[name] = nil; self:UpdateOrder() self:Update() @@ -848,11 +865,6 @@ local RemoveFromParentDock = function(self) end local ActivateDockletButton = function(self, button, clickFunction, tipFunction, isAction) - button.Activate = DockButtonActivate - button.Deactivate = DockButtonDeactivate - button.MakeDefault = DockButtonMakeDefault - button.GetMenuList = GetDockablePositions - button.DockAdd = AddToParentDock button.DockRemove = RemoveFromParentDock @@ -876,7 +888,7 @@ local ActivateDockletButton = function(self, button, clickFunction, tipFunction, end end -local CreateBasicToolButton = function(self, displayName, texture, onclick, globalName, tipFunction, primaryTemplate) +local CreateBasicToolButton = function(self, displayName, texture, onclick, globalName, tipFunction, primaryTemplate, frameLink) local dockIcon = texture or [[Interface\AddOns\SVUI_!Core\assets\textures\Dock\DOCK-ICON-ADDON]]; local size = self.ToolBar:GetHeight(); local template = "SVUI_DockletButtonTemplate" @@ -893,9 +905,19 @@ local CreateBasicToolButton = function(self, displayName, texture, onclick, glob button.Icon:SetTexture(dockIcon) button:SetAttribute("tipText", displayName) button:SetAttribute("tipAnchor", self.Data.TipAnchor) - button:SetAttribute("ownerFrame", globalName) button.OrderIndex = 0; + button.Activate = DockButtonActivate + button.Deactivate = DockButtonDeactivate + button.MakeDefault = DockButtonMakeDefault + button.GetMenuList = GetDockablePositions + + if(frameLink) then + button.FrameLink = frameLink + button:SetAttribute("ownerFrame", frameLink:GetName()) + else + button:SetAttribute("ownerFrame", globalName) + end self:Add(button) self:Initialize(button, onclick, tipFunction, primaryTemplate) @@ -925,7 +947,7 @@ for location, settings in pairs(DOCK_LOCATIONS) do MOD[location].Bar.Refresh = RefreshDockButtons; MOD[location].Bar.Cycle = RefreshDockWindows; MOD[location].Bar.GetDefault = GetDefault; - MOD[location].Bar.UnsetDefault = OldDefault; + MOD[location].Bar.NextDefault = NextDefault; MOD[location].Bar.Toggle = ToggleDockletWindow; MOD[location].Bar.Update = RefreshBarLayout; MOD[location].Bar.UpdateOrder = RefreshBarOrder; @@ -1034,8 +1056,7 @@ function MOD:NewDocklet(location, globalName, readableName, texture, onclick) newParent.Bar.Data.Windows[globalName] = frame; local buttonName = ("%sButton"):format(globalName) - frame.DockButton = newParent.Bar:Create(readableName, texture, onclick, buttonName); - frame.DockButton.FrameLink = frame + frame.DockButton = newParent.Bar:Create(readableName, texture, onclick, buttonName, false, false, frame); DOCK_REGISTRY[globalName] = frame; frame:SetAlpha(0) DOCK_CHECK = true @@ -1137,22 +1158,20 @@ function MOD:Refresh() local spacing = SV.db.Dock.buttonSpacing; for location, settings in pairs(DOCK_LOCATIONS) do - if(location ~= "TopRight") then - local width, height = self:GetDimensions(location); - local dock = self[location]; + local width, height = self:GetDimensions(location); + local dock = self[location]; - dock.Bar:SetSize(width, buttonsize) - dock.Bar.ToolBar:SetHeight(buttonsize) - dock:SetSize(width, height) - dock.Alert:SetSize(width, 1) - dock.Window:SetSize(width, height) + dock.Bar:SetSize(width, buttonsize) + dock.Bar.ToolBar:SetHeight(buttonsize) + dock:SetSize(width, height) + dock.Alert:SetSize(width, 1) + dock.Window:SetSize(width, height) - if(dock.Bar.Button) then - dock.Bar.Button:SetSize(buttonsize, buttonsize) - end + if(dock.Bar.Button) then + dock.Bar.Button:SetSize(buttonsize, buttonsize) + end - dock.Bar:Update() - end + dock.Bar:Update() end local centerWidth = SV.db.Dock.dockCenterWidth; @@ -1271,40 +1290,37 @@ function MOD:Load() dock.Bar.ToolBar:ClearAllPoints() if(dock.Bar.Button) then - dock.Bar.Button:SetSize(buttonsize, buttonsize) - self:SetButtonTheme(dock.Bar.Button, buttonsize) - dock.Bar.Button.Icon:SetTexture(SV.media.icon.default) - dock.Bar.ToolBar:SetSize(1, buttonsize) - dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar.Button, barReverse, (spacing * mod), 0) - InitDockButton(dock.Bar.Button, location) - else - dock.Bar.ToolBar:SetSize(1, buttonsize) - dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar, barAnchor, 0, 0) - end - - dock:SetParent(SV.Screen) - dock:ClearAllPoints() - dock:SetPoint(anchor, dock.Bar, reverse, 0, (12 * vertMod)) - dock:SetSize(width, height) - dock:SetAttribute("buttonSize", buttonsize) - dock:SetAttribute("spacingSize", spacing) - - dock.Alert:ClearAllPoints() - dock.Alert:SetSize(width, 1) - dock.Alert:SetPoint(anchor, dock, anchor, 0, 0) - - dock.Window:ClearAllPoints() - dock.Window:SetSize(width, height) - dock.Window:SetPoint(anchor, dock.Alert, reverse, 0, (4 * vertMod)) - - if(isBottom) then - dock.backdrop = self.SetThemeDockStyle(dock.Window, isBottom) - dock.backdrop:Hide() - dock.Alert.backdrop = self.SetThemeDockStyle(dock.Alert, isBottom) - dock.Alert.backdrop:Hide() - SV:NewAnchor(dock.Bar, location .. " Dock ToolBar"); - SV:NewAnchor(dock, location .. " Dock Window") - end + dock.Bar.Button:SetSize(buttonsize, buttonsize) + self:SetButtonTheme(dock.Bar.Button, buttonsize) + dock.Bar.Button.Icon:SetTexture(SV.media.icon.default) + dock.Bar.ToolBar:SetSize(1, buttonsize) + dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar.Button, barReverse, (spacing * mod), 0) + InitDockButton(dock.Bar.Button, location) + else + dock.Bar.ToolBar:SetSize(1, buttonsize) + dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar, barAnchor, 0, 0) + end + + dock:SetParent(SV.Screen) + dock:ClearAllPoints() + dock:SetPoint(anchor, dock.Bar, reverse, 0, (12 * vertMod)) + dock:SetSize(width, height) + dock:SetAttribute("buttonSize", buttonsize) + dock:SetAttribute("spacingSize", spacing) + + dock.Alert:ClearAllPoints() + dock.Alert:SetSize(width, 1) + dock.Alert:SetPoint(anchor, dock, anchor, 0, 0) + + dock.Window:ClearAllPoints() + dock.Window:SetSize(width, height) + dock.Window:SetPoint(anchor, dock.Alert, reverse, 0, (4 * vertMod)) + dock.backdrop = self.SetThemeDockStyle(dock.Window, isBottom) + dock.backdrop:Hide() + dock.Alert.backdrop = self.SetThemeDockStyle(dock.Alert, isBottom) + dock.Alert.backdrop:Hide() + SV:NewAnchor(dock.Bar, location .. " Dock ToolBar"); + SV:NewAnchor(dock, location .. " Dock Window") end if MOD.private.LeftFaded then MOD.BottomLeft:Hide() end diff --git a/SVUI_!Core/system/layout.lua b/SVUI_!Core/system/layout.lua index 72a3d99..05ed81a 100644 --- a/SVUI_!Core/system/layout.lua +++ b/SVUI_!Core/system/layout.lua @@ -714,7 +714,7 @@ function Layout:Reset(request, bypass) end else for frameName, frameData in pairs(self.Frames) do - if(frameData.layoutString and (request == frameData.text)) then + if(frameData.layoutString and (request == frameName or request == frameData.text)) then local frame = _G[frameName] local anchor1, anchorParent, anchor2, xPos, yPos, width, height = LayoutParser(frameData.layoutString) frame:ClearAllPoints() diff --git a/SVUI_!Core/system/utilities.lua b/SVUI_!Core/system/utilities.lua index a3cde67..5c62a99 100644 --- a/SVUI_!Core/system/utilities.lua +++ b/SVUI_!Core/system/utilities.lua @@ -123,12 +123,11 @@ function SV:DisbandRaidGroup() end function SV:PlayerInfoUpdate() - local specID = GetInspectSpecialization(); - local roleToken = GetSpecializationRoleByID(specID); - local spec = GetSpecialization(); - if spec then self.CurrentSpec = spec end + if not spec then return end + self.CurrentSpec = spec + local roleToken = GetSpecializationRole(spec); local actualRole = roleToken; if(roleToken == "DAMAGER") then local intellect = select(2, UnitStat("player", 4)) diff --git a/SVUI_!Core/xml/widgets.xml b/SVUI_!Core/xml/widgets.xml index 474530c..250e4b7 100644 --- a/SVUI_!Core/xml/widgets.xml +++ b/SVUI_!Core/xml/widgets.xml @@ -160,7 +160,7 @@ <Size x="50" y="17"/> <Anchors> <Anchor point="BOTTOMRIGHT" relativeTo="$parentBG" relativePoint="CENTER"> - <Offset x="-45" y="3"/> + <Offset x="-36" y="3"/> </Anchor> </Anchors> @@ -183,7 +183,7 @@ <Size x="50" y="17"/> <Anchors> <Anchor point="BOTTOMLEFT" relativeTo="$parentBG" relativePoint="CENTER"> - <Offset x="45" y="3"/> + <Offset x="36" y="3"/> </Anchor> </Anchors> <Scripts> diff --git a/SVUI_Maps/Loader.lua b/SVUI_Maps/Loader.lua index abd87aa..50307cb 100644 --- a/SVUI_Maps/Loader.lua +++ b/SVUI_Maps/Loader.lua @@ -113,8 +113,8 @@ function MOD:LoadOptions() type = "range", name = L["Size"], desc = L['Adjust the size of the minimap.'], - min = 120, - max = 240, + min = 100, + max = 1000, width = "full", step = 1 }, diff --git a/SVUI_NamePlates/Loader.lua b/SVUI_NamePlates/Loader.lua index 05b1cc3..d2f664b 100644 --- a/SVUI_NamePlates/Loader.lua +++ b/SVUI_NamePlates/Loader.lua @@ -263,7 +263,8 @@ function MOD:LoadOptions() colorNameByValue = { type = "toggle", order = 4, - name = L["Color Name By Health Value"] + name = L["Color Name By Health Value"], + width = 'full', }, showthreat = { type = "toggle", @@ -284,13 +285,20 @@ function MOD:LoadOptions() order = 7, name = L["Non-Target Alpha"], desc = L["Alpha of nameplates that are not your current target."], + width = 'full', min = 0, max = 1, step = 0.01, isPercent = true }, + spacer1 = { + order = 8, + type = "description", + name = "", + width = "full", + }, reactions = { - order = 200, + order = 9, type = "group", name = L["Reaction Coloring"], guiInline = true, @@ -336,15 +344,18 @@ function MOD:LoadOptions() type = "color", hasAlpha = false }, - spacer1 = { - order = 6, - type = "description", - name = "", - width = "full", - }, + } + }, + threat = { + type = "group", + name = L["Threat Coloring"], + guiInline = true, + order = 10, + disabled = function(key) return not SV.db[Schema].threat.enable end, + args = { enable = { type = "toggle", - order = 7, + order = 1, name = L["Enable Threat Coloring"], width = "full", get = function(key)return SV.db[Schema].threat.enable end, @@ -352,7 +363,7 @@ function MOD:LoadOptions() }, goodColor = { type = "color", - order = 8, + order = 2, name = L["Good Threat"], hasAlpha = false, disabled = function(key) return not SV.db[Schema].threat.enable end, @@ -369,7 +380,7 @@ function MOD:LoadOptions() }, badColor = { name = L["Bad Threat"], - order = 9, + order = 3, type = "color", hasAlpha = false, disabled = function(key) return not SV.db[Schema].threat.enable end, @@ -386,7 +397,7 @@ function MOD:LoadOptions() }, goodTransitionColor = { name = L["Good Threat Transition"], - order = 10, + order = 4, type = "color", hasAlpha = false, disabled = function(key) return not SV.db[Schema].threat.enable end, @@ -403,7 +414,7 @@ function MOD:LoadOptions() }, badTransitionColor = { name = L["Bad Threat Transition"], - order = 11, + order = 5, type = "color", hasAlpha = false, disabled = function(key) return not SV.db[Schema].threat.enable end, @@ -418,37 +429,39 @@ function MOD:LoadOptions() MOD:UpdateAllPlates() end, }, - scaling = { - type = "group", - name = L["Threat Scaling"], - guiInline = true, - order = 12, - disabled = function(key) return not SV.db[Schema].threat.enable end, - args = { - goodScale = { - type = "range", - name = L["Good"], - order = 1, - min = 0.5, - max = 1.5, - step = 0.01, - isPercent = true, - get = function(key)return SV.db[Schema].threat.goodScale end, - set = function(key,value) SV.db[Schema].threat.goodScale = value; MOD:UpdateAllPlates() end, - }, - badScale = { - type = "range", - name = L["Bad"], - order = 1, - min = 0.5, - max = 1.5, - step = 0.01, - isPercent = true, - get = function(key)return SV.db[Schema].threat.badScale end, - set = function(key,value) SV.db[Schema].threat.badScale = value; MOD:UpdateAllPlates() end, - } - } + } + }, + scaling = { + type = "group", + name = L["Threat Scaling"], + guiInline = true, + order = 11, + disabled = function(key) return not SV.db[Schema].threat.enable end, + args = { + goodScale = { + type = "range", + name = L["Good"], + order = 1, + min = 0.5, + max = 1.5, + step = 0.01, + width = 'full', + isPercent = true, + get = function(key)return SV.db[Schema].threat.goodScale end, + set = function(key,value) SV.db[Schema].threat.goodScale = value; MOD:UpdateAllPlates() end, }, + badScale = { + type = "range", + name = L["Bad"], + order = 1, + min = 0.5, + max = 1.5, + step = 0.01, + width = 'full', + isPercent = true, + get = function(key)return SV.db[Schema].threat.badScale end, + set = function(key,value) SV.db[Schema].threat.badScale = value; MOD:UpdateAllPlates() end, + } } }, } diff --git a/SVUI_NamePlates/SVUI_NamePlates.lua b/SVUI_NamePlates/SVUI_NamePlates.lua index 726e8d2..dfbb86d 100644 --- a/SVUI_NamePlates/SVUI_NamePlates.lua +++ b/SVUI_NamePlates/SVUI_NamePlates.lua @@ -1491,27 +1491,7 @@ UPDATE AND BUILD ########################################################## ]]-- local function PlayerRoleUpdate() - local tc = SV.db.NamePlates.threat - NPUseThreat = tc.enable; - NPThreatGS = tc.goodScale; - NPThreatBS = tc.badScale; - if(SV.ClassRole == 'TANK') then - CONFIG_THREAT_HOSTILE = { - {tc.badColor[1], tc.badColor[2], tc.badColor[3]}, - {tc.badTransitionColor[1], tc.badTransitionColor[2], tc.badTransitionColor[3]}, - {tc.goodTransitionColor[1], tc.goodTransitionColor[2], tc.goodTransitionColor[3]}, - {tc.goodColor[1], tc.goodColor[2], tc.goodColor[3]} - }; - CONFIG_THREAT_SCALE = { NPThreatBS, NPThreatBS, NPThreatGS, NPThreatGS }; - else - CONFIG_THREAT_HOSTILE = { - {tc.goodColor[1], tc.goodColor[2], tc.goodColor[3]}, - {tc.goodTransitionColor[1], tc.goodTransitionColor[2], tc.goodTransitionColor[3]}, - {tc.badTransitionColor[1], tc.badTransitionColor[2], tc.badTransitionColor[3]}, - {tc.badColor[1], tc.badColor[2], tc.badColor[3]} - }; - CONFIG_THREAT_SCALE = { NPThreatGS, NPThreatGS, NPThreatBS, NPThreatBS }; - end + MOD:UpdateAllPlates() end function MOD:UpdateLocals() @@ -1564,7 +1544,27 @@ function MOD:UpdateLocals() AuraFilterName = db.auras.additionalFilter AuraFilter = SV.db.Filters[AuraFilterName] - PlayerRoleUpdate() + local tc = SV.db.NamePlates.threat + NPUseThreat = tc.enable; + NPThreatGS = tc.goodScale; + NPThreatBS = tc.badScale; + if(SV.ClassRole == 'TANK') then + CONFIG_THREAT_HOSTILE = { + {tc.badColor[1], tc.badColor[2], tc.badColor[3]}, + {tc.badTransitionColor[1], tc.badTransitionColor[2], tc.badTransitionColor[3]}, + {tc.goodTransitionColor[1], tc.goodTransitionColor[2], tc.goodTransitionColor[3]}, + {tc.goodColor[1], tc.goodColor[2], tc.goodColor[3]} + }; + CONFIG_THREAT_SCALE = { NPThreatBS, NPThreatBS, NPThreatGS, NPThreatGS }; + else + CONFIG_THREAT_HOSTILE = { + {tc.goodColor[1], tc.goodColor[2], tc.goodColor[3]}, + {tc.goodTransitionColor[1], tc.goodTransitionColor[2], tc.goodTransitionColor[3]}, + {tc.badTransitionColor[1], tc.badTransitionColor[2], tc.badTransitionColor[3]}, + {tc.badColor[1], tc.badColor[2], tc.badColor[3]} + }; + CONFIG_THREAT_SCALE = { NPThreatGS, NPThreatGS, NPThreatBS, NPThreatBS }; + end if(not db.themed) then PLATE_TOP = SV.NoTexture @@ -1626,5 +1626,5 @@ function MOD:Load() self:RegisterEvent("UPDATE_MOUSEOVER_UNIT") WorldFrame:HookScript('OnUpdate', WorldFrameUpdateHook) self:CombatToggle(true) - SV.Events:On("PLAYER_ROLE_CHANGED", PlayerRoleUpdate) + SV.Events:On("PLAYER_ROLE_CHANGED", PlayerRoleUpdate, true) end diff --git a/SVUI_QuestTracker/SVUI_QuestTracker.lua b/SVUI_QuestTracker/SVUI_QuestTracker.lua index 53dc50a..f20788c 100644 --- a/SVUI_QuestTracker/SVUI_QuestTracker.lua +++ b/SVUI_QuestTracker/SVUI_QuestTracker.lua @@ -493,7 +493,7 @@ function MOD:Load() self:InitializeAchievements() self:UpdateDimensions(); - self.Docklet.DockButton:MakeDefault(); + --self.Docklet.DockButton:MakeDefault(); self.Docklet:Show(); ObjectiveTrackerFrame:UnregisterAllEvents(); diff --git a/SVUI_Skins/components/blizzard/trainer.lua b/SVUI_Skins/components/blizzard/trainer.lua index 067d377..fb8b3e1 100644 --- a/SVUI_Skins/components/blizzard/trainer.lua +++ b/SVUI_Skins/components/blizzard/trainer.lua @@ -78,8 +78,8 @@ local function TrainerStyle() ClassTrainerFrameSkillStepButtonHighlight:SetTexture(1, 1, 1, 0.3) ClassTrainerFrameSkillStepButton.selectedTex:SetTexture(1, 1, 1, 0.3) ClassTrainerStatusBar:RemoveTextures() - ClassTrainerStatusBar:SetStatusBarTexture(SV.media.statusbar.default) - ClassTrainerStatusBar:SetStyle("Frame", "Icon", true, 1, 2, 2) + ClassTrainerStatusBar:SetStatusBarTexture(SV.media.statusbar.gradient) + ClassTrainerStatusBar:SetStyle("Frame", "Inset", true, 1, 2, 2) ClassTrainerStatusBar.rankText:ClearAllPoints() ClassTrainerStatusBar.rankText:SetPoint("CENTER", ClassTrainerStatusBar, "CENTER") end diff --git a/SVUI_Skins/components/docklet.lua b/SVUI_Skins/components/docklet.lua index 64b7728..1d70105 100644 --- a/SVUI_Skins/components/docklet.lua +++ b/SVUI_Skins/components/docklet.lua @@ -423,9 +423,6 @@ function MOD:RegisterAddonDocklets() self.Docklet.Dock1:Hide() self.Docklet.Dock2:Hide() self.Docklet:Disable() - - self.Docklet.Parent.Bar:UnsetDefault(); - --Librarian:UnlockLibrary('LibWindow'); end end