diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index fe2f6df..b90b010 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -235,6 +235,17 @@ function string.link(this, prefix, text, color) local colorstring = tostring(this):color(color or "ffffff") return ("|H%s:%s|h%s|h"):format(prefix, text, colorstring) end + +function string.explode(str, delim) + local res = { } + local pattern = string.format("([^%s]+)%s()", delim, delim) + while (true) do + line, pos = str:match(pattern, pos) + if line == nil then break end + table.insert(res, line) + end + return res +end --[[ ########################################################## DEFINE REGISTRY HELPERS diff --git a/Interface/AddOns/SVUI/libs/LibActionButton-1.0/LibActionButton-1.0.lua b/Interface/AddOns/SVUI/libs/LibActionButton-1.0/LibActionButton-1.0.lua index f8f66d3..9a7be27 100644 --- a/Interface/AddOns/SVUI/libs/LibActionButton-1.0/LibActionButton-1.0.lua +++ b/Interface/AddOns/SVUI/libs/LibActionButton-1.0/LibActionButton-1.0.lua @@ -971,16 +971,7 @@ function Update(self) end -- Update icon and hotkey - -- if string.find(test,"SVUI_ActionBar1Button") then end - -- if test == "SVUI_ActionBar1Button1" then - -- if self._state_action ~= nil then - -- local act = self._state_action - -- local type, id, subType, spellID = GetActionInfo(act) - -- local t = {["ACTION"] = act,["TYPE"] = type, ["GenID"] = id, ["SUBTYPE"] = subType, ["SpellID"] = spellID} - -- SVUI[1]:ShowDebug("LibActionButton:"..test, " GetActionInfo", t) - -- --SVUI[1]:ShowDebug("LibActionButton:"..test, " GetActionTexture", GetActionTexture(self._state_action)) - -- end; - -- end + local texture = self:GetTexture() if texture then self.icon:SetTexture(texture) diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua b/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua index 99d819b..38cec70 100644 --- a/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua +++ b/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua @@ -44,10 +44,10 @@ local UNIT_SPELLCAST_START = function(self, event, unit, spell) local repeatCount = GetTradeskillRepeatCount() or 1 local start = GetTime() - startTime - if(tradeskill) then + if(tradeskill and repeatCount >= 1) then if(castbar.previous ~= name) then castbar.recipecount = 1 - castbar.maxrecipe = GetTradeskillRepeatCount() + castbar.maxrecipe = repeatCount castbar.duration = start else castbar.recipecount = castbar.recipecount or 1 @@ -98,8 +98,7 @@ local UNIT_SPELLCAST_START = function(self, event, unit, spell) castbar:PostCastStart(unit, name, castid) end - --castbar:Show() - SuperVillain:SecureFadeIn(castbar, 0.5, 0.5, 1) + castbar:Show() end local UNIT_SPELLCAST_FAILED = function(self, event, unit, spellname, _, castid) @@ -112,7 +111,7 @@ local UNIT_SPELLCAST_FAILED = function(self, event, unit, spellname, _, castid) castbar.casting = nil castbar.tradeskill = nil castbar.recipecount = nil - castbar.maxrecipe = nil + castbar.maxrecipe = 1 castbar.interrupt = nil castbar:SetValue(0) castbar:Hide() @@ -132,7 +131,7 @@ local UNIT_SPELLCAST_INTERRUPTED = function(self, event, unit, spellname, _, cas castbar.casting = nil castbar.tradeskill = nil castbar.recipecount = nil - castbar.maxrecipe = nil + castbar.maxrecipe = 1 castbar.channeling = nil castbar:SetValue(0) @@ -204,11 +203,11 @@ local UNIT_SPELLCAST_STOP = function(self, event, unit, spellname, _, castid) castbar.interrupt = nil castbar.tradeskill = nil castbar.recipecount = nil - castbar.maxrecipe = nil + castbar.maxrecipe = 1 castbar:SetValue(0) end - SuperVillain:SecureFadeOut(castbar, 4, 1, 0, true) + castbar:Hide() if(castbar.PostCastStop) then return castbar:PostCastStop(unit, spellname, castid) @@ -243,7 +242,7 @@ local UNIT_SPELLCAST_CHANNEL_START = function(self, event, unit, spellname) castbar.casting = nil castbar.tradeskill = nil castbar.recipecount = nil - castbar.maxrecipe = nil + castbar.maxrecipe = 1 castbar.castid = nil castbar:SetMinMaxValues(0, max) @@ -326,7 +325,7 @@ local UpdateCastingTimeInfo = function(self, duration) else self.Time:SetFormattedText("%.1f|cffff0000-%.1f|r", duration, self.delay) end - elseif(self.recipecount and self.recipecount > 0) then + elseif(self.recipecount and self.recipecount > 0 and self.maxrecipe and self.maxrecipe > 1) then self.Time:SetText(self.recipecount .. "/" .. self.maxrecipe) else if(self.CustomTimeText) then @@ -350,7 +349,7 @@ local onUpdate = function(self, elapsed) self.casting = nil self.tradeskill = nil self.recipecount = nil - self.maxrecipe = nil + self.maxrecipe = 1 self.castid = nil self.channeling = nil @@ -366,7 +365,7 @@ local onUpdate = function(self, elapsed) self.casting = nil self.tradeskill = nil self.recipecount = nil - self.maxrecipe = nil + self.maxrecipe = 1 self:Hide() if(self.PostCastStop) then self:PostCastStop(self.__owner.unit) end diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/stagger.lua b/Interface/AddOns/SVUI/libs/oUF/elements/stagger.lua index bf66b8e..6cc7dc9 100644 --- a/Interface/AddOns/SVUI/libs/oUF/elements/stagger.lua +++ b/Interface/AddOns/SVUI/libs/oUF/elements/stagger.lua @@ -116,7 +116,6 @@ local Enable = function(self, unit) MonkStaggerBar:UnregisterEvent'PLAYER_SPECIALIZATION_CHANGED' MonkStaggerBar:UnregisterEvent'UNIT_DISPLAYPOWER' MonkStaggerBar:UnregisterEvent'UPDATE_VEHICLE_ACTION_BAR' - --SVUI[1]:ShowDebug("Stagger", "Enable", self) return true end end diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 972a295..32de19d 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -381,6 +381,13 @@ do local Tab_OnClick = function(self,button) FCF_Tab_OnClick(self,button); local chatFrame = _G[("ChatFrame%d"):format(self:GetID())]; + if(chatFrame:AtBottom() and ScrollIndicator:IsShown()) then + SuperVillain.Animate:StopFlash(ScrollIndicator) + ScrollIndicator:Hide() + elseif(not chatFrame:AtBottom() and not ScrollIndicator:IsShown()) then + ScrollIndicator:Show() + SuperVillain.Animate:Flash(ScrollIndicator,1,true) + end if ( chatFrame.isDocked and FCFDock_GetSelectedWindow(GENERAL_CHAT_DOCK) ~= chatFrame ) then self.IsOpen = true self:SetPanelColor("highlight") @@ -738,7 +745,7 @@ do local _hook_OnMouseWheel = function(self, delta) if(IsShiftKeyDown()) then - if(delta > 0) then + if(delta and delta > 0) then self:ScrollToTop() else self:ScrollToBottom() diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index f84093a..dc2b981 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -691,45 +691,47 @@ end INVITE AUTOMATONS ########################################################## ]]-- -function MOD:AutoGroupInvite(b, B) - if not self.db.autoAcceptInvite then return end - if b == "PARTY_INVITE_REQUEST" then - if QueueStatusMinimapButton:IsShown() then return end - if IsInGroup() then return end +local function AutoGroupInvite(self, event, arg) + if not SuperVillain.db.SVHenchmen.autoAcceptInvite then return end + if IsInGroup() then return end + if event == "PARTY_INVITE_REQUEST" then + if QueueStatusMinimapButton:IsShown() then return end hideStatic = true; - if GetNumFriends()>0 then ShowFriends() end - if IsInGuild()then GuildRoster()end - local r = false; - for C = 1, GetNumFriends()do - local D = GetFriendInfo(C) - if D == B then - AcceptGroup()r = true; - SuperVillain:HenchmanSays("Accepted an Invite From Your Friends!") + if GetNumFriends() > 0 then ShowFriends() end + if IsInGuild() then GuildRoster() end + local invited = false; + for i = 1, GetNumFriends()do + local friend = GetFriendInfo(i) + if friend == arg then + AcceptGroup() + invited = true; + SuperVillain:AddonMessage("Accepted an Invite From Your Friends!") break end end - if not r then - for E = 1, GetNumGuildMembers(true)do - local F = GetGuildRosterInfo(E) - if F == B then - AcceptGroup()r = true; - SuperVillain:HenchmanSays("Accepted an Invite From Your Guild!") + if not invited then + for i = 1, GetNumGuildMembers(true)do + local guildMate = GetGuildRosterInfo(i) + if guildMate == arg then + AcceptGroup() + invited = true; + SuperVillain:AddonMessage("Accepted an Invite From Your Guild!") break end end end - if not r then - for G = 1, BNGetNumFriends()do - local m, m, m, H = BNGetFriendInfo(G) - B = B:match("(.+)%-.+") or B; - if H == B then + if not invited then + for i = 1, BNGetNumFriends()do + local _, _, _, friend = BNGetFriendInfo(i) + arg = arg:match("(.+)%-.+") or arg; + if friend == arg then AcceptGroup() - SuperVillain:HenchmanSays("Accepted an Invite!") + SuperVillain:AddonMessage("Accepted an Invite!") break end end end - elseif b == "GROUP_ROSTER_UPDATE" and hideStatic == true then + elseif event == "GROUP_ROSTER_UPDATE" and hideStatic == true then StaticPopup_Hide("PARTY_INVITE") hideStatic = false end @@ -912,13 +914,13 @@ function MOD:Load() self:ToggleMailMinions() end - self:RegisterEvent('PARTY_INVITE_REQUEST','AutoGroupInvite') - self:RegisterEvent('GROUP_ROSTER_UPDATE','AutoGroupInvite') + self:RegisterEvent('PARTY_INVITE_REQUEST', AutoGroupInvite) + self:RegisterEvent('GROUP_ROSTER_UPDATE', AutoGroupInvite) for _,event in pairs(AutomatedEvents) do self:RegisterEvent(event) end - if self.db.pvpautorelease then + if SuperVillain.db.SVHenchmen.pvpautorelease then local autoReleaseHandler = CreateFrame("frame") autoReleaseHandler:RegisterEvent("PLAYER_DEAD") autoReleaseHandler:SetScript("OnEvent",function(self,event) diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua index 788b177..d6bd546 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -994,10 +994,10 @@ local GroupLootDropDown_GiveLoot = function(self) end local BailOut_OnEvent = function(self, event, ...) - if (CanExitVehicle()) then - SuperVillain:SecureFadeIn(self, 0.25, 0, 1) - else - SuperVillain:SecureFadeOut(self, 0.25, 1, 0, true) + if (event == "UNIT_ENTERED_VEHICLE" or CanExitVehicle()) then + self:Show() + elseif(event == "UNIT_EXITED_VEHICLE") then + self:Hide() end end --[[ @@ -1081,7 +1081,7 @@ function MOD:Load() self:RegisterEvent("MIRROR_TIMER_PAUSE", MirrorBarToggleHandler) self:RegisterEvent("START_TIMER", MirrorBarToggleHandler) - local exit = CreateFrame("Button", "SVUI_BailOut", SuperVillain.UIParent, "SecureHandlerClickTemplate") + local exit = CreateFrame("Button", "SVUI_BailOut", SuperVillain.UIParent) exit:Size(40, 40) exit:Point("TOPLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, -30) exit:SetNormalTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\EXIT") diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.lua b/Interface/AddOns/SVUI/packages/stats/SVStats.lua index 4727f5d..c8dad65 100644 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua @@ -38,8 +38,27 @@ local CONFIGS = SuperVillain.Configs local MOD = {}; MOD.Anchors = {}; MOD.Statistics = {}; -MOD.PlotPoints = {"middle", "left", "right"}; +MOD.StatListing = {[""] = "None"}; MOD.tooltip = CreateFrame("GameTooltip", "StatisticTooltip", UIParent, "GameTooltipTemplate") +MOD.BGPanels = { + ["TopLeftDataPanel"] = {left = "Honor", middle = "Kills", right = "Assists"}, + ["TopRightDataPanel"] = {left = "Damage", middle = "Healing", right = "Deaths"} +}; +MOD.BGStats = { + ["Name"] = {1, NAME}, + ["Kills"] = {2, KILLS}, + ["Assists"] = {3, PET_ASSIST}, + ["Deaths"] = {4, DEATHS}, + ["Honor"] = {5, HONOR}, + ["Faction"] = {6, FACTION}, + ["Race"] = {7, RACE}, + ["Class"] = {8, CLASS}, + ["Damage"] = {10, DAMAGE}, + ["Healing"] = {11, SHOW_COMBAT_HEALING}, + ["Rating"] = {12, BATTLEGROUND_RATING}, + ["Changes"] = {13, RATING_CHANGE}, + ["Spec"] = {16, SPECIALIZATION} +}; --[[ ########################################################## LOCALIZED GLOBALS @@ -54,13 +73,16 @@ LOCAL VARIABLES ]]-- local playerName = UnitName("player"); local playerRealm = GetRealmName(); -local hexString = "FFFFFF"; +local BGStatString = "%s: %s" local myName = UnitName("player"); local myClass = select(2,UnitClass("player")); local classColor = RAID_CLASS_COLORS[myClass]; -local BGStatString = ''; local StatMenuFrame = CreateFrame("Frame", "SVUI_StatMenu", UIParent); local ListNeedsUpdate = true +local SCORE_CACHE = {}; + +-- When its vertical then "left" = "top" and "right" = "bottom". Yes I know thats ghetto, bite me! +local positionIndex = {{"middle", "left", "right"}, {"middle", "top", "bottom"}}; --[[ ########################################################## LOCAL FUNCTIONS @@ -69,29 +91,45 @@ LOCAL FUNCTIONS local function GrabPlot(parent, slot, max) if max == 1 then return"CENTER", parent, "CENTER" - else - if slot == 1 then - return"CENTER", parent, "CENTER" - elseif slot == 2 then - return "RIGHT", parent.holders["middle"], "LEFT", -4, 0 - elseif slot == 3 then - return"LEFT", parent.holders["middle"], "RIGHT", 4, 0 + else + if(parent.vertical) then + if slot == 1 then + return "CENTER", parent, "CENTER" + elseif slot == 2 then + return "BOTTOM", parent.holders["middle"], "TOP", 0, 4 + elseif slot == 3 then + return "TOP", parent.holders["middle"], "BOTTOM", 0, -4 + end + else + if slot == 1 then + return "CENTER", parent, "CENTER" + elseif slot == 2 then + return "RIGHT", parent.holders["middle"], "LEFT", -4, 0 + elseif slot == 3 then + return "LEFT", parent.holders["middle"], "RIGHT", 4, 0 + end end end end local UpdateAnchor = function() - local backdrops = MOD.db.showBackground - for _, anchor in pairs(MOD.Anchors)do - local w = anchor:GetWidth() / anchor.numPoints - 4; - local h = anchor:GetHeight() - 4; - if(backdrops) then - h = RightSuperDockToggleButton:GetHeight() - 6 + local backdrops, width, height = MOD.db.showBackground + for _, anchor in pairs(MOD.Anchors) do + if(anchor.vertical) then + width = anchor:GetWidth() - 4; + height = anchor:GetHeight() / anchor.numPoints - 4; + else + width = anchor:GetWidth() / anchor.numPoints - 4; + height = anchor:GetHeight() - 4; + if(backdrops) then + height = RightSuperDockToggleButton:GetHeight() - 6 + end end + for i = 1, anchor.numPoints do - local this = MOD.PlotPoints[i] - anchor.holders[this]:Width(w) - anchor.holders[this]:Height(h) + local this = positionIndex[anchor.useIndex][i] + anchor.holders[this]:Width(width) + anchor.holders[this]:Height(height) anchor.holders[this]:Point(GrabPlot(anchor, i, numPoints)) end end @@ -140,33 +178,47 @@ function MOD:ShowTip(noSpace) MOD.tooltip:Show() end -function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop) +function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop, customTemplate, isVertical) ListNeedsUpdate = true + + local activeIndex = isVertical and 2 or 1 + local template, strata + + if(customTemplate) then + template = customTemplate + strata = "LOW" + else + template = isTop and "FramedTop" or "FramedBottom" + strata = "HIGH" + end + MOD.Anchors[parent:GetName()] = parent; parent.holders = {}; + parent.vertical = isVertical; parent.numPoints = maxCount; parent.anchor = tipAnchor; - local template = isTop and "FramedTop" or "FramedBottom" + parent.useIndex = activeIndex + for i = 1, maxCount do - local this = MOD.PlotPoints[i] - if not parent.holders[this] then - parent.holders[this] = CreateFrame("Button", "DataText"..i, parent) - parent.holders[this]:RegisterForClicks("AnyUp") - parent.holders[this].barframe = CreateFrame("Frame", nil, parent.holders[this]) + local position = positionIndex[activeIndex][i] + if not parent.holders[position] then + parent.holders[position] = CreateFrame("Button", "DataText"..i, parent) + parent.holders[position]:RegisterForClicks("AnyUp") + parent.holders[position].barframe = CreateFrame("Frame", nil, parent.holders[position]) if(MOD.db.showBackground) then - parent.holders[this].barframe:Point("TOPLEFT", parent.holders[this], "TOPLEFT", 24, -2) - parent.holders[this].barframe:Point("BOTTOMRIGHT", parent.holders[this], "BOTTOMRIGHT", -2, 2) - parent.holders[this]:SetFramedButtonTemplate(template) + parent.holders[position].barframe:Point("TOPLEFT", parent.holders[position], "TOPLEFT", 24, -2) + parent.holders[position].barframe:Point("BOTTOMRIGHT", parent.holders[position], "BOTTOMRIGHT", -2, 2) + parent.holders[position]:SetFramedButtonTemplate(template) else - parent.holders[this].barframe:Point("TOPLEFT", parent.holders[this], "TOPLEFT", 24, 2) - parent.holders[this].barframe:Point("BOTTOMRIGHT", parent.holders[this], "BOTTOMRIGHT", 2, -2) - parent.holders[this].barframe.bg = parent.holders[this].barframe:CreateTexture(nil, "BORDER") - parent.holders[this].barframe.bg:FillInner(parent.holders[this].barframe, 2, 2) - parent.holders[this].barframe.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - parent.holders[this].barframe.bg:SetGradient(unpack(SuperVillain.Media.gradient.dark)) + parent.holders[position].barframe:Point("TOPLEFT", parent.holders[position], "TOPLEFT", 24, 2) + parent.holders[position].barframe:Point("BOTTOMRIGHT", parent.holders[position], "BOTTOMRIGHT", 2, -2) + parent.holders[position].barframe.bg = parent.holders[position].barframe:CreateTexture(nil, "BORDER") + parent.holders[position].barframe.bg:FillInner(parent.holders[position].barframe, 2, 2) + parent.holders[position].barframe.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) + parent.holders[position].barframe.bg:SetGradient(unpack(SuperVillain.Media.gradient.dark)) end - parent.holders[this].barframe:SetFrameLevel(parent.holders[this]:GetFrameLevel()-1) - parent.holders[this].barframe:SetBackdrop({ + parent.holders[position].barframe:SetFrameLevel(parent.holders[position]:GetFrameLevel()-1) + parent.holders[position].barframe:SetBackdrop({ bgFile = [[Interface\BUTTONS\WHITE8X8]], edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], tile = false, @@ -174,40 +226,40 @@ function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop) edgeSize = 2, insets = {left = 0, right = 0, top = 0, bottom = 0} }) - parent.holders[this].barframe:SetBackdropColor(0, 0, 0, 0.5) - parent.holders[this].barframe:SetBackdropBorderColor(0, 0, 0, 0.8) - parent.holders[this].barframe.icon = CreateFrame("Frame", nil, parent.holders[this].barframe) - parent.holders[this].barframe.icon:Point("TOPLEFT", parent.holders[this], "TOPLEFT", 0, 6) - parent.holders[this].barframe.icon:Point("BOTTOMRIGHT", parent.holders[this], "BOTTOMLEFT", 26, -6) - parent.holders[this].barframe.icon.texture = parent.holders[this].barframe.icon:CreateTexture(nil, "OVERLAY") - parent.holders[this].barframe.icon.texture:FillInner(parent.holders[this].barframe.icon, 2, 2) - parent.holders[this].barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\PLACEHOLDER") - parent.holders[this].barframe.bar = CreateFrame("StatusBar", nil, parent.holders[this].barframe) - parent.holders[this].barframe.bar:FillInner(parent.holders[this].barframe, 2, 2) - parent.holders[this].barframe.bar:SetStatusBarTexture(SuperVillain.Media.bar.default) + parent.holders[position].barframe:SetBackdropColor(0, 0, 0, 0.5) + parent.holders[position].barframe:SetBackdropBorderColor(0, 0, 0, 0.8) + parent.holders[position].barframe.icon = CreateFrame("Frame", nil, parent.holders[position].barframe) + parent.holders[position].barframe.icon:Point("TOPLEFT", parent.holders[position], "TOPLEFT", 0, 6) + parent.holders[position].barframe.icon:Point("BOTTOMRIGHT", parent.holders[position], "BOTTOMLEFT", 26, -6) + parent.holders[position].barframe.icon.texture = parent.holders[position].barframe.icon:CreateTexture(nil, "OVERLAY") + parent.holders[position].barframe.icon.texture:FillInner(parent.holders[position].barframe.icon, 2, 2) + parent.holders[position].barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\PLACEHOLDER") + parent.holders[position].barframe.bar = CreateFrame("StatusBar", nil, parent.holders[position].barframe) + parent.holders[position].barframe.bar:FillInner(parent.holders[position].barframe, 2, 2) + parent.holders[position].barframe.bar:SetStatusBarTexture(SuperVillain.Media.bar.default) - parent.holders[this].barframe.bar.extra = CreateFrame("StatusBar", nil, parent.holders[this].barframe.bar) - parent.holders[this].barframe.bar.extra:SetAllPoints() - parent.holders[this].barframe.bar.extra:SetStatusBarTexture(SuperVillain.Media.bar.default) - parent.holders[this].barframe.bar.extra:Hide() - parent.holders[this].barframe:Hide() - parent.holders[this].textframe = CreateFrame("Frame", nil, parent.holders[this]) - parent.holders[this].textframe:SetAllPoints(parent.holders[this]) - parent.holders[this].textframe:SetFrameStrata("HIGH") - parent.holders[this].text = parent.holders[this].textframe:CreateFontString(nil, "OVERLAY", nil, 7) - parent.holders[this].text:SetAllPoints() + parent.holders[position].barframe.bar.extra = CreateFrame("StatusBar", nil, parent.holders[position].barframe.bar) + parent.holders[position].barframe.bar.extra:SetAllPoints() + parent.holders[position].barframe.bar.extra:SetStatusBarTexture(SuperVillain.Media.bar.default) + parent.holders[position].barframe.bar.extra:Hide() + parent.holders[position].barframe:Hide() + parent.holders[position].textframe = CreateFrame("Frame", nil, parent.holders[position]) + parent.holders[position].textframe:SetAllPoints(parent.holders[position]) + parent.holders[position].textframe:SetFrameStrata(strata) + parent.holders[position].text = parent.holders[position].textframe:CreateFontString(nil, "OVERLAY", nil, 7) + parent.holders[position].text:SetAllPoints() if(MOD.db.showBackground) then - parent.holders[this].text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, "NONE", "CENTER", "MIDDLE") - parent.holders[this].text:SetShadowColor(0, 0, 0, 0.5) - parent.holders[this].text:SetShadowOffset(2, -4) + parent.holders[position].text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, "NONE", "CENTER", "MIDDLE") + parent.holders[position].text:SetShadowColor(0, 0, 0, 0.5) + parent.holders[position].text:SetShadowOffset(2, -4) else - parent.holders[this].text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) - parent.holders[this].text:SetJustifyH("CENTER") - parent.holders[this].text:SetJustifyV("middle") + parent.holders[position].text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + parent.holders[position].text:SetJustifyH("CENTER") + parent.holders[position].text:SetJustifyV("MIDDLE") end end - parent.holders[this].MenuList = {}; - parent.holders[this]:Point(GrabPlot(parent, i, maxCount)) + parent.holders[position].MenuList = {}; + parent.holders[position]:Point(GrabPlot(parent, i, maxCount)) end parent:SetScript("OnSizeChanged", UpdateAnchor) UpdateAnchor(parent) @@ -215,25 +267,26 @@ end function MOD:Extend(newStat, eventList, onEvents, update, click, focus, blur, init) if not newStat then return end - MOD.Statistics[newStat] = {} + self.Statistics[newStat] = {} + self.StatListing[newStat] = newStat if type(eventList) == "table" then - MOD.Statistics[newStat]["events"] = eventList; - MOD.Statistics[newStat]["event_handler"] = onEvents + self.Statistics[newStat]["events"] = eventList; + self.Statistics[newStat]["event_handler"] = onEvents end if update and type(update) == "function" then - MOD.Statistics[newStat]["update_handler"] = update + self.Statistics[newStat]["update_handler"] = update end if click and type(click) == "function" then - MOD.Statistics[newStat]["click_handler"] = click + self.Statistics[newStat]["click_handler"] = click end if focus and type(focus) == "function" then - MOD.Statistics[newStat]["focus_handler"] = focus + self.Statistics[newStat]["focus_handler"] = focus end if blur and type(blur) == "function" then - MOD.Statistics[newStat]["blur_handler"] = blur + self.Statistics[newStat]["blur_handler"] = blur end if init and type(init) == "function" then - MOD.Statistics[newStat]["init_handler"] = init + self.Statistics[newStat]["init_handler"] = init end end @@ -246,9 +299,24 @@ function MOD:UnSet(parent) end do - local dataLayout, dataStrings = {}, {"None",KILLING_BLOWS,HONORABLE_KILLS,DEATHS,HONOR,"None","None","None","None",DAMAGE,SHOW_COMBAT_HEALING}; - dataLayout["TopLeftDataPanel"] = {['left'] = 10, ['middle'] = 5, ['right'] = 2}; - dataLayout["TopRightDataPanel"] = {['left'] = 4, ['middle'] = 3, ['right'] = 11}; + local dataStrings = { + NAME, + KILLING_BLOWS, + HONORABLE_KILLS, + DEATHS, + HONOR, + FACTION, + RACE, + CLASS, + "None", + DAMAGE, + SHOW_COMBAT_HEALING, + BATTLEGROUND_RATING, + RATING_CHANGE, + "None", + "None", + SPECIALIZATION + }; local Stat_OnLeave = function() MOD.tooltip:Hide() @@ -401,20 +469,19 @@ do end end - local BGStatPrev; local BG_OnUpdate = function(self) - BGStatPrev = self; - local truncated, tmp, bgName; - local parentName = BGStatPrev:GetParent():GetName(); - local lookup = BGStatPrev.pointIndex - local pointIndex = dataLayout[parentName][lookup] - local scoreType = dataStrings[pointIndex] - for index = 1, GetNumBattlefieldScores() do - bgName = GetBattlefieldScore(index) - if(bgName == myName) then - tmp = select(pointIndex, GetBattlefieldScore(index)) - truncated = TruncateString(tmp) - BGStatPrev.text:SetFormattedText(BGStatString, scoreType, truncated) + local scoreString; + local parentName = self:GetParent():GetName(); + local lookup = self.pointIndex + local pointIndex = MOD.BGPanels[parentName][lookup] + local scoreindex = MOD.BGStats[pointIndex][1] + local scoreType = MOD.BGStats[pointIndex][2] + local scoreCount = GetNumBattlefieldScores() + for i = 1, scoreCount do + SCORE_CACHE = {GetBattlefieldScore(i)} + if(SCORE_CACHE[1] and SCORE_CACHE[1] == myName and SCORE_CACHE[scoreindex]) then + scoreString = TruncateString(SCORE_CACHE[scoreindex]) + self.text:SetFormattedText(BGStatString, scoreType, scoreString) break end end @@ -430,7 +497,10 @@ do else r, g, b = 1, 1, 1 end - for i = 1, GetNumBattlefieldScores() do + + local scoreCount = GetNumBattlefieldScores() + + for i = 1, scoreCount do bgName = GetBattlefieldScore(i) if(bgName and bgName == myName) then MOD.tooltip:AddDoubleLine(L["Stats For:"], bgName, 1, 1, 1, r, g, b) @@ -472,10 +542,10 @@ do local function SetMenuLists() for place,parent in pairs(MOD.Anchors)do - for h = 1, parent.numPoints do - local this = MOD.PlotPoints[h] + for i = 1, parent.numPoints do + local this = positionIndex[parent.useIndex][i] tinsert(parent.holders[this].MenuList,{text = NONE, func = function() MOD:ChangeDBVar(NONE, this, "panels", place); MOD:Generate() end}); - for name,config in pairs(MOD.Statistics)do + for name,config in pairs(MOD.Statistics) do tinsert(parent.holders[this].MenuList,{text = name, func = function() MOD:ChangeDBVar(name, this, "panels", place); MOD:Generate() end}); end end @@ -488,44 +558,56 @@ do SetMenuLists() end local instance, groupType = IsInInstance() - for place, parent in pairs(MOD.Anchors)do - for h = 1, parent.numPoints do - local this = MOD.PlotPoints[h] - parent.holders[this]:UnregisterAllEvents() - parent.holders[this]:SetScript("OnUpdate", nil) - parent.holders[this]:SetScript("OnEnter", nil) - parent.holders[this]:SetScript("OnLeave", nil) - parent.holders[this]:SetScript("OnClick", nil) - if(MOD.db.showBackground) then - parent.holders[this].text:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, "NONE") + local anchorTable = self.Anchors + local statTable = self.Statistics + local db = self.db + local allowPvP = (db.battleground and not ForceHideBGStats) or false + for place, parent in pairs(anchorTable) do + local pvpTable = allowPvP and self.BGPanels[place] + for i = 1, parent.numPoints do + local position = positionIndex[parent.useIndex][i] + + parent.holders[position]:UnregisterAllEvents() + parent.holders[position]:SetScript("OnUpdate", nil) + parent.holders[position]:SetScript("OnEnter", nil) + parent.holders[position]:SetScript("OnLeave", nil) + parent.holders[position]:SetScript("OnClick", nil) + + if(db.showBackground) then + parent.holders[position].text:SetFont(SuperVillain.Shared:Fetch("font", db.font), db.fontSize, "NONE") else - parent.holders[this].text:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + parent.holders[position].text:SetFont(SuperVillain.Shared:Fetch("font", db.font), db.fontSize, db.fontOutline) end - parent.holders[this].text:SetText(nil) - if parent.holders[this].barframe then - parent.holders[this].barframe:Hide() + parent.holders[position].text:SetText(nil) + + if parent.holders[position].barframe then + parent.holders[position].barframe:Hide() end - parent.holders[this].pointIndex = this; - parent.holders[this]:Hide() - if place == "TopLeftDataPanel" and instance and groupType == "pvp" and not ForceHideBGStats and SuperVillain.db.SVStats.battleground then - parent.holders[this]:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") - parent.holders[this]:SetScript("OnEvent", BG_OnUpdate) - parent.holders[this]:SetScript("OnEnter", BG_OnEnter) - parent.holders[this]:SetScript("OnLeave", Stat_OnLeave) - parent.holders[this]:SetScript("OnClick", BG_OnClick) - BG_OnUpdate(parent.holders[this]) - parent.holders[this]:Show() + + parent.holders[position].pointIndex = position; + parent.holders[position]:Hide() + + if(pvpTable and ((instance and groupType == "pvp") or parent.lockedOpen)) then + parent.holders[position]:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") + parent.holders[position]:SetScript("OnEvent", BG_OnUpdate) + parent.holders[position]:SetScript("OnEnter", BG_OnEnter) + parent.holders[position]:SetScript("OnLeave", Stat_OnLeave) + parent.holders[position]:SetScript("OnClick", BG_OnClick) + + BG_OnUpdate(parent.holders[position]) + + parent.holders[position]:Show() else - for name, config in pairs(MOD.Statistics)do - for k, l in pairs(SuperVillain.db.SVStats.panels)do - if l and type(l) == "table"then - if k == place and SuperVillain.db.SVStats.panels[k][this] and SuperVillain.db.SVStats.panels[k][this] == name then - _load(parent.holders[this], config) + for name, config in pairs(statTable)do + for panelName, panelData in pairs(db.panels) do + if(panelData and type(panelData) == "table") then + if(panelName == place and panelData[position] and panelData[position] == name) then + _load(parent.holders[position], config) end - elseif l and type(l) == "string"and l == name then - if SuperVillain.db.SVStats.panels[k] == name and k == place then - _load(parent.holders[this], config) + elseif(panelData and type(panelData) == "string" and panelData == name) then + if(name == place) then + _load(parent.holders[position], config) end end end @@ -535,15 +617,6 @@ do end if ForceHideBGStats then ForceHideBGStats = nil end end - - local BGStatColorUpdate = function() - BGStatString = join("", "%s: |cff", hexString, "%s|r") - if BGStatPrev ~= nil then - BG_OnUpdate(BGStatPrev) - end - end - - SuperVillain.Registry:SetCallback(BGStatColorUpdate); end --[[ ########################################################## @@ -555,7 +628,9 @@ function MOD:ReLoad() end function MOD:Load() - hexString = SuperVillain:HexColor("highlight") or "FFFFFF" + local hexHighlight = SuperVillain:HexColor("highlight") or "FFFFFF" + local hexClass = classColor.colorStr + BGStatString = "|cff" .. hexHighlight .. "%s: |c" .. hexClass .. "%s|r"; SVUI_Global["Accountant"] = SVUI_Global["Accountant"] or {}; SVUI_Global["Accountant"][playerRealm] = SVUI_Global["Accountant"][playerRealm] or {}; SVUI_Global["Accountant"][playerRealm]["gold"] = SVUI_Global["Accountant"][playerRealm]["gold"] or {}; @@ -577,6 +652,8 @@ function MOD:Load() self:Generate() self:RegisterEvent("PLAYER_ENTERING_WORLD", "Generate") + + myName = UnitName("player"); end --[[ ########################################################## @@ -605,6 +682,11 @@ CONFIGS["SVStats"] = { ["left"] = "Durability Bar", ["middle"] = "Reputation Bar", ["right"] = "Experience Bar", + }, + ["TopRightDataPanel"] = { + ["left"] = "None", + ["middle"] = "None", + ["right"] = "None", }, }, ["localtime"] = true, diff --git a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua index 9953a30..2e02985 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua @@ -280,7 +280,7 @@ local CustomTimeText = function(self, value) end local CustomCastTimeUpdate = function(self, duration) - if(self.recipecount and self.maxrecipe and self.maxrecipe > 0) then + if(self.recipecount and self.recipecount > 0 and self.maxrecipe and self.maxrecipe > 1) then self.Text:SetText(self.recipecount .. "/" .. self.maxrecipe .. ": " .. self.previous) end if(self.Time) then @@ -324,7 +324,7 @@ local CustomCastBarUpdate = function(self, elapsed) self.channeling = nil self.tradeskill = nil self.recipecount = nil - self.maxrecipe = nil + self.maxrecipe = 1 self:SetValue(1) self:Hide() return @@ -353,7 +353,7 @@ local CustomCastBarUpdate = function(self, elapsed) self.casting = nil self.tradeskill = nil self.recipecount = nil - self.maxrecipe = nil + self.maxrecipe = 1 self:Hide() if(self.PostCastStop) then self:PostCastStop(self.__owner.unit) end @@ -384,7 +384,7 @@ local CustomCastBarUpdate = function(self, elapsed) self.casting = nil self.tradeskill = nil self.recipecount = nil - self.maxrecipe = nil + self.maxrecipe = 1 self:Hide() if(self.PostChannelStop) then self:PostChannelStop(self.__owner.unit) end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua index e3a88bc..64e6fdb 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua @@ -49,6 +49,8 @@ assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") DRUID ALT MANA ########################################################## ]]-- +local TRACKER_FONT = [[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]] + local UpdateAltPower = function(self, unit, arg1, arg2) local value = self:GetParent().InfoPanel.Power; if(arg1 ~= arg2) then @@ -140,6 +142,7 @@ local Reposition = function(self) bar.Text:SetPoint("TOPLEFT", bar, "TOPLEFT", 10, 0) bar.Text:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -10, 0) + bar.Text:SetFont(TRACKER_FONT, size, 'OUTLINE') end --[[ ########################################################## @@ -262,7 +265,7 @@ function MOD:CreateClassBar(playerFrame) points.Text = points:CreateFontString(nil,'OVERLAY') points.Text:SetAllPoints(points) - points.Text:SetFont([[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]], 26, 'OUTLINE') + points.Text:SetFont(TRACKER_FONT, 26, 'OUTLINE') points.Text:SetTextColor(1,1,1) playerFrame.HyperCombo = hyper; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua index 75039c4..9800ab3 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua @@ -49,6 +49,7 @@ assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") LOCALS ########################################################## ]]-- +local TRACKER_FONT = [[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]] local ICON_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\ROGUE]]; local ICON_COORDS = { {0,0.5,0,0.5}, @@ -193,7 +194,7 @@ local RepositionTracker = function(self) bar.Tracking:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) bar.Tracking.Text:ClearAllPoints() bar.Tracking.Text:SetAllPoints(bar.Tracking) - bar.Tracking.Text:SetFontTemplate([[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]], size, 'OUTLINE') + bar.Tracking.Text:SetFont(TRACKER_FONT, size, 'OUTLINE') end if(bar.Anticipation) then bar.Anticipation:ClearAllPoints() @@ -202,7 +203,7 @@ local RepositionTracker = function(self) bar.Anticipation:SetPoint("LEFT", bar.Tracking, "RIGHT", -2, 0) bar.Anticipation.Text:ClearAllPoints() bar.Anticipation.Text:SetAllPoints(bar.Anticipation) - bar.Anticipation.Text:SetFontTemplate([[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]], size, 'OUTLINE') + bar.Anticipation.Text:SetFont(TRACKER_FONT, size, 'OUTLINE') end if(bar.Guile) then bar.Guile:ClearAllPoints() @@ -211,7 +212,7 @@ local RepositionTracker = function(self) bar.Guile:SetPoint("LEFT", bar.Anticipation, "RIGHT", -2, 0) bar.Guile.Text:ClearAllPoints() bar.Guile.Text:SetAllPoints(bar.Guile) - bar.Guile.Text:SetFontTemplate([[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]], size, 'OUTLINE') + bar.Guile.Text:SetFont(TRACKER_FONT, size, 'OUTLINE') end end; @@ -225,7 +226,7 @@ function MOD:CreateClassBar(playerFrame) points.Text = points:CreateFontString(nil,'OVERLAY') points.Text:SetAllPoints(points) - points.Text:SetFontTemplate([[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]],30,'OUTLINE') + points.Text:SetFontTemplate(TRACKER_FONT,30,'OUTLINE') points.Text:SetTextColor(1,1,1) bar.Tracking = points; @@ -236,7 +237,7 @@ function MOD:CreateClassBar(playerFrame) anticipation.Text = anticipation:CreateFontString(nil,'OVERLAY') anticipation.Text:SetAllPoints(anticipation) - anticipation.Text:SetFontTemplate([[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]],30,'OUTLINE') + anticipation.Text:SetFontTemplate(TRACKER_FONT,30,'OUTLINE') anticipation.Text:SetTextColor(1,1,1) bar.Anticipation = anticipation; @@ -247,7 +248,7 @@ function MOD:CreateClassBar(playerFrame) guile.Text = guile:CreateFontString(nil,'OVERLAY') guile.Text:SetAllPoints(guile) - guile.Text:SetFontTemplate([[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]],30,'OUTLINE') + guile.Text:SetFontTemplate(TRACKER_FONT,30,'OUTLINE') guile.Text:SetTextColor(1,1,1) bar.Guile = guile; diff --git a/Interface/AddOns/SVUI/system/common.lua b/Interface/AddOns/SVUI/system/common.lua index 5521b36..8ae228c 100644 --- a/Interface/AddOns/SVUI/system/common.lua +++ b/Interface/AddOns/SVUI/system/common.lua @@ -908,12 +908,9 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd bottomLeft:SetNonBlocking(true) end - local level = frame:GetFrameLevel() - 1 - if(level >= 0) then - frame.Panel:SetFrameLevel(level) - else - frame.Panel:SetFrameLevel(0) - end + local level = frame:GetFrameLevel() + frame:SetFrameLevel(level + 1) + frame.Panel:SetFrameLevel(level) end local function HasCooldown(n) diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua index d93047b..8c89297 100644 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua @@ -777,7 +777,6 @@ do function PLUGIN:TakeAMessage(caller, inbound) ClearResponses(caller) local data = PhoneLines[caller]; - --SuperVillain:ShowDebug("Answering Service","TakeAMessage",data) if(data) then if(data.InUse) then local data = PhoneLines[caller]; @@ -855,9 +854,9 @@ local PhoneTimeUpdate = function(self, elapsed) ElapsedUpdate = ElapsedUpdate + elapsed if ElapsedUpdate > 4 then local timer = 300; + local ttime = GetTime() ElapsedUpdate = 0 if #ResponseQueue > 0 then - local ttime = GetTime() for x = 1, #ResponseQueue, 1 do if ResponseQueue[x] then if ResponseQueue[x].ETA < ttime then @@ -867,19 +866,13 @@ local PhoneTimeUpdate = function(self, elapsed) end end end - if GetTime() > timer then + if ttime > timer then for x = 1, 5, 1 do local btn = _G["HenchmenPhoneLine"..x]; local caller = btn.Text:GetText() if(PhoneLines[caller]) then - if PhoneLines[caller].TimeStamp < (GetTime() - timer) then - if(not PhoneLines[caller].GiveUp) then - SendChatMessage("You still there?", "WHISPER", nil, caller) - PhoneLines[caller].GiveUp = true - else - PhoneLines[caller].GiveUp = nil; - HangUp(caller) - end + if PhoneLines[caller].TimeStamp < (ttime - timer) then + HangUp(caller) end end end diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua index 268059e..d4ce857 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua @@ -84,7 +84,7 @@ CORE FUNCTIONS ########################################################## ]]-- local EnemyCache, AlertedCache = {},{} -local AoWLogs = CreateFrame("Frame", "SVUI_AoWLogs", UIParent) + local playerGUID = UnitGUID('player') local playerFaction = UnitFactionGroup("player") local classColor = RAID_CLASS_COLORS @@ -93,12 +93,17 @@ local classR, classG, classB = classColors.r, classColors.g, classColors.b local classA = 0.35 local fallbackColor = {r=1,g=1,b=1} local ACTIVE_ZONE = "" +--[[ ICONS ]]-- +local INFO_ICON = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-INFO]] +local UTILITY_ICON = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-UTILITIES]] +local RADIO_ICON = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-RADIO]] +local SCANNER_ICON = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-SCANNER]] local ICON_FILE = [[Interface\AddOns\SVUI_ArtOfWar\artwork\DOCK-PVP]] local PVP_SAFE = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-SAFE]] local PVP_HELP = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-INCOMING]] -local SCAN_ICON = [[Interface\Addons\SVUI_ArtOfWar\artwork\DOCK-SCAN]] -local SCAN_ANIM = [[Interface\Addons\SVUI_ArtOfWar\artwork\SCAN-ANIMATION]] local PVP_LOST = [[Interface\WorldMap\Skull_64Red]] +local linkString = "|Hplayer:%s:1|h%s|h" +--[[ BG MAP DATA ]]-- local PVP_NODES = { [461] = { --Arathi Basin (5) "Stables", "Lumber", "Blacksmith", "Mine", "Farm" @@ -214,7 +219,7 @@ end local function ClearCacheScans() wipe(EnemyCache) wipe(AlertedCache) - PLUGIN.LogWindow:Clear(); + PLUGIN.LOG.Output:Clear(); end local function ClearSavedScans() @@ -243,7 +248,7 @@ local function StealthAlarm(name) end function PLUGIN:UpdateSummary() - self.SummaryWindow:Clear(); + self.Summary:Clear(); local stored = SVAOW_Cache; local amount = 0 for _,data in pairs(stored) do @@ -251,16 +256,16 @@ function PLUGIN:UpdateSummary() amount = amount + 1; end end - self.SummaryWindow:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); + self.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); end function PLUGIN:ResetLogs() wipe(EnemyCache) - self.TitleWindow:Clear(); - self.SummaryWindow:Clear(); - self.LogWindow:Clear(); - self.TitleWindow:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); - SVUI_AoWLogsClear:Show() + self.Title:Clear(); + self.Summary:Clear(); + self.LOG.Output:Clear(); + self.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + self.Switch:Show() local stored = SVAOW_Cache; local amount = 0 for _,data in pairs(stored) do @@ -268,17 +273,36 @@ function PLUGIN:ResetLogs() amount = amount + 1; end end - self.SummaryWindow:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); + self.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8) collectgarbage("collect") end -function PLUGIN:SwitchToLogs() - if(not AoWLogs:IsShown()) then AoWLogs:Show() end - self.TitleWindow:Clear(); - self.SummaryWindow:Clear(); - self.LogWindow:Clear(); - self.TitleWindow:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); - SVUI_AoWLogsClear:Show() +function PLUGIN:PopulateKOS() + self.Title:Clear(); + self.Summary:Clear(); + self.LOG.Output:Clear(); + self.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + self.Switch:Show() + local stored = SVAOW_Cache; + local amount = 0 + for _,data in pairs(stored) do + if type(data) == "table" and data.name and data.class and data.race then + amount = amount + 1; + local nameLink = linkString:format(data.name, data.name) + local hex = ("%s - %s %s"):format(nameLink, data.race, data.class) + self.LOG.Output:AddMessage(hex, data.colors.r, data.colors.g, data.colors.b); + end + end + self.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8) +end + +function PLUGIN:PopulateScans() + self.COMM.Unavailable:Hide() + self.Title:Clear(); + self.Summary:Clear(); + self.LOG.Output:Clear(); + self.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + self.Switch:Show() local stored = SVAOW_Cache; local amount = 0 for _,data in pairs(stored) do @@ -286,47 +310,48 @@ function PLUGIN:SwitchToLogs() amount = amount + 1; end end - self.SummaryWindow:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); + self.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); for _,data in pairs(EnemyCache) do if type(data) == "table" and data.name and data.class and data.race then - local hex = ("%s - %s %s"):format(data.name, data.race, data.class) - self.LogWindow:AddMessage(hex, data.colors.r, data.colors.g, data.colors.b); + local nameLink = linkString:format(data.name, data.name) + local hex = ("%s - %s %s"):format(nameLink, data.race, data.class) + self.LOG.Output:AddMessage(hex, data.colors.r, data.colors.g, data.colors.b); end end end -function PLUGIN:SwitchToBG() - if(self.InPVP) then - if(AoWLogs:IsShown()) then AoWLogs:Hide() end +function PLUGIN:PauseScanner() + if(not self.InPVP) then + self.Title:Clear(); + self.Summary:Clear(); + self.LOG.Output:Clear(); + self.Title:AddMessage("Scanning Paused", 1, 0.1, 0); + self.Summary:AddMessage(ACTIVE_ZONE, 1, 0.75, 0); + self.Switch:Hide() + self.LOG.Output:AddMessage(" ", 1, 1, 1); + self.LOG.Output:AddMessage(" ", 1, 1, 1); + self.LOG.Output:AddMessage("The Enenmy Scanner Will Resume", 0.8, 0.8, 0.8); + self.LOG.Output:AddMessage("When You Leave This BattleGround", 0.8, 0.8, 0.8); else - if(not AoWLogs:IsShown()) then AoWLogs:Show() end - self.TitleWindow:Clear(); - self.SummaryWindow:Clear(); - self.LogWindow:Clear(); - self.TitleWindow:AddMessage("Scanning Paused", 1, 0.1, 0); - self.SummaryWindow:AddMessage(ACTIVE_ZONE, 1, 0.75, 0); - SVUI_AoWLogsClear:Hide() - self.LogWindow:AddMessage(" ", 1, 1, 1); - self.LogWindow:AddMessage(" ", 1, 1, 1); - self.LogWindow:AddMessage("The Enenmy Scanner Will Resume", 0.8, 0.8, 0.8); - self.LogWindow:AddMessage("When You Leave This BattleGround", 0.8, 0.8, 0.8); + self:PopulateScans() end end function PLUGIN:ScannerLog(enemy) if(not enemy.name or not enemy.race or not enemy.class) then return end - local hex = ("%s - %s %s"):format(enemy.name, enemy.race, enemy.class) - self.LogWindow:AddMessage(hex, enemy.colors.r, enemy.colors.g, enemy.colors.b); + local nameLink = linkString:format(enemy.name, enemy.name) + local hex = ("%s - %s %s"):format(nameLink, enemy.race, enemy.class) + self.LOG.Output:AddMessage(hex, enemy.colors.r, enemy.colors.g, enemy.colors.b); EnemyAlarm(enemy.name, enemy.class, enemy.colors) end function PLUGIN:UpdateCommunicator() - local docklet = _G["SVUI_ArtOfWarDock_ToolBarButton"] if(not self.InPVP) then local mapID = GetCurrentMapAreaID() if(mapID) then local points = PVP_NODES[mapID] if(points) then + self.COMM.Unavailable:Hide() for i = 1, 5 do local nodeName = ("SVUI_PVPNode%d"):format(i) local node = _G[nodeName] @@ -347,14 +372,12 @@ function PLUGIN:UpdateCommunicator() end self.InPVP = true SVUIAddonEventHandler:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") - self.DockButton:SaveColors("yellow", "yellow", true) - self.DockButton.icon:SetTexture(ICON_FILE) - self.DockButton.Scanner:Hide() self.Scanning = false - self:SwitchToBG() + self:PauseScanner() end end elseif(self.InPVP) then + self.COMM.Unavailable:Show() for i = 1, 5 do local nodeName = ("SVUI_PVPNode%d"):format(i) local node = _G[nodeName] @@ -367,12 +390,9 @@ function PLUGIN:UpdateCommunicator() end self.InPVP = nil SVUIAddonEventHandler:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") - self.DockButton:SaveColors("special", "icon", false) - self.DockButton.icon:SetTexture(0,0,0,0) - self.DockButton.Scanner:Show() self.Scanning = true - self:SwitchToLogs() + self:PopulateScans() end end @@ -385,8 +405,8 @@ function PLUGIN:UpdateZoneStatus() if(zoneText ~= ACTIVE_ZONE) then ClearCacheScans() ACTIVE_ZONE = zoneText - PLUGIN.TitleWindow:Clear(); - PLUGIN.TitleWindow:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + PLUGIN.Title:Clear(); + PLUGIN.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); end local zonePvP = GetZonePVPInfo() if(zonePvP == "sanctuary" or zoneText == "") then @@ -399,7 +419,7 @@ function PLUGIN:UpdateZoneStatus() elseif (not zonePvP or (zonePvP == "friendly") or (not UnitIsPVP("player"))) then PLUGIN.Scanning = false elseif(instanceType == "pvp") then - PLUGIN:SwitchToBG() + PLUGIN:PauseScanner() PLUGIN.Scanning = false if(not PLUGIN.InPVP) then PLUGIN:UpdateCommunicator() @@ -534,26 +554,6 @@ end SVUIAddonEventHandler:SetScript("OnEvent", Registry_OnEvent) -local LogClear_OnClick = function(self, button) - if(IsShiftKeyDown()) then - ClearSavedScans() - PLUGIN:ResetLogs() - end - ClearCacheScans() -end - -local LogClear_OnEnter = function(self) - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddDoubleLine("Click", "To Clear Scan", 0.1, 1, 0.2, 1, 1, 1) - GameTooltip:AddDoubleLine("[SHIFT] Click", "To Clear All", 0.1, 1, 0.2, 1, 1, 1) - GameTooltip:Show() -end - -local LogClear_OnLeave = function(self) - GameTooltip:Hide() -end - local onMouseWheel = function(self, delta) if (delta > 0) then self:ScrollUp() @@ -563,75 +563,41 @@ local onMouseWheel = function(self, delta) end local function MakeLogWindow() - AoWLogs:SetFrameStrata("MEDIUM") - AoWLogs:FillInner(SVUI_ArtOfWarDock) - AoWLogs:SetParent(SVUI_ArtOfWarDock) - - local title = CreateFrame("ScrollingMessageFrame", nil, AoWLogs) - title:SetSpacing(4) - title:SetClampedToScreen(false) - title:SetFrameStrata("MEDIUM") - title:SetPoint("TOPLEFT", AoWLogs, "TOPLEFT",0,0) - title:SetPoint("BOTTOMRIGHT", AoWLogs, "TOPRIGHT",0,-20) - title:SetFontTemplate(SuperVillain.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") - title:SetMaxLines(1) - title:EnableMouseWheel(false) - title:SetFading(false) - title:SetInsertMode('TOP') - - title.divider = title:CreateTexture(nil,"OVERLAY") - title.divider:SetTexture(classR, classG, classB) - title.divider:SetAlpha(classA) - title.divider:SetPoint("BOTTOMLEFT") - title.divider:SetPoint("BOTTOMRIGHT") - title.divider:SetHeight(1) - - local clearcount = CreateFrame("Button", "SVUI_AoWLogsClear", AoWLogs) - clearcount:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) - clearcount:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-20) - clearcount:SetButtonTemplate(true) - clearcount:SetScript("OnEnter", LogClear_OnEnter) - clearcount:SetScript("OnLeave", LogClear_OnLeave) - clearcount:SetScript("OnClick", LogClear_OnClick) - - local summary = CreateFrame("ScrollingMessageFrame", nil, AoWLogs) - summary:SetSpacing(4) - summary:SetClampedToScreen(false) - summary:SetFrameStrata("MEDIUM") - summary:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) - summary:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-20) - summary:SetFontTemplate(SuperVillain.Media.font.system, 16, "OUTLINE", "CENTER", "MIDDLE") - summary:SetMaxLines(1) - summary:EnableMouse(false) - summary:SetFading(false) - summary:SetInsertMode('TOP') - - summary.divider = summary:CreateTexture(nil,"OVERLAY") - summary.divider:SetTexture(classR, classG, classB) - summary.divider:SetAlpha(classA) - summary.divider:SetPoint("BOTTOMLEFT") - summary.divider:SetPoint("BOTTOMRIGHT") - summary.divider:SetHeight(1) - - local log = CreateFrame("ScrollingMessageFrame", nil, AoWLogs) - log:SetSpacing(4) - log:SetClampedToScreen(false) - log:SetFrameStrata("MEDIUM") - log:SetPoint("TOPLEFT",summary,"BOTTOMLEFT",0,0) - log:SetPoint("BOTTOMRIGHT",AoWLogs,"BOTTOMRIGHT",0,0) - log:SetFont(SuperVillain.Media.font.system, 11, "OUTLINE") - log:SetJustifyH("CENTER") - log:SetJustifyV("MIDDLE") - log:SetShadowColor(0, 0, 0, 0) - log:SetMaxLines(120) - log:EnableMouseWheel(true) - log:SetScript("OnMouseWheel", onMouseWheel) - log:SetFading(false) - log:SetInsertMode('TOP') - - PLUGIN.TitleWindow = title - PLUGIN.SummaryWindow = summary - PLUGIN.LogWindow = log + local frame = CreateFrame("Frame", nil, UIParent) + + frame:SetFrameStrata("MEDIUM") + frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) + frame:SetPoint("BOTTOMRIGHT", SVUI_ArtOfWarDock, "BOTTOMRIGHT",0,0) + frame:SetParent(SVUI_ArtOfWarDock) + + local output = CreateFrame("ScrollingMessageFrame", nil, frame) + output:SetSpacing(4) + output:SetClampedToScreen(false) + output:SetFrameStrata("MEDIUM") + output:SetAllPoints(frame) + output:SetFont(SuperVillain.Media.font.system, 11, "OUTLINE") + output:SetJustifyH("CENTER") + output:SetJustifyV("MIDDLE") + output:SetShadowColor(0, 0, 0, 0) + output:SetMaxLines(120) + output:EnableMouseWheel(true) + output:SetHyperlinksEnabled(true) + output:SetScript("OnMouseWheel", onMouseWheel) + output:SetFading(false) + output:SetInsertMode('TOP') + + output:SetScript("OnHyperlinkEnter", function(self, linkData, link, button) + local t = link:explode(":") + local name = t[2] or "" + SVUI_TargetScanButton:SetAttribute("macrotext", ("/tar %s"):format(name)) + SVUI_TargetScanButton:EnableMouse(true) + end) + + frame.Output = output + + PLUGIN.LOG = frame + + _G["SVUI_ArtOfWarTool1"].Window = PLUGIN.LOG SVUIAddonEventHandler:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") SVUIAddonEventHandler:RegisterEvent("ZONE_CHANGED") @@ -643,82 +609,40 @@ local function MakeLogWindow() SVUIAddonEventHandler:RegisterEvent("UNIT_FACTION") SVUIAddonEventHandler:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") end ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAOW = { - type = "group", - name = L["Art of War"], - childGroups = "tree", - args = { - enable = { - order = 1, - type = "toggle", - name = "Enable", - get = function(a) return SuperVillain.db.SVAOW.enable end, - set = function(a,b)SuperVillain.db.SVAOW.enable = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end - } - } - } -end - -local function LoadWarVillain() - if(not SuperVillain.db.SVAOW.enable) then return end - PLUGIN.db = SuperVillain.db.SVAOW - - if(not SVAOW_Data) then SVAOW_Data = {} end - if(not SVAOW_Cache) then SVAOW_Cache = {} end - - PLUGIN.HitBy = false; - PLUGIN.Scanning = false; - PLUGIN.InPVP = false - - local holder = CreateFrame("Frame", "SVUI_ArtOfWarDock", SuperDockWindowRight) - holder:SetFrameStrata("BACKGROUND") - MakeLogWindow() - SuperVillain:RegisterDocklet("SVUI_ArtOfWarDock", "Art of War", ICON_FILE) - local dockbutton = _G["SVUI_ArtOfWarDock_ToolBarButton"]; - - local scanner = CreateFrame("Frame", nil, dockbutton) - scanner:SetAllPoints(dockbutton) - scanner:SetFrameLevel(dockbutton:GetFrameLevel() + 2) +local function MakeCommWindow() - -- local blip = scanner:CreateTexture(nil, "BORDER") - -- blip:SetAllPoints(scanner) - -- blip:SetTexture(SCAN_ICON) - -- blip:SetVertexColor(0,0.8,0) - -- blip:SetAlpha(0.5) + local frame = CreateFrame("Frame", nil, UIParent) - scanner.Spinner = scanner:CreateTexture(nil, "ARTWORK", nil, 2) - scanner.Spinner:SetTexture(SCAN_ANIM) - scanner.Spinner:SetVertexColor(0.5,0.5,0.5) - scanner.Spinner:Size(dockbutton:GetSize()) - scanner.Spinner:SetPoint("CENTER", scanner, "CENTER", 0, 0) + frame:SetFrameStrata("MEDIUM") + frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) + frame:SetPoint("BOTTOMRIGHT", SVUI_ArtOfWarDock, "BOTTOMRIGHT",0,0) + frame:SetParent(SVUI_ArtOfWarDock) - SuperVillain.Animate:Orbit(scanner.Spinner, 8, true) + local fallback = CreateFrame("Frame", nil, frame) + fallback:SetAllPoints(frame) - dockbutton.Scanner = scanner + local fbText = fallback:CreateFontString(nil, "OVERLAY") + fbText:SetAllPoints(fallback) + fbText:SetFont(SuperVillain.Media.font.roboto, 12, "NONE") + fbText:SetText("Nothing To Broadcast Right Now") - PLUGIN.DockButton = dockbutton - PLUGIN.DockButton.icon:SetTexture(0,0,0,0) + frame.Unavailable = fallback - local width = holder:GetWidth() - local height = holder:GetHeight() - local sectionWidth = (width / 6) - 2 - local sectionHeight = (height / 5) - 2 + local DOCK_WIDTH = frame:GetWidth(); + local DOCK_HEIGHT = frame:GetHeight(); + local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; + local sectionWidth = (DOCK_WIDTH / 6) - 2 + local sectionHeight = (DOCK_HEIGHT / 5) - 2 local iconSize = sectionHeight * 0.5 for i = 1, 5 do local yOffset = (sectionHeight * (i - 1)) + 2 local poiName = ("SVUI_PVPNode%d"):format(i) - local poi = CreateFrame("Frame", poiName, holder) - poi:SetSize((width - 2), sectionHeight) - poi:SetPoint("TOP", holder, "TOP", 0, -yOffset) + local poi = CreateFrame("Frame", poiName, frame) + poi:SetSize((DOCK_WIDTH - 2), sectionHeight) + poi:SetPoint("TOP", frame, "TOP", 0, -yOffset) poi:SetPanelTemplate("Transparent") local safe = CreateFrame("Button", nil, poi) @@ -762,11 +686,365 @@ local function LoadWarVillain() poi:Hide() end + PLUGIN.COMM = frame + + _G["SVUI_ArtOfWarTool2"].Window = PLUGIN.COMM + + PLUGIN.COMM:Hide() +end + +local function MakeUtilityWindow() + local frame = CreateFrame("Frame", nil, UIParent) + + frame:SetFrameStrata("MEDIUM") + frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) + frame:SetPoint("BOTTOMRIGHT", SVUI_ArtOfWarDock, "BOTTOMRIGHT",0,0) + frame:SetParent(SVUI_ArtOfWarDock) + + local fbText = frame:CreateFontString(nil, "OVERLAY") + fbText:SetAllPoints(frame) + fbText:SetFont(SuperVillain.Media.font.roboto, 12, "NONE") + fbText:SetText("Utilities Coming Soon....") + + PLUGIN.TOOL = frame + + _G["SVUI_ArtOfWarTool3"].Window = PLUGIN.TOOL + + PLUGIN.TOOL:Hide() +end + +local function MakeInfoWindow() + local frame = CreateFrame("Frame", nil, UIParent) + + frame:SetFrameStrata("MEDIUM") + frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) + frame:SetPoint("BOTTOMRIGHT", SVUI_ArtOfWarDock, "BOTTOMRIGHT",0,0) + frame:SetParent(SVUI_ArtOfWarDock) + + local DATA_WIDTH = (frame:GetWidth() * 0.5) - 2; + local DATA_HEIGHT = frame:GetHeight() - 2; + + local leftColumn = CreateFrame("Frame", "SVUI_ArtOfWarInfoLeft", frame) + leftColumn:Size(DATA_WIDTH, DATA_HEIGHT) + leftColumn:Point("LEFT", frame, "LEFT", 0, 0) + leftColumn.lockedOpen = true + SuperVillain.SVStats:NewAnchor(leftColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) + leftColumn:SetFrameLevel(0) + + local rightColumn = CreateFrame("Frame", "SVUI_ArtOfWarInfoRight", frame) + rightColumn:Size(DATA_WIDTH, DATA_HEIGHT) + rightColumn:Point("LEFT", leftColumn, "RIGHT", 2, 0) + rightColumn.lockedOpen = true + SuperVillain.SVStats:NewAnchor(rightColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) + rightColumn:SetFrameLevel(0) + + PLUGIN.INFO = frame + + _G["SVUI_ArtOfWarTool4"].Window = PLUGIN.INFO + + SuperVillain.SVStats.BGPanels = { + ["SVUI_ArtOfWarInfoLeft"] = {top = "Honor", middle = "Kills", bottom = "Assists"}, + ["SVUI_ArtOfWarInfoRight"] = {top = "Damage", middle = "Healing", bottom = "Deaths"} + } + + SuperVillain.SVStats:Generate() + + PLUGIN.INFO:Hide() +end +--[[ +########################################################## +DOCK ELEMENT HANDLERS +########################################################## +]]-- +local ArtOfWarAlert_OnEnter = function(self) + if InCombatLockdown() then return; end + self:SetBackdropColor(0.9, 0.15, 0.1) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine(self.TText, 1, 1, 0) + GameTooltip:Show() +end + +local ArtOfWarAlert_OnLeave = function(self) + GameTooltip:Hide() + if InCombatLockdown() then return end; + self:SetBackdropColor(0.25, 0.52, 0.1) +end + +local ArtOfWarAlert_OnHide = function() + if InCombatLockdown() then + SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); + return; + end + SuperDockAlertRight:Deactivate() +end + +local ArtOfWarAlert_OnShow = function(self) + if InCombatLockdown() then + SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); + self:Hide() + return; + end + SuperVillain:SecureFadeIn(self, 0.3, 0, 1) + SuperDockAlertRight:Activate(self) +end + +local ArtOfWarAlert_OnMouseDown = function(self) + -- DO STUFF + SuperVillain:SecureFadeOut(self, 0.5, 1, 0, true) +end + +local ArtOfWarTool_OnEnter = function(self) + if InCombatLockdown() then return; end + self.icon:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine(self.TText, 1, 1, 1) + GameTooltip:Show() +end + +local ArtOfWarTool_OnLeave = function(self) + if InCombatLockdown() then return; end + self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + GameTooltip:Hide() +end + +local ArtOfWarTool_OnMouseDown = function(self) + SuperVillain:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) + SuperVillain:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) + SuperVillain:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) + SuperVillain:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) + SuperVillain:SecureFadeIn(self.Window, 0.3, 0, 1) + PLUGIN.Title:Clear(); + PLUGIN.Title:AddMessage(self.TTitle, 1, 1, 0); +end + +local Scanner_OnMouseDown = function(self) + SuperVillain:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) + SuperVillain:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) + SuperVillain:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) + SuperVillain:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) + SuperVillain:SecureFadeIn(self.Window, 0.3, 0, 1) + PLUGIN:PopulateScans() +end + +local Switch_OnEnter = function(self) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + if(self.ShowingKOS) then + GameTooltip:AddDoubleLine("Click", "Show Scan List", 0.1, 1, 0.2, 1, 1, 1) + else + GameTooltip:AddDoubleLine("Click", 'Show "Kill On Sight" List', 0.1, 1, 0.2, 1, 1, 1) + end + GameTooltip:AddDoubleLine("[SHIFT] Click", "Clear All Scans", 0.1, 1, 0.2, 1, 1, 1) + GameTooltip:AddDoubleLine("[CTRL] Click", 'Clear All "Kill On Sight"', 0.1, 1, 0.2, 1, 1, 1) + GameTooltip:Show() +end + +local Switch_OnLeave = function(self) + GameTooltip:Hide() +end + +local Switch_OnClick = function(self, button) + Switch_OnLeave(self) + if(IsControlKeyDown()) then + ClearSavedScans() + PLUGIN:ResetLogs() + elseif(IsShiftKeyDown()) then + ClearCacheScans() + else + if(self.ShowingKOS) then + PLUGIN:PopulateScans() + self.ShowingKOS = false + else + PLUGIN:PopulateKOS() + self.ShowingKOS = true + end + end + Switch_OnEnter(self) +end +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +local function LoadOptions() + SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAOW = { + type = "group", + name = L["Art of War"], + childGroups = "tree", + args = { + enable = { + order = 1, + type = "toggle", + name = "Enable", + get = function(a) return SuperVillain.db.SVAOW.enable end, + set = function(a,b)SuperVillain.db.SVAOW.enable = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end + } + } + } +end + +local function LoadWarVillain() + if(not SuperVillain.db.SVAOW.enable) then return end + + local ALERT_HEIGHT = 60; + local DOCK_WIDTH = SuperDockWindowRight:GetWidth(); + local DOCK_HEIGHT = SuperDockWindowRight:GetHeight(); + local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; + + PLUGIN.db = SuperVillain.db.SVAOW + + if(not SVAOW_Data) then SVAOW_Data = {} end + if(not SVAOW_Cache) then SVAOW_Cache = {} end + + PLUGIN.HitBy = false; + PLUGIN.Scanning = false; + PLUGIN.InPVP = false + + local holder = CreateFrame("Frame", "SVUI_ArtOfWarDock", SuperDockWindowRight) + holder:SetFrameStrata("BACKGROUND") + holder:SetWidth(DOCK_WIDTH - 4); + holder:SetHeight(DOCK_HEIGHT - 4); + holder:SetPoint("CENTER",SuperDockWindowRight,"CENTER",0,0); + + local toolBar = CreateFrame("Frame", "SVUI_ArtOfWarToolBar", holder) + toolBar:SetWidth(BUTTON_SIZE + 4); + toolBar:SetHeight((BUTTON_SIZE + 4) * 4); + toolBar:SetPoint("BOTTOMLEFT",holder,"BOTTOMLEFT",0,0); + + local tbDivider = toolBar:CreateTexture(nil,"OVERLAY") + tbDivider:SetTexture(0,0,0,0.5) + tbDivider:SetPoint("TOPRIGHT") + tbDivider:SetPoint("BOTTOMRIGHT") + tbDivider:SetWidth(1) + + local tool4 = CreateFrame("Frame", "SVUI_ArtOfWarTool4", toolBar) + tool4:SetPoint("BOTTOM",toolBar,"BOTTOM",0,0) + tool4:SetSize(BUTTON_SIZE,BUTTON_SIZE) + tool4.icon = tool4:CreateTexture(nil, 'OVERLAY') + tool4.icon:SetTexture(INFO_ICON) + tool4.icon:FillInner(tool4) + tool4.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + tool4.TText = "Stats" + tool4.TTitle = "Statistics and Information" + tool4:SetScript('OnEnter', ArtOfWarTool_OnEnter) + tool4:SetScript('OnLeave', ArtOfWarTool_OnLeave) + tool4:SetScript('OnMouseDown', ArtOfWarTool_OnMouseDown) + + local tool3 = CreateFrame("Frame", "SVUI_ArtOfWarTool3", toolBar) + tool3:SetPoint("BOTTOM",tool4,"TOP",0,2) + tool3:SetSize(BUTTON_SIZE,BUTTON_SIZE) + tool3.icon = tool3:CreateTexture(nil, 'OVERLAY') + tool3.icon:SetTexture(UTILITY_ICON) + tool3.icon:FillInner(tool3) + tool3.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + tool3.TText = "Tools" + tool3.TTitle = "Tools and Utilities" + tool3:SetScript('OnEnter', ArtOfWarTool_OnEnter) + tool3:SetScript('OnLeave', ArtOfWarTool_OnLeave) + tool3:SetScript('OnMouseDown', ArtOfWarTool_OnMouseDown) + + local tool2 = CreateFrame("Frame", "SVUI_ArtOfWarTool2", toolBar) + tool2:SetPoint("BOTTOM",tool3,"TOP",0,2) + tool2:SetSize(BUTTON_SIZE,BUTTON_SIZE) + tool2.icon = tool2:CreateTexture(nil, 'OVERLAY') + tool2.icon:SetTexture(RADIO_ICON) + tool2.icon:FillInner(tool2) + tool2.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + tool2.TText = "Radio" + tool2.TTitle = "Radio Communicator" + tool2:SetScript('OnEnter', ArtOfWarTool_OnEnter) + tool2:SetScript('OnLeave', ArtOfWarTool_OnLeave) + tool2:SetScript('OnMouseDown', ArtOfWarTool_OnMouseDown) + + local tool1 = CreateFrame("Frame", "SVUI_ArtOfWarTool1", toolBar) + tool1:SetPoint("BOTTOM",tool2,"TOP",0,2) + tool1:SetSize(BUTTON_SIZE,BUTTON_SIZE) + tool1.icon = tool1:CreateTexture(nil, 'OVERLAY') + tool1.icon:SetTexture(SCANNER_ICON) + tool1.icon:FillInner(tool1) + tool1.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + tool1.TText = "Scanner" + tool1.TTitle = "Enemy Scanner" + tool1:SetScript('OnEnter', ArtOfWarTool_OnEnter) + tool1:SetScript('OnLeave', ArtOfWarTool_OnLeave) + tool1:SetScript('OnMouseDown', Scanner_OnMouseDown) + + local title = CreateFrame("ScrollingMessageFrame", nil, holder) + title:SetSpacing(4) + title:SetClampedToScreen(false) + title:SetFrameStrata("MEDIUM") + title:SetPoint("TOPLEFT", toolBar, "TOPRIGHT",0,0) + title:SetPoint("BOTTOMRIGHT", holder, "TOPRIGHT",0,-16) + title:SetFontTemplate(SuperVillain.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") + title:SetMaxLines(1) + title:EnableMouseWheel(false) + title:SetFading(false) + title:SetInsertMode('TOP') + + local divider1 = title:CreateTexture(nil,"OVERLAY") + divider1:SetTexture(0,0,0,0.5) + divider1:SetPoint("BOTTOMLEFT") + divider1:SetPoint("BOTTOMRIGHT") + divider1:SetHeight(1) + + PLUGIN.Title = title + + local listbutton = CreateFrame("Button", nil, holder) + listbutton:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) + listbutton:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) + listbutton:SetButtonTemplate(true) + listbutton.ShowingKOS = false + listbutton:SetScript("OnEnter", Switch_OnEnter) + listbutton:SetScript("OnLeave", Switch_OnLeave) + listbutton:SetScript("OnClick", Switch_OnClick) + + PLUGIN.Switch = listbutton + + local summary = CreateFrame("ScrollingMessageFrame", nil, holder) + summary:SetSpacing(4) + summary:SetClampedToScreen(false) + summary:SetFrameStrata("MEDIUM") + summary:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) + summary:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) + summary:SetFontTemplate(SuperVillain.Media.font.system, 12, "OUTLINE", "CENTER", "MIDDLE") + summary:SetMaxLines(1) + summary:EnableMouse(false) + summary:SetFading(false) + summary:SetInsertMode('TOP') + + PLUGIN.Summary = summary + + local divider2 = summary:CreateTexture(nil,"OVERLAY") + divider2:SetTexture(0,0,0,0.5) + divider2:SetPoint("BOTTOMLEFT") + divider2:SetPoint("BOTTOMRIGHT") + divider2:SetHeight(1) + + MakeLogWindow() + MakeCommWindow() + MakeUtilityWindow() + MakeInfoWindow() + + SuperVillain:RegisterDocklet("SVUI_ArtOfWarDock", "Art of War", ICON_FILE) + holder:Hide() PLUGIN:ResetLogs() + + local targetButton = CreateFrame("Button", "SVUI_TargetScanButton", UIParent, "SecureActionButtonTemplate") + targetButton:SetAllPoints(PLUGIN.LOG) + targetButton:SetFrameLevel(99) + targetButton:RegisterForClicks("AnyUp") + targetButton:SetAttribute("type1", "macro") + targetButton:SetAttribute("macrotext", "/tar") + targetButton:EnableMouse(false) + targetButton:HookScript("OnClick", function(self) self:EnableMouse(false) end) end +--/tar Munglunch + CONFIGS["SVAOW"] = { ["enable"] = true } diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-SCAN.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-SCAN.blp deleted file mode 100644 index 8bc4525..0000000 Binary files a/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-SCAN.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INFO.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INFO.blp new file mode 100644 index 0000000..112e648 Binary files /dev/null and b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INFO.blp differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-RADIO.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-RADIO.blp new file mode 100644 index 0000000..8d38764 Binary files /dev/null and b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-RADIO.blp differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SCANNER.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SCANNER.blp new file mode 100644 index 0000000..6bcd5d3 Binary files /dev/null and b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SCANNER.blp differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-UTILITIES.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-UTILITIES.blp new file mode 100644 index 0000000..eef0a56 Binary files /dev/null and b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-UTILITIES.blp differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/SCAN-ANIMATION.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/SCAN-ANIMATION.blp deleted file mode 100644 index 53d920b..0000000 Binary files a/Interface/AddOns/SVUI_ArtOfWar/artwork/SCAN-ANIMATION.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua index e876da8..11b5564 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua @@ -49,6 +49,10 @@ if gameLocale == "enUS" then L["reset"] = "Reset Profile" L["reset_desc"] = "Reset the current profile back to its default values, in case your configuration is broken, or you simply want to start over." L["reset_sub"] = "Reset the current profile to the default" + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end if gameLocale == "frFR" then L["AURAS_DESC"] = "Configure les icônes qui apparaissent près de la Minicarte." @@ -81,6 +85,10 @@ if gameLocale == "frFR" then L["reset"] = "Réinitialiser le profil" L["reset_desc"] = "Réinitialise le profil actuel au cas où votre configuration est corrompue ou si vous voulez tout simplement faire table rase." L["reset_sub"] = "Réinitialise le profil actuel avec les paramètres par défaut." + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end if gameLocale == "deDE" then L["AURAS_DESC"] = "Konfiguriere die Symbole für die Stärkungs- und Schwächungszauber nahe der Minimap." @@ -112,6 +120,10 @@ if gameLocale == "deDE" then L["reset"] = "Profil zurücksetzen" L["reset_desc"] = "Setzt das momentane Profil auf Standardwerte zurück, für den Fall das mit der Konfiguration etwas schief lief oder weil du einfach neu starten willst." L["reset_sub"] = "Das aktuelle Profil auf Standard zurücksetzen." + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end if gameLocale == "itIT" then L["AURAS_DESC"] = "Configure the aura icons that appear near the minimap." @@ -144,6 +156,10 @@ if gameLocale == "itIT" then L["reset"] = "Reimposta Profilo" L["reset_desc"] = "Riporta il tuo profilo attivo alle sue impostazioni di default, nel caso in cui la tua configurazione si sia corrotta, o semplicemente tu voglia re-inizializzarla." L["reset_sub"] = "Reimposta il profilo ai suoi valori di default." + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end if gameLocale == "koKR" then L["AURAS_DESC"] = "Configure the aura icons that appear near the minimap." @@ -176,6 +192,10 @@ if gameLocale == "koKR" then L["reset"] = "프로필 초기화" L["reset_desc"] = "단순히 다시 새롭게 구성을 원하는 경우, 현재 프로필을 기본값으로 초기화 합니다." L["reset_sub"] = "현재의 프로필을 기본값으로 초기화 합니다" + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end if gameLocale == "ptBR" then L["AURAS_DESC"] = "Configurar os ícones das auras que aparecem perto do minimapa." @@ -189,6 +209,10 @@ if gameLocale == "ptBR" then L["TOGGLEART_DESC"] = "Ativa / Desativa a aparência deste quadro." L["TOOLTIP_DESC"] = "Opções de configuração para a Tooltip." L["TEXT_FORMAT_DESC"] = "Select the formatting of this text" + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end if gameLocale == "ruRU" then L["AURAS_DESC"] = "Настройка иконок эффектов, находящихся у миникарты." @@ -221,6 +245,10 @@ if gameLocale == "ruRU" then L["reset"] = "Сброс профиля" L["reset_desc"] = "Если ваша конфигурации испорчена или если вы хотите настроить всё заново - сбросьте текущий профиль на стандартные значения." L["reset_sub"] = "Сброс текущего профиля на стандартный" + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end if gameLocale == "esES" or gameLocale == "esMX" then L["AURAS_DESC"] = "Configura los iconos de las auras que aparecen cerca del minimapa." @@ -253,6 +281,10 @@ if gameLocale == "esES" or gameLocale == "esMX" then L["reset"] = "Reiniciar Perfil" L["reset_desc"] = "Reinicia el perfil actual a los valores por defectos, en caso de que se haya estropeado la configuración o quieras volver a empezar de nuevo." L["reset_sub"] = "Reinicar el perfil actual al de por defecto" + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end if gameLocale == "zhTW" then L["AURAS_DESC"] = "小地圖旁的光環圖示設定." @@ -285,6 +317,10 @@ if gameLocale == "zhTW" then L["reset"] = "重置設定檔" L["reset_desc"] = "將當前的設定檔恢復到它的預設值,用於你的設定檔損壞,或者你只是想重來的情況。" L["reset_sub"] = "將當前的設定檔恢復為預設值" + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end if gameLocale == "zhCN" then L["AURAS_DESC"] = "小地图旁的光环图标设置." @@ -317,4 +353,8 @@ if gameLocale == "zhCN" then L["reset"] = "重置配置文件" L["reset_desc"] = "将当前的配置文件恢复到它的默认值,用于你的配置文件损坏,或者你只是想重来的情况。" L["reset_sub"] = "将当前的配置文件恢复为默认值" + L["BottomRightDataPanel"] = "Bottom Bar Right" + L["BottomLeftDataPanel"] = "Bottom Bar Left" + L["TopLeftDataPanel"] = "Top Bar Left" + L["TopRightDataPanel"] = "Top Bar Right" end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua index 1e89d07..ca127f9 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua @@ -17,15 +17,12 @@ LOCALIZED LUA FUNCTIONS ########################################################## ]]-- --[[ GLOBALS ]]-- -local _G = _G; +local _G = _G; local unpack = _G.unpack; local pairs = _G.pairs; local tinsert = _G.tinsert; -local string = _G.string; -local table = _G.table; -local upper = string.upper; ---[[ TABLE METHODS ]]-- -local tsort = table.sort; +local string = _G.string; +local upper = string.upper; --[[ ########################################################## GET ADDON DATA @@ -42,8 +39,8 @@ SuperVillain.Options.args.SVStats = { type = "group", name = L["Statistics"], childGroups = "tab", - get = function(i)return SuperVillain.db.SVStats[i[#i]]end, - set = function(i, h)MOD:ChangeDBVar(h, i[#i]);MOD:Generate()end, + get = function(key) return SuperVillain.db.SVStats[key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key]); MOD:Generate() end, args = { intro = { order = 1, @@ -56,33 +53,36 @@ SuperVillain.Options.args.SVStats = { name = L["24-Hour Time"], desc = L["Toggle 24-hour mode for the time datatext."] }, - localtime = {order = 3, type = "toggle", name = L["Local Time"], desc = L["If not set to true then the server time will be displayed instead."]}, - battleground = {order = 4, type = "toggle", name = L["Battleground Texts"], desc = L["When inside a battleground display personal scoreboard information on the main datatext bars."]}, + localtime = { + order = 3, + type = "toggle", + name = L["Local Time"], + desc = L["If not set to true then the server time will be displayed instead."] + }, + battleground = { + order = 4, + type = "toggle", + name = L["Battleground Texts"], + desc = L["When inside a battleground display personal scoreboard information on the main datatext bars."] + }, showBackground = { order = 5, name = "Show Backgrounds", desc = L["Display statistic background textures"], type = "toggle", - set = function(i, h)MOD:ChangeDBVar(h, i[#i]);SuperVillain:StaticPopup_Show("RL_CLIENT")end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key]); SuperVillain:StaticPopup_Show("RL_CLIENT") end, }, shortGold = { order = 6, type = "toggle", name = L["Shortened Gold Text"], }, - panels = { - type = "group", - name = L["Panels"], - order = 100, - args = {}, - guiInline = true - }, fontGroup = { - order = 120, + order = 7, type = "group", guiInline = true, name = L["Fonts"], - set = function(i, h)MOD:ChangeDBVar(h, i[#i]);MOD:Generate()end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key]); MOD:Generate() end, args = { font = { type = "select", @@ -112,42 +112,46 @@ SuperVillain.Options.args.SVStats = { } } } - } + }, + panels = { + type = "group", + name = L["Panels"], + order = 100, + args = {}, + guiInline = true + }, } } do - local statValues = {} + local orderIncrement = 0; + local statValues = MOD.StatListing + local configTable = SuperVillain.db.SVStats.panels; + local optionTable = SuperVillain.Options.args.SVStats.args.panels.args; - for name,b in pairs(MOD.Statistics)do - statValues[name]=name - end; - statValues[''] = NONE; - local options = SuperVillain.Options.args.SVStats.args.panels.args; - local d = 0; - for e,f in pairs(SuperVillain.db.SVStats.panels)do - d = d + 1; - if not _G[e] then - options[e] = nil; + for panelName, panelPositions in pairs(configTable)do + orderIncrement = orderIncrement + 1; + if(not _G[panelName]) then + optionTable[panelName] = nil; return - end; - if type(f) == 'table' then - options[e] = { + end + if(type(panelPositions) == "table") then + optionTable[panelName] = { type = 'group', args = {}, - name = L[e] or e, + name = L[panelName] or panelName, guiInline = true, - order = (d + 10) + order = (orderIncrement + 10) } - for g,h in pairs(f)do - options[e].args[g] = { + for position,_ in pairs(panelPositions) do + optionTable[panelName].args[position] = { type = 'select', - name = L[g] or upper(g), + name = L[position] or upper(position), values = statValues, - get = function(i)return SuperVillain.db.SVStats.panels[e][i[#i]] end, - set = function(i,h) MOD:ChangeDBVar(h, i[#i], "panels", e); MOD:Generate() end + get = function(key) return SuperVillain.db.SVStats.panels[panelName][key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "panels", panelName); MOD:Generate() end } end end end -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua index 836e296..eed7439 100644 --- a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua +++ b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua @@ -295,15 +295,13 @@ function PLUGIN:MakeLogWindow() title:SetInsertMode('TOP') title.divider = title:CreateTexture(nil,"OVERLAY") - title.divider:SetTexture(classR, classG, classB) - title.divider:SetAlpha(classA) + title.divider:SetTexture(0,0,0,0.5) title.divider:SetPoint("BOTTOMLEFT") title.divider:SetPoint("BOTTOMRIGHT") title.divider:SetHeight(1) local topleftline = title:CreateTexture(nil,"OVERLAY") - topleftline:SetTexture(classR, classG, classB) - topleftline:SetAlpha(classA) + topleftline:SetTexture(0,0,0,0.5) topleftline:SetPoint("TOPLEFT") topleftline:SetPoint("BOTTOMLEFT") topleftline:SetWidth(1) @@ -325,8 +323,7 @@ function PLUGIN:MakeLogWindow() log:SetInsertMode('TOP') local bottomleftline = log:CreateTexture(nil,"OVERLAY") - bottomleftline:SetTexture(classR, classG, classB) - bottomleftline:SetAlpha(classA) + bottomleftline:SetTexture(0,0,0,0.5) bottomleftline:SetPoint("TOPLEFT") bottomleftline:SetPoint("BOTTOMLEFT") bottomleftline:SetWidth(1) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua index 0fa3b3b..c4e3c37 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua @@ -78,69 +78,101 @@ end; local function QuestFrameStyle() if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.quest ~= true then return end; + + --[[ WIPE TEXTURES ]]-- + QuestInfoSkillPointFrame:Formula409() + QuestLogFrame:Formula409() + QuestLogScrollFrame:Formula409() + QuestLogCount:Formula409() + EmptyQuestLogFrame:Formula409() + QuestProgressScrollFrame:Formula409() + QuestLogFrameShowMapButton:Formula409() + QuestGreetingScrollFrame:Formula409() + QuestLogFrameCompleteButton:Formula409() + QuestFrame:Formula409(true) + QuestFrameDetailPanel:Formula409(true) + QuestDetailScrollFrame:Formula409(true) + QuestInfoItemHighlight:Formula409() + QuestDetailScrollChildFrame:Formula409(true) + QuestRewardScrollFrame:Formula409(true) + QuestRewardScrollChildFrame:Formula409(true) + QuestFrameProgressPanel:Formula409(true) + QuestFrameRewardPanel:Formula409(true) + QuestNPCModel:Formula409() + QuestNPCModelTextFrame:Formula409() + QuestLogDetailFrame:Formula409() + QuestLogDetailScrollFrame:Formula409() + + QuestFrameInset:MUNG() + QuestLogFrameInset:MUNG() + QuestLogDetailFrameInset:MUNG() + STYLE:ApplyCloseButtonStyle(QuestLogFrameCloseButton) STYLE:ApplyScrollStyle(QuestLogDetailScrollFrameScrollBar) STYLE:ApplyScrollStyle(QuestLogScrollFrameScrollBar, 5) STYLE:ApplyScrollStyle(QuestProgressScrollFrameScrollBar) STYLE:ApplyScrollStyle(QuestRewardScrollFrameScrollBar) - QuestLogScrollFrame:Formula409() - QuestLogFrame:Formula409() + QuestLogFrame:SetPanelTemplate("Halftone") - QuestLogCount:Formula409() QuestLogCount:SetFixedPanelTemplate("Default") - EmptyQuestLogFrame:Formula409() - QuestLogDetailFrameInset:MUNG() STYLE:ApplyScrollStyle(QuestDetailScrollFrameScrollBar) - QuestProgressScrollFrame:Formula409() - QuestLogFrameShowMapButton:Formula409() + QuestLogFrameShowMapButton:SetButtonTemplate() QuestLogFrameShowMapButton.text:ClearAllPoints() QuestLogFrameShowMapButton.text:SetPoint("CENTER") QuestLogFrameShowMapButton:Size(QuestLogFrameShowMapButton:GetWidth()-30, QuestLogFrameShowMapButton:GetHeight(), -40) - QuestGreetingScrollFrame:Formula409() + STYLE:ApplyScrollStyle(QuestGreetingScrollFrameScrollBar) - QuestLogFrameInset:MUNG() - QuestLogFrameCompleteButton:Formula409() + for _,i in pairs(QuestFrameList)do _G[i]:SetButtonTemplate() _G[i]:SetFrameLevel(_G[i]:GetFrameLevel() + 2) end; QuestLogFramePushQuestButton:Point("LEFT", QuestLogFrameAbandonButton, "RIGHT", 2, 0) QuestLogFramePushQuestButton:Point("RIGHT", QuestLogFrameTrackButton, "LEFT", -2, 0) - for j = 1, MAX_NUM_ITEMS do - local cLvl = _G["QuestInfoItem"..j]:GetFrameLevel() + 1 - _G["QuestInfoItem"..j]:Formula409() - _G["QuestInfoItem"..j]:Width(_G["QuestInfoItem"..j]:GetWidth()-4) - _G["QuestInfoItem"..j]:SetFrameLevel(cLvl) - - _G["QuestInfoItem"..j.."IconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G["QuestInfoItem"..j.."IconTexture"]:SetDrawLayer("OVERLAY",1) - _G["QuestInfoItem"..j.."IconTexture"]:Point("TOPLEFT", 2, -2) - _G["QuestInfoItem"..j.."IconTexture"]:Size(_G["QuestInfoItem"..j.."IconTexture"]:GetWidth()-2, _G["QuestInfoItem"..j.."IconTexture"]:GetHeight()-2) - STYLE:ApplyLinkButtonStyle(_G["QuestInfoItem"..j]) + + for i = 1, MAX_NUM_ITEMS do + local item = _G["QuestInfoItem"..i] + if(item) then + local cLvl = item:GetFrameLevel() + 1 + item:Formula409() + item:Width(item:GetWidth() - 4) + item:SetFrameLevel(cLvl) + + local tex = _G["QuestInfoItem"..i.."IconTexture"] + if(tex) then + tex:SetTexCoord(0.1, 0.9, 0.1, 0.9) + tex:SetDrawLayer("OVERLAY",1) + tex:SetPoint("TOPLEFT", 2, -2) + tex:Size(tex:GetWidth() - 2, tex:GetHeight() - 2) + end + STYLE:ApplyLinkButtonStyle(item) + end end; - QuestInfoSkillPointFrame:Formula409() - QuestInfoSkillPointFrame:Width(QuestInfoSkillPointFrame:GetWidth()-4) - local curLvl = QuestInfoSkillPointFrame:GetFrameLevel() + 1 - QuestInfoSkillPointFrame:SetFrameLevel(curLvl) + + + QuestInfoSkillPointFrame:Width(QuestInfoSkillPointFrame:GetWidth() - 4) + QuestInfoSkillPointFrame:SetFrameLevel(QuestInfoSkillPointFrame:GetFrameLevel() + 1) QuestInfoSkillPointFrame:SetFixedPanelTemplate("Slot") QuestInfoSkillPointFrame:SetBackdropColor(1,1,0,0.5) QuestInfoSkillPointFrameIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) QuestInfoSkillPointFrameIconTexture:SetDrawLayer("OVERLAY") QuestInfoSkillPointFrameIconTexture:Point("TOPLEFT", 2, -2) - QuestInfoSkillPointFrameIconTexture:Size(QuestInfoSkillPointFrameIconTexture:GetWidth()-2, QuestInfoSkillPointFrameIconTexture:GetHeight()-2) + QuestInfoSkillPointFrameIconTexture:Size(QuestInfoSkillPointFrameIconTexture:GetWidth() - 2, QuestInfoSkillPointFrameIconTexture:GetHeight() - 2) QuestInfoSkillPointFrameCount:SetDrawLayer("OVERLAY") QuestInfoSkillPointFramePoints:ClearAllPoints() QuestInfoSkillPointFramePoints:Point("BOTTOMRIGHT", QuestInfoSkillPointFrameIconTexture, "BOTTOMRIGHT") - QuestInfoItemHighlight:Formula409() + QuestInfoItemHighlight:SetFixedPanelTemplate("Slot") QuestInfoItemHighlight:SetBackdropBorderColor(1, 1, 0) QuestInfoItemHighlight:SetBackdropColor(0, 0, 0, 0) QuestInfoItemHighlight:Size(142, 40) + hooksecurefunc("QuestInfoItem_OnClick", function(k) QuestInfoItemHighlight:ClearAllPoints() QuestInfoItemHighlight:SetAllPoints(k) end) + QuestLogFrame:HookScript("OnShow", function() if not QuestLogScrollFrame.spellTex then QuestLogScrollFrame:SetFixedPanelTemplate("Default") @@ -154,6 +186,7 @@ local function QuestFrameStyle() QuestLogScrollFrame.spellTex2:FillInner() end end) + QuestLogDetailScrollFrame:HookScript('OnShow', function(k) if not QuestLogDetailScrollFrame.Panel then QuestLogDetailScrollFrame:SetPanelTemplate("Default") @@ -162,6 +195,7 @@ local function QuestFrameStyle() end; QuestLogDetailScrollFrame.spellTex:Height(k:GetHeight() + 217) end) + QuestRewardScrollFrame:HookScript('OnShow', function(k) if not k.Panel then k:SetPanelTemplate("Default") @@ -170,6 +204,7 @@ local function QuestFrameStyle() end; k.spellTex:Height(k:GetHeight() + 217) end) + hooksecurefunc("QuestInfo_Display", function(l, m) for j = 1, MAX_NUM_ITEMS do local n = _G["QuestInfoItem"..j] @@ -186,27 +221,23 @@ local function QuestFrameStyle() end end end) - QuestFrame:Formula409(true) - QuestFrameInset:MUNG() - QuestFrameDetailPanel:Formula409(true) - QuestDetailScrollFrame:Formula409(true) - QuestScrollHelper(QuestDetailScrollFrame, 506, 615, true) + QuestProgressScrollFrame:SetFixedPanelTemplate() - QuestScrollHelper(QuestProgressScrollFrame, 506, 615, true) QuestGreetingScrollFrame:SetFixedPanelTemplate() + + QuestScrollHelper(QuestDetailScrollFrame, 506, 615, true) + QuestScrollHelper(QuestProgressScrollFrame, 506, 615, true) QuestScrollHelper(QuestGreetingScrollFrame, 506, 615, true) - QuestDetailScrollChildFrame:Formula409(true) - QuestRewardScrollFrame:Formula409(true) - QuestRewardScrollChildFrame:Formula409(true) - QuestFrameProgressPanel:Formula409(true) - QuestFrameRewardPanel:Formula409(true) + QuestFrame:SetPanelTemplate("Action") QuestFrameAcceptButton:SetButtonTemplate() QuestFrameDeclineButton:SetButtonTemplate() QuestFrameCompleteButton:SetButtonTemplate() QuestFrameGoodbyeButton:SetButtonTemplate() QuestFrameCompleteQuestButton:SetButtonTemplate() + STYLE:ApplyCloseButtonStyle(QuestFrameCloseButton, QuestFrame.Panel) + for j = 1, 6 do local i = _G["QuestProgressItem"..j] local texture = _G["QuestProgressItem"..j.."IconTexture"] @@ -219,16 +250,17 @@ local function QuestFrameStyle() texture:Size(texture:GetWidth() - 2, texture:GetHeight() - 2) _G["QuestProgressItem"..j.."Count"]:SetDrawLayer("OVERLAY") end; - QuestNPCModel:Formula409() + QuestNPCModel:SetPanelTemplate("Comic") QuestNPCModel:Point("TOPLEFT", QuestLogDetailFrame, "TOPRIGHT", 4, -34) - QuestNPCModelTextFrame:Formula409() + QuestNPCModelTextFrame:SetPanelTemplate("Default") QuestNPCModelTextFrame.Panel:Point("TOPLEFT", QuestNPCModel.Panel, "BOTTOMLEFT", 0, -2) - QuestLogDetailFrame:Formula409() + QuestLogDetailFrame:SetPanelTemplate("Action") - QuestLogDetailScrollFrame:Formula409() + STYLE:ApplyCloseButtonStyle(QuestLogDetailFrameCloseButton) + hooksecurefunc("QuestFrame_ShowQuestPortrait", function(m, t, text, u, r, s) QuestNPCModel:ClearAllPoints() QuestNPCModel:SetPoint("TOPLEFT", m, "TOPRIGHT", r+18, s) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua index 8a7e64f..b5d9c02 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua @@ -348,9 +348,10 @@ STYLE LOADING STYLE:SaveBlizzardStyle("Blizzard_TalentUI", TalentFrameStyle) local function GlyphStyle() + GlyphFrame:Formula409() GlyphFrame.background:ClearAllPoints() GlyphFrame.background:SetAllPoints(PlayerTalentFrameInset) - GlyphFrame:SetPanelTemplate("Comic", false, 0, 3, 3) + GlyphFrame:SetFixedPanelTemplate("Comic", false, 0, 3, 3) GlyphFrameSideInset:Formula409() GlyphFrameClearInfoFrame:SetFixedPanelTemplate("Comic") GlyphFrameClearInfoFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua index ffc78dd..b53960c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua @@ -34,8 +34,8 @@ local function TradeSkillStyle() TradeSkillRankFrame:Formula409() TradeSkillRankFrame:SetPanelTemplate("Slot", true, 1, 2, 2) TradeSkillRankFrame:SetStatusBarTexture(SuperVillain.Media.bar.default) - TradeSkillListScrollFrame:SetFixedPanelTemplate("Inset") - TradeSkillDetailScrollFrame:SetFixedPanelTemplate("Inset") + TradeSkillListScrollFrame:SetPanelTemplate("Inset") + TradeSkillDetailScrollFrame:SetPanelTemplate("Inset") TradeSkillFilterButton:Formula409(true) TradeSkillCreateButton:SetButtonTemplate() TradeSkillCancelButton:SetButtonTemplate()