diff --git a/SVUI_!Core/libs/_SVUI_Lib/Registry.lua b/SVUI_!Core/libs/_SVUI_Lib/Registry.lua index 8df333e..e752229 100644 --- a/SVUI_!Core/libs/_SVUI_Lib/Registry.lua +++ b/SVUI_!Core/libs/_SVUI_Lib/Registry.lua @@ -477,7 +477,7 @@ function lib:LiveUpdate(forced) if(forced or PRIVATE_SV.SAFEDATA.NEEDSLIVEUPDATE) then if(CoreObject.ReLoad) then CoreObject.Timers:ClearAllTimers() - CoreObject:ReLoad() + if(forced) then CoreObject:ReLoad() end end self:RefreshAll() if((not InCombatLockdown()) and (not C_PetBattles.IsInBattle())) then @@ -571,7 +571,7 @@ local function UpdateProfileSources(newKey) end if(not MEDIA_SV.profiles[THEME_KEY]) then MEDIA_SV.profiles[THEME_KEY] = {} end if(not MEDIA_SV.profiles[THEME_KEY][PROFILE_KEY]) then MEDIA_SV.profiles[THEME_KEY][PROFILE_KEY] = {} end - + DirtyDataList[PROFILE_KEY] = THEME_KEY; if(not newKey) then if((CoreObject.initialized) and (PREVIOUS_PROFILE_KEY ~= PROFILE_KEY)) then @@ -1188,7 +1188,7 @@ function lib:CopyDatabase(key, linked) export = MEDIA_SV.profiles[THEME_KEY][key]; saved = MEDIA_SV.profiles[THEME_KEY][PROFILE_KEY]; tablecopy(saved, export); - + DirtyDataList[PROFILE_KEY] = THEME_KEY; ReloadUI() diff --git a/SVUI_!Core/system/api.lua b/SVUI_!Core/system/api.lua index 92442ff..09a177f 100644 --- a/SVUI_!Core/system/api.lua +++ b/SVUI_!Core/system/api.lua @@ -167,6 +167,13 @@ end APPENDED POSITIONING METHODS ########################################################## ]]-- +local ModSize = function(self, width, height) + if(type(width) == "number") then + local h = (height and type(height) == "number") and height or width + self:SetSize(width, h) + end +end + local WrapPoints = function(self, parent, x, y) x = type(x) == "number" and x or 1 y = y or x @@ -1368,6 +1375,10 @@ local function AppendFrameMethods(OBJECT) local META = getmetatable(OBJECT).__index if not OBJECT.SetStyle then META.SetStyle = SetStyle end if not OBJECT.SetPanelColor then META.SetPanelColor = SetPanelColor end + if not OBJECT.ModSize then META.ModSize = ModSize end + if not OBJECT.ModWidth then META.ModWidth = META.SetWidth end + if not OBJECT.ModHeight then META.ModHeight = META.SetHeight end + if not OBJECT.ModPoint then META.ModPoint = META.SetPoint end if not OBJECT.WrapPoints then META.WrapPoints = WrapPoints end if not OBJECT.InsetPoints then META.InsetPoints = InsetPoints end if not OBJECT.Die then META.Die = Die end @@ -1381,6 +1392,10 @@ end local function AppendTextureMethods(OBJECT) local META = getmetatable(OBJECT).__index + if not OBJECT.ModSize then META.ModSize = ModSize end + if not OBJECT.ModWidth then META.ModWidth = META.SetWidth end + if not OBJECT.ModHeight then META.ModHeight = META.SetHeight end + if not OBJECT.ModPoint then META.ModPoint = META.SetPoint end if not OBJECT.WrapPoints then META.WrapPoints = WrapPoints end if not OBJECT.InsetPoints then META.InsetPoints = InsetPoints end if not OBJECT.Die then META.Die = Die end @@ -1391,6 +1406,10 @@ end local function AppendFontStringMethods(OBJECT) local META = getmetatable(OBJECT).__index + if not OBJECT.ModSize then META.ModSize = ModSize end + if not OBJECT.ModWidth then META.ModWidth = META.SetWidth end + if not OBJECT.ModHeight then META.ModHeight = META.SetHeight end + if not OBJECT.ModPoint then META.ModPoint = META.SetPoint end if not OBJECT.WrapPoints then META.WrapPoints = WrapPoints end if not OBJECT.InsetPoints then META.InsetPoints = InsetPoints end end @@ -1620,7 +1639,7 @@ MOD.Concepts["PageButton"] = function(self, adjustable, frame, isVertical, isLef if not frame.icon then frame.icon = frame:CreateTexture(nil,'ARTWORK') - frame.icon:SetSize(13) + frame.icon:SetSize(13, 13) frame.icon:SetPoint('CENTER') frame.icon:SetTexture(SV.media.button.radio) frame.icon:SetTexCoord(0.02, 0.2, 0.02, 0.2) diff --git a/SVUI_!Core/system/overrides.lua b/SVUI_!Core/system/overrides.lua index 691dd15..c86e748 100644 --- a/SVUI_!Core/system/overrides.lua +++ b/SVUI_!Core/system/overrides.lua @@ -435,10 +435,11 @@ local function MakeSlots(id) end local function CreateRollButton(rollFrame, type, locale, anchor) + local btnSize = LOOT_HEIGHT - 4; local preset = RollTypePresets[type]; local rollButton = CreateFrame("Button", nil, rollFrame) rollButton:SetPoint("LEFT", anchor, "RIGHT", tonumber(preset[4]), tonumber(preset[5])) - rollButton:SetSize(LOOT_HEIGHT - 4) + rollButton:SetSize(btnSize, btnSize) rollButton:SetNormalTexture(preset[1]) if preset[2] and preset[2] ~= "" then rollButton:SetPushedTexture(preset[2]) @@ -459,6 +460,7 @@ end local function CreateRollFrame() UpdateLootUpvalues() + local btnSize = LOOT_HEIGHT - 2; local rollFrame = CreateFrame("Frame", nil, UIParent) rollFrame:SetSize(LOOT_WIDTH,LOOT_HEIGHT) rollFrame:SetStyle("!_Frame", 'Default') @@ -467,7 +469,7 @@ local function CreateRollFrame() rollFrame:Hide() rollFrame.button = CreateFrame("Button",nil,rollFrame) rollFrame.button:SetPoint("RIGHT",rollFrame,'LEFT',0,0) - rollFrame.button:SetSize(LOOT_HEIGHT - 2) + rollFrame.button:SetSize(btnSize, btnSize) rollFrame.button:SetStyle("Frame", 'Default') rollFrame.button:SetScript("OnEnter",LootItem_SetTooltip) rollFrame.button:SetScript("OnLeave",LootItem_OnLeave) diff --git a/SVUI_!Core/system/reports.lua b/SVUI_!Core/system/reports.lua index 730028d..e3eaf70 100644 --- a/SVUI_!Core/system/reports.lua +++ b/SVUI_!Core/system/reports.lua @@ -151,7 +151,7 @@ end local _hook_TooltipOnShow = function(self) self:SetBackdrop({ - bgFile = SV.BaseTexture, + bgFile = SV.media.background.transparent, edgeFile = [[Interface\BUTTONS\WHITE8X8]], tile = false, edgeSize = 1 diff --git a/SVUI_ActionBars/SVUI_ActionBars.lua b/SVUI_ActionBars/SVUI_ActionBars.lua index 4e9c35e..3155eef 100644 --- a/SVUI_ActionBars/SVUI_ActionBars.lua +++ b/SVUI_ActionBars/SVUI_ActionBars.lua @@ -637,7 +637,7 @@ do lastRow = bar.buttons[i - cols] button:SetParent(bar) button:ClearAllPoints() - button:SetSize(size) + button:SetSize(size, size) button:SetAttribute("showgrid",1) if(SELF_CASTING) then diff --git a/SVUI_ActionBars/components/totem.lua b/SVUI_ActionBars/components/totem.lua index 75f9291..205dcba 100644 --- a/SVUI_ActionBars/components/totem.lua +++ b/SVUI_ActionBars/components/totem.lua @@ -81,7 +81,7 @@ function Totems:Update() local button = self[i] if(button) then local lastButton = self[i - 1] - button:SetSize(totemSize) + button:SetSize(totemSize, totemSize) button:ClearAllPoints() if(totemGrowth == "HORIZONTAL" and totemSort == "ASCENDING") then if(i == 1) then diff --git a/SVUI_Chat/SVUI_Chat.lua b/SVUI_Chat/SVUI_Chat.lua index fad2f33..aed1ede 100644 --- a/SVUI_Chat/SVUI_Chat.lua +++ b/SVUI_Chat/SVUI_Chat.lua @@ -737,8 +737,6 @@ do local chatID = chat:GetID(); local tabName = chatName.."Tab"; local tabText = _G[chatName.."TabText"] - SV:FontManager(chat, "chatdialog", "LEFT") - SV:FontManager(tabText, "chattab") if(not chat.Panel) then chat:SetStyle("Frame", "Transparent", true, 1, 3, 6) chat.Panel:Hide() @@ -755,6 +753,9 @@ do local editBoxName = chatName.."EditBox"; local editBox = _G[editBoxName] ------------------------------------------- + SV:FontManager(chat, "chatdialog", "LEFT") + SV:FontManager(tabText, "chattab") + ------------------------------------------- chat:SetFrameLevel(4) chat:SetClampRectInsets(0, 0, 0, 0) chat:SetClampedToScreen(false) diff --git a/SVUI_Inventory/SVUI_Inventory.lua b/SVUI_Inventory/SVUI_Inventory.lua index 8f9ee41..17b46db 100644 --- a/SVUI_Inventory/SVUI_Inventory.lua +++ b/SVUI_Inventory/SVUI_Inventory.lua @@ -314,21 +314,6 @@ function MOD:INVENTORY_SEARCH_UPDATE() SearchInBags(self.BagFrame) SearchInBags(self.BankFrame) SearchInBags(self.ReagentFrame) - -- if(self.ReagentFrame and self.ReagentFrame:IsShown()) then - -- for i = 1, self.ReagentFrame.numSlots do - -- local _, _, _, _, _, _, _, isFiltered = GetContainerItemInfo(REAGENTBANK_CONTAINER, i) - -- local item = self.ReagentFrame.Bags[REAGENTBANK_CONTAINER][i] - -- if(item and item:IsShown()) then - -- if isFiltered then - -- SetItemButtonDesaturated(item, 1) - -- item:SetAlpha(0.4) - -- else - -- SetItemButtonDesaturated(item) - -- item:SetAlpha(1) - -- end - -- end - -- end - -- end end local SlotUpdate = function(self, slotID) @@ -507,8 +492,9 @@ local ContainerFrame_UpdateLayout = function(self) local lastMenu; for i, bagID in ipairs(self.BagIDs) do if((not isBank and bagID <= 3) or (isBank and bagID ~= -1 and numContainerSlots >= 1 and not (i - 1 > numContainerSlots))) then - - menu:SetSize(((buttonSize + buttonSpacing) * (isBank and i - 1 or i)) + buttonSpacing, buttonSize + (buttonSpacing * 2)) + local menuWidth = ((buttonSize + buttonSpacing) * (isBank and i - 1 or i)) + buttonSpacing; + local menuHeight = buttonSize + (buttonSpacing * 2); + menu:SetSize(menuWidth, menuHeight) local bagSlot = menu[i]; if(not bagSlot) then @@ -552,7 +538,7 @@ local ContainerFrame_UpdateLayout = function(self) menu[i] = bagSlot; end - bagSlot:SetSize(buttonSize) + bagSlot:SetSize(buttonSize, buttonSize) bagSlot:ClearAllPoints() if(isBank) then @@ -662,7 +648,7 @@ local ContainerFrame_UpdateLayout = function(self) end self.Bags[bagID][slotID]:SetID(slotID); - self.Bags[bagID][slotID]:SetSize(buttonSize); + self.Bags[bagID][slotID]:SetSize(buttonSize, buttonSize); if self.Bags[bagID][slotID]:GetPoint() then self.Bags[bagID][slotID]:ClearAllPoints(); @@ -791,7 +777,7 @@ local ReagentFrame_UpdateLayout = function(self) end slot:SetID(slotID); - slot:SetSize(buttonSize); + slot:SetSize(buttonSize, buttonSize); if slot:GetPoint() then slot:ClearAllPoints(); @@ -1284,7 +1270,9 @@ do frame.sortButton:SetSize(25, 25) StyleBagToolButton(frame.sortButton, MOD.media.cleanupIcon) frame.sortButton.ttText = L["Sort Bags"] - frame.sortButton.altText = L["Filtered Cleanup"] + frame.sortButton.altText = L["Filtered Cleanup (Default Sorting)"] + frame.sortButton.ttText2 = L["Hold Alt:"] + frame.sortButton.ttText2desc = L["Default Sorting"] frame.sortButton:SetScript("OnEnter", Tooltip_Show) frame.sortButton:SetScript("OnLeave", Tooltip_Hide) local Sort_OnClick = MOD:RunSortingProcess(MOD.Sort, "bags", SortBags) @@ -1343,7 +1331,7 @@ do frame.currencyButton:SetHeight(32) for h = 1, MAX_WATCHED_TOKENS do frame.currencyButton[h] = CreateFrame("Button", nil, frame.currencyButton) - frame.currencyButton[h]:SetSize(22) + frame.currencyButton[h]:SetSize(22, 22) frame.currencyButton[h]:SetStyle("!_Frame", "Default") frame.currencyButton[h]:SetID(h) frame.currencyButton[h].icon = frame.currencyButton[h]:CreateTexture(nil, "OVERLAY") @@ -1432,7 +1420,9 @@ do frame.sortButton:SetSize(25, 25) StyleBagToolButton(frame.sortButton, MOD.media.cleanupIcon) frame.sortButton.ttText = L["Sort Bank"] - frame.sortButton.altText = L["Filtered Cleanup"] + frame.sortButton.altText = L["Filtered Cleanup (Default Sorting)"] + frame.sortButton.ttText2 = L["Hold Alt:"] + frame.sortButton.ttText2desc = L["Default Sorting"] frame.sortButton:SetScript("OnEnter", Tooltip_Show) frame.sortButton:SetScript("OnLeave", Tooltip_Hide) diff --git a/SVUI_Maps/SVUI_Maps.lua b/SVUI_Maps/SVUI_Maps.lua index 4795d82..007bc93 100644 --- a/SVUI_Maps/SVUI_Maps.lua +++ b/SVUI_Maps/SVUI_Maps.lua @@ -1,7 +1,7 @@ --[[ ########################################################## S V U I By: Munglunch -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -20,8 +20,8 @@ local lower, upper, len = string.lower, string.upper, string.len; local match, gsub, find = string.match, string.gsub, string.find; --[[ MATH METHODS ]]-- local parsefloat = math.parsefloat; -- Uncommon ---[[ -########################################################## +--[[ +########################################################## GET ADDON DATA ########################################################## ]]-- @@ -29,14 +29,14 @@ local SV = _G['SVUI'] local L = SV.L local MOD = SV.Maps; if(not MOD) then return end; ---[[ -########################################################## +--[[ +########################################################## LOCALIZED GLOBALS ########################################################## ]]-- local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS ---[[ -########################################################## +--[[ +########################################################## LOCAL VARS ########################################################## ]]-- @@ -48,8 +48,8 @@ local MMBHolder, MMBBar; local NewHook = hooksecurefunc local Initialized = false local CoordPattern = "%.1f"; ---[[ -########################################################## +--[[ +########################################################## DATA UPVALUES ########################################################## ]]-- @@ -60,6 +60,7 @@ local WM_TINY = false; local MM_COLOR = "darkest" local MM_BRDR = 0 local MM_SIZE = 240 +local MM_BTN_SIZE = 30 local MM_OFFSET_TOP = (MM_SIZE * 0.07) local MM_OFFSET_BOTTOM = (MM_SIZE * 0.11) local MM_WIDTH = MM_SIZE + (MM_BRDR * 2) @@ -68,8 +69,8 @@ local WM_ALPHA = false; local MM_SHAPE = 'RECTANGLE'; local NARR_TEXT = "Meanwhile"; local NARR_PREFIX = "In "; ---[[ -########################################################## +--[[ +########################################################## MODULE CHILDREN ########################################################## ]]-- @@ -82,35 +83,35 @@ local WorldMapCoords = _G["SVUI_WorldMapCoords"]; --local SVUI_MinimapFrame = CreateFrame("Frame", "SVUI_MinimapFrame", UIParent) --local WMCoords = CreateFrame('Frame', 'SVUI_WorldMapCoords', WorldMapFrame) --SVUI_MinimapFrame:SetSize(MM_WIDTH, MM_HEIGHT); ---[[ -########################################################## +--[[ +########################################################## GENERAL HELPERS ########################################################## ]]-- --[[ - /$$$$$$$ /$$ /$$ /$$$$$$$$/$$$$$$$$/$$$$$$ /$$ /$$ /$$$$$$ + /$$$$$$$ /$$ /$$ /$$$$$$$$/$$$$$$$$/$$$$$$ /$$ /$$ /$$$$$$ | $$__ $$| $$ | $$|__ $$__/__ $$__/$$__ $$| $$$ | $$ /$$__ $$ | $$ \ $$| $$ | $$ | $$ | $$ | $$ \ $$| $$$$| $$| $$ \__/ -| $$$$$$$ | $$ | $$ | $$ | $$ | $$ | $$| $$ $$ $$| $$$$$$ +| $$$$$$$ | $$ | $$ | $$ | $$ | $$ | $$| $$ $$ $$| $$$$$$ | $$__ $$| $$ | $$ | $$ | $$ | $$ | $$| $$ $$$$ \____ $$ | $$ \ $$| $$ | $$ | $$ | $$ | $$ | $$| $$\ $$$ /$$ \ $$ | $$$$$$$/| $$$$$$/ | $$ | $$ | $$$$$$/| $$ \ $$| $$$$$$/ -|_______/ \______/ |__/ |__/ \______/ |__/ \__/ \______/ +|_______/ \______/ |__/ |__/ \______/ |__/ \__/ \______/ --]] local MMB_OnEnter = function(self) if(not SV.db.Maps.minimapbar.mouseover or SV.db.Maps.minimapbar.styleType == "NOANCHOR") then return end UIFrameFadeIn(SVUI_MiniMapButtonBar, 0.2, SVUI_MiniMapButtonBar:GetAlpha(), 1) - if self:GetName() ~= "SVUI_MiniMapButtonBar" then + if self:GetName() ~= "SVUI_MiniMapButtonBar" then self:SetBackdropBorderColor(.7, .7, 0) - end -end + end +end local MMB_OnLeave = function(self) if(not SV.db.Maps.minimapbar.mouseover or SV.db.Maps.minimapbar.styleType == "NOANCHOR") then return end UIFrameFadeOut(SVUI_MiniMapButtonBar, 0.2, SVUI_MiniMapButtonBar:GetAlpha(), 0) - if self:GetName() ~= "SVUI_MiniMapButtonBar" then + if self:GetName() ~= "SVUI_MiniMapButtonBar" then self:SetBackdropBorderColor(0, 0, 0) - end + end end do @@ -129,16 +130,16 @@ do local list = MOD.MinimapButtons local count = 1 - for name,btn in pairs(list) do + for name,btn in pairs(list) do local preset = btn.preset; - if(SV.db.Maps.minimapbar.styleType == "NOANCHOR") then + if(SV.db.Maps.minimapbar.styleType == "NOANCHOR") then btn:SetParent(preset.Parent) - if preset.DragStart then + if preset.DragStart then btn:SetScript("OnDragStart", preset.DragStart) - end - if preset.DragEnd then + end + if preset.DragEnd then btn:SetScript("OnDragStop", preset.DragEnd) - end + end btn:ClearAllPoints() btn:SetSize(preset.Width, preset.Height) btn:SetPoint(preset.Point, preset.relativeTo, preset.relativePoint, preset.xOfs, preset.yOfs) @@ -146,7 +147,7 @@ do btn:SetFrameLevel(preset.FrameLevel) btn:SetScale(preset.Scale) btn:SetMovable(true) - else + else btn:SetParent(MMBBar) btn:SetMovable(false) btn:SetScript("OnDragStart", nil) @@ -154,49 +155,49 @@ do btn:ClearAllPoints() btn:SetFrameStrata("LOW") btn:SetFrameLevel(20) - btn:SetSize(SV.db.Maps.minimapbar.buttonSize) - if SV.db.Maps.minimapbar.styleType == "HORIZONTAL"then + btn:SetSize(MM_BTN_SIZE, MM_BTN_SIZE) + if SV.db.Maps.minimapbar.styleType == "HORIZONTAL"then anchor = "RIGHT" relative = "LEFT" xPos = -2; - yPos = 0 - else + yPos = 0 + else anchor = "TOP" relative = "BOTTOM" xPos = 0; - yPos = -2 - end - if not lastButton then + yPos = -2 + end + if not lastButton then btn:SetPoint(anchor, MMBBar, anchor, xPos, yPos) - else + else btn:SetPoint(anchor, lastButton, relative, xPos, yPos) - end - end + end + end lastButton = btn count = count + 1 - end - if (SV.db.Maps.minimapbar.styleType ~= "NOANCHOR" and (count > 0)) then - if SV.db.Maps.minimapbar.styleType == "HORIZONTAL" then + end + if (SV.db.Maps.minimapbar.styleType ~= "NOANCHOR" and (count > 0)) then + if SV.db.Maps.minimapbar.styleType == "HORIZONTAL" then MMBBar:SetWidth((SV.db.Maps.minimapbar.buttonSize * count) + count * 2) - else + else MMBBar:SetHeight((SV.db.Maps.minimapbar.buttonSize * count) + count * 2) - end + end MMBHolder:SetSize(MMBBar:GetSize()) MMBBar:Show() - else + else MMBBar:Hide() - end - end + end + end local function SetMinimapButton(btn) - if btn == nil or btn:GetName() == nil or btn:GetObjectType() ~= "Button" or not btn:IsVisible() then return end + if btn == nil or btn:GetName() == nil or btn:GetObjectType() ~= "Button" or not btn:IsVisible() then return end local name = btn:GetName() local isLib = false; if name:sub(1,len("LibDBIcon")) == "LibDBIcon" then isLib = true end if(not isLib) then local count = #reserved for i = 1, count do - if name:sub(1,len(reserved[i])) == reserved[i] then return end + if name:sub(1,len(reserved[i])) == reserved[i] then return end if name:find(reserved[i]) ~= nil then return end end end @@ -204,7 +205,7 @@ do btn:SetPushedTexture("") btn:SetHighlightTexture("") btn:SetDisabledTexture("") - + if not btn.isStyled then btn:HookScript("OnEnter", MMB_OnEnter) btn:HookScript("OnLeave", MMB_OnLeave) @@ -216,38 +217,38 @@ do btn.preset.FrameStrata = btn:GetFrameStrata() btn.preset.FrameLevel = btn:GetFrameLevel() btn.preset.Scale = btn:GetScale() - if btn:HasScript("OnDragStart") then + if btn:HasScript("OnDragStart") then btn.preset.DragStart = btn:GetScript("OnDragStart") - end - if btn:HasScript("OnDragEnd") then + end + if btn:HasScript("OnDragEnd") then btn.preset.DragEnd = btn:GetScript("OnDragEnd") end - for i = 1, btn:GetNumRegions() do + for i = 1, btn:GetNumRegions() do local frame = select(i, btn:GetRegions()) - if frame:GetObjectType() == "Texture" then + if frame:GetObjectType() == "Texture" then local iconFile = frame:GetTexture() - if(iconFile ~= nil and (iconFile:find("Border") or iconFile:find("Background") or iconFile:find("AlphaMask"))) then + if(iconFile ~= nil and (iconFile:find("Border") or iconFile:find("Background") or iconFile:find("AlphaMask"))) then frame:SetTexture("") - else + else frame:ClearAllPoints() frame:SetPoint("TOPLEFT", btn, "TOPLEFT", 2, -2) frame:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -2, 2) frame:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) frame:SetDrawLayer("ARTWORK") - if name == "PS_MinimapButton" then + if name == "PS_MinimapButton" then frame.SetPoint = SV.fubar - end - end - end + end + end + end end btn:SetStyle("Button", -1, -1) - if(name == "DBMMinimapButton") then + if(name == "DBMMinimapButton") then btn:SetNormalTexture("Interface\\Icons\\INV_Helmet_87") - end + end - if(name == "SmartBuff_MiniMapButton") then + if(name == "SmartBuff_MiniMapButton") then btn:SetNormalTexture(select(3, GetSpellInfo(12051))) end @@ -255,7 +256,7 @@ do MOD.MinimapButtons[name] = btn end - end + end local StyleMinimapButtons = function() local count = Minimap:GetNumChildren() @@ -267,9 +268,9 @@ do UpdateMinimapButtons() - if SV.db.Maps.minimapbar.mouseover then + if SV.db.Maps.minimapbar.mouseover then MMBBar:SetAlpha(0) - else + else MMBBar:SetAlpha(1) end end @@ -347,7 +348,7 @@ local function UpdateWorldMapCoords() local cursorX, cursorY = GetCursorPosition() local mouseX = (cursorX / scale - (centerX - (width / 2))) / width; local mouseY = (centerY + (height / 2) - cursorY / scale) / height; - if(((mouseX >= 0) and (mouseX <= 1)) and ((mouseY >= 0) and (mouseY <= 1))) then + if(((mouseX >= 0) and (mouseX <= 1)) and ((mouseY >= 0) and (mouseY <= 1))) then mouseX = parsefloat(100 * mouseX, 2) mouseY = parsefloat(100 * mouseY, 2) if(not WorldMapCoords.Mouse:IsShown()) then @@ -355,7 +356,7 @@ local function UpdateWorldMapCoords() end WorldMapCoords.Mouse.X:SetFormattedText(CoordPattern, mouseX) WorldMapCoords.Mouse.Y:SetFormattedText(CoordPattern, mouseY) - else + else WorldMapCoords.Mouse:FadeOut(0.2, 1, 0, true) end end @@ -366,19 +367,19 @@ local function UpdateWorldMapCoords() WorldMapFrame:SetAlpha(0.2) else WorldMapFrame:SetAlpha(1) - end + end end end --[[ - /$$ /$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$ + /$$ /$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$ | $$ /$ | $$ /$$__ $$| $$__ $$| $$ | $$__ $$| $$$ /$$$ /$$__ $$| $$__ $$ | $$ /$$$| $$| $$ \ $$| $$ \ $$| $$ | $$ \ $$| $$$$ /$$$$| $$ \ $$| $$ \ $$ | $$/$$ $$ $$| $$ | $$| $$$$$$$/| $$ | $$ | $$| $$ $$/$$ $$| $$$$$$$$| $$$$$$$/ -| $$$$_ $$$$| $$ | $$| $$__ $$| $$ | $$ | $$| $$ $$$| $$| $$__ $$| $$____/ -| $$$/ \ $$$| $$ | $$| $$ \ $$| $$ | $$ | $$| $$\ $ | $$| $$ | $$| $$ -| $$/ \ $$| $$$$$$/| $$ | $$| $$$$$$$$| $$$$$$$/| $$ \/ | $$| $$ | $$| $$ -|__/ \__/ \______/ |__/ |__/|________/|_______/ |__/ |__/|__/ |__/|__/ +| $$$$_ $$$$| $$ | $$| $$__ $$| $$ | $$ | $$| $$ $$$| $$| $$__ $$| $$____/ +| $$$/ \ $$$| $$ | $$| $$ \ $$| $$ | $$ | $$| $$\ $ | $$| $$ | $$| $$ +| $$/ \ $$| $$$$$$/| $$ | $$| $$$$$$$$| $$$$$$$/| $$ \/ | $$| $$ | $$| $$ +|__/ \__/ \______/ |__/ |__/|________/|_______/ |__/ |__/|__/ |__/|__/ --]] local function SetLargeWorldMap() @@ -391,7 +392,7 @@ local function SetLargeWorldMap() WorldMapFrame:SetScale(1) if WorldMapFrame:GetAttribute('UIPanelLayout-area') ~= 'center'then SetUIPanelAttribute(WorldMapFrame, "area", "center") - end + end if WorldMapFrame:GetAttribute('UIPanelLayout-allowOtherPanels') ~= true then SetUIPanelAttribute(WorldMapFrame, "allowOtherPanels", true) end @@ -399,10 +400,10 @@ local function SetLargeWorldMap() WorldMapFrameSizeUpButton:Hide() WorldMapFrameSizeDownButton:Show() -end +end local function SetSmallWorldMap() - if InCombatLockdown() then return end + if InCombatLockdown() then return end WorldMapFrameSizeUpButton:Show() WorldMapFrameSizeDownButton:Hide() end @@ -410,16 +411,16 @@ end local function AdjustMapSize() if InCombatLockdown() then return end - if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then + if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then WorldMapFrame:SetPoint("TOP", SV.Screen, "TOP", 0, 0) end - + if SV.db.Maps.tinyWorldMap == true then BlackoutWorld:SetTexture("") else BlackoutWorld:SetTexture(0, 0, 0, 1) end -end +end local function UpdateWorldMapConfig() if(not MM_XY_COORD) then @@ -487,10 +488,10 @@ local function UpdateWorldMapConfig() NewHook("WorldMap_ToggleSizeDown", SetSmallWorldMap) MOD.WorldMapHooked = true end - AdjustMapSize() + AdjustMapSize() end ---[[ -########################################################## +--[[ +########################################################## HANDLERS ########################################################## ]]-- @@ -529,10 +530,10 @@ local Basic_OnEnter = function(self) GameTooltip:ClearLines() GameTooltip:AddLine(self.TText, 1, 1, 1) GameTooltip:Show() -end +end local Basic_OnLeave = function(self) - GameTooltip:Hide() + GameTooltip:Hide() end local Tour_OnEnter = function(self, ...) @@ -547,11 +548,11 @@ local Tour_OnEnter = function(self, ...) GameTooltip:AddDoubleLine(L["ShiftClick : "], L["Announce your position in chat"],0.7, 0.7, 1, 0.7, 0.7, 1) GameTooltip:Show() end -end +end local Tour_OnLeave = function(self, ...) GameTooltip:Hide() -end +end local Tour_OnClick = function(self, btn) if IsShiftKeyDown() then @@ -571,32 +572,32 @@ local Tour_OnClick = function(self, btn) else local message = ("%s (%s)"):format(zoneText, coords) edit_box:Insert(message) - end + end else ToggleFrame(WorldMapFrame) end GameTooltip:Hide() end ---[[ -########################################################## +--[[ +########################################################## HOOKS ########################################################## ]]-- local _hook_WorldMapZoneDropDownButton_OnClick = function(self) DropDownList1:ClearAllPoints() DropDownList1:SetPoint("TOPRIGHT",self,"BOTTOMRIGHT",-17,-4) -end +end local _hook_WorldMapFrame_OnShow = function() MOD:RegisterEvent("PLAYER_REGEN_DISABLED"); if InCombatLockdown()then return end - if(not SV.db.Maps.tinyWorldMap and not Initialized) then + if(not SV.db.Maps.tinyWorldMap and not Initialized) then WorldMap_ToggleSizeUp() Initialized = true end -end +end local _hook_WorldMapFrame_OnHide = function() MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") @@ -604,12 +605,12 @@ end local _hook_DropDownList1 = function(self) local parentScale = UIParent:GetScale() - if(self:GetScale() ~= parentScale) then + if(self:GetScale() ~= parentScale) then self:SetScale(parentScale) - end + end end ---[[ -########################################################## +--[[ +########################################################## EVENTS ########################################################## ]]-- @@ -672,21 +673,21 @@ function MOD:PLAYER_REGEN_ENABLED() self:RefreshMiniMap() self.CombatLocked = nil end -end +end function MOD:PLAYER_REGEN_DISABLED() WorldMapFrameSizeDownButton:Disable() WorldMapFrameSizeUpButton:Disable() end ---[[ -########################################################## +--[[ +########################################################## CORE FUNCTIONS ########################################################## ]]-- function MOD:RefreshMiniMap() - if(InCombatLockdown()) then + if(InCombatLockdown()) then self.CombatLocked = true - return + return end self:UpdateLocals() @@ -735,7 +736,7 @@ function MOD:RefreshMiniMap() self.InfoTop.Text:SetSize(MM_WIDTH,28) self.InfoBottom.Text:SetSize(MM_WIDTH,32) self:RefreshZoneText() - + if TimeManagerClockButton then TimeManagerClockButton:Die() end @@ -746,8 +747,8 @@ end local function RotationHook() MOD:RefreshMiniMap() end ---[[ -########################################################## +--[[ +########################################################## BUILD FUNCTION / UPDATE ########################################################## ]]-- @@ -766,6 +767,7 @@ function MOD:UpdateLocals() MM_OFFSET_BOTTOM = (MM_SIZE * 0.11) MM_WIDTH = MM_SIZE + (MM_BRDR * 2) MM_SHAPE = db.mapShape; + MM_BTN_SIZE = db.minimapbar.buttonSize; MM_HEIGHT = (MM_SHAPE == 'RECTANGLE') and (MM_SIZE - (MM_OFFSET_TOP + MM_OFFSET_BOTTOM) + (MM_BRDR * 2)) or MM_WIDTH WM_ALPHA = GetCVarBool("mapFade") end @@ -801,7 +803,7 @@ function MOD:Load() else Minimap:SetBlipTexture(MOD.media.defaultBlips) end - + Minimap:SetClampedToScreen(false) self.Holder:SetFrameStrata(Minimap:GetFrameStrata()) @@ -823,7 +825,7 @@ function MOD:Load() TimeManagerClockButton:Die() end - Minimap:SetQuestBlobRingAlpha(0) + Minimap:SetQuestBlobRingAlpha(0) Minimap:SetArchBlobRingAlpha(0) Minimap:SetParent(self.Holder) Minimap:SetFrameStrata("LOW") @@ -901,10 +903,10 @@ function MOD:Load() self.InfoBottom:SetScript("OnLeave", InfoBottom_OnLeave) Minimap:EnableMouseWheel(true) - Minimap:SetScript("OnMouseWheel", MiniMap_MouseWheel) + Minimap:SetScript("OnMouseWheel", MiniMap_MouseWheel) Minimap:SetScript("OnMouseUp", MiniMap_MouseUp) - SV:NewAnchor(self.Holder, L["Minimap"]) + SV:NewAnchor(self.Holder, L["Minimap"]) if(SV.db.Maps.tinyWorldMap) then setfenv(WorldMapFrame_OnShow, setmetatable({ UpdateMicroButtons = SV.fubar }, { __index = _G })) @@ -990,6 +992,6 @@ function MOD:Load() self:RegisterEvent("ZONE_CHANGED_NEW_AREA", "RefreshZoneText") NewHook("Minimap_UpdateRotationSetting", RotationHook) - + SV.Events:On("CORE_INITIALIZED", MapTriggerFired); -end \ No newline at end of file +end diff --git a/SVUI_NamePlates/SVUI_NamePlates.lua b/SVUI_NamePlates/SVUI_NamePlates.lua index 3dfdaa3..5c67975 100644 --- a/SVUI_NamePlates/SVUI_NamePlates.lua +++ b/SVUI_NamePlates/SVUI_NamePlates.lua @@ -4,7 +4,7 @@ S V U I By: Munglunch ############################################################################## credit: Elv. NamePlatess was parently nameplates.lua adapted from ElvUI # ############################################################################## -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -34,8 +34,8 @@ local floor, ceil = math.floor, math.ceil; -- Basic local band, bor = bit.band, bit.bor; --[[ TABLE METHODS ]]-- local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wipe, table.sort, table.concat; ---[[ -########################################################## +--[[ +########################################################## GET ADDON DATA ########################################################## ]]-- @@ -45,8 +45,8 @@ local MOD = SV.NamePlates; if(not MOD) then return end; local LSM = _G.LibStub("LibSharedMedia-3.0") ---[[ -########################################################## +--[[ +########################################################## LOCALIZED GLOBALS ########################################################## ]]-- @@ -84,8 +84,8 @@ local SPELL_AURA_REMOVED_DOSE = _G.SPELL_AURA_REMOVED_DOSE local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS local MAX_COMBO_POINTS = _G.MAX_COMBO_POINTS local COMBATLOG_OBJECT_CONTROL_PLAYER = _G.COMBATLOG_OBJECT_CONTROL_PLAYER ---[[ -########################################################## +--[[ +########################################################## LOCAL VARS ########################################################## ]]-- @@ -101,7 +101,7 @@ local PLATE_RIGHT = MOD.media.rightArt; local PLATE_LEFT = MOD.media.leftArt; --[[ Quick explaination of what Im doing with all of these locals... - Unlike many of the other modules, NamePlatess has to continuously + Unlike many of the other modules, NamePlatess has to continuously reference config settings which can start to get sluggish. What I have done is set local variables for every database value that the module can read efficiently. The function "UpdateLocals" @@ -156,6 +156,7 @@ local HBWidth = 108; local HBHeight = 9; local NPIcons = 14; +local ICON_SIZE = 20; local CBColor = {0.1,0.81,0} local CBNoInterrupt = {1,0.25,0.25} @@ -184,68 +185,68 @@ local AuraClocks = {}; local ClockIsTicking = false; local TickTock = 0; local LastKnownTarget; ---[[ -########################################################## +--[[ +########################################################## UTILITY FRAMES ########################################################## ]]-- local NPGrip = _G.SVUI_PlateParentFrame local NPGlow = _G.SVUI_PlateGlowFrame local AuraClockManager = CreateFrame("Frame") ---[[ -########################################################## +--[[ +########################################################## PRE VARS/FUNCTIONS ########################################################## ]]-- local formatting = { - ["CURRENT"] = "%s", - ["CURRENT_MAX"] = "%s - %s", - ["CURRENT_PERCENT"] = "%s - %s%%", - ["CURRENT_MAX_PERCENT"] = "%s - %s | %s%%", - ["PERCENT"] = "%s%%", + ["CURRENT"] = "%s", + ["CURRENT_MAX"] = "%s - %s", + ["CURRENT_PERCENT"] = "%s - %s%%", + ["CURRENT_MAX_PERCENT"] = "%s - %s | %s%%", + ["PERCENT"] = "%s%%", ["DEFICIT"] = "-%s" }; local function TruncateString(value) - if value >= 1e9 then + if value >= 1e9 then return ("%.1fb"):format(value / 1e9):gsub("%.?0 + ([kmb])$", "%1") - elseif value >= 1e6 then + elseif value >= 1e6 then return ("%.1fm"):format(value / 1e6):gsub("%.?0 + ([kmb])$", "%1") - elseif value >= 1e3 or value <= -1e3 then + elseif value >= 1e3 or value <= -1e3 then return ("%.1fk"):format(value / 1e3):gsub("%.?0 + ([kmb])$", "%1") - else - return value - end + else + return value + end end local function SetTextStyle(style, min, max) - if max == 0 then max = 1 end + if max == 0 then max = 1 end local result; local textFormat = formatting[style] - if style == "DEFICIT" then + if style == "DEFICIT" then local result = max - min; - if result <= 0 then + if result <= 0 then return "" - else + else return format(textFormat, TruncateString(result)) - end - elseif style == "PERCENT" then + end + elseif style == "PERCENT" then result = format(textFormat, format("%.1f", min / max * 100)) result = result:gsub(".0%%", "%%") - return result - elseif style == "CURRENT" or (style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max then + return result + elseif style == "CURRENT" or (style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max then return format(formatting["CURRENT"], TruncateString(min)) - elseif style == "CURRENT_MAX" then + elseif style == "CURRENT_MAX" then return format(textFormat, TruncateString(min), TruncateString(max)) - elseif style == "CURRENT_PERCENT" then + elseif style == "CURRENT_PERCENT" then result = format(textFormat, TruncateString(min), format("%.1f", min / max * 100)) result = result:gsub(".0%%", "%%") - return result - elseif style == "CURRENT_MAX_PERCENT" then + return result + elseif style == "CURRENT_MAX_PERCENT" then result = format(textFormat, TruncateString(min), TruncateString(max), format("%.1f", min / max * 100)) result = result:gsub(".0%%", "%%") - return result - end + return result + end end local function CreatePlateBorder(plate) @@ -262,28 +263,28 @@ local function CreatePlateBorder(plate) plate.bordertop:SetPoint("TOPLEFT", plate, "TOPLEFT", -noscalemult, noscalemult) plate.bordertop:SetPoint("TOPRIGHT", plate, "TOPRIGHT", noscalemult, noscalemult) plate.bordertop:SetHeight(noscalemult) - plate.bordertop:SetTexture(0,0,0) + plate.bordertop:SetTexture(0,0,0) plate.bordertop:SetDrawLayer("BORDER", 1) plate.borderbottom = plate:CreateTexture(nil, "BORDER") plate.borderbottom:SetPoint("BOTTOMLEFT", plate, "BOTTOMLEFT", -noscalemult, -noscalemult) plate.borderbottom:SetPoint("BOTTOMRIGHT", plate, "BOTTOMRIGHT", noscalemult, -noscalemult) plate.borderbottom:SetHeight(noscalemult) - plate.borderbottom:SetTexture(0,0,0) + plate.borderbottom:SetTexture(0,0,0) plate.borderbottom:SetDrawLayer("BORDER", 1) plate.borderleft = plate:CreateTexture(nil, "BORDER") plate.borderleft:SetPoint("TOPLEFT", plate, "TOPLEFT", -noscalemult, noscalemult) plate.borderleft:SetPoint("BOTTOMLEFT", plate, "BOTTOMLEFT", noscalemult, -noscalemult) plate.borderleft:SetWidth(noscalemult) - plate.borderleft:SetTexture(0,0,0) + plate.borderleft:SetTexture(0,0,0) plate.borderleft:SetDrawLayer("BORDER", 1) plate.borderright = plate:CreateTexture(nil, "BORDER") plate.borderright:SetPoint("TOPRIGHT", plate, "TOPRIGHT", noscalemult, noscalemult) plate.borderright:SetPoint("BOTTOMRIGHT", plate, "BOTTOMRIGHT", -noscalemult, -noscalemult) plate.borderright:SetWidth(noscalemult) - plate.borderright:SetTexture(0,0,0) + plate.borderright:SetTexture(0,0,0) plate.borderright:SetDrawLayer("BORDER", 1) end @@ -330,8 +331,8 @@ local function CreatePlateBorder(plate) plate.eliteborder:Hide() end end ---[[ -########################################################## +--[[ +########################################################## UPVALUE PROXYS ########################################################## ]]-- @@ -350,8 +351,8 @@ local function ProxyThisPlate(plate, updateName) PLATE_REALNAME = plate.ref.nametext return true end ---[[ -########################################################## +--[[ +########################################################## LOCAL HELPERS ########################################################## ]]-- @@ -375,7 +376,7 @@ local function CheckRaidIcon(plate) SVUI_PLATE.raidicon:SetTexCoord(ULx,ULy,LLx,LLy,URx,URy,LRx,LRy) else PLATE_REF.raidicontype = nil; - SVUI_PLATE.raidicon:Hide() + SVUI_PLATE.raidicon:Hide() end end @@ -406,8 +407,8 @@ local function UpdateComboPoints() LastKnownTarget = plate end end ---[[ -########################################################## +--[[ +########################################################## AURA HELPERS ########################################################## ]]-- @@ -419,11 +420,11 @@ local ClockUpdateHandler = function(self, elapsed) for frame, expiration in pairs(AuraClocks) do local calc = 0; local expires = expiration - curTime; - if expiration < curTime then - frame:Hide(); + if expiration < curTime then + frame:Hide(); AuraClocks[frame] = nil - else - if expires < 60 then + else + if expires < 60 then calc = floor(expires) if expires >= 4 then frame.TimeLeft:SetFormattedText("|cffffff00%d|r", calc) @@ -431,7 +432,7 @@ local ClockUpdateHandler = function(self, elapsed) frame.TimeLeft:SetFormattedText("|cffff0000%d|r", calc) else frame.TimeLeft:SetFormattedText("|cffff0000%.1f|r", expires) - end + end elseif expires < 3600 then calc = ceil(expires / 60); frame.TimeLeft:SetFormattedText("|cffffffff%.1f|r", calc) @@ -445,21 +446,21 @@ local ClockUpdateHandler = function(self, elapsed) deactivate = false end end - if deactivate then - self:SetScript("OnUpdate", nil); - ClockIsTicking = false + if deactivate then + self:SetScript("OnUpdate", nil); + ClockIsTicking = false end end local function RegisterAuraClock(frame, expiration) if(not frame) then return end - if expiration == 0 then + if expiration == 0 then frame:Hide() AuraClocks[frame] = nil else AuraClocks[frame] = expiration frame:Show() - if(not ClockIsTicking) then + if(not ClockIsTicking) then AuraClockManager:SetScript("OnUpdate", ClockUpdateHandler) ClockIsTicking = true end @@ -498,14 +499,14 @@ end local function UpdateAuraIcon(aura, texture, expiration, stacks, test) if aura and texture and expiration then aura.Icon:SetTexture(texture) - if stacks > 1 then + if stacks > 1 then aura.Stacks:SetText(stacks) - else - aura.Stacks:SetText("") + else + aura.Stacks:SetText("") end aura:Show() RegisterAuraClock(aura, expiration) - else + else RegisterAuraClock(aura, 0) end end @@ -541,11 +542,11 @@ local function UpdateAuraIconGrid(plate) local cachedaura = AurasCache[index] local gridaura = iconCache[AuraSlotIndex] if gridaura and cachedaura.spellID and cachedaura.expiration then - UpdateAuraIcon(gridaura, cachedaura.texture, cachedaura.expiration, cachedaura.stacks) + UpdateAuraIcon(gridaura, cachedaura.texture, cachedaura.expiration, cachedaura.stacks) AuraSlotIndex = AuraSlotIndex + 1 end - if(AuraSlotIndex > AuraMaxCount) then - break + if(AuraSlotIndex > AuraMaxCount) then + break end end if(iconCache[AuraSlotIndex]) then @@ -555,7 +556,7 @@ local function UpdateAuraIconGrid(plate) end local function LoadDuration(spellID) - if spellID then + if spellID then return CachedAuraDurations[spellID] or 0 end return 0 @@ -585,7 +586,7 @@ local function CreateAuraIcon(auras, plate) button.TimeLeft = button:CreateFontString(nil, 'OVERLAY') button.TimeLeft:SetFontObject(SVUI_Font_NamePlate_Aura) button.TimeLeft:SetPoint("BOTTOMLEFT",button,"TOPLEFT",-3,-1) - button.TimeLeft:SetJustifyH('CENTER') + button.TimeLeft:SetJustifyH('CENTER') button.Stacks = button:CreateFontString(nil,"OVERLAY") button.Stacks:SetFontObject(SVUI_Font_NamePlate_Aura) @@ -603,7 +604,7 @@ local function CreateAuraIcon(auras, plate) end function MOD:UpdateAuras(plate) - if plate.setting.tiny then return end + if plate.setting.tiny then return end local guid = plate.guid local frame = plate.frame if not guid then @@ -611,8 +612,8 @@ function MOD:UpdateAuras(plate) local pn = plate.name:GetText() local name = pn:gsub("%s%(%*%)", "") guid = AuraByName[name] - elseif plate.ref.raidicon:IsShown() then - guid = AuraByRaidIcon[plate.ref.raidicontype] + elseif plate.ref.raidicon:IsShown() then + guid = AuraByRaidIcon[plate.ref.raidicontype] end if guid then plate.guid = guid @@ -649,7 +650,7 @@ function MOD:UpdateAurasByUnitID(unitid) SetAuraInstance(guid, spellid, expirationTime, count, UnitGUID(unitCaster or ""), duration, texture) end local name; - if UnitPlayerControlled(unitid) then + if UnitPlayerControlled(unitid) then name = UnitName(unitid) AuraByName[name] = guid end @@ -659,8 +660,8 @@ function MOD:UpdateAurasByUnitID(unitid) end self:RequestScanUpdate(guid, raidIcon, name, "UpdateAuras") end ---[[ -########################################################## +--[[ +########################################################## PLATE COLORING ########################################################## ]]-- @@ -727,7 +728,7 @@ do plate.setting.unitcategory = unitType local latestColor; - + if RAID_CLASS_COLORS[unitType] then latestColor = {RAID_CLASS_COLORS[unitType].r, RAID_CLASS_COLORS[unitType].g, RAID_CLASS_COLORS[unitType].b} elseif unitType == "TAPPED_NPC" then @@ -739,7 +740,7 @@ do latestColor = NPReactNeutral else latestColor = NPReactEnemy - end + end else if threatReaction == 'FULL_THREAT' then if NPClassRole == 'T' then @@ -802,7 +803,8 @@ do if(not plate.setting.scaled and not plate.setting.tiny and frame.health:GetWidth() ~= (HBWidth * scale)) then frame.health:SetSize(HBWidth * scale, HBHeight * scale) - plate.cast.icon:SetSize(CBHeight + (HBHeight * scale) + 5, CBHeight + (HBHeight * scale) + 5) + local scaledIconSize = CBHeight + (HBHeight * scale) + 5; + plate.cast.icon:SetSize(scaledIconSize, scaledIconSize) end end @@ -851,8 +853,8 @@ do end end end ---[[ -########################################################## +--[[ +########################################################## PLATE UPDATE HANDLERS ########################################################## ]]-- @@ -911,7 +913,7 @@ do elseif PLATE_REF.highlight:IsShown() and UnitExists("mouseover") and (UnitName("mouseover") == plateName) then if(PLATE_ARGS.unit ~= "mouseover" or PLATE_ARGS.allowed) then SVUI_PLATE:SetFrameLevel(1) - SVUI_PLATE.highlight:Show() + SVUI_PLATE.highlight:Show() MOD:UpdateAurasByUnitID('mouseover') if MOD.UseCombo then UpdateComboPoints() @@ -919,7 +921,7 @@ do PLATE_ARGS.allowed = nil end BLIZZ_PLATE.guid = UnitGUID("mouseover") - PLATE_ARGS.unit = "mouseover" + PLATE_ARGS.unit = "mouseover" else SVUI_PLATE:SetFrameLevel(0) SVUI_PLATE.highlight:Hide() @@ -967,8 +969,8 @@ do end end end ---[[ -########################################################## +--[[ +########################################################## SCRIPT HANDLERS ########################################################## ]]-- @@ -989,7 +991,7 @@ do if(index == 1) then PLATE_AURAICONS[index]:SetPoint("LEFT", PLATE_AURAS, 0, 0) else - PLATE_AURAICONS[index]:SetPoint("LEFT", PLATE_AURAICONS[index-1], "RIGHT", 4, 0) + PLATE_AURAICONS[index]:SetPoint("LEFT", PLATE_AURAICONS[index-1], "RIGHT", 4, 0) end end if(numAuras > #PLATE_AURAICONS) then @@ -1044,7 +1046,7 @@ do else color = CBColor end - end + end castBar:SetStatusBarColor(unpack(color)) end @@ -1116,12 +1118,12 @@ do SVUI_PLATE.health.icon:Hide() if SVUI_PLATE.health then SVUI_PLATE.health:SetSize(HBWidth, HBHeight) - plate.cast.icon:SetSize(CBHeight + HBHeight + 5) + plate.cast.icon:SetSize(ICON_SIZE, ICON_SIZE) end if PLATE_AURAS then for index = 1, #PLATE_AURAICONS do RegisterAuraClock(PLATE_AURAICONS[index], 0) - end + end end if MOD.UseCombo then for i=1, MAX_COMBO_POINTS do @@ -1146,14 +1148,14 @@ do SVUI_PLATE.cast:SetStatusBarTexture(NPBarTex) SVUI_PLATE.cast.text:SetFont(SV.media.font.default, 8, "OUTLINE") plate.cast.text:SetFont(SV.media.font.default, 8, "OUTLINE") - plate.cast.icon:SetSize((CBHeight + HBHeight) + 5) + plate.cast.icon:SetSize(ICON_SIZE, ICON_SIZE) PLATE_REF.raidicon:ClearAllPoints() - SV:SetReversePoint(PLATE_REF.raidicon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) + SV:SetReversePoint(PLATE_REF.raidicon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) PLATE_REF.raidicon:SetSize(RISize, RISize) SVUI_PLATE.health.icon:ClearAllPoints() SV:SetReversePoint(SVUI_PLATE.health.icon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) SVUI_PLATE.health.icon:SetSize(RISize, RISize) - for index = 1, #PLATE_AURAICONS do + for index = 1, #PLATE_AURAICONS do if PLATE_AURAICONS and PLATE_AURAICONS[index] then PLATE_AURAICONS[index].TimeLeft:SetFontObject(SVUI_Font_NamePlate_Aura) PLATE_AURAICONS[index].Stacks:SetFontObject(SVUI_Font_NamePlate_Aura) @@ -1162,9 +1164,9 @@ do end if(MOD.UseCombo and not SVUI_PLATE.combo:IsShown()) then - SVUI_PLATE.combo:Show() + SVUI_PLATE.combo:Show() elseif(SVUI_PLATE.combo:IsShown()) then - SVUI_PLATE.combo:Hide() + SVUI_PLATE.combo:Hide() end ShowThisPlate(plate) @@ -1287,7 +1289,7 @@ do alert:SetBackdrop({ edgeFile = SV.media.border.shadow, edgeSize = 2 - }); + }); alert:SetBackdropColor(0, 0, 0, 0) alert:SetBackdropBorderColor(1, 1, 0, 0.9) alert:SetScale(1.5) @@ -1299,7 +1301,7 @@ do --[[ CAST BAR ]]-- frame.cast = CreateFrame("StatusBar", nil, frame) - frame.cast:SetPoint('TOPLEFT', frame.health, 'BOTTOMLEFT', 0, -8) + frame.cast:SetPoint('TOPLEFT', frame.health, 'BOTTOMLEFT', 0, -8) frame.cast:SetPoint('TOPRIGHT', frame.health, 'BOTTOMRIGHT', 0, -8) frame.cast:SetFrameStrata("BACKGROUND") frame.cast:SetStyle("Frame", 'Bar') @@ -1393,8 +1395,8 @@ do end end end ---[[ -########################################################## +--[[ +########################################################## SCANNER ########################################################## ]]-- @@ -1415,7 +1417,7 @@ do if plate and plate:IsShown() and plate.ref.raidicon:IsShown() and (plate.ref.raidicontype and plate.ref.raidicontype == raidIcon) then return plate end - end + end end function MOD:RequestScanUpdate(guid, raidIcon, name, callbackFunc, ...) @@ -1428,8 +1430,8 @@ do end end end ---[[ -########################################################## +--[[ +########################################################## EVENTS ########################################################## ]]-- @@ -1502,7 +1504,7 @@ function MOD:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, combatevent, hideCast end local rawName, raidIcon - if(destName and (band(destFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) > 0)) then + if(destName and (band(destFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) > 0)) then rawName = split("-", destName) AuraByName[rawName] = destGUID end @@ -1513,16 +1515,16 @@ function MOD:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, combatevent, hideCast break end end - self:RequestScanUpdate(destGUID, raidIcon, rawName, "UpdateAuras") + self:RequestScanUpdate(destGUID, raidIcon, rawName, "UpdateAuras") end ---[[ -########################################################## +--[[ +########################################################## UPDATE AND BUILD ########################################################## ]]-- function MOD:UpdateLocals() local db = SV.db.NamePlates - if not db then return end + if not db then return end NPBarTex = LSM:Fetch("statusbar", db.barTexture); @@ -1553,6 +1555,8 @@ function MOD:UpdateLocals() CBXoffset = db.castBar.text.xOffset; CBYoffset = db.castBar.text.yOffset; + ICON_SIZE = CBHeight + HBHeight + 5 + NPUsePointer = db.pointer.enable; NPPointerMatch = db.pointer.colorMatchHealthBar; NPPointerColor = {db.pointer.color[1], db.pointer.color[2], db.pointer.color[3], 0.5}; @@ -1617,7 +1621,7 @@ end function MOD:ReLoad() self:UpdateAllPlates(); -end +end function MOD:Load() --SV.SpecialFX:Register("platepoint", [[Spells\Arcane_missile_lvl1.m2]], -12, 48, 12, -48, 0.25, 0, 0) @@ -1638,4 +1642,4 @@ function MOD:Load() self:RegisterEvent("UPDATE_MOUSEOVER_UNIT") WorldFrame:HookScript('OnUpdate', WorldFrameUpdateHook) self:CombatToggle(true) -end \ No newline at end of file +end diff --git a/SVUI_Skins/components/addons/DXE.lua b/SVUI_Skins/components/addons/DXE.lua index 0de14e4..30455ca 100644 --- a/SVUI_Skins/components/addons/DXE.lua +++ b/SVUI_Skins/components/addons/DXE.lua @@ -1,7 +1,7 @@ --[[ ########################################################## S V U I By: Munglunch -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -13,8 +13,8 @@ local pairs = _G.pairs; local string = _G.string; --[[ STRING METHODS ]]-- local format = string.format; ---[[ -########################################################## +--[[ +########################################################## GET ADDON DATA ########################################################## ]]-- @@ -25,8 +25,8 @@ local Schema = MOD.Schema; local playerName = UnitName("player"); local playerRealm = GetRealmName(); local playerKey = ("%s - %s"):format(playerName, playerRealm) ---[[ -########################################################## +--[[ +########################################################## DXE ########################################################## ]]-- @@ -95,7 +95,7 @@ local function StyleDXE() local DXEAlerts = DXE:GetModule("Alerts") local frame = CreateFrame("Frame") - + frame.elapsed = 1 frame:SetScript("OnUpdate", function(frame,elapsed) frame.elapsed = frame.elapsed + elapsed @@ -116,9 +116,9 @@ local function StyleDXE() if not DXEDB["profiles"][playerKey]["Globals"] then DXEDB["profiles"][playerKey]["Globals"] = {} end DXEDB["profiles"][playerKey]["Globals"]["BackgroundTexture"] = [[Interface\BUTTONS\WHITE8X8]] - DXEDB["profiles"][playerKey]["Globals"]["BarTexture"] = SV.BaseTexture + DXEDB["profiles"][playerKey]["Globals"]["BarTexture"] = SV.media.statusbar.default DXEDB["profiles"][playerKey]["Globals"]["Border"] = "None" DXEDB["profiles"][playerKey]["Globals"]["Font"] = SV.media.font.dialog DXEDB["profiles"][playerKey]["Globals"]["TimerFont"] = SV.media.font.dialog end -MOD:SaveAddonStyle("DXE", StyleDXE) \ No newline at end of file +MOD:SaveAddonStyle("DXE", StyleDXE) diff --git a/SVUI_Skins/components/addons/MasterPlan.lua b/SVUI_Skins/components/addons/MasterPlan.lua index 3c35351..ec59970 100644 --- a/SVUI_Skins/components/addons/MasterPlan.lua +++ b/SVUI_Skins/components/addons/MasterPlan.lua @@ -14,17 +14,17 @@ local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; ---[[ -########################################################## +--[[ +########################################################## HELPERS ########################################################## ]]-- local RING_TEXTURE = [[Interface\AddOns\SVUI_Skins\artwork\FOLLOWER-RING]] local LVL_TEXTURE = [[Interface\AddOns\SVUI_Skins\artwork\FOLLOWER-LEVEL]] -local HIGHLIGHT_TEXTURE = SV.BaseTexture +local HIGHLIGHT_TEXTURE = SV.media.background.default local DEFAULT_COLOR = {r = 0.25, g = 0.25, b = 0.25}; ---[[ -########################################################## +--[[ +########################################################## STYLE ########################################################## ]]-- @@ -109,10 +109,10 @@ local function StyleMasterPlan() SV.API:Set("Tab", GarrisonMissionFrameTab3) SV.API:Set("Tab", GarrisonMissionFrameTab4) -end ---[[ -########################################################## +end +--[[ +########################################################## MOD LOADING ########################################################## ]]-- -MOD:SaveAddonStyle("MasterPlan", StyleMasterPlan, false, true) \ No newline at end of file +MOD:SaveAddonStyle("MasterPlan", StyleMasterPlan, false, true) diff --git a/SVUI_Skins/components/addons/Outfitter.lua b/SVUI_Skins/components/addons/Outfitter.lua index ea870ab..e7853d0 100644 --- a/SVUI_Skins/components/addons/Outfitter.lua +++ b/SVUI_Skins/components/addons/Outfitter.lua @@ -41,7 +41,7 @@ local function StyleOutfitter() if _G["OutfitterItem"..i.."OutfitSelected"] then _G["OutfitterItem"..i.."OutfitSelected"]:SetStyle("Button") _G["OutfitterItem"..i.."OutfitSelected"]:ClearAllPoints() - _G["OutfitterItem"..i.."OutfitSelected"]:SetSize(16) + _G["OutfitterItem"..i.."OutfitSelected"]:SetSize(16, 16) _G["OutfitterItem"..i.."OutfitSelected"]:SetPoint("LEFT", _G["OutfitterItem"..i.."Outfit"], "LEFT", 8, 0) end end @@ -89,12 +89,12 @@ local function StyleOutfitter() OutfitterShowMinimapButton:SetStyle("Button") OutfitterShowOutfitBar:SetStyle("Button") OutfitterAutoSwitch:SetStyle("Button") - OutfitterItemComparisons:SetSize(20) - OutfitterTooltipInfo:SetSize(20) - OutfitterShowHotkeyMessages:SetSize(20) - OutfitterShowMinimapButton:SetSize(20) - OutfitterShowOutfitBar:SetSize(20) - OutfitterAutoSwitch:SetSize(20) + OutfitterItemComparisons:SetSize(20, 20) + OutfitterTooltipInfo:SetSize(20, 20) + OutfitterShowHotkeyMessages:SetSize(20, 20) + OutfitterShowMinimapButton:SetSize(20, 20) + OutfitterShowOutfitBar:SetSize(20, 20) + OutfitterAutoSwitch:SetSize(20, 20) OutfitterShowOutfitBar:SetPoint("TOPLEFT", OutfitterAutoSwitch, "BOTTOMLEFT", 0, -5) OutfitterEditScriptDialogDoneButton:SetStyle("Button") OutfitterEditScriptDialogCancelButton:SetStyle("Button") diff --git a/SVUI_Skins/components/addons/TinyDPS.lua b/SVUI_Skins/components/addons/TinyDPS.lua index 4f1cd75..82d342e 100644 --- a/SVUI_Skins/components/addons/TinyDPS.lua +++ b/SVUI_Skins/components/addons/TinyDPS.lua @@ -1,7 +1,7 @@ --[[ ########################################################## S V U I By: Munglunch -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -13,8 +13,8 @@ local pairs = _G.pairs; local string = _G.string; --[[ STRING METHODS ]]-- local format = string.format; ---[[ -########################################################## +--[[ +########################################################## GET ADDON DATA ########################################################## ]]-- @@ -22,8 +22,8 @@ local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; ---[[ -########################################################## +--[[ +########################################################## TINYDPS ########################################################## ]]-- @@ -31,20 +31,20 @@ local function StyleTinyDPS() assert(tdpsFrame, "AddOn Not Loaded") SV.API:Set("Frame", tdpsFrame) - + tdpsFrame:HookScript("OnShow", function() - if InCombatLockdown() then return end + if InCombatLockdown() then return end if MOD.Docklet:IsEmbedded("TinyDPS") then MOD.Docklet:Show() end end) if tdpsStatusBar then - tdpsStatusBar:SetBackdrop({bgFile = SV.BaseTexture, edgeFile = S.Blank, tile = false, tileSize = 0, edgeSize = 1}) + tdpsStatusBar:SetBackdrop({bgFile = SV.media.background.default, edgeFile = [[Interface\AddOns\SVUI_!Core\assets\textures\EMPTY]], tile = false, tileSize = 0, edgeSize = 1}) tdpsStatusBar:SetStatusBarTexture(SV.media.statusbar.default) end tdpsRefresh() end -MOD:SaveAddonStyle("TinyDPS", StyleTinyDPS) \ No newline at end of file +MOD:SaveAddonStyle("TinyDPS", StyleTinyDPS) diff --git a/SVUI_Skins/components/addons/VEM.lua b/SVUI_Skins/components/addons/VEM.lua index 48d611c..b4d4165 100644 --- a/SVUI_Skins/components/addons/VEM.lua +++ b/SVUI_Skins/components/addons/VEM.lua @@ -1,7 +1,7 @@ --[[ ########################################################## S V U I By: Munglunch -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -13,8 +13,8 @@ local pairs = _G.pairs; local string = _G.string; --[[ STRING METHODS ]]-- local format = string.format; ---[[ -########################################################## +--[[ +########################################################## GET ADDON DATA ########################################################## ]]-- @@ -22,8 +22,8 @@ local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; ---[[ -########################################################## +--[[ +########################################################## VEM ########################################################## ]]-- @@ -47,14 +47,14 @@ local function StyleBars(self) icon1.overlay = CreateFrame('Frame', '$parentIcon1Overlay', tbar) icon1.overlay:SetStyle("!_Frame") icon1.overlay:SetFrameLevel(0) - icon1.overlay:SetSize(22) + icon1.overlay:SetSize(22, 22) icon1.overlay:SetPoint('BOTTOMRIGHT', frame, 'BOTTOMLEFT', -2, 0) end if not icon2.overlay then icon2.overlay = CreateFrame('Frame', '$parentIcon2Overlay', tbar) icon2.overlay:SetStyle("!_Frame") icon2.overlay:SetFrameLevel(0) - icon2.overlay:SetSize(22) + icon2.overlay:SetSize(22, 22) icon2.overlay:SetPoint('BOTTOMLEFT', frame, 'BOTTOMRIGHT', 2, 0) end @@ -85,7 +85,7 @@ local function StyleBars(self) icon2:ClearAllPoints() icon2:InsetPoints(icon2.overlay) - texture:SetTexture(SV.BaseTexture) + texture:SetTexture(SV.media.statusbar.default) tbar:InsetPoints(frame) frame:SetStyle("!_Frame") @@ -132,7 +132,7 @@ local StyleBossTitle = function() header[1]:SetFont(SV.media.font.dialog, 12, 'OUTLINE') header[1]:SetTextColor(1, 1, 1) header[1]:SetShadowColor(0, 0, 0, 0) - anchor.styled = true + anchor.styled = true end header = nil end @@ -147,7 +147,7 @@ local StyleBoss = function() local progress = _G[bar:GetName()..'Bar'] local name = _G[bar:GetName()..'BarName'] local timer = _G[bar:GetName()..'BarTimer'] - local prev = _G[format('VEM_BossHealth_Bar_%d', count-1)] + local prev = _G[format('VEM_BossHealth_Bar_%d', count-1)] local _, anch, _ ,_, _ = bar:GetPoint() bar:ClearAllPoints() if count == 1 then @@ -174,7 +174,7 @@ local StyleBoss = function() timer:ClearAllPoints() timer:SetJustifyH('RIGHT') timer:SetShadowColor(0, 0, 0, 0) - + bar:SetHeight(22) name:SetPoint('LEFT', bar, 'LEFT', 4, 0) timer:SetPoint('RIGHT', bar, 'RIGHT', -4, 0) @@ -236,4 +236,4 @@ local function StyleVEM(event, addon) MOD:SafeEventRemoval("VEM", event) end end -MOD:SaveAddonStyle("VEM", StyleVEM, nil, true) \ No newline at end of file +MOD:SaveAddonStyle("VEM", StyleVEM, nil, true) diff --git a/SVUI_Skins/components/atlas.lua b/SVUI_Skins/components/atlas.lua index 8538392..cf02325 100644 --- a/SVUI_Skins/components/atlas.lua +++ b/SVUI_Skins/components/atlas.lua @@ -14,17 +14,16 @@ local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; ---[[ -########################################################## +--[[ +########################################################## HELPERS ########################################################## ]]-- local RING_TEXTURE = [[Interface\AddOns\SVUI_Skins\artwork\FOLLOWER-RING]] local LVL_TEXTURE = [[Interface\AddOns\SVUI_Skins\artwork\FOLLOWER-LEVEL]] -local HIGHLIGHT_TEXTURE = SV.BaseTexture local DEFAULT_COLOR = {r = 0.25, g = 0.25, b = 0.25}; ---[[ -########################################################## +--[[ +########################################################## STYLE ########################################################## ]]-- @@ -53,4 +52,4 @@ SV:SetAtlasFilter("Garr_FollowerToast-Rare"); SV:SetAtlasFilter("GarrLanding-MinimapIcon-Horde-Up"); SV:SetAtlasFilter("GarrLanding-MinimapIcon-Horde-Down"); SV:SetAtlasFilter("GarrLanding-MinimapIcon-Alliance-Up"); -SV:SetAtlasFilter("GarrLanding-MinimapIcon-Alliance-Down"); \ No newline at end of file +SV:SetAtlasFilter("GarrLanding-MinimapIcon-Alliance-Down"); diff --git a/SVUI_Skins/components/atlas/garrison.lua b/SVUI_Skins/components/atlas/garrison.lua index 8538392..cf02325 100644 --- a/SVUI_Skins/components/atlas/garrison.lua +++ b/SVUI_Skins/components/atlas/garrison.lua @@ -14,17 +14,16 @@ local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; ---[[ -########################################################## +--[[ +########################################################## HELPERS ########################################################## ]]-- local RING_TEXTURE = [[Interface\AddOns\SVUI_Skins\artwork\FOLLOWER-RING]] local LVL_TEXTURE = [[Interface\AddOns\SVUI_Skins\artwork\FOLLOWER-LEVEL]] -local HIGHLIGHT_TEXTURE = SV.BaseTexture local DEFAULT_COLOR = {r = 0.25, g = 0.25, b = 0.25}; ---[[ -########################################################## +--[[ +########################################################## STYLE ########################################################## ]]-- @@ -53,4 +52,4 @@ SV:SetAtlasFilter("Garr_FollowerToast-Rare"); SV:SetAtlasFilter("GarrLanding-MinimapIcon-Horde-Up"); SV:SetAtlasFilter("GarrLanding-MinimapIcon-Horde-Down"); SV:SetAtlasFilter("GarrLanding-MinimapIcon-Alliance-Up"); -SV:SetAtlasFilter("GarrLanding-MinimapIcon-Alliance-Down"); \ No newline at end of file +SV:SetAtlasFilter("GarrLanding-MinimapIcon-Alliance-Down"); diff --git a/SVUI_Skins/components/blizzard/achievement.lua b/SVUI_Skins/components/blizzard/achievement.lua index c32eb24..542c1f1 100644 --- a/SVUI_Skins/components/blizzard/achievement.lua +++ b/SVUI_Skins/components/blizzard/achievement.lua @@ -19,30 +19,30 @@ local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; ---[[ -########################################################## +--[[ +########################################################## HELPERS ########################################################## ]]-- local AchievementFrameList = { - "AchievementFrame", - "AchievementFrameCategories", - "AchievementFrameSummary", - "AchievementFrameHeader", - "AchievementFrameSummaryCategoriesHeader", - "AchievementFrameSummaryAchievementsHeader", - "AchievementFrameStatsBG", - "AchievementFrameAchievements", - "AchievementFrameComparison", - "AchievementFrameComparisonHeader", - "AchievementFrameComparisonSummaryPlayer", + "AchievementFrame", + "AchievementFrameCategories", + "AchievementFrameSummary", + "AchievementFrameHeader", + "AchievementFrameSummaryCategoriesHeader", + "AchievementFrameSummaryAchievementsHeader", + "AchievementFrameStatsBG", + "AchievementFrameAchievements", + "AchievementFrameComparison", + "AchievementFrameComparisonHeader", + "AchievementFrameComparisonSummaryPlayer", "AchievementFrameComparisonSummaryFriend" } local AchievementTextureList = { - "AchievementFrameStats", - "AchievementFrameSummary", - "AchievementFrameAchievements", + "AchievementFrameStats", + "AchievementFrameSummary", + "AchievementFrameAchievements", "AchievementFrameComparison" } @@ -57,23 +57,23 @@ local AchievementItemButtons = { } local _hook_DescriptionColor = function(self, r, g, b) - if(r ~= 0.6 or g ~= 0.6 or b ~= 0.6) then + if(r ~= 0.6 or g ~= 0.6 or b ~= 0.6) then self:SetTextColor(0.6, 0.6, 0.6) - end + end end local _hook_HiddenDescriptionColor = function(self, r, g, b) - if(r ~= 1 or g ~= 1 or b ~= 1) then + if(r ~= 1 or g ~= 1 or b ~= 1) then self:SetTextColor(1, 1, 1) - end + end end local _hook_TrackingPoint = function(self, anchor, parent, relative, x, y) local actual = self.ListParent - if(anchor ~= "BOTTOMLEFT" or parent ~= actual or relative ~= "BOTTOMLEFT" or x ~= 5 or y ~= 5) then + if(anchor ~= "BOTTOMLEFT" or parent ~= actual or relative ~= "BOTTOMLEFT" or x ~= 5 or y ~= 5) then self:ClearAllPoints() self:SetPoint("BOTTOMLEFT", actual, "BOTTOMLEFT", 5, 5) - end + end end local _hook_AchievementsUpdate = function() @@ -95,11 +95,11 @@ local _hook_AchievementsUpdate = function() if(desc) then desc:SetTextColor(0.6, 0.6, 0.6) end if(iconbling) then iconbling:Die() end if(iconover) then iconover:Die() end - if(icontex) then + if(icontex) then icontex:SetTexCoord(unpack(_G.SVUI_ICON_COORDS)) icontex:InsetPoints() end - if(icon and not icon.Panel) then + if(icon and not icon.Panel) then icon:SetStyle("!_Frame", "Icon") icon:SetHeight(icon:GetHeight() - 14) icon:SetWidth(icon:GetWidth() - 14) @@ -107,9 +107,9 @@ local _hook_AchievementsUpdate = function() icon:SetPoint("LEFT", 6, 0) end - if summary.accountWide then + if summary.accountWide then summary:SetBackdropBorderColor(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) - else + else summary:SetBackdropBorderColor(0,0,0,1) end end @@ -121,47 +121,47 @@ local function BarStyleHelper(bar) bar:SetStatusBarTexture(SV.media.statusbar.default) bar:SetStatusBarColor(4/255, 179/255, 30/255) bar:SetStyle("Frame", "Default") - if _G[bar:GetName().."Title"]then + if _G[bar:GetName().."Title"]then _G[bar:GetName().."Title"]:SetPoint("LEFT", 4, 0) - end - if _G[bar:GetName().."Label"]then + end + if _G[bar:GetName().."Label"]then _G[bar:GetName().."Label"]:SetPoint("LEFT", 4, 0) - end - if _G[bar:GetName().."Text"]then + end + if _G[bar:GetName().."Text"]then _G[bar:GetName().."Text"]:SetPoint("RIGHT", -4, 0) - end -end ---[[ -########################################################## + end +end +--[[ +########################################################## ACHIEVEMENTFRAME MODR ########################################################## ]]-- local function AchievementStyle() - if SV.db.Skins.blizzard.enable ~= true or SV.db.Skins.blizzard.achievement ~= true then - return + if SV.db.Skins.blizzard.enable ~= true or SV.db.Skins.blizzard.achievement ~= true then + return end AchievementFrameHeader:EnableMouse(false) - for _, gName in pairs(AchievementFrameList) do + for _, gName in pairs(AchievementFrameList) do local frame = _G[gName] if(frame) then frame:RemoveTextures(true) end end - + for _, gName in pairs(AchievementTextureList) do local frame = _G[gName] if(frame) then local count = frame:GetNumChildren() - for i = 1, count do + for i = 1, count do local childFrame = select(i, frame:GetChildren()) - if(childFrame and not childFrame:GetName()) then + if(childFrame and not childFrame:GetName()) then childFrame:SetBackdrop(nil) - end + end end end - end + end SV.API:Set("Window", AchievementFrame, false, false, 1, 4, 8) @@ -191,7 +191,7 @@ local function AchievementStyle() SV.API:Set("Tab", tab) tab:SetFrameLevel(tab:GetFrameLevel() + 2) end - end + end BarStyleHelper(AchievementFrameSummaryCategoriesStatusBar) BarStyleHelper(AchievementFrameComparisonSummaryPlayerStatusBar) @@ -219,19 +219,19 @@ local function AchievementStyle() end AchievementFrame:HookScript("OnShow", function(self) - if(self.containerStyled) then return end + if(self.containerStyled) then return end for i = 1, 20 do SV.API:Set("!_ItemButton", _G["AchievementFrameCategoriesContainerButton"..i]) - end - self.containerStyled = true + end + self.containerStyled = true end) hooksecurefunc("AchievementButton_DisplayAchievement", function(self) - if(self.accountWide and self.bg3) then + if(self.accountWide and self.bg3) then self.bg3:SetBackdropBorderColor(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) - elseif self.bg3 then + elseif self.bg3 then self.bg3:SetBackdropBorderColor(0,0,0) - end + end end) hooksecurefunc("AchievementFrameSummary_UpdateAchievements", _hook_AchievementsUpdate) @@ -277,7 +277,7 @@ local function AchievementStyle() local tex = _G[gName.."IconTexture"] if(bling) then bling:Die() end if(over) then over:Die() end - if(tex) then + if(tex) then tex:SetTexCoord(unpack(_G.SVUI_ICON_COORDS)) tex:InsetPoints() end @@ -288,7 +288,7 @@ local function AchievementStyle() icon:ClearAllPoints() icon:SetPoint("LEFT", 6, 0) end - + if(track) then track:ClearAllPoints() track:SetPoint("BOTTOMLEFT", 1, 5) @@ -300,18 +300,18 @@ local function AchievementStyle() end local u = {"Player", "Friend"} - for c, v in pairs(u) do - for f = 1, 9 do + for c, v in pairs(u) do + for f = 1, 9 do local d = "AchievementFrameComparisonContainerButton"..f..v; _G[d]:RemoveTextures() _G[d.."Background"]:Die() - if _G[d.."Description"]then + if _G[d.."Description"]then _G[d.."Description"]:SetTextColor(0.6, 0.6, 0.6) hooksecurefunc(_G[d.."Description"], "SetTextColor", _hook_DescriptionColor) - end + end _G[d].bg1 = _G[d]:CreateTexture(nil, "BACKGROUND") _G[d].bg1:SetDrawLayer("BACKGROUND", 4) - _G[d].bg1:SetTexture(SV.BaseTexture) + _G[d].bg1:SetTexture(SV.media.background.transparent) _G[d].bg1:SetVertexColor(unpack(SV.media.color.default)) _G[d].bg1:SetPoint("TOPLEFT", 4, -4) _G[d].bg1:SetPoint("BOTTOMRIGHT", -4, 4) @@ -331,9 +331,9 @@ local function AchievementStyle() _G[d].bg4:SetPoint("TOPLEFT", 1, -1) _G[d].bg4:SetPoint("BOTTOMRIGHT", -1, 1) - if v == "Friend"then + if v == "Friend"then _G[d.."Shield"]:SetPoint("TOPRIGHT", _G["AchievementFrameComparisonContainerButton"..f.."Friend"], "TOPRIGHT", -20, -3) - end + end _G[d.."IconBling"]:Die() _G[d.."IconOverlay"]:Die() @@ -344,28 +344,28 @@ local function AchievementStyle() _G[d.."Icon"]:SetPoint("LEFT", 6, 0) _G[d.."IconTexture"]:SetTexCoord(unpack(_G.SVUI_ICON_COORDS)) _G[d.."IconTexture"]:InsetPoints() - end + end end hooksecurefunc("AchievementFrameComparison_DisplayAchievement", function(i) local w = i.player; - local x = i.friend + local x = i.friend w.titleBar:Die() x.titleBar:Die() - if not w.bg3 or not x.bg3 then - return - end - if w.accountWide then + if not w.bg3 or not x.bg3 then + return + end + if w.accountWide then w.bg3:SetTexture(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) - else + else w.bg3:SetTexture(0,0,0,1) - end + end - if x.accountWide then + if x.accountWide then x.bg3:SetTexture(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) - else + else x.bg3:SetTexture(0,0,0,1) - end + end end) for f = 1, 20 do @@ -385,8 +385,8 @@ local function AchievementStyle() hooksecurefunc("AchievementButton_GetProgressBar", function(y) local d = _G["AchievementFrameProgressBar"..y] - if d then - if not d.styled then + if d then + if not d.styled then d:RemoveTextures() d:SetStatusBarTexture(SV.media.statusbar.default) d:SetStatusBarColor(4/255, 179/255, 30/255) @@ -394,7 +394,7 @@ local function AchievementStyle() d:SetHeight(d:GetHeight()-2) d.bg1 = d:CreateTexture(nil, "BACKGROUND") d.bg1:SetDrawLayer("BACKGROUND", 4) - d.bg1:SetTexture(SV.BaseTexture) + d.bg1:SetTexture(SV.media.background.transparent) d.bg1:SetVertexColor(unpack(SV.media.color.default)) d.bg1:SetAllPoints() d.bg3 = d:CreateTexture(nil, "BACKGROUND") @@ -405,58 +405,58 @@ local function AchievementStyle() d.text:ClearAllPoints() d.text:SetPoint("CENTER", d, "CENTER", 0, -1) d.text:SetJustifyH("CENTER") - if y>1 then + if y>1 then d:ClearAllPoints() d:SetPoint("TOP", _G["AchievementFrameProgressBar"..y-1], "BOTTOM", 0, -5) hooksecurefunc(d, "SetPoint", function(k, p, q, r, s, t, z) - if not z then + if not z then k:ClearAllPoints()k:SetPoint("TOP", _G["AchievementFrameProgressBar"..y-1], "BOTTOM", 0, -5, true) - end + end end) - end - d.styled = true - end - end + end + d.styled = true + end + end end) hooksecurefunc("AchievementObjectives_DisplayCriteria", function(A, B) local C = GetAchievementNumCriteria(B) local D, E = 0, 0; - for f = 1, C do + for f = 1, C do local F, G, H, I, J, K, L, M, N = GetAchievementCriteriaInfo(B, f) - if G == CRITERIA_TYPE_ACHIEVEMENT and M then + if G == CRITERIA_TYPE_ACHIEVEMENT and M then E = E+1; local O = AchievementButton_GetMeta(E) - if A.completed and H then + if A.completed and H then O.label:SetShadowOffset(0, 0) O.label:SetTextColor(1, 1, 1, 1) - elseif H then + elseif H then O.label:SetShadowOffset(1, -1) O.label:SetTextColor(0, 1, 0, 1) - else + else O.label:SetShadowOffset(1, -1) O.label:SetTextColor(.6, .6, .6, 1) - end - elseif G ~= 1 then + end + elseif G ~= 1 then D = D+1; local P = AchievementButton_GetCriteria(D) - if A.completed and H then + if A.completed and H then P.name:SetTextColor(1, 1, 1, 1) P.name:SetShadowOffset(0, 0) - elseif H then + elseif H then P.name:SetTextColor(0, 1, 0, 1) P.name:SetShadowOffset(1, -1) - else + else P.name:SetTextColor(.6, .6, .6, 1) P.name:SetShadowOffset(1, -1) - end - end - end + end + end + end end) -end ---[[ -########################################################## +end +--[[ +########################################################## MOD LOADING ########################################################## ]]-- -MOD:SaveBlizzardStyle("Blizzard_AchievementUI", AchievementStyle) \ No newline at end of file +MOD:SaveBlizzardStyle("Blizzard_AchievementUI", AchievementStyle) diff --git a/SVUI_Skins/components/blizzard/guild.lua b/SVUI_Skins/components/blizzard/guild.lua index 5552a5e..83cdee2 100644 --- a/SVUI_Skins/components/blizzard/guild.lua +++ b/SVUI_Skins/components/blizzard/guild.lua @@ -18,15 +18,15 @@ local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; ---[[ -########################################################## +--[[ +########################################################## HELPERS ########################################################## ]]-- local format = string.format; local internalTest = false; -local GuildFrameList = { +local GuildFrameList = { "GuildNewPerksFrame", "GuildFrameInset", "GuildFrameBottomInset", @@ -84,7 +84,7 @@ local CalendarIconList = { [CALENDAR_EVENTTYPE_OTHER] = "Interface\\Calendar\\UI-Calendar-Event-Other" }; -local LFGFrameList = { +local LFGFrameList = { "LookingForGuildPvPButton", "LookingForGuildWeekendsButton", "LookingForGuildWeekdaysButton", @@ -98,13 +98,13 @@ local function GCTabHelper(tab) tab.Panel:Hide() tab.bg1 = tab:CreateTexture(nil,"BACKGROUND") tab.bg1:SetDrawLayer("BACKGROUND",4) - tab.bg1:SetTexture(SV.BaseTexture) + tab.bg1:SetTexture(SV.media.background.transparent) tab.bg1:SetVertexColor(unpack(SV.media.color.default)) tab.bg1:InsetPoints(tab.Panel,1) tab.bg3 = tab:CreateTexture(nil,"BACKGROUND") tab.bg3:SetDrawLayer("BACKGROUND",2) tab.bg3:SetTexture(0,0,0,1) - tab.bg3:SetAllPoints(tab.Panel) + tab.bg3:SetAllPoints(tab.Panel) end local function Tab_OnEnter(this) @@ -138,20 +138,20 @@ local function ChangeTabHelper(this) local a,b,c,d,e = this:GetPoint() this:SetPoint(a,b,c,1,e) -end +end local function StyleSortingButton(button) - if button.styled then return end + if button.styled then return end local outer = button:CreateTexture(nil, "OVERLAY") outer:WrapPoints(button, 6, 6) outer:SetTexture(SV.media.button.round) - outer:SetGradient("VERTICAL", 0.4, 0.47, 0.5, 0.3, 0.33, 0.35) - + outer:SetGradient("VERTICAL", 0.4, 0.47, 0.5, 0.3, 0.33, 0.35) + local icon = button:CreateTexture(nil, "OVERLAY") icon:WrapPoints(button, 6, 6) - if button.SetNormalTexture then + if button.SetNormalTexture then local iconTex = button:GetNormalTexture() iconTex:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) SetPortraitToTexture(icon, iconTex) @@ -163,53 +163,53 @@ local function StyleSortingButton(button) hover:SetTexture(SV.media.button.round) hover:SetGradient(unpack(SV.media.gradient.yellow)) - if button.SetPushedTexture then + if button.SetPushedTexture then local pushed = button:CreateTexture(nil, "BORDER") pushed:WrapPoints(button, 6, 6) pushed:SetTexture(SV.media.button.round) pushed:SetGradient(unpack(SV.media.gradient.highlight)) button:SetPushedTexture(pushed) - end + end - if button.SetCheckedTexture then + if button.SetCheckedTexture then local checked = button:CreateTexture(nil, "BORDER") checked:WrapPoints(button, 6, 6) checked:SetTexture(SV.media.button.round) checked:SetGradient(unpack(SV.media.gradient.green)) button:SetCheckedTexture(checked) - end + end - if button.SetDisabledTexture then + if button.SetDisabledTexture then local disabled = button:CreateTexture(nil, "BORDER") disabled:WrapPoints(button, 6, 6) disabled:SetTexture(SV.media.button.round) disabled:SetGradient(unpack(SV.media.gradient.default)) button:SetDisabledTexture(disabled) - end + end local cd = button:GetName() and _G[button:GetName().."Cooldown"] - if cd then + if cd then cd:ClearAllPoints() cd:InsetPoints() - end + end button.styled = true end local _hook_RankOrder_OnUpdate = function() - for i = 1, GuildControlGetNumRanks()do + for i = 1, GuildControlGetNumRanks()do local frame = _G["GuildControlUIRankOrderFrameRank"..i] - if frame then + if frame then frame.downButton:SetStyle("Button") frame.upButton:SetStyle("Button") frame.deleteButton:SetStyle("Button") - if not frame.nameBox.Panel then + if not frame.nameBox.Panel then frame.nameBox:SetStyle("Editbox") - end + end frame.nameBox.Panel:SetPoint("TOPLEFT",-2,-4) frame.nameBox.Panel:SetPoint("BOTTOMRIGHT",-4,4) - end - end -end + end + end +end local function GuildInfoEvents_SetButton(button, eventIndex) local dateData = date("*t") @@ -217,34 +217,34 @@ local function GuildInfoEvents_SetButton(button, eventIndex) local formattedTime = GameTime_GetFormattedTime(hour, minute, true) local unformattedText; if dateData["day"] == day and dateData["month"] == month then - unformattedText = NORMAL_FONT_COLOR_CODE..GUILD_EVENT_TODAY..FONT_COLOR_CODE_CLOSE + unformattedText = NORMAL_FONT_COLOR_CODE..GUILD_EVENT_TODAY..FONT_COLOR_CODE_CLOSE else local year = dateData["year"] if month < dateData["month"] then - year = year + 1 - end + year = year + 1 + end local newTime = time{year = year, month = month, day = day} if(((newTime - time()) < 518400) and CALENDAR_WEEKDAY_NAMES[weekday]) then unformattedText = CALENDAR_WEEKDAY_NAMES[weekday] - elseif CALENDAR_WEEKDAY_NAMES[weekday]and day and month then + elseif CALENDAR_WEEKDAY_NAMES[weekday]and day and month then unformattedText = format(GUILD_NEWS_DATE, CALENDAR_WEEKDAY_NAMES[weekday], day, month) - end - end + end + end if button.text and unformattedText then button.text:SetFormattedText(GUILD_EVENT_FORMAT, unformattedText, formattedTime, title) - end + end button.index = eventIndex; if button.icon.type ~= "event" then button.icon.type = "event" button.icon:SetTexCoord(0, 1, 0, 1) button.icon:SetWidth(14) button.icon:SetHeight(14) - end + end if CalendarIconList[eventType] then button.icon:SetTexture(CalendarIconList[eventType]) else button.icon:SetTexture("Interface\\LFGFrame\\LFGIcon-"..textureName) - end + end end local _hook_UIRankOrder = function(self) @@ -252,7 +252,7 @@ local _hook_UIRankOrder = function(self) end local _hook_GuildBankFrame_Update = function(self) - if GuildBankFrame.mode ~= "bank" then return end + if GuildBankFrame.mode ~= "bank" then return end local curTab = GetCurrentGuildBankTab() local numSlots = NUM_SLOTS_PER_GUILDBANK_GROUP local maxSlots = MAX_GUILDBANK_SLOTS_PER_TAB @@ -260,7 +260,7 @@ local _hook_GuildBankFrame_Update = function(self) for i = 1, maxSlots do btnID = i % numSlots if btnID == 0 then - btnID = numSlots + btnID = numSlots end slotID = ceil((i - 0.5) / numSlots) btnName = ("GuildBankColumn%dButton%d"):format(slotID, btnID) @@ -273,10 +273,10 @@ local _hook_GuildBankFrame_Update = function(self) if(quality > 1) then r, g, b = GetItemQualityColor(quality) end - end + end button:SetBackdropBorderColor(r, g, b, a) end - end + end end local _hook_BankTabPermissions = function(self) @@ -284,15 +284,15 @@ local _hook_BankTabPermissions = function(self) tabs = GetNumGuildBankTabs() - if tabs < MAX_BUY_GUILDBANK_TABS then - tabs = tabs + 1 + if tabs < MAX_BUY_GUILDBANK_TABS then + tabs = tabs + 1 end - for i = 1, tabs do + for i = 1, tabs do baseName = ("GuildControlBankTab%d"):format(i) ownedName = ("%sOwned"):format(baseName) tab = _G[ownedName] - + if(tab) then if(tab.tabIcon) then tab.tabIcon:SetTexCoord(unpack(_G.SVUI_ICON_COORDS)) end if(tab.editBox) then tab.editBox:SetStyle("Editbox") end @@ -324,17 +324,17 @@ local _hook_BankTabPermissions = function(self) end end end - end - internalTest = true + end + internalTest = true end ---[[ -########################################################## +--[[ +########################################################## GUILDFRAME MODRS ########################################################## ]]-- local function GuildBankStyle() if SV.db.Skins.blizzard.enable ~= true or SV.db.Skins.blizzard.gbank ~= true then - return + return end SV.API:Set("Window", GuildBankFrame) @@ -343,11 +343,11 @@ local function GuildBankStyle() GuildBankMoneyFrameBackground:Die() SV.API:Set("ScrollFrame", GuildBankPopupScrollFrameScrollBar) - for i = 1, GuildBankFrame:GetNumChildren() do + for i = 1, GuildBankFrame:GetNumChildren() do local child = select(i, GuildBankFrame:GetChildren()) if(child and child.GetPushedTexture and child:GetPushedTexture() and not child:GetName()) then SV.API:Set("CloseButton", child) - end + end end GuildBankFrameDepositButton:SetStyle("Button") @@ -360,7 +360,7 @@ local function GuildBankStyle() -- local sortButton = CreateFrame("Button", nil, GuildBankFrame) -- sortButton:SetPoint("BOTTOMLEFT", GuildBankFrame, "BOTTOMRIGHT", 2, 0) -- sortButton:SetSize(36, 36) - -- sortButton:SetStyle("DockButton") + -- sortButton:SetStyle("DockButton") -- sortButton:SetNormalTexture(BAGS.media.cleanupIcon) -- StyleSortingButton(sortButton) -- local Sort_OnClick = BAGS:RunSortingProcess(BAGS.Sort, "guild") @@ -372,13 +372,13 @@ local function GuildBankStyle() GuildBankInfoScrollFrame:RemoveTextures() GuildBankInfoScrollFrame:SetWidth(GuildBankInfoScrollFrame:GetWidth()-8) GuildBankTransactionsScrollFrame:RemoveTextures() - + for i = 1, NUM_GUILDBANK_COLUMNS do local frame = _G["GuildBankColumn"..i] if(frame) then frame:RemoveTextures() local baseName = ("GuildBankColumn%dButton"):format(i) - for slotID = 1, NUM_SLOTS_PER_GUILDBANK_GROUP do + for slotID = 1, NUM_SLOTS_PER_GUILDBANK_GROUP do local btnName = ("%s%d"):format(baseName, slotID) local button = _G[btnName] if(button) then @@ -397,7 +397,7 @@ local function GuildBankStyle() end end end - end + end for i = 1, 8 do local baseName = ("GuildBankTab%d"):format(i) @@ -416,7 +416,7 @@ local function GuildBankStyle() end end end - end + end for i = 1, 4 do local baseName = ("GuildBankFrameTab%d"):format(i) @@ -424,7 +424,7 @@ local function GuildBankStyle() if(frame) then SV.API:Set("Tab", _G[baseName]) end - end + end hooksecurefunc('GuildBankFrame_Update', _hook_GuildBankFrame_Update) @@ -457,17 +457,17 @@ local function GuildBankStyle() icon:SetTexCoord(unpack(_G.SVUI_ICON_COORDS)) end end - end + end SV.API:Set("ScrollFrame", GuildBankTransactionsScrollFrameScrollBar) SV.API:Set("ScrollFrame", GuildBankInfoScrollFrameScrollBar) -end +end local function GuildFrameStyle() if SV.db.Skins.blizzard.enable ~= true or SV.db.Skins.blizzard.guild ~= true then - return + return end - + SV.API:Set("Window", GuildFrame) SV.API:Set("CloseButton", GuildMemberDetailCloseButton) @@ -488,12 +488,12 @@ local function GuildFrameStyle() button:RemoveTextures(true) button:SetStyle("Button") end - end + end for i = 1, #GuildCheckBoxList do local check = _G[GuildCheckBoxList[i]] if(check) then check:SetStyle("Checkbox") end - end + end for i = 1, 5 do local tab = _G["GuildFrameTab"..i] @@ -504,7 +504,7 @@ local function GuildFrameStyle() end end end - + GuildNewsBossModel:SetStyle("Frame", 'Transparent') GuildNewsBossModelTextFrame:SetStyle("Frame", "Default") GuildNewsBossModelTextFrame.Panel:SetPoint("TOPLEFT", GuildNewsBossModel.Panel, "BOTTOMLEFT", 0, -1) @@ -515,11 +515,11 @@ local function GuildFrameStyle() GuildRecruitmentDamagerButton.checkButton:SetStyle("Checkbox") GuildFactionBar:RemoveTextures() - GuildFactionBar.progress:SetTexture(SV.BaseTexture) + GuildFactionBar.progress:SetTexture(SV.media.statusbar.default) GuildFactionBar:SetStyle("Frame", "Inset") GuildFactionBar.Panel:SetPoint("TOPLEFT", GuildFactionBar.progress, "TOPLEFT", -1, 1) GuildFactionBar.Panel:SetPoint("BOTTOMRIGHT", GuildFactionBar, "BOTTOMRIGHT", 1, 1) - + GuildRosterContainer:SetStyle("Frame", "Inset") SV.API:Set("ScrollFrame", GuildRosterContainerScrollBar, 4, -4) GuildRosterShowOfflineButton:SetStyle("Checkbox") @@ -529,7 +529,7 @@ local function GuildFrameStyle() if(btn) then btn:RemoveTextures(true) end - end + end SV.API:Set("DropDown", GuildRosterViewDropdown, 200) @@ -557,8 +557,8 @@ local function GuildFrameStyle() if(btn.header) then btn.header:Die() end btn:RemoveTextures() btn:SetStyle("Button") - end - end + end + end GuildNewsFiltersFrame:RemoveTextures() GuildNewsFiltersFrame:SetStyle("!_Frame", "Transparent", true) @@ -569,7 +569,7 @@ local function GuildFrameStyle() if(btn) then btn:SetStyle("Checkbox") end - end + end GuildNewsFiltersFrame:SetPoint("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -20) SV.API:Set("ScrollFrame", GuildNewsContainerScrollBar, 4, 4) @@ -604,7 +604,7 @@ local function GuildFrameStyle() local editChildren = GuildTextEditFrame:GetNumChildren() - for i = 1, editChildren do + for i = 1, editChildren do local child = select(i, GuildTextEditFrame:GetChildren()) if(child:GetName() == "GuildTextEditFrameCloseButton") then if(child:GetWidth() < 33) then @@ -612,7 +612,7 @@ local function GuildFrameStyle() else child:SetStyle("Button") end - end + end end SV.API:Set("ScrollFrame", GuildLogScrollFrameScrollBar, 4, 4) @@ -620,22 +620,22 @@ local function GuildFrameStyle() local logChildren = GuildLogFrame:GetNumChildren() - for i = 1, logChildren do + for i = 1, logChildren do local child = select(i, GuildLogFrame:GetChildren()) - if child:GetName() == "GuildLogFrameCloseButton" then + if child:GetName() == "GuildLogFrameCloseButton" then if(child:GetWidth() < 33) then SV.API:Set("CloseButton", child) else child:SetStyle("Button") end - end - end + end + end GuildRewardsFrame:SetStyle("Frame", "Inset") SV.API:Set("ScrollFrame", GuildRewardsContainerScrollBar, 4, -4) SV.API:Set("ScrollFrame", GuildPerksContainerScrollBar, 4, 2) - for i = 1, 8 do + for i = 1, 8 do local button = _G["GuildPerksContainerButton"..i] if button then button:RemoveTextures() @@ -648,15 +648,15 @@ local function GuildFrameStyle() icon:SetParent(button.Panel) end end - end - - for i = 1, 8 do + end + + for i = 1, 8 do local button = _G["GuildRewardsContainerButton"..i] if button then button:RemoveTextures() SV.API:Set("ItemButton", button) end - end + end local maxCalendarEvents = CalendarGetNumGuildEvents(); local scrollFrame = GuildInfoFrameApplicantsContainer; @@ -669,8 +669,8 @@ local function GuildFrameStyle() button.selectedTex:Die() button:GetHighlightTexture():Die() button:SetBackdrop(nil) - end -end + end +end local function GuildControlStyle() if SV.db.Skins.blizzard.enable~=true or SV.db.Skins.blizzard.guildcontrol~=true then return end @@ -694,7 +694,7 @@ local function GuildControlStyle() for i=1, NUM_RANK_FLAGS do local check = _G["GuildControlUIRankSettingsFrameCheckbox"..i] - if(check) then check:SetStyle("Checkbox") end + if(check) then check:SetStyle("Checkbox") end end GuildControlUIRankOrderFrameNewButton:SetStyle("Button") @@ -709,7 +709,7 @@ local function GuildControlStyle() SV.API:Set("DropDown", GuildControlUIRankBankFrameRankDropDown, 180) GuildControlUIRankBankFrameRankDropDownButton:SetWidth(20) -end +end local function LFGuildFrameStyle() if(SV.db.Skins.blizzard.enable ~= true or SV.db.Skins.blizzard.lfguild ~= true) then return end @@ -720,7 +720,7 @@ local function LFGuildFrameStyle() local check = _G[LFGFrameList[i]] if(check) then check:SetStyle("Checkbox") end end - + LookingForGuildTankButton.checkButton:SetStyle("Checkbox") LookingForGuildHealerButton.checkButton:SetStyle("Checkbox") LookingForGuildDamagerButton.checkButton:SetStyle("Checkbox") @@ -756,13 +756,13 @@ local function LFGuildFrameStyle() GuildFinderRequestMembershipFrameCancelButton:SetStyle("Button") GuildFinderRequestMembershipFrameInputFrame:RemoveTextures() GuildFinderRequestMembershipFrameInputFrame:SetStyle("!_Frame", "Default") -end ---[[ -########################################################## +end +--[[ +########################################################## MOD LOADING ########################################################## ]]-- MOD:SaveBlizzardStyle("Blizzard_GuildBankUI",GuildBankStyle) MOD:SaveBlizzardStyle("Blizzard_GuildUI",GuildFrameStyle) MOD:SaveBlizzardStyle("Blizzard_GuildControlUI",GuildControlStyle) -MOD:SaveBlizzardStyle("Blizzard_LookingForGuildUI",LFGuildFrameStyle) \ No newline at end of file +MOD:SaveBlizzardStyle("Blizzard_LookingForGuildUI",LFGuildFrameStyle) diff --git a/SVUI_Skins/components/blizzard/lfd.lua b/SVUI_Skins/components/blizzard/lfd.lua index dfd0c23..245affb 100644 --- a/SVUI_Skins/components/blizzard/lfd.lua +++ b/SVUI_Skins/components/blizzard/lfd.lua @@ -218,12 +218,12 @@ local function LFDFrameStyle() LFDQueueFrameRoleButtonLeader.leadIcon = LFDQueueFrameRoleButtonLeader:CreateTexture(nil, 'BACKGROUND') LFDQueueFrameRoleButtonLeader.leadIcon:SetTexture([[Interface\GroupFrame\UI-Group-LeaderIcon]]) LFDQueueFrameRoleButtonLeader.leadIcon:SetPoint(LFDQueueFrameRoleButtonLeader:GetNormalTexture():GetPoint()) - LFDQueueFrameRoleButtonLeader.leadIcon:SetSize(50) + LFDQueueFrameRoleButtonLeader.leadIcon:SetSize(50, 50) LFDQueueFrameRoleButtonLeader.leadIcon:SetAlpha(0.4) RaidFinderQueueFrameRoleButtonLeader.leadIcon = RaidFinderQueueFrameRoleButtonLeader:CreateTexture(nil, 'BACKGROUND') RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetTexture([[Interface\GroupFrame\UI-Group-LeaderIcon]]) RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetPoint(RaidFinderQueueFrameRoleButtonLeader:GetNormalTexture():GetPoint()) - RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetSize(50) + RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetSize(50, 50) RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetAlpha(0.4) hooksecurefunc('LFG_DisableRoleButton', function(self) @@ -264,7 +264,7 @@ local function LFDFrameStyle() button:SetStyle("Button") button.icon:SetTexCoord(unpack(_G.SVUI_ICON_COORDS)) button.icon:SetDrawLayer("OVERLAY") - button.icon:SetSize(40) + button.icon:SetSize(40, 40) button.icon:ClearAllPoints() button.icon:SetPoint("LEFT", 10, 0) button.border = CreateFrame("Frame", nil, button) diff --git a/SVUI_Skins/components/blizzard/petbattle.lua b/SVUI_Skins/components/blizzard/petbattle.lua index 5cf1c25..d4d5d9c 100644 --- a/SVUI_Skins/components/blizzard/petbattle.lua +++ b/SVUI_Skins/components/blizzard/petbattle.lua @@ -233,7 +233,7 @@ local function PetBattleStyle() frame.Name:SetFontObject(SystemFont_Shadow_Outline_Huge2) frame.Name:ClearAllPoints() frame.FirstAttack = frame:CreateTexture(nil, "ARTWORK") - frame.FirstAttack:SetSize(30) + frame.FirstAttack:SetSize(30, 30) frame.FirstAttack:SetTexture("Interface\\PetBattles\\PetBattle-StatIcons") if i == 1 then frame.HealthBarBackdrop:SetPoint('TOPLEFT', frame.ActualHealthBar, 'TOPLEFT', -1, 1) @@ -287,7 +287,7 @@ local function PetBattleStyle() frame.BorderAlive:SetAlpha(0) frame.HealthBarBG:SetAlpha(0) frame.HealthDivider:SetAlpha(0) - frame:SetSize(40) + frame:SetSize(40, 40) frame.IconBackdrop = CreateFrame("Frame", nil, frame) frame.IconBackdrop:SetFrameLevel(0) diff --git a/SVUI_Skins/components/blizzard/pvp.lua b/SVUI_Skins/components/blizzard/pvp.lua index ce9d147..8394126 100644 --- a/SVUI_Skins/components/blizzard/pvp.lua +++ b/SVUI_Skins/components/blizzard/pvp.lua @@ -12,8 +12,8 @@ local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; ---[[ -########################################################## +--[[ +########################################################## PVP MODR ########################################################## ]]-- @@ -32,7 +32,7 @@ end local function PVPFrameStyle() if (SV.db.Skins and (SV.db.Skins.blizzard.enable ~= true or SV.db.Skins.blizzard.pvp ~= true)) then - return + return end local HonorFrame = _G.HonorFrame; @@ -40,22 +40,22 @@ local function PVPFrameStyle() local PVPUIFrame = _G.PVPUIFrame; local WarGamesFrame = _G.WarGamesFrame; local PVPReadyDialog = _G.PVPReadyDialog; - + SV.API:Set("Window", PVPUIFrame, true) - + SV.API:Set("CloseButton", PVPUIFrameCloseButton) for g = 1, 2 do SV.API:Set("Tab", _G["PVPUIFrameTab"..g]) end - for i = 1, 4 do + for i = 1, 4 do local btn = _G["PVPQueueFrameCategoryButton"..i] if(btn) then btn.Background:Die() btn.Ring:Die() btn:SetStyle("Button") - btn.Icon:SetSize(45) + btn.Icon:SetSize(45, 45) btn.Icon:SetTexCoord(.15, .85, .15, .85) btn.Icon:SetDrawLayer("OVERLAY", nil, 7) btn.Panel:WrapPoints(btn.Icon) @@ -77,7 +77,7 @@ local function PVPFrameStyle() HonorFrame.BonusFrame.RandomBGButton:SetStyle("Button") HonorFrame.BonusFrame.RandomBGButton.SelectedTexture:InsetPoints() HonorFrame.BonusFrame.RandomBGButton.SelectedTexture:SetTexture(1, 1, 0, 0.1) - + HonorFrame.BonusFrame.DiceButton:DisableDrawLayer("ARTWORK") HonorFrame.BonusFrame.DiceButton:SetHighlightTexture("") HonorFrame.RoleInset:RemoveTextures() @@ -95,16 +95,16 @@ local function PVPFrameStyle() n.bg:SetDesaturated(true) end end) - + local ConquestPointsBar = _G.ConquestPointsBar; - + ConquestFrame.Inset:RemoveTextures() ConquestPointsBarLeft:Die() ConquestPointsBarRight:Die() ConquestPointsBarMiddle:Die() ConquestPointsBarBG:Die() ConquestPointsBarShadow:Die() - ConquestPointsBar.progress:SetTexture(SV.BaseTexture) + ConquestPointsBar.progress:SetTexture(SV.media.statusbar.default) ConquestPointsBar:SetStyle("!_Frame", 'Inset') ConquestPointsBar.Panel:WrapPoints(ConquestPointsBar, nil, -2) ConquestFrame:RemoveTextures() @@ -125,7 +125,7 @@ local function PVPFrameStyle() SV.API:Set("ScrollFrame", WarGamesFrameScrollFrameScrollBar) SV.API:Set("ScrollFrame", WarGamesFrameInfoScrollFrameScrollBar) WarGamesFrame.HorizontalBar:RemoveTextures() - + PVPReadyDialog:RemoveTextures() PVPReadyDialog:SetStyle("Frame", "Pattern") PVPReadyDialogEnterBattleButton:SetStyle("Button") @@ -133,17 +133,17 @@ local function PVPFrameStyle() SV.API:Set("CloseButton", PVPReadyDialogCloseButton) PVPReadyDialogRoleIcon.texture:SetTexture("Interface\\LFGFrame\\UI-LFG-ICONS-ROLEBACKGROUNDS") PVPReadyDialogRoleIcon.texture:SetAlpha(0.5) - + ConquestFrame.Inset:SetStyle("!_Frame", "Inset") WarGamesFrameScrollFrame:SetStyle("Frame", "Inset",false,2,2,6) hooksecurefunc("PVPReadyDialog_Display", _hook_PVPReadyDialogDisplay) -end ---[[ -########################################################## +end +--[[ +########################################################## MOD LOADING ########################################################## ]]-- MOD:SaveBlizzardStyle('Blizzard_PVPUI', PVPFrameStyle) --- /script StaticPopupSpecial_Show(PVPReadyDialog) \ No newline at end of file +-- /script StaticPopupSpecial_Show(PVPReadyDialog) diff --git a/SVUI_TrackOMatic/components/_load.xml b/SVUI_TrackOMatic/components/_load.xml index de680a2..620029a 100644 --- a/SVUI_TrackOMatic/components/_load.xml +++ b/SVUI_TrackOMatic/components/_load.xml @@ -1,4 +1,5 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> +<Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file="triangulate.lua"/> <Script file="unitframe_gps.lua"/> -</Ui> \ No newline at end of file + <Script file="guides.lua"/> +</Ui> diff --git a/SVUI_TrackOMatic/components/guides.lua b/SVUI_TrackOMatic/components/guides.lua new file mode 100644 index 0000000..8e329a3 --- /dev/null +++ b/SVUI_TrackOMatic/components/guides.lua @@ -0,0 +1,84 @@ +--[[ +########################################################## +S V U I By: S.Jackson +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local assert = _G.assert; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local print = _G.print; +local ipairs = _G.ipairs; +local pairs = _G.pairs; +local next = _G.next; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local collectgarbage = _G.collectgarbage; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local string = _G.string; +local math = _G.math; +local bit = _G.bit; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format, find, lower, match = string.format, string.find, string.lower, string.match; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic +local fmod, modf, sqrt = math.fmod, math.modf, math.sqrt; -- Algebra +local atan2, cos, deg, rad, sin = math.atan2, math.cos, math.deg, math.rad, math.sin; -- Trigonometry +local min, huge, random = math.min, math.huge, math.random; -- Uncommon +local sqrt2, max = math.sqrt(2), math.max; +--[[ TABLE METHODS ]]-- +local tcopy, twipe, tsort, tconcat, tdump = table.copy, table.wipe, table.sort, table.concat, table.dump; +--[[ BINARY METHODS ]]-- +local band = bit.band; +--BLIZZARD API +local InCombatLockdown = _G.InCombatLockdown; +local CreateFrame = _G.CreateFrame; +local IsInRaid = _G.IsInRaid; +local IsInGroup = _G.IsInGroup; +local IsInInstance = _G.IsInInstance; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = _G["SVUI"]; +local L = SV.L; +local PLUGIN = select(2, ...); +local CONFIGS = SV.defaults[PLUGIN.Schema]; + +local JOURNAL_CACHE = {}; + +local function CacheEncounterData() + local instanceID = EJ_GetCurrentInstance() + local difficultyID = GetDungeonDifficultyID() + EJ_SetDifficulty(difficultyID) + local bossIndex = 1; + local _, _, encounterID = EJ_GetEncounterInfoByIndex(bossIndex); + while encounterID do + local stack, encounter, _, _, curSectionID = {}, EJ_GetEncounterInfo(encounterID); + + repeat + local title, desc, _, _, _, siblingID, nextSectionID = EJ_GetSectionInfo(curSectionID) + JOURNAL_CACHE[curSectionID] = {title, desc} + table.insert(stack, siblingID) + table.insert(stack, nextSectionID) + curSectionID = table.remove(stack) + until not curSectionID + + bossIndex = bossIndex + 1; + _, _, encounterID = EJ_GetEncounterInfoByIndex(bossIndex); + end +end + +function PLUGIN:InitializeGuides() + LoadAddOn("Blizzard_EncounterJournal") + CacheEncounterData() +end diff --git a/SVUI_UnitFrames/SVUI_UnitFrames.lua b/SVUI_UnitFrames/SVUI_UnitFrames.lua index 32677fb..ef0b737 100644 --- a/SVUI_UnitFrames/SVUI_UnitFrames.lua +++ b/SVUI_UnitFrames/SVUI_UnitFrames.lua @@ -1025,7 +1025,7 @@ function MOD:RefreshUnitLayout(frame, template) classIcon:ClearAllPoints() classIcon:SetAlpha(1) - classIcon:SetSize(size) + classIcon:SetSize(size, size) SV:SetReversePoint(classIcon, ico.classIcon.attachTo, MASTER_GRIP, ico.classIcon.xOffset, ico.classIcon.yOffset) else classIcon:Hide() @@ -1044,11 +1044,11 @@ function MOD:RefreshUnitLayout(frame, template) if(GRID_MODE) then raidIcon:SetAlpha(0.7) - raidIcon:SetSize(10) + raidIcon:SetSize(10, 10) raidIcon:SetPoint("TOP", MASTER_GRIP, "TOP", 0, 0) else raidIcon:SetAlpha(1) - raidIcon:SetSize(size) + raidIcon:SetSize(size, size) SV:SetReversePoint(raidIcon, ico.raidicon.attachTo, MASTER_GRIP, ico.raidicon.xOffset, ico.raidicon.yOffset) end else @@ -1069,11 +1069,11 @@ function MOD:RefreshUnitLayout(frame, template) if(GRID_MODE) then lfd:SetAlpha(0.7) - lfd:SetSize(10) + lfd:SetSize(10, 10) lfd:SetPoint("BOTTOM", MASTER_GRIP, "BOTTOM", 0, 0) else lfd:SetAlpha(1) - lfd:SetSize(size) + lfd:SetSize(size, size) SV:SetReversePoint(lfd, ico.roleIcon.attachTo, MASTER_GRIP, ico.roleIcon.xOffset, ico.roleIcon.yOffset) end else @@ -1095,11 +1095,11 @@ function MOD:RefreshUnitLayout(frame, template) if(GRID_MODE) then roles:SetAlpha(0.7) - roles:SetSize(10) + roles:SetSize(10, 10) roles:SetPoint("CENTER", MASTER_GRIP, "TOPLEFT", 0, 2) else roles:SetAlpha(1) - roles:SetSize(size) + roles:SetSize(size, size) SV:SetReversePoint(roles, ico.raidRoleIcons.attachTo, MASTER_GRIP, ico.raidRoleIcons.xOffset, ico.raidRoleIcons.yOffset) end else diff --git a/SVUI_UnitFrames/class_resources/druid.lua b/SVUI_UnitFrames/class_resources/druid.lua index 06d18c8..8c10ca8 100644 --- a/SVUI_UnitFrames/class_resources/druid.lua +++ b/SVUI_UnitFrames/class_resources/druid.lua @@ -161,6 +161,46 @@ end DRUID ECLIPSE BAR ########################################################## ]]-- +local EclipseDirection = function(self) + if(self.inEclipse) then + local status = GetEclipseDirection() + + if(status == "sun") then + --self.Text:SetText("<") + --self.Text:SetTextColor(0.2, 1, 1, 0.5) + if(not self.Moon[1].anim:IsPlaying()) then + self.Sun[1]:Hide() + self.Sun[1].anim:Finish() + self.Moon[1]:Show() + self.Moon[1].anim:Play() + end + elseif(status == "moon") then + --self.Text:SetText(">") + --self.Text:SetTextColor(1, 0.5, 0, 0.5) + if(not self.Sun[1].anim:IsPlaying()) then + self.Moon[1]:Hide() + self.Moon[1].anim:Finish() + self.Sun[1]:Show() + self.Sun[1].anim:Play() + end + else + --self.Text:SetText("<") + --self.Text:SetTextColor(0.2, 1, 1, 0.5) + self.Sun[1]:Hide() + self.Sun[1].anim:Finish() + self.Moon[1]:Hide() + self.Moon[1].anim:Finish() + end + else + --self.Text:SetText("<") + --self.Text:SetTextColor(0.2, 1, 1, 0.5) + self.Sun[1]:Hide() + self.Sun[1].anim:Finish() + self.Moon[1]:Hide() + self.Moon[1].anim:Finish() + end +end + function MOD:CreateClassBar(playerFrame) local bar = CreateFrame('Frame', nil, playerFrame) bar:SetFrameLevel(playerFrame.TextGrip:GetFrameLevel() + 30) @@ -228,31 +268,8 @@ function MOD:CreateClassBar(playerFrame) chicken.Text:SetShadowOffset(0,0) chicken.Text:SetJustifyH("CENTER") - chicken.PostDirectionChange = { - ["sun"] = function(this) - --this.Text:SetText("<") - --this.Text:SetTextColor(0.2, 1, 1, 0.5) - this.Sun[1]:Hide() - this.Sun[1].anim:Finish() - this.Moon[1]:Show() - this.Moon[1].anim:Play() - end, - ["moon"] = function(this) - --this.Text:SetText(">") - --this.Text:SetTextColor(1, 0.5, 0, 0.5) - this.Moon[1]:Hide() - this.Moon[1].anim:Finish() - this.Sun[1]:Show() - this.Sun[1].anim:Play() - end, - ["none"] = function(this) - this.Text:SetText() - this.Sun[1]:Hide() - this.Sun[1].anim:Finish() - this.Moon[1]:Hide() - this.Moon[1].anim:Finish() - end - } + chicken.PostUpdatePower = EclipseDirection; + chicken.PostUpdateAura = EclipseDirection; local cat = CreateFrame('Frame',nil,bar) cat:SetAllPoints(bar) diff --git a/SVUI_UnitFrames/class_resources/shaman.lua b/SVUI_UnitFrames/class_resources/shaman.lua index 0ea7e52..b73a7b1 100644 --- a/SVUI_UnitFrames/class_resources/shaman.lua +++ b/SVUI_UnitFrames/class_resources/shaman.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 ~= "SHAMAN") then return end ---[[ -########################################################## +if(SV.class ~= "SHAMAN") then return end +--[[ +########################################################## LOCALS ########################################################## ]]-- @@ -46,10 +46,19 @@ local totemTextures = { [EARTH_TOTEM_SLOT] = [[Interface\Addons\SVUI_UnitFrames\assets\Class\SHAMAN-EARTH]], [FIRE_TOTEM_SLOT] = [[Interface\Addons\SVUI_UnitFrames\assets\Class\SHAMAN-FIRE]], [WATER_TOTEM_SLOT] = [[Interface\Addons\SVUI_UnitFrames\assets\Class\SHAMAN-WATER]], - [AIR_TOTEM_SLOT] = [[Interface\Addons\SVUI_UnitFrames\assets\Class\SHAMAN-AIR]], + [AIR_TOTEM_SLOT] = [[Interface\Addons\SVUI_UnitFrames\assets\Class\SHAMAN-AIR]], +}; + +SV.SpecialFX:Register("air", [[Spells\whiteflame_low.m2]], -12, 12, 12, -12, 0.22, 0, 0.52) + +local specEffects = { + [EARTH_TOTEM_SLOT] = "earth", + [FIRE_TOTEM_SLOT] = "fire", + [WATER_TOTEM_SLOT] = "water", + [AIR_TOTEM_SLOT] = "air", }; ---[[ -########################################################## +--[[ +########################################################## POSITIONING ########################################################## ]]-- @@ -78,15 +87,15 @@ local Reposition = function(self) bar[i]:SetHeight(size) bar[i]:SetWidth(size) bar[i]:GetStatusBarTexture():SetHorizTile(false) - if i==1 then + if i==1 then bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) - else - bar[i]:SetPoint("LEFT", bar[i - 1], "RIGHT", -1, 0) + else + bar[i]:SetPoint("LEFT", bar[i - 1], "RIGHT", -1, 0) end - end -end ---[[ -########################################################## + end +end +--[[ +########################################################## SHAMAN ########################################################## ]]-- @@ -106,7 +115,9 @@ function MOD:CreateClassBar(playerFrame) bar[i].backdrop:SetDesaturated(true) bar[i].backdrop:SetVertexColor(0.2,0.2,0.2,0.7) bar[i]:EnableMouse(true) - end + + SV.SpecialFX:SetFXFrame(bar[i], specEffects[totemPriorities[i]], true) + end local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar) classBarHolder:SetPoint("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) @@ -117,5 +128,5 @@ function MOD:CreateClassBar(playerFrame) playerFrame.MaxClassPower = totemMax; playerFrame.RefreshClassBar = Reposition; playerFrame.TotemBars = bar - return 'TotemBars' -end \ No newline at end of file + return 'TotemBars' +end diff --git a/SVUI_UnitFrames/elements/essentials.lua b/SVUI_UnitFrames/elements/essentials.lua index e2e1389..56be10c 100644 --- a/SVUI_UnitFrames/elements/essentials.lua +++ b/SVUI_UnitFrames/elements/essentials.lua @@ -311,7 +311,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) end frame.ActionPanel.class = CreateFrame("Frame", nil, frame.TextGrip) - frame.ActionPanel.class:SetSize(18) + frame.ActionPanel.class:SetSize(18, 18) frame.ActionPanel.class:SetPoint("TOPLEFT", frame.ActionPanel, "TOPLEFT", 2, -2) frame.ActionPanel.class:SetStyle("Frame", "Default", true, 2, 0, 0) @@ -356,18 +356,6 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) SV.Animate:Sprite4(stunned, 0.12, false, true) frame.LossOfControl.stunned = stunned - --stunned:Hide() - -- LossOfControlFrame:HookScript("OnShow", function() - -- if(_G["SVUI_Player"] and _G["SVUI_Player"].LossOfControl) then - -- _G["SVUI_Player"].LossOfControl:Show() - -- end - -- end) - -- LossOfControlFrame:HookScript("OnHide", function() - -- if(_G["SVUI_Player"] and _G["SVUI_Player"].LossOfControl) then - -- _G["SVUI_Player"].LossOfControl:Hide() - -- end - -- end) - frame.LossOfControl:SetParent(LossOfControlFrame) end elseif(unit and (unit == 'pet' or unit == 'targettarget')) then diff --git a/SVUI_UnitFrames/elements/misc.lua b/SVUI_UnitFrames/elements/misc.lua index d3f5f35..9abfef8 100644 --- a/SVUI_UnitFrames/elements/misc.lua +++ b/SVUI_UnitFrames/elements/misc.lua @@ -67,12 +67,12 @@ 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.") ---[[ -########################################################## +--[[ +########################################################## LOCAL VARIABLES ########################################################## ]]-- @@ -84,23 +84,23 @@ local ROLE_ICON_DATA = { local function BasicBG(frame) frame:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - edgeSize = 2, + bgFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + edgeSize = 2, insets = { - left = 0, - right = 0, - top = 0, + left = 0, + right = 0, + top = 0, bottom = 0 } }) frame:SetBackdropColor(0, 0, 0, 0) frame:SetBackdropBorderColor(0, 0, 0) end ---[[ -########################################################## +--[[ +########################################################## RAID DEBUFFS / DEBUFF HIGHLIGHT ########################################################## ]]-- @@ -120,7 +120,7 @@ function MOD:CreateRaidDebuffs(frame) raidDebuff.time:SetTextColor(1, .9, 0) raidDebuff:SetParent(frame.TextGrip) return raidDebuff -end +end function MOD:CreateAfflicted(frame) local holder = CreateFrame("Frame", nil, frame.Health) @@ -131,13 +131,13 @@ function MOD:CreateAfflicted(frame) afflicted:SetTexture(MOD.media.afflicted) afflicted:SetVertexColor(0, 0, 0, 0) afflicted:SetBlendMode("ADD") - frame.AfflictedFilter = true - frame.AfflictedAlpha = 0.75 - + afflicted.ClassFilter = true + afflicted.MaxAlpha = 0.75 + return afflicted end ---[[ -########################################################## +--[[ +########################################################## VARIOUS ICONS ########################################################## ]]-- @@ -146,17 +146,17 @@ function MOD:CreateResurectionIcon(frame) rez:SetPoint("CENTER", frame.TextGrip.Health, "CENTER") rez:SetSize(30, 25) rez:SetDrawLayer("OVERLAY", 7) - return rez -end + return rez +end function MOD:CreateReadyCheckIcon(frame) local rdyHolder = CreateFrame("Frame", nil, frame.TextGrip) rdyHolder:SetAllPoints(frame) local rdy = rdyHolder:CreateTexture(nil, "OVERLAY", nil, 7) - rdy:SetSize(18) + rdy:SetSize(18, 18) rdy:SetPoint("RIGHT", rdyHolder, "RIGHT", 0, 0) - return rdy -end + return rdy +end function MOD:CreateGladiator(frame) local pvp = CreateFrame("Frame", nil, frame) @@ -189,7 +189,7 @@ function MOD:CreateGladiator(frame) pvp.Badge = badge - return pvp + return pvp end function MOD:CreateFriendshipBar(frame) @@ -205,32 +205,32 @@ function MOD:CreateFriendshipBar(frame) icon:SetSize(22,22) icon:SetTexture(MOD.media.buddy) - return buddy + return buddy end ---[[ -########################################################## +--[[ +########################################################## CONFIGURABLE ICONS ########################################################## ]]-- function MOD:CreateRaidIcon(frame) local rIcon = frame.TextGrip:CreateTexture(nil, "OVERLAY", nil, 2) rIcon:SetTexture([[Interface\TargetingFrame\UI-RaidTargetingIcons]]) - rIcon:SetSize(18) + rIcon:SetSize(18, 18) rIcon:SetPoint("CENTER", frame.TextGrip, "TOP", 0, 2) - return rIcon -end + return rIcon +end local UpdateRoleIcon = function(self) local key = self.___key local db = SV.db.UnitFrames[key] - if(not db or not db.icons or (db.icons and not db.icons.roleIcon)) then return end + if(not db or not db.icons or (db.icons and not db.icons.roleIcon)) then return end local lfd = self.LFDRole - if(not db.icons.roleIcon.enable) then lfd:Hide() return end + if(not db.icons.roleIcon.enable) then lfd:Hide() return end local unitRole = UnitGroupRolesAssigned(self.unit) - if(self.isForced and unitRole == "NONE") then + if(self.isForced and unitRole == "NONE") then local rng = random(1, 3) - unitRole = rng == 1 and "TANK" or rng == 2 and "HEALER" or rng == 3 and "DAMAGER" - end + unitRole = rng == 1 and "TANK" or rng == 2 and "HEALER" or rng == 3 and "DAMAGER" + end if(unitRole ~= "NONE" and (self.isForced or UnitIsConnected(self.unit))) then local coords = ROLE_ICON_DATA[unitRole] lfd:SetTexture(MOD.media.roles) @@ -242,20 +242,20 @@ local UpdateRoleIcon = function(self) lfd:Show() else lfd:Hide() - end -end + end +end function MOD:CreateRoleIcon(frame) local parent = frame.TextGrip or frame; local rIconHolder = CreateFrame("Frame", nil, parent) rIconHolder:SetAllPoints() local rIcon = rIconHolder:CreateTexture(nil, "ARTWORK", nil, 2) - rIcon:SetSize(14) + rIcon:SetSize(14, 14) rIcon:SetPoint("BOTTOMRIGHT", rIconHolder, "BOTTOMRIGHT") rIcon.Override = UpdateRoleIcon; frame:RegisterEvent("UNIT_CONNECTION", UpdateRoleIcon) - return rIcon -end + return rIcon +end function MOD:CreateRaidRoleFrames(frame) local parent = frame.TextGrip or frame; @@ -280,14 +280,14 @@ function MOD:CreateRaidRoleFrames(frame) frame.Leader.PostUpdate = MOD.RaidRoleUpdate; frame.MasterLooter.PostUpdate = MOD.RaidRoleUpdate; - return raidRoles -end + return raidRoles +end function MOD:RaidRoleUpdate() local frame = self:GetParent() local leaderIcon = frame.Leader; local looterIcon = frame.MasterLooter; - if not leaderIcon or not looterIcon then return end + if not leaderIcon or not looterIcon then return end local key = frame.___key; local db = SV.db.UnitFrames[key]; local leaderShown = leaderIcon:IsShown() @@ -296,21 +296,21 @@ function MOD:RaidRoleUpdate() looterIcon:ClearAllPoints() if db and db.icons and db.icons.raidRoleIcons then local settings = db.icons.raidRoleIcons - if leaderShown and settings.position == "TOPLEFT"then + if leaderShown and settings.position == "TOPLEFT"then leaderIcon:SetPoint("LEFT", frame, "LEFT") looterIcon:SetPoint("RIGHT", frame, "RIGHT") - elseif leaderShown and settings.position == "TOPRIGHT" then + elseif leaderShown and settings.position == "TOPRIGHT" then leaderIcon:SetPoint("RIGHT", frame, "RIGHT") looterIcon:SetPoint("LEFT", frame, "LEFT") - elseif looterShown and settings.position == "TOPLEFT" then + elseif looterShown and settings.position == "TOPLEFT" then looterIcon:SetPoint("LEFT", frame, "LEFT") - else + else looterIcon:SetPoint("RIGHT", frame, "RIGHT") - end - end + end + end end ---[[ -########################################################## +--[[ +########################################################## PLAYER ONLY COMPONENTS ########################################################## ]]-- @@ -324,7 +324,7 @@ function MOD:CreatePlayerIndicators(frame) resting.bg:SetAllPoints(resting) resting.bg:SetTexture(MOD.media.playerstate) resting.bg:SetTexCoord(0.5,1,0,0.5) - + local combat = CreateFrame("Frame",nil,frame) combat:SetFrameStrata("MEDIUM") combat:SetFrameLevel(30) @@ -354,13 +354,13 @@ function MOD:CreatePlayerIndicators(frame) frame.Combat = combat end -local ExRep_OnEnter = function(self)if self:IsShown() then UIFrameFadeIn(self,.1,0,1) end end -local ExRep_OnLeave = function(self)if self:IsShown() then UIFrameFadeOut(self,.2,1,0) end end +local ExRep_OnEnter = function(self)if self:IsShown() then UIFrameFadeIn(self,.1,0,1) end end +local ExRep_OnLeave = function(self)if self:IsShown() then UIFrameFadeOut(self,.2,1,0) end end function MOD:CreateExperienceRepBar(frame) local db = SV.db.UnitFrames.player; - - if db.playerExpBar then + + if db.playerExpBar then local xp = CreateFrame("StatusBar", "PlayerFrameExperienceBar", frame.Power) xp:InsetPoints(frame.Power, 0, 0) xp:SetStyle("Frame") @@ -385,10 +385,10 @@ function MOD:CreateExperienceRepBar(frame) xp:SetScript("OnEnter", ExRep_OnEnter) xp:SetScript("OnLeave", ExRep_OnLeave) xp:SetAlpha(0) - frame.Experience = xp - end + frame.Experience = xp + end - if db.playerRepBar then + if db.playerRepBar then local rep = CreateFrame("StatusBar", "PlayerFrameReputationBar", frame.Power) rep:InsetPoints(frame.Power, 0, 0) rep:SetStyle("Frame") @@ -407,11 +407,11 @@ function MOD:CreateExperienceRepBar(frame) rep:SetScript("OnEnter", ExRep_OnEnter) rep:SetScript("OnLeave", ExRep_OnLeave) rep:SetAlpha(0) - frame.Reputation = rep - end -end ---[[ -########################################################## + frame.Reputation = rep + end +end +--[[ +########################################################## HEAL PREDICTION ########################################################## ]]-- @@ -545,8 +545,8 @@ function MOD:CreateHealPrediction(frame, fullSet) return healPrediction end ---[[ -########################################################## +--[[ +########################################################## RESOLVE ########################################################## ]]-- @@ -557,7 +557,7 @@ local function Short(value) local fmt if value >= 10000 then fmt = "%.0fk" - value = value / 1000 + value = value / 1000 elseif value >= 1000 then fmt = "%.1fk" value = value / 1000 @@ -569,7 +569,7 @@ end local function IsTank() local _, playerclass = UnitClass("player") - local masteryIndex + local masteryIndex local tank = false if playerclass == "DEATHKNIGHT" then masteryIndex = GetSpecialization() @@ -612,7 +612,7 @@ local ResolveBar_OnEvent = function(self, event, unit) self.bar.text:SetText(Short(amount)) self:FadeIn() cached_resolve = amount - end + end end else if IsTank() then @@ -659,7 +659,7 @@ function MOD:CreateResolveBar(frame) resolve:RegisterEvent("PLAYER_TALENT_UPDATE") resolve:RegisterEvent("PLAYER_ENTERING_WORLD") resolve:SetScript('OnEvent', ResolveBar_OnEvent) - + ResolveBar_OnEvent(resolve) return resolve -end \ No newline at end of file +end diff --git a/SVUI_UnitFrames/frames.lua b/SVUI_UnitFrames/frames.lua index eb869ae..ba3a022 100644 --- a/SVUI_UnitFrames/frames.lua +++ b/SVUI_UnitFrames/frames.lua @@ -185,7 +185,7 @@ local UpdatePlayerFrame = function(self) if iconDB and iconDB.restIcon and iconDB.restIcon.enable then local size = iconDB.restIcon.size; resting:ClearAllPoints() - resting:SetSize(size) + resting:SetSize(size, size) SV:SetReversePoint(resting, iconDB.restIcon.attachTo, MASTER_GRIP, iconDB.restIcon.xOffset, iconDB.restIcon.yOffset) if not self:IsElementEnabled("Resting")then self:EnableElement("Resting") @@ -202,7 +202,7 @@ local UpdatePlayerFrame = function(self) if iconDB and iconDB.combatIcon and iconDB.combatIcon.enable then local size = iconDB.combatIcon.size; combat:ClearAllPoints() - combat:SetSize(size) + combat:SetSize(size, size) SV:SetReversePoint(combat, iconDB.combatIcon.attachTo, MASTER_GRIP, iconDB.combatIcon.xOffset, iconDB.combatIcon.yOffset) if not self:IsElementEnabled("Combat")then self:EnableElement("Combat") @@ -762,7 +762,9 @@ local UpdateArenaFrame = function(self) local leftAnchor = self local rightAnchor = self - trinket:SetSize(db.pvp.trinketSize) + local trinketSize = db.pvp.trinketSize + local specSize = db.pvp.specSize + trinket:SetSize(trinketSize, trinketSize) trinket:ClearAllPoints() if(db.pvp.trinketPosition == "RIGHT") then trinket:SetPoint("LEFT", rightAnchor, "RIGHT", db.pvp.trinketX, db.pvp.trinketY) @@ -772,7 +774,7 @@ local UpdateArenaFrame = function(self) leftAnchor = trinket end - badge:SetSize(db.pvp.specSize) + badge:SetSize(specSize, specSize) badge:ClearAllPoints() if(db.pvp.specPosition == "RIGHT") then badge:SetPoint("LEFT", rightAnchor, "RIGHT", db.pvp.specX, db.pvp.specY) diff --git a/SVUI_UnitFrames/groups.lua b/SVUI_UnitFrames/groups.lua index 1398ac4..fc62c2e 100644 --- a/SVUI_UnitFrames/groups.lua +++ b/SVUI_UnitFrames/groups.lua @@ -394,7 +394,7 @@ local RaidUnitUpdate = function(self) self:EnableElement("RaidDebuffs") end local actualSz = numMin(db.rdebuffs.size, (UNIT_HEIGHT - 8)) - rdBuffs:SetSize(actualSz) + rdBuffs:SetSize(actualSz, actualSz) rdBuffs:SetPoint("CENTER", self, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) rdBuffs:Show() else @@ -1026,7 +1026,7 @@ local GroupConfigure = function(self) heightCalc = size + 10 end frame.GroupTag:Show() - frame.GroupTag:SetSize(size) + frame.GroupTag:SetSize(size, size) frame.GroupTag:SetPoint(tagPoint1, frame, tagPoint2, x, y) else frame.GroupTag:Hide() diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_Afflicted/oUF_Afflicted.lua b/SVUI_UnitFrames/libs/Plugins/oUF_Afflicted/oUF_Afflicted.lua index def4e56..22b11d1 100644 --- a/SVUI_UnitFrames/libs/Plugins/oUF_Afflicted/oUF_Afflicted.lua +++ b/SVUI_UnitFrames/libs/Plugins/oUF_Afflicted/oUF_Afflicted.lua @@ -15,7 +15,7 @@ local GetActiveSpecGroup = _G.GetActiveSpecGroup; local _, ns = ... local oUF = oUF or ns.oUF if not oUF then return end - + local playerClass = select(2,UnitClass("player")) local CanDispel = { PRIEST = { Magic = true, Disease = true }, @@ -44,6 +44,7 @@ local blackList = { [GetSpellInfo(136182)] = true, --Improved Synapses [GetSpellInfo(136180)] = true, --Keen Eyesight } + local function GetDebuffType(unit, filter) if not unit or not UnitCanAssist("player", unit) then return nil end local i = 1 @@ -57,45 +58,46 @@ local function GetDebuffType(unit, filter) end end -local function CheckTalentTree(tree) - local activeGroup = GetActiveSpecGroup() - if activeGroup and GetSpecialization(false, false, activeGroup) then - return tree == GetSpecialization(false, false, activeGroup) - end -end - -local function CheckSpec(self, event, levels) +local function UpdateTalentSpec(self, event, levels) if event == "CHARACTER_POINTS_CHANGED" and levels > 0 then return end + + local currentSpec = 0; + local activeGroup = GetActiveSpecGroup() + + if(activeGroup) then + currentSpec = GetSpecialization(false, false, activeGroup) + end; + if playerClass == "PRIEST" then - if CheckTalentTree(3) then + if currentSpec == 3 then dispellist.Disease = false else - dispellist.Disease = true - end + dispellist.Disease = true + end elseif playerClass == "PALADIN" then - if CheckTalentTree(1) then + if currentSpec == 1 then dispellist.Magic = true else - dispellist.Magic = false + dispellist.Magic = false end elseif playerClass == "SHAMAN" then - if CheckTalentTree(3) then + if currentSpec == 3 then dispellist.Magic = true else - dispellist.Magic = false + dispellist.Magic = false end elseif playerClass == "DRUID" then - if CheckTalentTree(4) then + if currentSpec == 4 then dispellist.Magic = true else - dispellist.Magic = false + dispellist.Magic = false end elseif playerClass == "MONK" then - if CheckTalentTree(2) then + if currentSpec == 2 then dispellist.Magic = true else - dispellist.Magic = false - end + dispellist.Magic = false + end end end @@ -106,46 +108,53 @@ local function CheckSymbiosis() dispellist.Disease = false end end - -local function Update(object, event, unit) - if unit ~= object.unit then return; end - local debuffType, texture = GetDebuffType(unit, object.AfflictedFilter) + +local function Update(self, event, unit) + if unit ~= self.unit then return; end + local afflicted = self.Afflicted + local debuffType, texture = GetDebuffType(unit, afflicted.ClassFilter) if debuffType then local color = AfflictedColor[debuffType] - object.Afflicted:SetVertexColor(color.r, color.g, color.b, object.AfflictedAlpha or .5) + afflicted:SetVertexColor(color.r, color.g, color.b, afflicted.MaxAlpha) else - object.Afflicted:SetVertexColor(0,0,0,0) + afflicted:SetVertexColor(0,0,0,0) end end - -local function Enable(object) - if not object.Afflicted then - return - end - if object.AfflictedFilter and not CanDispel[playerClass] then - return - end - object:RegisterEvent("UNIT_AURA", Update) - object:RegisterEvent("PLAYER_TALENT_UPDATE", CheckSpec) - object:RegisterEvent("CHARACTER_POINTS_CHANGED", CheckSpec) - CheckSpec(object) - object:RegisterUnitEvent("UNIT_AURA", object.unit) +local function Enable(self) + local afflicted = self.Afflicted + if(not afflicted) then return end + if(afflicted.ClassFilter and (not CanDispel[playerClass])) then return end + + afflicted.MaxAlpha = afflicted.MaxAlpha or 0.7 + + self:RegisterEvent("UNIT_AURA", Update) + self:RegisterEvent("PLAYER_TALENT_UPDATE", UpdateTalentSpec) + self:RegisterEvent("CHARACTER_POINTS_CHANGED", UpdateTalentSpec) + + UpdateTalentSpec(self) + + self:RegisterUnitEvent("UNIT_AURA", self.unit) + if playerClass == "DRUID" then - object:RegisterEvent("SPELLS_CHANGED", CheckSymbiosis) - end + self:RegisterEvent("SPELLS_CHANGED", CheckSymbiosis) + end + return true end - -local function Disable(object) - object:UnregisterEvent("UNIT_AURA", Update) - object:UnregisterEvent("PLAYER_TALENT_UPDATE", CheckSpec) - object:UnregisterEvent("CHARACTER_POINTS_CHANGED", CheckSpec) + +local function Disable(self) + local afflicted = self.Afflicted + if(not afflicted) then return end + self:UnregisterEvent("UNIT_AURA", Update) + self:UnregisterEvent("PLAYER_TALENT_UPDATE", UpdateTalentSpec) + self:UnregisterEvent("CHARACTER_POINTS_CHANGED", UpdateTalentSpec) if playerClass == "DRUID" then - object:UnregisterEvent("SPELLS_CHANGED", CheckSymbiosis) + self:UnregisterEvent("SPELLS_CHANGED", CheckSymbiosis) end - object.Afflicted:SetVertexColor(0,0,0,0) + + afflicted:SetVertexColor(0,0,0,0) end - -oUF:AddElement('Afflicted', Update, Enable, Disable) \ No newline at end of file + +oUF:AddElement('Afflicted', Update, Enable, Disable) diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua b/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua index cd9afe4..1184739 100644 --- a/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua +++ b/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua @@ -49,64 +49,89 @@ local TextColors = { [5]={0.1,1,0.1} }; -local function ManaBarState(mana) +local UpdateAura = function(self, event, unit) + if((not unit) or (unit ~= self.unit)) then return end + local chicken = self.Druidness.Chicken + if(not chicken) then return end + + for i = 1, 40, 1 do + local name, _, _, _, _, _, _, _, _, _, spellID = UnitAura("player", i, "HELPFUL|PLAYER") + if not name then break end + if spellID == ECLIPSE_BAR_SOLAR_BUFF_ID then + chicken.inEclipse = true + break + elseif spellID == ECLIPSE_BAR_LUNAR_BUFF_ID then + chicken.inEclipse = true + break + end + end + + if(chicken.PostUpdateAura) then + return chicken:PostUpdateAura() + end +end + +local function CatOverMana(mana, form) if mana.ManaBar:GetValue() < UnitPowerMax('player', SPELL_POWER_MANA) then mana:Show() + return false else mana:Hide() + return form == CAT_FORM end end -local UPDATE_VISIBILITY = function(self, event) +local UpdateVisibility = function(self, event) local bar = self.Druidness local chicken = bar.Chicken local cat = bar.Cat local mana = bar.Mana - - -- check form/mastery local form = GetShapeshiftFormID() - if(not form) then + if(form) then + if(form == MOONKIN_FORM) then + chicken:Show() + mana:Hide() + cat:Hide() + self:RegisterEvent('UNIT_AURA', UpdateAura) + else + chicken:Hide() + self:UnregisterEvent('UNIT_AURA', UpdateAura) + + if (form == BEAR_FORM or form == CAT_FORM) then + if(CatOverMana(mana, form)) then + cat:Show() + else + cat:Hide() + end + else + cat:Hide() + mana:Hide() + end + end + else local ptt = GetSpecialization() if(ptt and ptt == 1) then -- player has balance spec chicken:Show() + self:RegisterEvent('UNIT_AURA', UpdateAura) else chicken:Hide() + self:UnregisterEvent('UNIT_AURA', UpdateAura) end mana:Hide() cat:Hide() - elseif(form == MOONKIN_FORM) then - chicken:Show() - mana:Hide() - cat:Hide() - elseif (form == BEAR_FORM or form == CAT_FORM) then - chicken:Hide() - if(form == CAT_FORM) then - cat:Show() - else - cat:Hide() - end - ManaBarState(mana) - else - chicken:Hide() - cat:Hide() - mana:Hide() - end - - if(bar.PostUpdateVisibility) then - return bar:PostUpdateVisibility(self.unit) end end -local UNIT_POWER = function(self, event, unit, powerType) +local UpdatePower = function(self, event, unit, powerType) if(self.unit ~= unit) then return end local bar = self.Druidness - local chicken = bar.Chicken - local mana = bar.Mana - if(chicken:IsShown() or powerType == 'ECLIPSE') then + if(powerType == 'ECLIPSE' and bar.Chicken) then + local chicken = bar.Chicken local power = UnitPower('player', SPELL_POWER_ECLIPSE) local maxPower = UnitPowerMax('player', SPELL_POWER_ECLIPSE) + if maxPower == 0 then maxPower = 100 end if(chicken.LunarBar) then chicken.LunarBar:SetMinMaxValues(-maxPower, maxPower) @@ -119,94 +144,57 @@ local UNIT_POWER = function(self, event, unit, powerType) end if(chicken.PostUpdatePower) then - return chicken:PostUpdatePower(unit) + chicken:PostUpdatePower() end end - if not (mana.ManaBar) then return end - - if(mana.PreUpdate) then - mana:PreUpdate(unit) - end - local min, max = UnitPower('player', SPELL_POWER_MANA), UnitPowerMax('player', SPELL_POWER_MANA) - - mana.ManaBar:SetMinMaxValues(0, max) - mana.ManaBar:SetValue(min) - - local r, g, b, t - if(mana.colorPower) then - t = self.colors.power["MANA"] - elseif(mana.colorClass and UnitIsPlayer(unit)) or - (mana.colorClassNPC and not UnitIsPlayer(unit)) or - (mana.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then - local _, class = UnitClass(unit) - t = self.colors.class[class] - elseif(mana.colorReaction and UnitReaction(unit, 'player')) then - t = self.colors.reaction[UnitReaction(unit, "player")] - elseif(mana.colorSmooth) then - r, g, b = self.ColorGradient(min / max, unpack(mana.smoothGradient or self.colors.smooth)) - end - - if(t) then - r, g, b = t[1], t[2], t[3] - end - - if(b) then - mana.ManaBar:SetStatusBarColor(r, g, b) - - local bg = mana.bg - if(bg) then - local mu = bg.multiplier or 1 - bg:SetVertexColor(r * mu, g * mu, b * mu) + if(bar.Mana and bar.Mana.ManaBar) then + local mana = bar.Mana + if(mana.PreUpdate) then + mana:PreUpdate(unit) + end + local min, max = UnitPower('player', SPELL_POWER_MANA), UnitPowerMax('player', SPELL_POWER_MANA) + + mana.ManaBar:SetMinMaxValues(0, max) + mana.ManaBar:SetValue(min) + + local r, g, b, t + if(mana.colorPower) then + t = self.colors.power["MANA"] + elseif(mana.colorClass and UnitIsPlayer(unit)) or + (mana.colorClassNPC and not UnitIsPlayer(unit)) or + (mana.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then + local _, class = UnitClass(unit) + t = self.colors.class[class] + elseif(mana.colorReaction and UnitReaction(unit, 'player')) then + t = self.colors.reaction[UnitReaction(unit, "player")] + elseif(mana.colorSmooth) then + r, g, b = self.ColorGradient(min / max, unpack(mana.smoothGradient or self.colors.smooth)) end - end - - UPDATE_VISIBILITY(self) - - if(mana.PostUpdatePower) then - return mana:PostUpdatePower(unit, min, max) - end -end -local UNIT_AURA = function(self, event, unit) - if((not unit) or (unit and self.unit ~= unit)) then return end - local bar = self.Druidness - local chicken = bar.Chicken - local mana = bar.Mana + if(t) then + r, g, b = t[1], t[2], t[3] + end - if(chicken and chicken:IsShown()) then - local i = 1 - local hasSolarEclipse, hasLunarEclipse - repeat - local _, _, _, _, _, _, _, _, _, _, spellID = UnitAura(unit, i, 'HELPFUL') + if(b) then + mana.ManaBar:SetStatusBarColor(r, g, b) - if(spellID == ECLIPSE_BAR_SOLAR_BUFF_ID) then - hasSolarEclipse = true - elseif(spellID == ECLIPSE_BAR_LUNAR_BUFF_ID) then - hasLunarEclipse = true + local bg = mana.bg + if(bg) then + local mu = bg.multiplier or 1 + bg:SetVertexColor(r * mu, g * mu, b * mu) end + end - i = i + 1 - until not spellID - chicken.hasSolarEclipse = hasSolarEclipse - chicken.hasLunarEclipse = hasLunarEclipse + if(mana.PostUpdatePower) then + mana:PostUpdatePower(unit, min, max) + end end - if(bar.PostUnitAura) then - return bar:PostUnitAura(unit) - end + UpdateVisibility(self) end -local ECLIPSE_DIRECTION_CHANGE = function(self, event, status) - local bar = self.Druidness - local chicken = bar.Chicken - - if(status and chicken:IsVisible() and chicken.PostDirectionChange[status]) then - return chicken.PostDirectionChange[status](chicken) - end -end - -local UPDATE_POINTS = function(self, event, unit) +local UpdateComboPoints = function(self, event, unit) if(unit == 'pet') then return end local bar = self.Druidness; local cpoints = bar.Cat; @@ -238,16 +226,16 @@ local UPDATE_POINTS = function(self, event, unit) end end - if(bar.PostUpdate) then - return bar:PostUpdate(current) + if(bar.PostUpdateComboPoints) then + return bar:PostUpdateComboPoints(current) end end local Update = function(self, ...) - UNIT_POWER(self, ...) - UNIT_AURA(self, ...) - UPDATE_POINTS(self, ...) - return UPDATE_VISIBILITY(self, ...) + UpdatePower(self, ...) + UpdateAura(self, ...) + UpdateComboPoints(self, ...) + return UpdateVisibility(self, ...) end local ForceUpdate = function(element) @@ -283,15 +271,13 @@ local function Enable(self) chicken.SolarBar:SetValue(power * -1) end - self:RegisterEvent('ECLIPSE_DIRECTION_CHANGE', ECLIPSE_DIRECTION_CHANGE, true) - self:RegisterEvent('PLAYER_TALENT_UPDATE', UPDATE_VISIBILITY, true) - self:RegisterEvent('UNIT_AURA', UNIT_AURA) - self:RegisterEvent('UNIT_POWER_FREQUENT', UNIT_POWER) - --self:RegisterEvent('UNIT_MAXPOWER', UNIT_POWER) - self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', UPDATE_VISIBILITY, true) - self:RegisterEvent('UNIT_COMBO_POINTS', UPDATE_POINTS, true) - self:RegisterEvent('PLAYER_TARGET_CHANGED', UPDATE_POINTS, true) - UPDATE_VISIBILITY(self) + self:RegisterEvent('UNIT_POWER_FREQUENT', UpdatePower) + self:RegisterEvent('PLAYER_TALENT_UPDATE', UpdateVisibility, true) + self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', UpdateVisibility, true) + self:RegisterEvent('UNIT_COMBO_POINTS', UpdateComboPoints, true) + self:RegisterEvent('PLAYER_TARGET_CHANGED', UpdateComboPoints, true) + + UpdateVisibility(self) return true end end @@ -304,14 +290,12 @@ local function Disable(self) local mana = bar.Mana chicken:Hide() mana:Hide() - self:UnregisterEvent('ECLIPSE_DIRECTION_CHANGE', ECLIPSE_DIRECTION_CHANGE) - self:UnregisterEvent('PLAYER_TALENT_UPDATE', UPDATE_VISIBILITY) - self:UnregisterEvent('UNIT_AURA', UNIT_AURA) - self:UnregisterEvent('UNIT_POWER_FREQUENT', UNIT_POWER) - --self:UnregisterEvent('UNIT_MAXPOWER', UNIT_POWER) - self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', UPDATE_VISIBILITY) - self:UnregisterEvent('UNIT_COMBO_POINTS', UPDATE_POINTS) - self:UnregisterEvent('PLAYER_TARGET_CHANGED', UPDATE_POINTS) + + self:RegisterEvent('UNIT_POWER_FREQUENT', UpdatePower) + self:UnregisterEvent('PLAYER_TALENT_UPDATE', UpdateVisibility) + self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', UpdateVisibility) + self:UnregisterEvent('UNIT_COMBO_POINTS', UpdateComboPoints) + self:UnregisterEvent('PLAYER_TARGET_CHANGED', UpdateComboPoints) end end