diff --git a/SVUI_!Core/system/alerts.lua b/SVUI_!Core/system/alerts.lua index 3336664..0e5404e 100644 --- a/SVUI_!Core/system/alerts.lua +++ b/SVUI_!Core/system/alerts.lua @@ -997,7 +997,7 @@ local function LoadSystemAlerts() SVUI_AlertFrame:SetSize(180, 20); SVUI_AlertFrame.callbackOnEnter = true; - SV:NewAnchor(SVUI_AlertFrame, L["Loot / Alert Frames"], nil, AlertFramePostMove_Hook, nil) + SV:NewAnchor(SVUI_AlertFrame, L["Loot / Alert Frames"], AlertFramePostMove_Hook) NewHook('AlertFrame_FixAnchors', AlertFramePostMove_Hook) NewHook('AlertFrame_SetLootAnchors', _hook_AlertFrame_SetLootAnchors) diff --git a/SVUI_!Core/system/core.lua b/SVUI_!Core/system/core.lua index 1821a7d..11f4f23 100644 --- a/SVUI_!Core/system/core.lua +++ b/SVUI_!Core/system/core.lua @@ -370,6 +370,10 @@ SV.defaults = { ["dockLeftHeight"] = 224, ["dockRightWidth"] = 412, ["dockRightHeight"] = 224, + ["dockTopLeftWidth"] = 412, + ["dockTopLeftHeight"] = 224, + ["dockTopRightWidth"] = 412, + ["dockTopRightHeight"] = 224, ["dockCenterWidth"] = defaultCenterWidth, ["dockCenterHeight"] = 20, ["buttonSize"] = 30, diff --git a/SVUI_!Core/system/dock.lua b/SVUI_!Core/system/dock.lua index a9571c6..c41ca05 100644 --- a/SVUI_!Core/system/dock.lua +++ b/SVUI_!Core/system/dock.lua @@ -93,24 +93,79 @@ MOD.ErrorSound = SV.Sounds:Blend("Malfunction", "Sparks", "Wired"); local function GetDockDimensions(location) local width, height; - - if(location:find("Left")) then - width = SV.db.Dock.dockLeftWidth; - height = SV.db.Dock.dockLeftHeight; - if(MOD.private.LeftExpanded) then - height = height + 300 + local isTop = location:find("Top") + local isLeft = location:find("Left") + if(isTop) then + if(isLeft) then + width = SV.db.Dock.dockTopLeftWidth; + height = SV.db.Dock.dockTopLeftHeight; + else + width = SV.db.Dock.dockTopRightWidth; + height = SV.db.Dock.dockTopRightHeight; end else - width = SV.db.Dock.dockRightWidth; - height = SV.db.Dock.dockRightHeight; - if(MOD.private.RightExpanded) then - height = height + 300 + if(isLeft) then + width = SV.db.Dock.dockLeftWidth; + height = SV.db.Dock.dockLeftHeight; + if(MOD.private.LeftExpanded) then + height = height + 300 + end + else + width = SV.db.Dock.dockRightWidth; + height = SV.db.Dock.dockRightHeight; + if(MOD.private.RightExpanded) then + height = height + 300 + end end end return width, height; end +local function SetDockDimensions(location, width, height, buttonSize) + local isTop = location:find("Top") + local isLeft = location:find("Left") + if(isTop) then + if(isLeft) then + SV.db.Dock.dockTopLeftWidth = width; + if(not buttonSize) then + SV.db.Dock.dockTopLeftHeight = height; + end + else + SV.db.Dock.dockTopRightWidth = width; + if(not buttonSize) then + SV.db.Dock.dockTopRightHeight = height; + end + end + else + if(isLeft) then + SV.db.Dock.dockLeftWidth = width; + if(not buttonSize) then + SV.db.Dock.dockLeftHeight = height; + end + else + SV.db.Dock.dockRightWidth = width; + if(not buttonSize) then + SV.db.Dock.dockRightHeight = height; + end + end + end + + if(buttonSize) then + SV.db.Dock.buttonSize = height; + end +end + +local dockPostSizeFunc = function(self, width, height) + local name = self:GetName() + SetDockDimensions(name, width, height) +end + +local dockBarPostSizeFunc = function(self, width, height) + local name = self:GetName() + SetDockDimensions(name, width, height, true) +end + local function ScreenBorderVisibility() if SV.db.Dock.bottomPanel then SVUIDock_BottomBorder:Show() @@ -504,8 +559,9 @@ local function ResetAllDockletWindows(dockbar, button) local currentButton = ""; if(button and button.GetName) then currentButton = button:GetName() + else + dockbar.Parent.backdrop:Hide(); end - dockbar.Parent.backdrop:Hide(); for nextName,nextButton in pairs(buttonList) do if(nextName ~= currentButton) then if(nextButton.FrameLink) then @@ -546,8 +602,8 @@ local DockBar_SetDefault = function(self, button, isAdvanced) self.Parent.Window.FrameLink = button.FrameLink; self.Parent.Window:Show(); self.Parent.Window:FadeIn(); - self.Parent.backdrop:Show(); if(ShowDockletWindow(button, location)) then + self.Parent.backdrop:Show(); ActivateDockletButton(button); return true; end @@ -567,8 +623,8 @@ local DockBar_NextDefault = function(self) self.Parent.Window.FrameLink = button.FrameLink; self.Parent.Window:Show(); self.Parent.Window:FadeIn(); - self.Parent.backdrop:Show(); if(ShowDockletWindow(button, location)) then + self.Parent.backdrop:Show(); ActivateDockletButton(button); return; end @@ -829,7 +885,7 @@ local DockButton_OnClick = function(self, button) self:ClickTheme() end MOD.ButtonSound() - if(button and button == "RightButton") then + if(button and (button == "RightButton") and (not IsShiftKeyDown())) then self.Parent.Parent.backdrop:Hide() self:SetAttribute("isActive", false) self:SetPanelColor("default") @@ -1418,7 +1474,9 @@ function MOD:Load() dock.Alert.backdrop:Hide() SV:NewAnchor(dock.Bar, location .. " Dock ToolBar"); - SV:NewAnchor(dock, location .. " Dock Window") + SV:SetAnchorResizing(dock.Bar, dockBarPostSizeFunc, 10, 500, 10, 80); + SV:NewAnchor(dock, location .. " Dock Window"); + SV:SetAnchorResizing(dock, dockPostSizeFunc, 10, 500); 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 a5ad8c0..c058925 100644 --- a/SVUI_!Core/system/layout.lua +++ b/SVUI_!Core/system/layout.lua @@ -430,6 +430,27 @@ HANDLERS ]]-- local LayoutUpdateHandler = CreateFrame("Frame", nil) +local function SetPrecisionSizes() + if(not CurrentFrameTarget) then return end + if(not CurrentFrameTarget.postsize) then + SVUI_LayoutPrecision:SetHeight(144) + local minRange = CurrentFrameTarget.minRange or 0; + local maxRange = CurrentFrameTarget.maxRange or 500; + local min2Range = CurrentFrameTarget.min2Range or minRange; + local max2Range = CurrentFrameTarget.max2Range or maxRange; + SVUI_LayoutPrecisionWidthAdjust.rangeLow:SetText(minRange); + SVUI_LayoutPrecisionWidthAdjust.rangeHigh:SetText(maxRange); + SVUI_LayoutPrecisionHeightAdjust.rangeLow:SetText(min2Range); + SVUI_LayoutPrecisionHeightAdjust.rangeHigh:SetText(max2Range); + SVUI_LayoutPrecisionWidthAdjust:Show() + SVUI_LayoutPrecisionHeightAdjust:Show() + else + SVUI_LayoutPrecision:SetHeight(70) + SVUI_LayoutPrecisionWidthAdjust:Hide() + SVUI_LayoutPrecisionHeightAdjust:Hide() + end +end + function Layout:Movable_OnMouseUp() if(not SVUI_LayoutPrecision) then return end; CurrentFrameTarget = self; @@ -479,6 +500,7 @@ function Layout:Movable_OnUpdate() else SVUI_LayoutPrecision:ClearAllPoints() SVUI_LayoutPrecision:SetPoint(anchor1, frame, anchor2, xOffset, yOffset) + SetPrecisionSizes() end Layout.Movable_OnMouseUp(frame) end @@ -620,14 +642,13 @@ end CONSTRUCTS ########################################################## ]]-- -local function SetNewAnchor(frame, moveName, title, postSizeFunc, postDragFunc, callbackOnEnter) +local function SetNewAnchor(frame, moveName, title, postDragFunc) if((not frame) or (not moveName) or (Layout.Frames[moveName] ~= nil)) then return end - --print('SetNewAnchor: '..moveName) + Layout.Frames[moveName] = { text = title, - postsize = postSizeFunc, postdrag = postDragFunc, - layoutString = CurrentPosition(frame) + layoutString = CurrentPosition(frame), } local grip = CreateFrame("Button", moveName, SV.Screen) @@ -683,18 +704,28 @@ local function SetNewAnchor(frame, moveName, title, postSizeFunc, postDragFunc, grip:SetMovable(true) grip:Hide() - if(postDragFunc and (type(postDragFunc) == "function") and callbackOnEnter) then - grip:RegisterEvent("PLAYER_ENTERING_WORLD") - grip:SetScript("OnEvent", function(this, event) - local point = Pinpoint(this) - postDragFunc(this, point) - this:UnregisterAllEvents() - end) - end - Sticky.Frames[#Sticky.Frames + 1] = grip; end +local function SetResizeHandling(frame, postSizeFunc, minRange, maxRange, min2Range, max2Range) + if((not frame) or (not frame.Grip)) then return end + + Layout.Frames[frame.Grip.name].postsize = postSizeFunc; + + frame.Grip.minRange = minRange; + frame.Grip.maxRange = maxRange; + frame.Grip.min2Range = min2Range; + frame.Grip.max2Range = max2Range; + frame.Grip.postsize = postSizeFunc; +end + +local function AnchorResize(frame, callback, width, height) + if(not width or width == 0) then width = frame:GetWidth() end + if(not height or height == 0) then height = frame:GetHeight() end + frame:SetSize(width, height) + callback(frame) +end + function Layout:Reset(request, bypass) if(request == "" or request == nil) then for frameName, frameData in pairs(self.Frames) do @@ -704,12 +735,9 @@ function Layout:Reset(request, bypass) frame:ClearAllPoints() frame:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) if(not bypass) then - if(frameData.postsize and (type(frameData.postsize) == "function")) then - if(not width or width == 0) then width = frame:GetWidth() end - if(not height or height == 0) then height = frame:GetHeight() end - frame:SetSize(width, height) - frameData.postsize(frame) - end + -- if(frameData.postsize and (type(frameData.postsize) == "function")) then + -- AnchorResize(frame, frameData.postsize, width, height) + -- end if(frameData.postdrag and (type(frameData.postdrag) == "function")) then frameData.postdrag(frame, Pinpoint(frame)) end @@ -727,12 +755,9 @@ function Layout:Reset(request, bypass) frame:ClearAllPoints() frame:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) if(not bypass) then - if(frameData.postsize and (type(frameData.postsize) == "function")) then - if(not width or width == 0) then width = frame:GetWidth() end - if(not height or height == 0) then height = frame:GetHeight() end - frame:SetSize(width, height) - frameData.postsize(frame) - end + -- if(frameData.postsize and (type(frameData.postsize) == "function")) then + -- AnchorResize(frame, frameData.postsize, width, height) + -- end if(frameData.postdrag and (type(frameData.postdrag) == "function")) then frameData.postdrag(frame, Pinpoint(frame)) end @@ -757,22 +782,16 @@ function Layout:Update() anchor1, parent, anchor2, x, y, width, height = LayoutParser(self.Anchors[frameName], frameName) frame:ClearAllPoints() frame:SetPoint(anchor1, parent, anchor2, x, y) - if(frameData.postsize and (type(frameData.postsize) == "function")) then - if(not width or width == 0) then width = frame:GetWidth() end - if(not height or height == 0) then height = frame:GetHeight() end - frame:SetSize(width, height) - frameData.postsize(frame) - end + -- if(frameData.postsize and (type(frameData.postsize) == "function")) then + -- AnchorResize(frame, frameData.postsize, width, height) + -- end elseif(frameData.layoutString) then anchor1, parent, anchor2, x, y, width, height = LayoutParser(frameData.layoutString, frameName) frame:ClearAllPoints() frame:SetPoint(anchor1, parent, anchor2, x, y) - if(frameData.postsize and (type(frameData.postsize) == "function")) then - if(not width or width == 0) then width = frame:GetWidth() end - if(not height or height == 0) then height = frame:GetHeight() end - frame:SetSize(width, height) - frameData.postsize(frame) - end + -- if(frameData.postsize and (type(frameData.postsize) == "function")) then + -- AnchorResize(frame, frameData.postsize, width, height) + -- end end end end @@ -954,6 +973,24 @@ local XML_LayoutPrecisionInputY_EnterPressed = function(self) self:SetText(floor((self.CurrentValue or 0) + 0.5)) EditBox_ClearFocus(self) end + +local XML_LayoutPrecisionWidthAdjust_OnValueChanged = function(self, widthValue) + self.rangeValue:SetText(floor(widthValue)) + if(CurrentFrameTarget and CurrentFrameTarget.postsize) then + local frame = CurrentFrameTarget.parent; + local heightValue = SVUI_LayoutPrecisionHeightAdjust:GetValue(); + CurrentFrameTarget.postsize(frame, widthValue, heightValue); + end +end + +local XML_LayoutPrecisionHeightAdjust_OnValueChanged = function(self, heightValue) + self.rangeValue:SetText(floor(heightValue)) + if(CurrentFrameTarget and CurrentFrameTarget.postsize) then + local frame = CurrentFrameTarget.parent; + local widthValue = SVUI_LayoutPrecisionWidthAdjust:GetValue(); + CurrentFrameTarget.postsize(frame, widthValue, heightValue); + end +end --[[ ########################################################## DRAGGABLES @@ -1278,19 +1315,19 @@ local function InitializeMovables() SVUI_LayoutPrecisionSetX:SetStyle("Editbox") SVUI_LayoutPrecisionSetX.CurrentValue = 0; SVUI_LayoutPrecisionSetX:SetScript("OnEnterPressed", XML_LayoutPrecisionInputX_EnterPressed) - SVUI_LayoutPrecisionSetY:SetStyle("Editbox") SVUI_LayoutPrecisionSetY.CurrentValue = 0; SVUI_LayoutPrecisionSetY:SetScript("OnEnterPressed", XML_LayoutPrecisionInputY_EnterPressed) - SVUI_LayoutPrecisionResetButton:SetStyle("Button") SVUI_LayoutPrecisionUpButton:SetStyle("Button") SVUI_LayoutPrecisionDownButton:SetStyle("Button") SVUI_LayoutPrecisionLeftButton:SetStyle("Button") SVUI_LayoutPrecisionRightButton:SetStyle("Button") - SVUI_LayoutPrecisionResetButton:SetScript("OnClick", SVUI_LayoutPrecisionResetButton_OnClick) + SVUI_LayoutPrecisionWidthAdjust:SetScript("OnValueChanged", XML_LayoutPrecisionWidthAdjust_OnValueChanged) + SVUI_LayoutPrecisionHeightAdjust:SetScript("OnValueChanged", XML_LayoutPrecisionHeightAdjust_OnValueChanged) + SVUI_LayoutPrecision:SetScript("OnHide", function() if(not CurrentFrameTarget) then return end CurrentFrameTarget.text:SetTextColor(0.5, 0.5, 0.5) @@ -1334,21 +1371,25 @@ SV.Events:On("LOAD_ALL_WIDGETS", InitializeMovables); CORE FUNCTIONS ########################################################## ]]-- -function SV:NewAnchor(frame, title, postSizeFunc, postDragFunc, overrideName, callbackOnEnter) - if(not frame or (not frame:GetName() and not overrideName)) then return end - local frameName = overrideName or frame:GetName() +function SV:NewAnchor(frame, title, postDragFunc) + if(not frame or (not frame.GetName)) then return end + local frameName = frame:GetName() local moveName = ("%s_MOVE"):format(frameName) - SetNewAnchor(frame, moveName, title, postSizeFunc, postDragFunc, callbackOnEnter) + SetNewAnchor(frame, moveName, title, postDragFunc) if(self.initialized) then Layout:Update() end return moveName end +function SV:SetAnchorResizing(frame, postSizeFunc, minRange, maxRange, min2Range, max2Range) + if(not frame or (not frame.Grip)) then return end + SetResizeHandling(frame, postSizeFunc, minRange, maxRange, min2Range, max2Range) +end + function SV:ReAnchor(name, ...) if((not name) or (not _G[name])) then return end local frame = _G[name] if(not frame.Grip) then return end - print(name) - print(frame.Grip.name) + frame.Grip:ClearAllPoints() frame.Grip:SetPoint(...) SaveAnchor(frame.Grip.name) end diff --git a/SVUI_!Core/system/overrides.lua b/SVUI_!Core/system/overrides.lua index 291e0f9..a295a4f 100644 --- a/SVUI_!Core/system/overrides.lua +++ b/SVUI_!Core/system/overrides.lua @@ -1004,7 +1004,8 @@ local function SetOverrides() TicketStatusFrame:ClearAllPoints() TicketStatusFrame:SetPoint("TOPRIGHT", SV.Dock.TopLeft, "TOPRIGHT", 0, 0) - SV:NewAnchor(TicketStatusFrame, L["GM Ticket Frame"], nil, nil, "GM") + -- SV:NewAnchor(TicketStatusFrame, L["GM Ticket Frame"], nil, nil, "GM") + SV:NewAnchor(TicketStatusFrame, L["GM Ticket Frame"]) HelpPlate:Die() HelpPlateTooltip:Die() @@ -1051,7 +1052,8 @@ local function SetOverrides() LossOfControlFrame:ClearAllPoints() LossOfControlFrame:SetSize(75, 75) LossOfControlFrame:SetPoint("CENTER", SV.Screen, "CENTER", -146, -40) - SV:NewAnchor(LossOfControlFrame, L["Loss Control Icon"], nil, nil, "LoC") + -- SV:NewAnchor(LossOfControlFrame, L["Loss Control Icon"], nil, nil, "LoC") + SV:NewAnchor(LossOfControlFrame, L["Loss Control Icon"]) SV:RegisterEvent("CHAT_MSG_BG_SYSTEM_HORDE", PVPRaidNoticeHandler) SV:RegisterEvent("CHAT_MSG_BG_SYSTEM_ALLIANCE", PVPRaidNoticeHandler) @@ -1071,7 +1073,8 @@ local function SetOverrides() LootFrame:UnregisterAllEvents(); SVUI_LootFrameHolder:SetSize(150, 22); - SV:NewAnchor(SVUI_LootFrameHolder, L["Loot Frame"], nil, nil, "SVUI_LootFrame"); + -- SV:NewAnchor(SVUI_LootFrameHolder, L["Loot Frame"], nil, nil, "SVUI_LootFrame"); + SV:NewAnchor(SVUI_LootFrameHolder, L["Loot Frame"]); SVUI_LootFrame:SetSize(256, 64); SVUI_LootFrame:SetStyle("!_Frame", 'Transparent'); diff --git a/SVUI_!Core/xml/templates.xml b/SVUI_!Core/xml/templates.xml index 19a0158..a6ed087 100644 --- a/SVUI_!Core/xml/templates.xml +++ b/SVUI_!Core/xml/templates.xml @@ -1,4 +1,126 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Slider name="SVUI_HSliderTemplate" orientation="HORIZONTAL" virtual="true" enableMouse="true"> + <Size> + <AbsDimension x="144" y="17"/> + </Size> + <HitRectInsets> + <AbsInset left="0" right="0" top="-10" bottom="-10"/> + </HitRectInsets> + <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="2" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0" g="0" b="0" a="0.5" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="ARTWORK"> + <FontString name="$parentText" inherits="GameFontHighlight"> + <Anchors> + <Anchor point="BOTTOM" relativePoint="TOP"/> + </Anchors> + </FontString> + <FontString name="$parentLow" inherits="GameFontHighlightSmall" text="LOW"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT"> + <Offset> + <AbsDimension x="-4" y="3"/> + </Offset> + </Anchor> + </Anchors> + </FontString> + <FontString name="$parentHigh" inherits="GameFontHighlightSmall" text="HIGH"> + <Anchors> + <Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT"> + <Offset> + <AbsDimension x="4" y="3"/> + </Offset> + </Anchor> + </Anchors> + </FontString> + </Layer> + </Layers> + <Scripts> + <OnEnter> + if ( self:IsEnabled() ) then + if ( self.tooltipText ) then + GameTooltip:SetOwner(self, self.tooltipOwnerPoint or "ANCHOR_RIGHT"); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, true); + end + end + </OnEnter> + <OnLeave> + GameTooltip:Hide(); + </OnLeave> + </Scripts> + <ThumbTexture name="$parentThumb" file="Interface\AddOns\SVUI_!Core\assets\buttons\SCROLLBAR-KNOB"> + <Size> + <AbsDimension x="32" y="32"/> + </Size> + </ThumbTexture> + </Slider> + + <Slider name="SVUI_VSliderTemplate" orientation="VERTICAL" virtual="true" enableMouse="true"> + <Size> + <AbsDimension x="17" y="144"/> + </Size> + <HitRectInsets> + <AbsInset left="-10" right="-10" top="0" bottom="0"/> + </HitRectInsets> + <Backdrop bgFile="Interface\BUTTONS\WHITE8X8" edgeFile="Interface\BUTTONS\WHITE8X8" tile="false"> + <EdgeSize val="2" /> + <TileSize val="0" /> + <BackgroundInsets left="0" right="0" top="0" bottom="0" /> + <Color r="0" g="0" b="0" a="0.5" /> + <BorderColor r="0" g="0" b="0" a="1" /> + </Backdrop> + <Layers> + <Layer level="ARTWORK"> + <FontString name="$parentText" inherits="GameFontHighlight"> + <Anchors> + <Anchor point="BOTTOM" relativePoint="TOP"/> + </Anchors> + </FontString> + <FontString name="$parentLow" inherits="GameFontHighlightSmall" text="LOW"> + <Anchors> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT"> + <Offset> + <AbsDimension x="3" y="-4"/> + </Offset> + </Anchor> + </Anchors> + </FontString> + <FontString name="$parentHigh" inherits="GameFontHighlightSmall" text="HIGH"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT"> + <Offset> + <AbsDimension x="3" y="4"/> + </Offset> + </Anchor> + </Anchors> + </FontString> + </Layer> + </Layers> + <Scripts> + <OnEnter> + if ( self:IsEnabled() ) then + if ( self.tooltipText ) then + GameTooltip:SetOwner(self, self.tooltipOwnerPoint or "ANCHOR_RIGHT"); + GameTooltip:SetText(self.tooltipText, nil, nil, nil, nil, true); + end + end + </OnEnter> + <OnLeave> + GameTooltip:Hide(); + </OnLeave> + </Scripts> + <ThumbTexture name="$parentThumb" file="Interface\AddOns\SVUI_!Core\assets\buttons\SCROLLBAR-KNOB"> + <Size> + <AbsDimension x="32" y="32"/> + </Size> + </ThumbTexture> + </Slider> + <Frame name="SVUI_ShadowTemplate" virtual="true"> <Attributes> <Attribute name="shadowAlpha" type="number" value="0.5" /> diff --git a/SVUI_!Core/xml/widgets.xml b/SVUI_!Core/xml/widgets.xml index 9600614..d1f4458 100644 --- a/SVUI_!Core/xml/widgets.xml +++ b/SVUI_!Core/xml/widgets.xml @@ -112,7 +112,7 @@ <Frame name="SVUI_RaidMarkFrame" frameStrata="DIALOG" hidden="true" /> <Frame name="SVUI_LayoutPrecision" hidden="true" frameStrata="DIALOG"> - <Size x="200" y="70"/> + <Size x="200" y="144"/> <Anchors> <Anchor point="CENTER"/> </Anchors> @@ -306,6 +306,44 @@ </OnClick> </Scripts> </Button> + + <Slider name="$parentWidthAdjust" inherits="SVUI_HSliderTemplate"> + <Size x="132" y="17"/> + <Anchors> + <Anchor point="TOP" relativeTo="$parentResetButton" relativePoint="BOTTOM"> + <Offset> + <AbsDimension x="0" y="-20"/> + </Offset> + </Anchor> + </Anchors> + <Scripts> + <OnLoad> + local name = self:GetName(); + self.rangeLow = _G[name.."Low"]; + self.rangeHigh = _G[name.."High"]; + self.rangeValue = _G[name.."Text"]; + </OnLoad> + </Scripts> + </Slider> + + <Slider name="$parentHeightAdjust" inherits="SVUI_HSliderTemplate"> + <Size x="132" y="17"/> + <Anchors> + <Anchor point="TOP" relativeTo="$parentWidthAdjust" relativePoint="BOTTOM"> + <Offset> + <AbsDimension x="0" y="-20"/> + </Offset> + </Anchor> + </Anchors> + <Scripts> + <OnLoad> + local name = self:GetName(); + self.rangeLow = _G[name.."Low"]; + self.rangeHigh = _G[name.."High"]; + self.rangeValue = _G[name.."Text"]; + </OnLoad> + </Scripts> + </Slider> </Frames> </Frame> diff --git a/SVUI_Tooltip/SVUI_Tooltip.lua b/SVUI_Tooltip/SVUI_Tooltip.lua index 8a0edf9..9278bc1 100644 --- a/SVUI_Tooltip/SVUI_Tooltip.lua +++ b/SVUI_Tooltip/SVUI_Tooltip.lua @@ -922,7 +922,8 @@ function MOD:Load() BNToastFrame:ClearAllPoints() BNToastFrame:SetPoint("BOTTOMRIGHT", SV.Dock.BottomLeft, "TOPRIGHT", 0, 20) - SV:NewAnchor(BNToastFrame, L["BattleNet Frame"], nil, nil, "BattleNetToasts") + --SV:NewAnchor(BNToastFrame, L["BattleNet Frame"], nil, nil, "BattleNetToasts") + SV:NewAnchor(BNToastFrame, L["BattleNet Frame"]) NewHook(BNToastFrame, "SetPoint", _hook_BNToastOnShow) ApplyTooltipSkins() diff --git a/SVUI_UnitFrames/SVUI_UnitFrames.lua b/SVUI_UnitFrames/SVUI_UnitFrames.lua index 29c91d3..bcf97b8 100644 --- a/SVUI_UnitFrames/SVUI_UnitFrames.lua +++ b/SVUI_UnitFrames/SVUI_UnitFrames.lua @@ -454,6 +454,8 @@ function MOD:RefreshUnitLayout(frame, template) local BUFF_ENABLED = (db.buffs and db.buffs.enable) or false; local DEBUFF_GRIP = frame.Debuffs; local DEBUFF_ENABLED = (db.debuffs and db.debuffs.enable) or false; + local RAID_DEBUFFS = frame.RaidDebuffs; + local RAID_DEBUFFS_ENABLED = (db.rdebuffs and db.rdebuffs.enable) or false; if(RESIZE_NEEDED) then frame:SetSize(UNIT_WIDTH + (MASTER_X1_OFFSET + MASTER_X2_OFFSET), UNIT_HEIGHT + (MASTER_TOP_OFFSET + MASTER_BOTTOM_OFFSET)) @@ -1014,6 +1016,23 @@ function MOD:RefreshUnitLayout(frame, template) end end + if(RAID_DEBUFFS) then + if RAID_DEBUFFS_ENABLED then + RAID_DEBUFFS.forceShow = frame.forceShowAuras; + if(not frame:IsElementEnabled("RaidDebuffs")) then + frame:EnableElement("RaidDebuffs") + end + local actualSz = db.rdebuffs.size + RAID_DEBUFFS:SetSize(actualSz, actualSz) + RAID_DEBUFFS:SetPoint("CENTER", frame, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) + RAID_DEBUFFS:Show() + else + RAID_DEBUFFS.forceShow = nil; + frame:DisableElement("RaidDebuffs") + RAID_DEBUFFS:Hide() + end + end + --[[ ICON LAYOUTS ]]-- do @@ -1135,8 +1154,10 @@ function MOD:RefreshUnitLayout(frame, template) if frame.Afflicted then if SV.db.UnitFrames.debuffHighlighting then + frame.Afflicted:ClearAllPoints() + frame.Afflicted:SetAllPoints(MASTER_GRIP) if(template ~= "player" and template ~= "target" and template ~= "focus") then - frame.Afflicted:SetTexture(SV.BaseTexture) + frame.Afflicted.Texture:SetTexture(SV.BaseTexture) end frame:EnableElement('Afflicted') else diff --git a/SVUI_UnitFrames/class_resources/deathknight.lua b/SVUI_UnitFrames/class_resources/deathknight.lua index 46e32fd..ed3d068 100644 --- a/SVUI_UnitFrames/class_resources/deathknight.lua +++ b/SVUI_UnitFrames/class_resources/deathknight.lua @@ -1,7 +1,7 @@ --[[ ########################################################## S V U I By: Munglunch -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -20,8 +20,8 @@ local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; ---[[ -########################################################## +--[[ +########################################################## GET ADDON DATA ########################################################## ]]-- @@ -30,13 +30,13 @@ local L = SV.L; local LSM = _G.LibStub("LibSharedMedia-3.0") local MOD = SV.UnitFrames -if(not MOD) then return end +if(not MOD) then return end local oUF_SVUI = MOD.oUF assert(oUF_SVUI, "SVUI UnitFrames: unable to locate oUF.") -if(SV.class ~= "DEATHKNIGHT") then return end ---[[ -########################################################## +if(SV.class ~= "DEATHKNIGHT") then return end +--[[ +########################################################## LOCALS ########################################################## ]]-- @@ -44,12 +44,12 @@ SV.SpecialFX:Register("rune_blood", [[Spells\Monk_drunkenhaze_impact.m2]], 0, 0, SV.SpecialFX:Register("rune_frost", [[Spells\Ice_cast_low_hand.m2]], 0, 0, 0, 0, 0.00001, -0.2, 0.4) SV.SpecialFX:Register("rune_unholy", [[Spells\Poison_impactdot_med_chest.m2]], 0, 0, 0, 0, 0.13, -0.3, -0.2) SV.SpecialFX:Register("rune_death", [[Spells\Shadow_strikes_state_hand.m2]], 0, 0, 0, 0, 0.001, 0, -0.25) -local specEffects = { - [1] = "rune_blood", - [2] = "rune_blood", +local specEffects = { + [1] = "rune_blood", + [2] = "rune_blood", [3] = "rune_frost", - [4] = "rune_frost", - [5] = "rune_unholy", + [4] = "rune_frost", + [5] = "rune_unholy", [6] = "rune_unholy", }; local colors = { @@ -60,8 +60,8 @@ local colors = { }; local RUNE_FG = [[Interface\AddOns\SVUI_UnitFrames\assets\Class\RUNES-FG]]; local RUNE_BG = [[Interface\AddOns\SVUI_UnitFrames\assets\Class\RUNES-BG]]; ---[[ -########################################################## +--[[ +########################################################## POSITIONING ########################################################## ]]-- @@ -76,7 +76,7 @@ local Reposition = function(self) local size = db.classbar.height local inset = size * 0.1 local width = size * max; - + bar.Holder:SetSize(width, size) if(not db.classbar.detachFromFrame) then SV:ResetAnchors(L["Classbar"]) @@ -93,21 +93,21 @@ local Reposition = function(self) bar[i]:SetHeight(size + 4) bar[i]:SetWidth(size) bar[i].bar:GetStatusBarTexture():SetHorizTile(false) - if i==1 then + if i==1 then bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 1) - else - bar[i]:SetPoint("LEFT", bar[i - 1], "RIGHT", -6, 0) + else + bar[i]:SetPoint("LEFT", bar[i - 1], "RIGHT", -6, 0) end bar[i].bar:ClearAllPoints() bar[i].bar:InsetPoints(bgFrame,inset,inset) end - if bar.UpdateAllRuneTypes then + if bar.UpdateAllRuneTypes then bar.UpdateAllRuneTypes(self) end end ---[[ -########################################################## +--[[ +########################################################## DEATHKNIGHT ########################################################## ]]-- @@ -158,16 +158,16 @@ function MOD:CreateClassBar(playerFrame) bar[i].bar.effectIndex = i; bar[i].bar.Change = RuneChange; bar[i].bar:SetOrientation("VERTICAL"); - end - + end + local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = max; playerFrame.RefreshClassBar = Reposition; playerFrame.Necromancy = bar - return 'Necromancy' -end \ No newline at end of file + return 'Necromancy' +end diff --git a/SVUI_UnitFrames/class_resources/druid.lua b/SVUI_UnitFrames/class_resources/druid.lua index 18553aa..a030949 100644 --- a/SVUI_UnitFrames/class_resources/druid.lua +++ b/SVUI_UnitFrames/class_resources/druid.lua @@ -361,7 +361,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.RefreshClassBar = Reposition; playerFrame.Druidness = bar diff --git a/SVUI_UnitFrames/class_resources/hunter.lua b/SVUI_UnitFrames/class_resources/hunter.lua index f1fb296..7cf76f1 100644 --- a/SVUI_UnitFrames/class_resources/hunter.lua +++ b/SVUI_UnitFrames/class_resources/hunter.lua @@ -140,7 +140,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = max; playerFrame.RefreshClassBar = Reposition; diff --git a/SVUI_UnitFrames/class_resources/mage.lua b/SVUI_UnitFrames/class_resources/mage.lua index b57e114..5f47b3d 100644 --- a/SVUI_UnitFrames/class_resources/mage.lua +++ b/SVUI_UnitFrames/class_resources/mage.lua @@ -195,7 +195,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = max; playerFrame.RefreshClassBar = Reposition; diff --git a/SVUI_UnitFrames/class_resources/monk.lua b/SVUI_UnitFrames/class_resources/monk.lua index 6178e2a..04c278a 100644 --- a/SVUI_UnitFrames/class_resources/monk.lua +++ b/SVUI_UnitFrames/class_resources/monk.lua @@ -163,7 +163,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = max playerFrame.RefreshClassBar = Reposition diff --git a/SVUI_UnitFrames/class_resources/paladin.lua b/SVUI_UnitFrames/class_resources/paladin.lua index 87736bb..34afa24 100644 --- a/SVUI_UnitFrames/class_resources/paladin.lua +++ b/SVUI_UnitFrames/class_resources/paladin.lua @@ -148,7 +148,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = max; playerFrame.RefreshClassBar = Reposition; diff --git a/SVUI_UnitFrames/class_resources/priest.lua b/SVUI_UnitFrames/class_resources/priest.lua index 4182a01..7ccc8c0 100644 --- a/SVUI_UnitFrames/class_resources/priest.lua +++ b/SVUI_UnitFrames/class_resources/priest.lua @@ -119,7 +119,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = max; playerFrame.RefreshClassBar = Reposition; diff --git a/SVUI_UnitFrames/class_resources/rogue.lua b/SVUI_UnitFrames/class_resources/rogue.lua index a1d74ca..fb859aa 100644 --- a/SVUI_UnitFrames/class_resources/rogue.lua +++ b/SVUI_UnitFrames/class_resources/rogue.lua @@ -145,7 +145,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = 5; playerFrame.RefreshClassBar = Reposition; diff --git a/SVUI_UnitFrames/class_resources/shaman.lua b/SVUI_UnitFrames/class_resources/shaman.lua index 1808b6d..3ebce47 100644 --- a/SVUI_UnitFrames/class_resources/shaman.lua +++ b/SVUI_UnitFrames/class_resources/shaman.lua @@ -154,7 +154,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = totemMax; playerFrame.RefreshClassBar = Reposition; diff --git a/SVUI_UnitFrames/class_resources/warlock.lua b/SVUI_UnitFrames/class_resources/warlock.lua index cec294b..1b5c258 100644 --- a/SVUI_UnitFrames/class_resources/warlock.lua +++ b/SVUI_UnitFrames/class_resources/warlock.lua @@ -274,7 +274,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = max; playerFrame.RefreshClassBar = Reposition; diff --git a/SVUI_UnitFrames/class_resources/warrior.lua b/SVUI_UnitFrames/class_resources/warrior.lua index d6f13d9..e278c96 100644 --- a/SVUI_UnitFrames/class_resources/warrior.lua +++ b/SVUI_UnitFrames/class_resources/warrior.lua @@ -121,7 +121,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:NewAnchor(bar.Holder, L["Classbar"], nil, OnMove) + SV:NewAnchor(bar.Holder, L["Classbar"], OnMove) playerFrame.MaxClassPower = max playerFrame.RefreshClassBar = Reposition diff --git a/SVUI_UnitFrames/elements/essentials.lua b/SVUI_UnitFrames/elements/essentials.lua index 6f4749b..ff9dde1 100644 --- a/SVUI_UnitFrames/elements/essentials.lua +++ b/SVUI_UnitFrames/elements/essentials.lua @@ -370,15 +370,16 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) ADDInfoBG(frame) frame.TextGrip = CreateFrame("Frame", nil, info) - frame.TextGrip:SetFrameStrata("LOW") + -- frame.TextGrip:SetFrameStrata("LOW") frame.TextGrip:SetFrameLevel(20) frame.TextGrip:SetAllPoints(info) else - frame.TextGrip = CreateFrame("Frame", nil, frame) + local info = CreateFrame("Frame", nil, frame) + info:SetFrameLevel(20) + info:SetAllPoints(frame) + frame.TextGrip = CreateFrame("Frame", nil, info) --frame.TextGrip:SetFrameStrata("LOW") - frame.TextGrip:SetFrameLevel(20) - frame.TextGrip:SetPoint("TOPLEFT", frame.ActionPanel, "TOPLEFT", 2, -2) - frame.TextGrip:SetPoint("BOTTOMRIGHT", frame.ActionPanel, "BOTTOMRIGHT", -2, 2) + frame.TextGrip:SetAllPoints(info) end frame.TextGrip.Name = CreateNameText(frame.TextGrip, unit) diff --git a/SVUI_UnitFrames/elements/misc.lua b/SVUI_UnitFrames/elements/misc.lua index cd39040..0cd7f41 100644 --- a/SVUI_UnitFrames/elements/misc.lua +++ b/SVUI_UnitFrames/elements/misc.lua @@ -99,14 +99,15 @@ function MOD:CreateRaidDebuffs(frame) end function MOD:CreateAfflicted(frame) - local holder = CreateFrame("Frame", nil, frame.TextGrip) - holder:SetFrameLevel(50) - holder:SetAllPoints(frame.Health) - local afflicted = holder:CreateTexture(nil, "OVERLAY", nil, 7) - afflicted:InsetPoints(holder) - afflicted:SetTexture(MOD.media.afflicted) - afflicted:SetVertexColor(0, 0, 0, 0) - afflicted:SetBlendMode("ADD") + local afflicted = CreateFrame("Frame", nil, frame.TextGrip) + afflicted:SetFrameLevel(50) + afflicted:SetPoint("TOPLEFT", frame.Health, "TOPLEFT", 0, 0) + afflicted:SetPoint("BOTTOMRIGHT", frame.Health, "BOTTOMRIGHT", 0, 0) + afflicted.Texture = afflicted:CreateTexture(nil, "OVERLAY", nil, 7) + afflicted.Texture:SetAllPoints(afflicted) + afflicted.Texture:SetTexture(MOD.media.afflicted) + afflicted.Texture:SetVertexColor(0, 0, 0, 0) + afflicted.Texture:SetBlendMode("ADD") afflicted.ClassFilter = true afflicted.MaxAlpha = 0.75 diff --git a/SVUI_UnitFrames/frames.lua b/SVUI_UnitFrames/frames.lua index aee5714..91ef460 100644 --- a/SVUI_UnitFrames/frames.lua +++ b/SVUI_UnitFrames/frames.lua @@ -91,6 +91,12 @@ local lastArenaFrame, lastBossFrame ALL UNIT HELPERS ########################################################## ]]-- +local unitLayoutPostSizeFunc = function(self, width, height) + SV.db.UnitFrames[self.___key].width = width; + SV.db.UnitFrames[self.___key].height = height; + self:Update() +end + local UpdateTargetGlow = function(self) if not self.unit then return end local unit = self.unit; @@ -281,6 +287,7 @@ CONSTRUCTORS["player"] = function(self, unit) self.CombatFade = true; self:SetPoint("BOTTOMRIGHT", SV.Screen, "BOTTOM", -80, 182) SV:NewAnchor(self, L["Player Frame"]) + SV:SetAnchorResizing(self, unitLayoutPostSizeFunc, 10, 500) self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePlayerFrame @@ -378,6 +385,7 @@ CONSTRUCTORS["target"] = function(self, unit) self:SetPoint("BOTTOMLEFT", SV.Screen, "BOTTOM", 80, 182) SV:NewAnchor(self, L["Target Frame"]) + SV:SetAnchorResizing(self, unitLayoutPostSizeFunc, 10, 500) self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateTargetFrame @@ -419,6 +427,7 @@ CONSTRUCTORS["targettarget"] = function(self, unit) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self:SetPoint("LEFT", SVUI_Target, "RIGHT", 4, 0) SV:NewAnchor(self, L["TargetTarget Frame"]) + SV:SetAnchorResizing(self, unitLayoutPostSizeFunc, 10, 500) self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateTargetTargetFrame @@ -468,6 +477,7 @@ CONSTRUCTORS["pet"] = function(self, unit) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self:SetPoint("RIGHT", SVUI_Player, "LEFT", -4, 0) SV:NewAnchor(self, L["Pet Frame"]) + SV:SetAnchorResizing(self, unitLayoutPostSizeFunc, 10, 500) self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePetFrame return self @@ -512,6 +522,7 @@ CONSTRUCTORS["pettarget"] = function(self, unit) self:SetPoint("BOTTOM", SVUI_Pet, "TOP", 0, 7) self.snapOffset = -7 SV:NewAnchor(self, L["PetTarget Frame"]) + SV:SetAnchorResizing(self, unitLayoutPostSizeFunc, 10, 500) self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePetTargetFrame @@ -588,6 +599,7 @@ CONSTRUCTORS["focus"] = function(self, unit) self:SetPoint("BOTTOMRIGHT", SVUI_Target, "TOPRIGHT", 0, 220) SV:NewAnchor(self, L["Focus Frame"]) + SV:SetAnchorResizing(self, unitLayoutPostSizeFunc, 10, 500) self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateFocusFrame @@ -629,6 +641,7 @@ CONSTRUCTORS["focustarget"] = function(self, unit) self:SetPoint("LEFT", SVUI_Focus, "RIGHT", 12, 0) self.snapOffset = -7 SV:NewAnchor(self, L["FocusTarget Frame"]) + SV:SetAnchorResizing(self, unitLayoutPostSizeFunc, 10, 500) self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateFocusTargetFrame @@ -704,7 +717,9 @@ CONSTRUCTORS["boss"] = function(self, unit) if(not _G["SVUI_Boss_MOVE"]) then self:SetPoint("RIGHT", SV.Screen, "RIGHT", -105, 0) - SV:NewAnchor(self, L["Boss Frames"], nil, nil, "SVUI_Boss") + --SV:NewAnchor(self, L["Boss Frames"], nil, nil, "SVUI_Boss") + SV:NewAnchor(self, L["Boss Frames"]) + SV:SetAnchorResizing(self, unitLayoutPostSizeFunc, 10, 500) else self:SetPoint("TOPRIGHT", lastBossFrame, "BOTTOMRIGHT", 0, -20) end @@ -875,7 +890,9 @@ CONSTRUCTORS["arena"] = function(self, unit) if(not _G["SVUI_Arena_MOVE"]) then self:SetPoint("RIGHT", SV.Screen, "RIGHT", -105, 0) - SV:NewAnchor(self, L["Arena Frames"], nil, nil, "SVUI_Arena") + --SV:NewAnchor(self, L["Arena Frames"], nil, nil, "SVUI_Arena") + SV:NewAnchor(self, L["Arena Frames"]) + SV:SetAnchorResizing(self, unitLayoutPostSizeFunc, 10, 500) else self:SetPoint("TOPRIGHT", lastArenaFrame, "BOTTOMRIGHT", 0, -20) end diff --git a/SVUI_UnitFrames/groups.lua b/SVUI_UnitFrames/groups.lua index 3d63380..8cc139e 100644 --- a/SVUI_UnitFrames/groups.lua +++ b/SVUI_UnitFrames/groups.lua @@ -160,6 +160,12 @@ local GroupDistributor = { FRAME HELPERS ########################################################## ]]-- +local groupLayoutPostSizeFunc = function(self, width, height) + SV.db.UnitFrames[self.___key].width = width; + SV.db.UnitFrames[self.___key].height = height; + self:Update() +end + local DetachSubFrames = function(...) for i = 1, select("#", ...) do local frame = select(i,...) @@ -287,22 +293,6 @@ local PartyUnitUpdate = function(self) local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db, "party") self:SetSize(UNIT_WIDTH, UNIT_HEIGHT) end - do - local rdBuffs = self.RaidDebuffs; - if db.rdebuffs.enable then - rdBuffs.forceShow = self.forceShowAuras; - if not self:IsElementEnabled('RaidDebuffs') then - self:EnableElement("RaidDebuffs") - end - local actualSz = db.rdebuffs.size - rdBuffs:SetSize(actualSz, actualSz) - rdBuffs:SetPoint("CENTER", self, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) - rdBuffs:Show() - else - self:DisableElement("RaidDebuffs") - rdBuffs:Hide() - end - end MOD:RefreshUnitLayout(self, "party") end self:EnableElement('ReadyCheck') @@ -319,6 +309,7 @@ UpdateTemplates["party"] = function(self) groupFrame:SetPoint("BOTTOMLEFT", SV.Dock.BottomLeft, "TOPLEFT", 0, 80) RegisterStateDriver(groupFrame, "visibility", "[group:party,nogroup:raid][@raid6,noexists,group:raid] show;hide") SV:NewAnchor(groupFrame, L['Party Frames']); + SV:SetAnchorResizing(groupFrame, groupLayoutPostSizeFunc, 10, 500) groupFrame.positioned = true; end @@ -404,23 +395,6 @@ local RaidUnitUpdate = function(self) self:SetSize(UNIT_WIDTH, UNIT_HEIGHT) end - do - local rdBuffs = self.RaidDebuffs; - if db.rdebuffs.enable then - rdBuffs.forceShow = self.forceShowAuras; - if not self:IsElementEnabled('RaidDebuffs') then - self:EnableElement("RaidDebuffs") - end - local actualSz = db.rdebuffs.size - rdBuffs:SetSize(actualSz, actualSz) - rdBuffs:SetPoint("CENTER", self, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) - rdBuffs:Show() - else - self:DisableElement("RaidDebuffs") - rdBuffs:Hide() - end - end - MOD.RefreshUnitMedia(self, token) MOD:RefreshUnitLayout(self, token) @@ -440,6 +414,7 @@ UpdateTemplates["raid"] = function(self) groupFrame:SetPoint("BOTTOMLEFT", SV.Dock.BottomLeft, "TOPLEFT", 0, 80) RegisterStateDriver(groupFrame, "visibility", "[@raid6,exists,group:raid] show;hide") SV:NewAnchor(groupFrame, "Raid Frames") + SV:SetAnchorResizing(groupFrame, groupLayoutPostSizeFunc, 10, 500) groupFrame.positioned = true end @@ -517,6 +492,7 @@ UpdateTemplates["raidpet"] = function(self) groupFrame:SetPoint("BOTTOMLEFT", SV.Screen, "BOTTOMLEFT", 4, 433) RegisterStateDriver(groupFrame, "visibility", "[group:raid] show;hide") SV:NewAnchor(groupFrame, L["Raid Pet Frames"]) + SV:SetAnchorResizing(groupFrame, groupLayoutPostSizeFunc, 10, 500) groupFrame.positioned = true; end @@ -640,6 +616,7 @@ UpdateTemplates["tank"] = function(self) self:ClearAllPoints() self:SetPoint("BOTTOMLEFT", SV.Dock.TopLeft, "BOTTOMLEFT", 0, 0) SV:NewAnchor(self, L["Tank Frames"]) + SV:SetAnchorResizing(self, groupLayoutPostSizeFunc, 10, 500) self.Grip.positionOverride = "TOPLEFT" self:SetAttribute("minHeight", self.dirtyHeight) self:SetAttribute("minWidth", self.dirtyWidth) @@ -750,6 +727,7 @@ UpdateTemplates["assist"] = function(self) self:ClearAllPoints() self:SetPoint("TOPLEFT", SV.Dock.TopLeft, "BOTTOMLEFT", 0, -10) SV:NewAnchor(self, L["Assist Frames"]) + SV:SetAnchorResizing(self, groupLayoutPostSizeFunc, 10, 500) self.Grip.positionOverride = "TOPLEFT" self:SetAttribute("minHeight", self.dirtyHeight) self:SetAttribute("minWidth", self.dirtyWidth) diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_Afflicted/oUF_Afflicted.lua b/SVUI_UnitFrames/libs/Plugins/oUF_Afflicted/oUF_Afflicted.lua index 22b11d1..3997dcc 100644 --- a/SVUI_UnitFrames/libs/Plugins/oUF_Afflicted/oUF_Afflicted.lua +++ b/SVUI_UnitFrames/libs/Plugins/oUF_Afflicted/oUF_Afflicted.lua @@ -115,9 +115,9 @@ local function Update(self, event, unit) local debuffType, texture = GetDebuffType(unit, afflicted.ClassFilter) if debuffType then local color = AfflictedColor[debuffType] - afflicted:SetVertexColor(color.r, color.g, color.b, afflicted.MaxAlpha) + afflicted.Texture:SetVertexColor(color.r, color.g, color.b, afflicted.MaxAlpha) else - afflicted:SetVertexColor(0,0,0,0) + afflicted.Texture:SetVertexColor(0,0,0,0) end end @@ -154,7 +154,7 @@ local function Disable(self) self:UnregisterEvent("SPELLS_CHANGED", CheckSymbiosis) end - afflicted:SetVertexColor(0,0,0,0) + afflicted.Texture:SetVertexColor(0,0,0,0) end oUF:AddElement('Afflicted', Update, Enable, Disable) diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_RaidDebuffs/oUF_RaidDebuffs.lua b/SVUI_UnitFrames/libs/Plugins/oUF_RaidDebuffs/oUF_RaidDebuffs.lua index ef51a6d..d42fe72 100644 --- a/SVUI_UnitFrames/libs/Plugins/oUF_RaidDebuffs/oUF_RaidDebuffs.lua +++ b/SVUI_UnitFrames/libs/Plugins/oUF_RaidDebuffs/oUF_RaidDebuffs.lua @@ -305,7 +305,7 @@ local function Update(self, event, unit) end end - if(self.forceShowAuras) then + if(self.forceShow) then _spellId = DEMO_SPELLS[random(1, #DEMO_SPELLS)]; _name, rank, _icon = GetSpellInfo(_spellId) _count, _dtype, _duration, _endTime = 5, 'Magic', 0, 60