diff --git a/Interface/AddOns/SVUI/assets/artwork/Unitframe/FOLLOWER-LEVEL.blp b/Interface/AddOns/SVUI/assets/artwork/Unitframe/FOLLOWER-LEVEL.blp index ab484de..0c646b4 100644 Binary files a/Interface/AddOns/SVUI/assets/artwork/Unitframe/FOLLOWER-LEVEL.blp and b/Interface/AddOns/SVUI/assets/artwork/Unitframe/FOLLOWER-LEVEL.blp differ diff --git a/Interface/AddOns/SVUI/data/defaults.lua b/Interface/AddOns/SVUI/data/defaults.lua index 0ca6aef..1575cc5 100644 --- a/Interface/AddOns/SVUI/data/defaults.lua +++ b/Interface/AddOns/SVUI/data/defaults.lua @@ -36,9 +36,9 @@ local function safename(id) return n end -local NAMEFONT = "SVUI Name Font"; +local DIALOGUE_FONT = "SVUI Name Font"; if(GetLocale() ~= "enUS") then - NAMEFONT = "SVUI Clean Font" + DIALOGUE_FONT = "SVUI Default Font" end SV.defaults = {}; @@ -90,33 +90,41 @@ SV.defaults["totems"] = { } SV.defaults["font"] = { - ["default"] = {file = "SVUI Default Font", size = 12, outline = "OUTLINE", optionName = "Default", optionDesc = "The most commonly used font."}, - ["name"] = {file = NAMEFONT, size = 10, outline = "OUTLINE", optionName = "Names", optionDesc = "Used in most places that unit names appear."}, - ["title"] = {file = NAMEFONT, size = 16, outline = "OUTLINE", optionName = "Titles", optionDesc = "Font used to display various titles."}, - ["number"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Numbers (Regular)", optionDesc = "Font used to display most numeric values."}, - ["number_big"] = {file = "SVUI Number Font", size = 18, outline = "OUTLINE", optionName = "Numbers (Large)", optionDesc = "Font used to display larger numeric values."}, - ["combat"] = {file = "SVUI Combat Font", size = 32, outline = "OUTLINE", optionName = "Combat", optionDesc = "Scrolling combat text font."}, - ["alert"] = {file = "SVUI Alert Font", size = 20, outline = "OUTLINE", optionName = "Alerts", optionDesc = "Font used for on-screen message alerts."}, - ["zone"] = {file = "SVUI Zone Font", size = 16, outline = "OUTLINE", optionName = "Zone Text", optionDesc = "Font used for zone names. Shown when changing zones."}, - ["caps"] = {file = "SVUI Caps Font", size = 12, outline = "OUTLINE", optionName = "Caps", optionDesc = "Font typically used for things like tabs and fitted headers."}, - ["aura"] = {file = "SVUI Number Font", size = 10, outline = "OUTLINE", optionName = "Auras", optionDesc = "Aura counts and timers use this font."}, - ["data"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Docked Stats", optionDesc = "Font used by the bottom and top data docks."}, - ["narrator"] = {file = "SVUI Narrator Font", size = 12, outline = "OUTLINE", optionName = "Narratives", optionDesc = "Font used for things like the 'Meanwhile' tag."}, - ["pixel"] = {file = "SVUI Pixel Font", size = 8, outline = "MONOCHROMEOUTLINE", optionName = "Pixel", optionDesc = "Tiniest fonts."}, - ["platename"] = {file = "SVUI Caps Font", size = 9, outline = "OUTLINE", optionName = "Nameplate Names", optionDesc = "Used on nameplates for unit names."}, - ["plateaura"] = {file = "SVUI Caps Font", size = 9, outline = "OUTLINE", optionName = "Nameplate Auras", optionDesc = "Used on nameplates for aura texts."}, - ["unitprimary"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Unitframe Values", optionDesc = "Used on all primary unit frames for health, power and misc values.\nUnits: player, pet, target, focus, boss and arena"}, - ["unitsecondary"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Unitframe Values", optionDesc = "Used on all non-primary unit frames for health, power and misc values.\nUnits: pettarget, targettarget, focustarget, party, raid, raidpet, tank and assist."}, - ["unitaurabar"] = {file = "SVUI Alert Font", size = 10, outline = "OUTLINE", optionName = "Unitframe AuraBar", optionDesc = "Used on unit aurabars."}, + ["default"] = {file = "SVUI Default Font", size = 12, outline = "OUTLINE", optionName = "Default", optionDesc = "The most commonly used font."}, + ["chat"] = {file = "SVUI Default Font", size = 12, outline = "OUTLINE", optionName = "Chat", optionDesc = "Font used for chat text."}, + ["chattab"] = {file = "SVUI Caps Font", size = 12, outline = "OUTLINE", optionName = "Chat Tabs", optionDesc = "Font used for chat tab labels."}, + ["dialog"] = {file = DIALOGUE_FONT, size = 10, outline = "OUTLINE", optionName = "Dialog", optionDesc = "Font used in places that story text appears. (ie.. quest text)"}, + ["title"] = {file = DIALOGUE_FONT, size = 16, outline = "OUTLINE", optionName = "Titles", optionDesc = "Font used to display various titles."}, + ["number"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Numbers (Regular)", optionDesc = "Font used to display most numeric values."}, + ["number_big"] = {file = "SVUI Number Font", size = 18, outline = "OUTLINE", optionName = "Numbers (Large)", optionDesc = "Font used to display larger numeric values."}, + ["combat"] = {file = "SVUI Combat Font", size = 32, outline = "OUTLINE", optionName = "Combat", optionDesc = "Scrolling combat text font."}, + ["alert"] = {file = "SVUI Alert Font", size = 20, outline = "OUTLINE", optionName = "Alerts", optionDesc = "Font used for on-screen message alerts."}, + ["zone"] = {file = "SVUI Zone Font", size = 16, outline = "OUTLINE", optionName = "Zone Text", optionDesc = "Font used for zone names. Shown when changing zones."}, + ["caps"] = {file = "SVUI Caps Font", size = 12, outline = "OUTLINE", optionName = "Caps", optionDesc = "Font typically used for things like tabs and fitted headers."}, + ["aura"] = {file = "SVUI Number Font", size = 10, outline = "OUTLINE", optionName = "Auras", optionDesc = "Aura counts and timers use this font."}, + ["data"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Docked Stats", optionDesc = "Font used by the bottom and top data docks."}, + ["narrator"] = {file = "SVUI Narrator Font", size = 12, outline = "OUTLINE", optionName = "Narratives", optionDesc = "Font used for things like the 'Meanwhile' tag."}, + ["pixel"] = {file = "SVUI Pixel Font", size = 8, outline = "MONOCHROMEOUTLINE", optionName = "Pixel", optionDesc = "Tiniest fonts."}, + + ["questdialog"] = {file = "SVUI Default Font", size = 11, outline = "OUTLINE", optionName = "Quest Tracker Dialog", optionDesc = "Default font used in the quest tracker"}, + ["questheader"] = {file = "SVUI Narrator Font", size = 16, outline = "OUTLINE", optionName = "Quest Tracker Titles", optionDesc = "Font used in the quest tracker for listing headers."}, + ["questnumber"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Quest Tracker Numbers", optionDesc = "Font used in the quest tracker to display numeric values."}, + + ["platename"] = {file = "SVUI Caps Font", size = 9, outline = "OUTLINE", optionName = "Nameplate Names", optionDesc = "Used on nameplates for unit names."}, + ["plateaura"] = {file = "SVUI Caps Font", size = 9, outline = "OUTLINE", optionName = "Nameplate Auras", optionDesc = "Used on nameplates for aura texts."}, + + ["unitprimary"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Unitframe Values", optionDesc = "Used on all primary unit frames for health, power and misc values.\nUnits: player, pet, target, focus, boss and arena"}, + ["unitsecondary"] = {file = "SVUI Number Font", size = 11, outline = "OUTLINE", optionName = "Unitframe Values", optionDesc = "Used on all non-primary unit frames for health, power and misc values.\nUnits: pettarget, targettarget, focustarget, party, raid, raidpet, tank and assist."}, + ["unitaurabar"] = {file = "SVUI Alert Font", size = 10, outline = "OUTLINE", optionName = "Unitframe AuraBar", optionDesc = "Used on unit aurabars."}, + ["unitauramedium"] = {file = "SVUI Default Font", size = 10, outline = "OUTLINE", optionName = "Unitframe Aura (Medium)",optionDesc = "Used on unit frames for auras (medium scale)."}, + ["unitauralarge"] = {file = "SVUI Number Font", size = 10, outline = "OUTLINE", optionName = "Unitframe Aura (Large)", optionDesc = "Used on unit frames for auras (large scale)."}, ["unitaurasmall"] = {file = "SVUI Pixel Font", size = 8, outline = "MONOCHROMEOUTLINE", optionName = "Unitframe Aura (Small)", optionDesc = "Used on unit frames for auras (small scale)."}, - ["unitauramedium"] = {file = "SVUI Default Font", size = 10, outline = "OUTLINE", optionName = "Unitframe Aura (Medium)", optionDesc = "Used on unit frames for auras (medium scale)."}, - ["unitauralarge"] = {file = "SVUI Number Font", size = 10, outline = "OUTLINE", optionName = "Unitframe Aura (Large)", optionDesc = "Used on unit frames for auras (large scale)."}, } SV.defaults["media"] = { ["fonts"] = { ["default"] = "SVUI Name Font", - ["name"] = NAMEFONT, + ["dialog"] = DIALOGUE_FONT, ["number"] = "SVUI Number Font", ["combat"] = "SVUI Number Font", ["giant"] = "SVUI Name Font", @@ -668,7 +676,7 @@ SV.defaults["SVPlate"] = { ["enable"] = true, ["comicStyle"] = true, ["filter"] = {}, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", ["comboPoints"] = true, @@ -862,7 +870,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "", ["xOffset"] = 0, ["yOffset"] = 0, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, @@ -1053,7 +1061,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:18][smartlevel]", ["xOffset"] = -2, ["yOffset"] = 9, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, @@ -1287,7 +1295,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:10]", ["xOffset"] = 0, ["yOffset"] = 1, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, @@ -1451,7 +1459,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["xOffset"] = 0, ["yOffset"] = 0, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, @@ -1659,7 +1667,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, @@ -1814,7 +1822,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:8]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, @@ -1940,7 +1948,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, @@ -2092,7 +2100,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, @@ -2216,7 +2224,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:15]", ["yOffset"] = 0, ["xOffset"] = 0, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "OUTLINE", }, @@ -2373,7 +2381,7 @@ SV.defaults["SVUnit"] = { ["tags"] = "[name:color][name:10]", ["yOffset"] = -2, ["xOffset"] = 0, - ["font"] = NAMEFONT, + ["font"] = DIALOGUE_FONT, ["fontSize"] = 10, ["fontOutline"] = "NONE", }, diff --git a/Interface/AddOns/SVUI/framework/api/api_general.lua b/Interface/AddOns/SVUI/framework/api/api_general.lua index f2688ec..572d880 100644 --- a/Interface/AddOns/SVUI/framework/api/api_general.lua +++ b/Interface/AddOns/SVUI/framework/api/api_general.lua @@ -165,8 +165,9 @@ APPENDED FONT TEMPLATING METHODS ########################################################## ]]-- local ManagedFonts = {}; +local RestrictedFonts = {}; -local FontManager = function(self, fontTemplate, fontJustifyH, preUpdateFunc, postUpdateFunc) +local FontManager = function(self, fontTemplate, fontJustifyH) if not self then return end local STANDARDFONTSIZE = SV.db.font and SV.db.font.default.size or 11 @@ -174,7 +175,7 @@ local FontManager = function(self, fontTemplate, fontJustifyH, preUpdateFunc, po fontJustifyH = fontJustifyH or "CENTER"; local template = SV.db.font[fontTemplate]; if(not template) then - print(fontTemplate) + --print(fontTemplate) return end @@ -184,15 +185,6 @@ local FontManager = function(self, fontTemplate, fontJustifyH, preUpdateFunc, po self.___style = template.outline; self.___common = (template.size == STANDARDFONTSIZE); - if(preUpdateFunc and type(preUpdateFunc) == 'function') then - self.___preUpdate = preUpdateFunc - end - - if(postUpdateFunc and type(postUpdateFunc) == 'function') then - self.___postUpdate = postUpdateFunc - end - - self:SetFont(self.___file, self.___size, self.___style) if(template.outline and template.outline ~= "NONE") then self:SetShadowColor(0, 0, 0, 0) @@ -203,7 +195,12 @@ local FontManager = function(self, fontTemplate, fontJustifyH, preUpdateFunc, po self:SetJustifyH(fontJustifyH) self:SetJustifyV("MIDDLE") - ManagedFonts[self] = true + if(fontTemplate ~= "number") then + ManagedFonts[self] = true + end + + --RestrictedFonts[fontTemplate] = RestrictedFonts[fontTemplate] or {} + --tinsert(RestrictedFonts[fontTemplate], self) end --[[ ########################################################## @@ -212,25 +209,25 @@ UPDATE CALLBACKS ]]-- local function FontTemplateUpdates() local defaultSize = SV.db.font.default.size; + --local frameCount = 0; for frame in pairs(ManagedFonts) do if frame then - if(frame.___preUpdate) then - frame:___preUpdate() - else - local template = SV.db.font[frame.___template]; - frame.___file = LSM:Fetch("font", template.file); - frame.___size = frame.___common and defaultSize or template.size; - frame.___style = template.outline; - end + local template = SV.db.font[frame.___template]; + frame.___file = LSM:Fetch("font", template.file); + frame.___size = frame.___common and defaultSize or template.size; + frame.___style = template.outline; frame:SetFont(frame.___file, frame.___size, frame.___style); - if(frame.___postUpdate) then - frame:___postUpdate() - end + --frameCount = frameCount + 1 else ManagedFonts[frame] = nil - end - end + end + end + + -- print("Total FontFrames: " .. frameCount) + -- for fontGroup, list in pairs(RestrictedFonts) do + -- print("Total [" .. fontGroup .."]: " .. #list) + -- end end SV.Events:On("SVUI_FONTS_UPDATED", "FontTemplateUpdates", FontTemplateUpdates); diff --git a/Interface/AddOns/SVUI/framework/docks/dock_stats.lua b/Interface/AddOns/SVUI/framework/docks/dock_stats.lua index e05823a..414ec80 100644 --- a/Interface/AddOns/SVUI/framework/docks/dock_stats.lua +++ b/Interface/AddOns/SVUI/framework/docks/dock_stats.lua @@ -171,7 +171,20 @@ function Dock:SetDataTip(stat) Dock.DataTooltip:SetOwner(parent, parent.Stats.TooltipAnchor) Dock.DataTooltip:ClearLines() GameTooltip:Hide() -end +end + +function Dock:SetBrokerTip(stat) + local parent = stat:GetParent() + Dock.DataTooltip:Hide() + Dock.DataTooltip:SetOwner(parent, "ANCHOR_CURSOR") + Dock.DataTooltip:ClearLines() + GameTooltip:Hide() +end + +function Dock:PrependDataTip() + Dock.DataTooltip:AddDoubleLine("[Alt + Click]", "Swap Stats", 0, 1, 0, 0.5, 1, 0.5) + Dock.DataTooltip:AddLine(" ") +end function Dock:ShowDataTip(noSpace) if(not noSpace) then @@ -603,24 +616,28 @@ function Dock:InitializeStats() if dataObj.OnTooltipShow then function OnEnter(self) - Dock:SetDataTip(self) - dataObj.OnTooltipShow(Dock.DataTooltip) - Dock:ShowDataTip() + dataObj.OnTooltipShow(GameTooltip) + -- GameTooltip:SetBackdropColor(0, 0, 0, 1) + -- if(GameTooltip.SuperBorder) then + -- GameTooltip.SuperBorder:SetBackdropColor(0, 0, 0, 0.8) + -- end end end if dataObj.OnEnter then function OnEnter(self) - Dock:SetDataTip(self) - dataObj.OnEnter(Dock.DataTooltip) - Dock:ShowDataTip() + dataObj.OnEnter(self) + -- GameTooltip:SetBackdropColor(0, 0, 0, 1) + -- if(GameTooltip.SuperBorder) then + -- GameTooltip.SuperBorder:SetBackdropColor(0, 0, 0, 0.8) + -- end end end if dataObj.OnLeave then function OnLeave(self) - dataObj.OnLeave(self) Dock.DataTooltip:Hide() + dataObj.OnLeave(self) end end diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua index 01485d4..2b5363d 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua @@ -40,7 +40,26 @@ local TRAP_COLORS = { local HAS_SNAKE_TRAP = false; -local function UpdateBar(self, elapsed) +local function UpdateTrap(self, elapsed) + if not self.duration then return end + self.elapsed = (self.elapsed or 0) + elapsed + if self.elapsed >= 0.5 then + local timeLeft = (self.duration - (self.duration - (GetTime() - self.start))) * 1000 + if timeLeft < self.duration then + self:SetValue(timeLeft) + self:SetStatusBarColor(unpack(TRAP_COLORS[self.colorIndex])) + else + self:SetStatusBarColor(0.9,0.9,0.9) + self.elapsed = 0 + self.start = nil + self.duration = nil + self:SetScript("OnUpdate", nil) + self:Update(true) + end + end +end + +local function UpdateSnakeTrap(self, elapsed) if not self.duration then return end self.elapsed = (self.elapsed or 0) + elapsed if self.elapsed >= 0.5 then @@ -72,6 +91,7 @@ local Update = function(self, event, ...) TRAP_COLORS[3] = ICE_COLOR HAS_SNAKE_TRAP = false end + bar[3]:Update(nil, HAS_SNAKE_TRAP, true) end if(bar.PreUpdate) then bar:PreUpdate(event) end @@ -97,8 +117,13 @@ local Update = function(self, event, ...) bar[i]:SetValue(0) bar[i].start = start bar[i].duration = duration - bar[i]:SetScript('OnUpdate', UpdateBar) - bar[i]:Update(false, HAS_SNAKE_TRAP) + if(i == 3) then + bar[i]:SetScript('OnUpdate', UpdateSnakeTrap) + bar[i]:Update(false, HAS_SNAKE_TRAP) + else + bar[i]:SetScript('OnUpdate', UpdateTrap) + bar[i]:Update() + end end end end diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 3fc4e47..f906e41 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -113,6 +113,7 @@ local SCROLL_ALERT = [[Interface\AddOns\SVUI\assets\artwork\Chat\CHAT-SCROLL]] local WHISPER_ALERT = [[Interface\AddOns\SVUI\assets\artwork\Chat\CHAT-WHISPER]] local THROTTLE_CACHE = {}; local ACTIVE_HYPER_LINK; +local TABS_DIRTY = false; --[[ ########################################################## INIT SETTINGS @@ -354,12 +355,30 @@ end CORE FUNCTIONS ########################################################## ]]-- +local TabsList = {}; + +local function AnchorInsertHighlight() + local lastTab = TabsList[1]; + for chatID,frame in pairs(TabsList) do + if(frame and frame.isDocked) then + lastTab = frame + end + end + MOD.Dock.Highlight:ClearAllPoints(); + if(not lastTab) then + MOD.Dock.Highlight:SetPoint("LEFT", MOD.Dock.Bar, "LEFT", 2, 0); + else + MOD.Dock.Highlight:SetPoint("LEFT", lastTab, "RIGHT", 6, 0); + end +end + do - local TabsList = {}; local TabSafety = {}; local refreshLocked = false; local doskey = false; + + local SVUI_OnHyperlinkShow = function(self, link, ...) if(link:sub(1, 3) == "url") then local ChatFrameEditBox = ChatEdit_ChooseBoxForSend() @@ -440,6 +459,14 @@ do end end + local Tab_OnDragStart = function(self) + MOD.Dock.Highlight:Show() + end + + local Tab_OnDragStop = function(self) + MOD.Dock.Highlight:Hide() + end + local EditBox_OnKeyUp = function(self, button) if(not button) then return end if(doskey) then @@ -523,6 +550,7 @@ do end local function _repositionDockedTabs() + if(not MOD.Dock or not TABS_DIRTY) then return end; local lastTab = TabsList[1]; if(lastTab) then lastTab:ClearAllPoints() @@ -533,16 +561,18 @@ do if(frame and chatID ~= 1 and frame.isDocked) then frame:ClearAllPoints() if(not lastTab) then - frame:SetPointToScale("LEFT", MOD.Dock.Bar, "LEFT", 2, 0); + frame:SetPoint("LEFT", MOD.Dock.Bar, "LEFT", 2, 0); else - frame:SetPointToScale("LEFT", lastTab, "RIGHT", 6, 0); + frame:SetPoint("LEFT", lastTab, "RIGHT", 6, 0); end lastTab = frame end end local newWidth = ((MOD.Dock.Bar:GetHeight() * 1.75) + 6) * offset; MOD.Dock.Bar:SetWidth(newWidth); - end + AnchorInsertHighlight(); + TABS_DIRTY = false; + end local function _removeTab(frame,chat) if(not frame or not frame.chatID) then return end @@ -556,6 +586,7 @@ do frame:SetParent(chat) frame:ClearAllPoints() frame:SetPointToScale("TOPLEFT", chat, "BOTTOMLEFT", 0, 0) + TABS_DIRTY = true _repositionDockedTabs() end @@ -566,9 +597,12 @@ do TabsList[chatID] = frame frame.chatID = chatID; frame:SetParent(MOD.Dock.Bar) + TABS_DIRTY = true _repositionDockedTabs() end + NewHook("FCFDock_UpdateTabs", _repositionDockedTabs) + local function _customTab(tab, chatID, enabled) if(tab.IsStyled) then return end local tabName = tab:GetName(); @@ -613,6 +647,8 @@ do tab:SetScript("OnEnter", Tab_OnEnter); tab:SetScript("OnLeave", Tab_OnLeave); tab:SetScript("OnClick", Tab_OnClick); + tab:HookScript("OnDragStart", Tab_OnDragStart); + tab:HookScript("OnDragStop", Tab_OnDragStop); tab.Holder = holder tab.Holder.link = tab tab.IsStyled = true; @@ -624,8 +660,8 @@ do local chatID = chat:GetID(); local tabName = chatName.."Tab"; local tabText = _G[chatName.."TabText"] - local _, fontSize = FCF_GetChatWindowInfo(chatID); - CHAT_FONTSIZE = fontSize + --local _, fontSize = FCF_GetChatWindowInfo(chatID); + --CHAT_FONTSIZE = fontSize chat:SetFont(CHAT_FONT, CHAT_FONTSIZE, CHAT_FONTOUTLINE) tabText:SetFont(TAB_FONT, TAB_FONTSIZE, TAB_FONTOUTLINE) if(not chat.Panel) then @@ -751,6 +787,7 @@ do _modifyChat(chat, tabText) tab.owner = chat; if not chat.isDocked and chat:IsShown() then + --print("setting size "..id .. " = " ..CHAT_WIDTH) chat:SetSize(CHAT_WIDTH, CHAT_HEIGHT) chat.Panel:Show() if(not TAB_SKINS) then @@ -766,14 +803,13 @@ do end end else - if id == 1 then - FCF_SavePositionAndDimensions(chat) - end - chat:ClearAllPoints(); - chat:SetAllPointsIn(MOD.Dock, 2, 2); + chat:SetPoint("TOPLEFT", MOD.Dock, "TOPLEFT", 2, -2); + chat:SetPoint("BOTTOMRIGHT", MOD.Dock, "BOTTOMRIGHT", -2, 2); chat:SetBackdropColor(0,0,0,0); chat.Panel:Hide(); + + FCF_SavePositionAndDimensions(chat) if(not TAB_SKINS) then tab.owner = chat; @@ -789,7 +825,7 @@ do _addTab(tab.Holder, id) end end - if chat:IsMovable()then + if chat:IsMovable() then chat:SetUserPlaced(true) end end @@ -807,6 +843,27 @@ function MOD:PET_BATTLE_CLOSE() end end +local function _hook_SetTabPosition(chatFrame) + local chatTab = _G[chatFrame:GetName().."Tab"]; + local frame = chatTab.Holder + if(frame) then + if(not chatFrame.isLocked) then + frame.isDocked = false; + frame:ClearAllPoints(); + frame:SetPoint("TOPLEFT", chatFrame, "BOTTOMLEFT", 0, 0); + TABS_DIRTY = true; + AnchorInsertHighlight(); + end + end +end + +local function _hook_TabStopDragging(chatFrame) + if(MOD.Dock.Highlight:IsMouseOver(10, -10, 0, 10)) then + TABS_DIRTY = true; + FCF_DockFrame(chatFrame, chatFrame:GetID(), true); + end +end + do local _linkTokens = { ['item'] = true, @@ -853,6 +910,8 @@ do if ( not size ) then size = self.value or CHAT_FONTSIZE; end + CHAT_FONTSIZE = size; + SV.db.font.chat.size = size; chat:SetFont(CHAT_FONT, size, CHAT_FONTOUTLINE) if(CHAT_FONTOUTLINE ~= 'NONE' )then chat:SetShadowColor(0, 0, 0, 0) @@ -865,10 +924,12 @@ do local _hook_GDMFrameSetPoint = function(self) self:SetAllPoints(MOD.Dock.Bar) + --print("_hook_GDMScrollSetPoint") end local _hook_GDMScrollSetPoint = function(self, point, anchor, attachTo, x, y) - if anchor == GeneralDockManagerOverflowButton and x == 0 and y == 0 then + if(anchor == GeneralDockManagerOverflowButton and x == 0 and y == 0) then + --print("_hook_GDMScrollSetPoint " .. point .. " " .. attachTo) self:SetPoint(point, anchor, attachTo, -2, -6) end end @@ -956,6 +1017,8 @@ do NewHook('FCF_UnDockFrame', MOD.RefreshChatFrames) NewHook('FCF_DockFrame', MOD.RefreshChatFrames) NewHook('FCF_OpenTemporaryWindow', MOD.RefreshChatFrames) + NewHook("FCF_SetTabPosition", _hook_SetTabPosition) + NewHook("FCF_StopDragging", _hook_TabStopDragging) NewHook('ChatEdit_OnEnterPressed', _hook_ChatEditOnEnterKey) NewHook('FCF_SetChatWindowFontSize', _hook_ChatFontUpdate) NewHook(GeneralDockManager, 'SetPoint', _hook_GDMFrameSetPoint) @@ -996,15 +1059,15 @@ function MOD:UpdateLocals() CHAT_ALLOW_URL = SV.db.SVChat.url; CHAT_HOVER_URL = SV.db.SVChat.hyperlinkHover; CHAT_STICKY = SV.db.SVChat.sticky; - CHAT_FONT = LSM:Fetch("font", SV.db.font.default.file); - CHAT_FONTSIZE = SV.db.font.default.size or 11; - CHAT_FONTOUTLINE = SV.db.font.default.outline; + CHAT_FONT = LSM:Fetch("font", SV.db.font.chat.file); + CHAT_FONTSIZE = SV.db.font.chat.size or 11; + CHAT_FONTOUTLINE = SV.db.font.chat.outline; TAB_WIDTH = SV.db.SVChat.tabWidth; TAB_HEIGHT = SV.db.SVChat.tabHeight; TAB_SKINS = SV.db.SVChat.tabStyled; - TAB_FONT = LSM:Fetch("font", SV.db.font.caps.file); - TAB_FONTSIZE = SV.db.font.caps.size; - TAB_FONTOUTLINE = SV.db.font.caps.outline; + TAB_FONT = LSM:Fetch("font", SV.db.font.chattab.file); + TAB_FONTSIZE = SV.db.font.chattab.size; + TAB_FONTOUTLINE = SV.db.font.chattab.outline; CHAT_FADING = SV.db.SVChat.fade; CHAT_PSST = LSM:Fetch("sound", SV.db.SVChat.psst); TIME_STAMP_MASK = SV.db.SVChat.timeStampFormat; @@ -1013,6 +1076,13 @@ function MOD:UpdateLocals() end end +local function ForceChatFrameUpdate() + MOD:UpdateLocals() + MOD:RefreshChatFrames(true) +end + +SV.Events:On("SVUI_FONTS_UPDATED", "ForceChatFrameUpdate", ForceChatFrameUpdate); + function MOD:ReLoad() if(not SV.db.SVChat.enable) then return end self:RefreshChatFrames(true) @@ -1021,6 +1091,18 @@ end function MOD:Load() self.Dock = SV.Dock:NewAdvancedDocklet("BottomLeft", "SVUI_ChatFrameDock") + local hlSize = self.Dock.Bar:GetHeight() + local insertHL = CreateFrame("Frame", nil, self.Dock.Bar) + insertHL:SetPoint("LEFT", self.Dock.Bar, "LEFT", 0, 0) + insertHL:SetSize(hlSize, hlSize) + local insTex = insertHL:CreateTexture(nil, "OVERLAY") + insTex:SetAllPoints() + insTex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]); + insTex:SetGradientAlpha("HORIZONTAL",0,1,1,0.8,0,0.3,0.3,0) + insertHL:Hide() + + self.Dock.Highlight = insertHL + ScrollIndicator:SetParent(self.Dock) ScrollIndicator:SetSize(20,20) ScrollIndicator:SetPoint("BOTTOMRIGHT", self.Dock, "BOTTOMRIGHT", 6, 0) @@ -1057,4 +1139,10 @@ function MOD:Load() _G.InterfaceOptionsSocialPanelChatStyle:EnableMouse(false) _G.InterfaceOptionsSocialPanelChatStyleButton:Hide() _G.InterfaceOptionsSocialPanelChatStyle:SetAlpha(0) + + -- NewHook(ChatFrame2, "SetPoint", function(self, a1, p, a2, x, y) + -- if(x > 2) then + -- self:SetPoint(a1, p, a2, 2, y) + -- end + -- end) end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/quest/SVQuest.lua b/Interface/AddOns/SVUI/packages/quest/SVQuest.lua index f1e0c60..fb83abd 100644 --- a/Interface/AddOns/SVUI/packages/quest/SVQuest.lua +++ b/Interface/AddOns/SVUI/packages/quest/SVQuest.lua @@ -216,12 +216,8 @@ local OBJECTIVE_GetStatus = function(self) status.Label = status.Bar:CreateFontString(nil,"OVERLAY"); status.Label:SetAllPointsIn(status.Bar); - status.Label:SetFont(SV.Media.font.numbers, 12, "OUTLINE") + status.Label:FontManager("questnumber") status.Label:SetTextColor(1,1,1) - status.Label:SetShadowOffset(-1,-1) - status.Label:SetShadowColor(0,0,0,0.5) - status.Label:SetJustifyH('CENTER') - status.Label:SetJustifyV('MIDDLE') status.Label:SetText('') status:SetAlpha(0); @@ -258,12 +254,8 @@ function MOD:NewObjectiveRow(header, index) objective.Text:SetPoint("TOPLEFT", objective, "TOPLEFT", 20 + 6, -2); objective.Text:SetPoint("TOPRIGHT", objective, "TOPRIGHT", 0, -2); objective.Text:SetHeightToScale(INNER_HEIGHT); - objective.Text:SetFont(SV.Media.font.default, 11, "NONE"); + objective.Text:FontManager("questdialog", "LEFT"); objective.Text:SetTextColor(0.6,0.6,0.6); - objective.Text:SetShadowOffset(-1,-1); - objective.Text:SetShadowColor(0,0,0,0.5); - objective.Text:SetJustifyH('LEFT'); - objective.Text:SetJustifyV('MIDDLE'); objective.Text:SetText(''); objective.StartProgress = OBJECTIVE_StartProgress; diff --git a/Interface/AddOns/SVUI/packages/quest/components/achievements.lua b/Interface/AddOns/SVUI/packages/quest/components/achievements.lua index 9dd5334..77d75ea 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/achievements.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/achievements.lua @@ -143,12 +143,8 @@ local GetAchievementRow = function(self, index) row.Header:SetPoint("TOPRIGHT", row, "TOPRIGHT", -2, 0); row.Header:SetHeightToScale(INNER_HEIGHT); row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") - row.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + row.Header.Text:FontManager("questdialog", "LEFT"); row.Header.Text:SetTextColor(1,1,0) - row.Header.Text:SetShadowOffset(-1,-1) - row.Header.Text:SetShadowColor(0,0,0,0.5) - row.Header.Text:SetJustifyH('LEFT') - row.Header.Text:SetJustifyV('MIDDLE') row.Header.Text:SetText('') row.Header.Text:SetPoint("TOPLEFT", row.Header, "TOPLEFT", 4, 0); row.Header.Text:SetPoint("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", 0, 0); @@ -317,12 +313,8 @@ function MOD:InitializeAchievements() achievements.Header.Text = achievements.Header:CreateFontString(nil,"OVERLAY") achievements.Header.Text:SetPoint("TOPLEFT", achievements.Header, "TOPLEFT", 2, 0); achievements.Header.Text:SetPoint("BOTTOMLEFT", achievements.Header, "BOTTOMLEFT", 2, 0); - achievements.Header.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") - achievements.Header.Text:SetJustifyH('LEFT') - achievements.Header.Text:SetJustifyV('MIDDLE') + achievements.Header.Text:FontManager("questheader", "LEFT"); achievements.Header.Text:SetTextColor(0.28,0.75,1) - achievements.Header.Text:SetShadowOffset(-1,-1) - achievements.Header.Text:SetShadowColor(0,0,0,0.5) achievements.Header.Text:SetText(TRACKER_HEADER_ACHIEVEMENTS) achievements.Header.Divider = achievements.Header:CreateTexture(nil, 'BACKGROUND'); diff --git a/Interface/AddOns/SVUI/packages/quest/components/active.lua b/Interface/AddOns/SVUI/packages/quest/components/active.lua index 2dea86f..e7085d9 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/active.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/active.lua @@ -339,12 +339,8 @@ function MOD:InitializeActive() block.Top.Text = block.Top:CreateFontString(nil,"OVERLAY") block.Top.Text:SetPoint("TOPLEFT", block.Top, "TOPLEFT", 2, 0); block.Top.Text:SetPoint("BOTTOMLEFT", block.Top, "BOTTOMLEFT", 2, 0); - block.Top.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") - block.Top.Text:SetJustifyH('LEFT') - block.Top.Text:SetJustifyV('MIDDLE') + block.Top.Text:FontManager("questheader", "LEFT"); block.Top.Text:SetTextColor(0.28,0.75,1) - block.Top.Text:SetShadowOffset(-1,-1) - block.Top.Text:SetShadowColor(0,0,0,0.5) block.Top.Text:SetText("Now Tracking...") block.CloseButton = CreateFrame("Button", nil, block.Top, "UIPanelCloseButton") @@ -395,22 +391,14 @@ function MOD:InitializeActive() block.Header:SetStylePanel("Default", "Headline") block.Header.Level = block.Header:CreateFontString(nil,"OVERLAY") - block.Header.Level:SetFont(SV.Media.font.default, 12, "NONE") - block.Header.Level:SetShadowOffset(-1,-1) - block.Header.Level:SetShadowColor(0,0,0,0.5) - block.Header.Level:SetJustifyH('LEFT') - block.Header.Level:SetJustifyV('MIDDLE') + block.Header.Level:FontManager("questdialog", "LEFT"); block.Header.Level:SetText('') block.Header.Level:SetPointToScale("TOPLEFT", block.Header, "TOPLEFT", 4, 0); block.Header.Level:SetPointToScale("BOTTOMLEFT", block.Header, "BOTTOMLEFT", 4, 0); block.Header.Text = block.Header:CreateFontString(nil,"OVERLAY") - block.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + block.Header.Text:FontManager("questdialog", "LEFT"); block.Header.Text:SetTextColor(1,1,0) - block.Header.Text:SetShadowOffset(-1,-1) - block.Header.Text:SetShadowColor(0,0,0,0.5) - block.Header.Text:SetJustifyH('LEFT') - block.Header.Text:SetJustifyV('MIDDLE') block.Header.Text:SetText('') block.Header.Text:SetPointToScale("TOPLEFT", block.Header.Level, "TOPRIGHT", 4, 0); block.Header.Text:SetPointToScale("BOTTOMRIGHT", block.Header, "BOTTOMRIGHT", 0, 0); diff --git a/Interface/AddOns/SVUI/packages/quest/components/bonus.lua b/Interface/AddOns/SVUI/packages/quest/components/bonus.lua index 81f8bc8..c157265 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/bonus.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/bonus.lua @@ -212,12 +212,8 @@ local GetBonusRow = function(self, index) row.Header:SetHeightToScale(INNER_HEIGHT); row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") - row.Header.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") + row.Header.Text:FontManager("questheader", "LEFT"); row.Header.Text:SetTextColor(0.2,0.75,1) - row.Header.Text:SetShadowOffset(-1,-1) - row.Header.Text:SetShadowColor(0,0,0,0.5) - row.Header.Text:SetJustifyH('LEFT') - row.Header.Text:SetJustifyV('MIDDLE') row.Header.Text:SetText('') row.Header.Text:SetPointToScale("TOPLEFT", row.Header, "TOPLEFT", 0, 0); row.Header.Text:SetPointToScale("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", 0, 0); diff --git a/Interface/AddOns/SVUI/packages/quest/components/popups.lua b/Interface/AddOns/SVUI/packages/quest/components/popups.lua index 1e1084b..e0afbd2 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/popups.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/popups.lua @@ -121,12 +121,8 @@ local GetPopUpRow = function(self, index) row.Header:SetPointToScale("BOTTOMRIGHT", row.Button, "BOTTOMRIGHT", -2, 2); row.Header:SetStylePanel("Default") row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") - row.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + row.Header.Text:FontManager("questdialog", "LEFT"); row.Header.Text:SetTextColor(1,1,0) - row.Header.Text:SetShadowOffset(-1,-1) - row.Header.Text:SetShadowColor(0,0,0,0.5) - row.Header.Text:SetJustifyH('LEFT') - row.Header.Text:SetJustifyV('MIDDLE') row.Header.Text:SetText('') row.Header.Text:SetPointToScale("TOPLEFT", row.Header, "TOPLEFT", 0, 0); row.Header.Text:SetPointToScale("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", 0, 0); diff --git a/Interface/AddOns/SVUI/packages/quest/components/quests.lua b/Interface/AddOns/SVUI/packages/quest/components/quests.lua index fd314de..ff75471 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/quests.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/quests.lua @@ -413,34 +413,22 @@ local GetQuestRow = function(self, index) row.Header:SetHeightToScale(INNER_HEIGHT); row.Header.Level = row.Header:CreateFontString(nil,"OVERLAY") - row.Header.Level:SetFont(SV.Media.font.numbers, 11, "NONE") - row.Header.Level:SetShadowOffset(-1,-1) - row.Header.Level:SetShadowColor(0,0,0,0.5) - row.Header.Level:SetJustifyH('RIGHT') - row.Header.Level:SetJustifyV('MIDDLE') + row.Header.Level:FontManager("questnumber", "RIGHT"); row.Header.Level:SetText('') row.Header.Level:SetPoint("TOPRIGHT", row.Header, "TOPRIGHT", -4, 0); row.Header.Level:SetPoint("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", -4, 0); row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") - row.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + row.Header.Text:FontManager("questdialog", "LEFT"); row.Header.Text:SetTextColor(1,1,0) - row.Header.Text:SetShadowOffset(-1,-1) - row.Header.Text:SetShadowColor(0,0,0,0.5) - row.Header.Text:SetJustifyH('LEFT') - row.Header.Text:SetJustifyV('MIDDLE') row.Header.Text:SetText('') row.Header.Text:SetPoint("TOPLEFT", row.Header, "TOPLEFT", 4, 0); row.Header.Text:SetPoint("BOTTOMRIGHT", row.Header.Level, "BOTTOMLEFT", 0, 0); row.Header.Zone = row:CreateFontString(nil,"OVERLAY") row.Header.Zone:SetAllPoints(row); - row.Header.Zone:SetFont(SV.Media.font.names, 11, "OUTLINE") - row.Header.Zone:SetJustifyH('LEFT') - row.Header.Zone:SetJustifyV('MIDDLE') + row.Header.Zone:FontManager("questdialog", "LEFT"); row.Header.Zone:SetTextColor(0.75,0.25,1) - row.Header.Zone:SetShadowOffset(-1,-1) - row.Header.Zone:SetShadowColor(0,0,0,0.5) row.Header.Zone:SetText("") row.Button = CreateFrame("Button", nil, row.Header) @@ -500,12 +488,8 @@ local GetQuestRow = function(self, index) row.Timer.TimeLeft = row.Timer.Bar:CreateFontString(nil,"OVERLAY"); row.Timer.TimeLeft:SetAllPointsIn(row.Timer.Bar); - row.Timer.TimeLeft:SetFont(SV.Media.font.numbers, 12, "OUTLINE") + row.Timer.TimeLeft:FontManager("questnumber"); row.Timer.TimeLeft:SetTextColor(1,1,1) - row.Timer.TimeLeft:SetShadowOffset(-1,-1) - row.Timer.TimeLeft:SetShadowColor(0,0,0,0.5) - row.Timer.TimeLeft:SetJustifyH('CENTER') - row.Timer.TimeLeft:SetJustifyV('MIDDLE') row.Timer.TimeLeft:SetText('') row.Timer:SetHeight(1); @@ -808,12 +792,8 @@ function MOD:InitializeQuests() quests.Header.Text = quests.Header:CreateFontString(nil,"OVERLAY") quests.Header.Text:SetPoint("TOPLEFT", quests.Header, "TOPLEFT", 2, 0); quests.Header.Text:SetPoint("BOTTOMLEFT", quests.Header, "BOTTOMLEFT", 2, 0); - quests.Header.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") - quests.Header.Text:SetJustifyH('LEFT') - quests.Header.Text:SetJustifyV('MIDDLE') + quests.Header.Text:FontManager("questheader", "LEFT"); quests.Header.Text:SetTextColor(0.28,0.75,1) - quests.Header.Text:SetShadowOffset(-1,-1) - quests.Header.Text:SetShadowColor(0,0,0,0.5) quests.Header.Text:SetText(TRACKER_HEADER_QUESTS) quests.Header.Divider = quests.Header:CreateTexture(nil, 'BACKGROUND'); diff --git a/Interface/AddOns/SVUI/packages/quest/components/scenario.lua b/Interface/AddOns/SVUI/packages/quest/components/scenario.lua index fabf194..4dde835 100644 --- a/Interface/AddOns/SVUI/packages/quest/components/scenario.lua +++ b/Interface/AddOns/SVUI/packages/quest/components/scenario.lua @@ -382,33 +382,21 @@ function MOD:InitializeScenarios() block.Header:SetStylePanel("Default") block.Header.Stage = block.Header:CreateFontString(nil,"OVERLAY") - block.Header.Stage:SetFont(SV.Media.font.default, 13, "NONE") - block.Header.Stage:SetShadowOffset(-1,-1) - block.Header.Stage:SetShadowColor(0,0,0,0.5) - block.Header.Stage:SetJustifyH('LEFT') - block.Header.Stage:SetJustifyV('MIDDLE') + block.Header.Stage:FontManager("questdialog", "LEFT"); block.Header.Stage:SetText('') block.Header.Stage:SetPointToScale("TOPLEFT", block.Header, "TOPLEFT", 4, 0); block.Header.Stage:SetPointToScale("BOTTOMLEFT", block.Header, "BOTTOMLEFT", 4, 0); block.Header.Score = block.Header:CreateFontString(nil,"OVERLAY") - block.Header.Score:SetFont(SV.Media.font.default, 13, "NONE") + block.Header.Score:FontManager("questdialog", "RIGHT"); block.Header.Score:SetTextColor(1,1,0) - block.Header.Score:SetShadowOffset(-1,-1) - block.Header.Score:SetShadowColor(0,0,0,0.5) - block.Header.Score:SetJustifyH('RIGHT') - block.Header.Score:SetJustifyV('MIDDLE') block.Header.Score:SetText('') block.Header.Score:SetPointToScale("TOPRIGHT", block.Header, "TOPRIGHT", -2, 0); block.Header.Score:SetPointToScale("BOTTOMRIGHT", block.Header, "BOTTOMRIGHT", -2, 0); block.Header.Text = block.Header:CreateFontString(nil,"OVERLAY") - block.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") + block.Header.Text:FontManager("questdialog"); block.Header.Text:SetTextColor(1,1,0) - block.Header.Text:SetShadowOffset(-1,-1) - block.Header.Text:SetShadowColor(0,0,0,0.5) - block.Header.Text:SetJustifyH('CENTER') - block.Header.Text:SetJustifyV('MIDDLE') block.Header.Text:SetText('') block.Header.Text:SetPointToScale("TOPLEFT", block.Header.Stage, "TOPRIGHT", 4, 0); block.Header.Text:SetPointToScale("BOTTOMRIGHT", block.Header.Score, "BOTTOMRIGHT", 0, 0); @@ -436,23 +424,15 @@ function MOD:InitializeScenarios() timer.Bar.Wave = timer.Bar:CreateFontString(nil,"OVERLAY") timer.Bar.Wave:SetPointToScale("TOPLEFT", timer.Bar, "TOPLEFT", 4, 0); timer.Bar.Wave:SetPointToScale("BOTTOMLEFT", timer.Bar, "BOTTOMLEFT", 4, 0); - timer.Bar.Wave:SetFont(SV.Media.font.default, 11, "NONE") + timer.Bar.Wave:FontManager("questdialog", "LEFT"); timer.Bar.Wave:SetTextColor(1,1,0) - timer.Bar.Wave:SetShadowOffset(-1,-1) - timer.Bar.Wave:SetShadowColor(0,0,0,0.5) - timer.Bar.Wave:SetJustifyH('LEFT') - timer.Bar.Wave:SetJustifyV('MIDDLE') timer.Bar.Wave:SetText('') timer.Bar.TimeLeft = timer.Bar:CreateFontString(nil,"OVERLAY"); timer.Bar.TimeLeft:SetPointToScale("TOPLEFT", timer.Bar.Wave, "TOPRIGHT", 4, 0); timer.Bar.TimeLeft:SetPointToScale("BOTTOMRIGHT", timer.Bar, "BOTTOMRIGHT", 0, 0); - timer.Bar.TimeLeft:SetFont(SV.Media.font.numbers, 12, "OUTLINE") + timer.Bar.TimeLeft:FontManager("questnumber"); timer.Bar.TimeLeft:SetTextColor(1,1,1) - timer.Bar.TimeLeft:SetShadowOffset(-1,-1) - timer.Bar.TimeLeft:SetShadowColor(0,0,0,0.5) - timer.Bar.TimeLeft:SetJustifyH('CENTER') - timer.Bar.TimeLeft:SetJustifyV('MIDDLE') timer.Bar.TimeLeft:SetText('') timer.Icon = block.Icon; diff --git a/Interface/AddOns/SVUI/packages/quest/components/working_quests.lua b/Interface/AddOns/SVUI/packages/quest/components/working_quests.lua deleted file mode 100644 index 180d346..0000000 --- a/Interface/AddOns/SVUI/packages/quest/components/working_quests.lua +++ /dev/null @@ -1,823 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -local wipe = _G.wipe; ---[[ STRING METHODS ]]-- -local format = string.format; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round, maxNum = math.abs, math.ceil, math.floor, math.round, math.max; ---[[ TABLE METHODS ]]-- -local tsort, tcopy = table.sort, table.copy; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = select(2, ...) -local L = SV.L -local LSM = LibStub("LibSharedMedia-3.0") -local MOD = SV.SVQuest; ---[[ -########################################################## -LOCALS -########################################################## -]]-- -local ROW_WIDTH = 300; -local ROW_HEIGHT = 20; -local QUEST_ROW_HEIGHT = ROW_HEIGHT + 2; -local INNER_HEIGHT = ROW_HEIGHT - 4; -local LARGE_ROW_HEIGHT = ROW_HEIGHT * 2; -local LARGE_INNER_HEIGHT = LARGE_ROW_HEIGHT - 4; - -local NO_ICON = [[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]; -local OBJ_ICON_ACTIVE = [[Interface\COMMON\Indicator-Yellow]]; -local OBJ_ICON_COMPLETE = [[Interface\COMMON\Indicator-Green]]; -local OBJ_ICON_INCOMPLETE = [[Interface\COMMON\Indicator-Gray]]; - -local QUEST_ICON = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-INCOMPLETE-ICON]]; -local QUEST_ICON_COMPLETE = [[Interface\AddOns\SVUI\assets\artwork\Quest\QUEST-COMPLETE-ICON]]; - -local CACHED_QUESTS = {}; -local USED_QUESTIDS = {}; -local CURRENT_MAP_ID = 0; -local WORLDMAP_UPDATE = false; - -local DEFAULT_COLOR = {r = 1, g = 0.68, b = 0.1} - -local QuestInZone = { - [14108] = 541, - [13998] = 11, - [25798] = 61, - [25799] = 61, - [25112] = 161, - [25111] = 161, - [24735] = 201, -}; - -local function UpdateCachedQuests() - local s = 62500; - local x = 1; - local c = 0; - local li = 0; - - local numWatch = GetNumQuestWatches(); - local numCache = #CACHED_QUESTS; - local numItems = maxNum(numWatch, numCache) - - --wipe(USED_QUESTIDS); - wipe(CACHED_QUESTS); - - for i = 1, GetNumQuestWatches() do - local questID, _, questLogIndex, numObjectives, _, completed, _, _, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(i); - if(questID) then -- and (not USED_QUESTIDS[questID]) - local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) - local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) - local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex) - local mapID, floorNumber = 0,0 - if(not WorldMapFrame:IsShown()) then - mapID, floorNumber = GetQuestWorldMapAreaID(questID) - else - WORLDMAP_UPDATE = true; - end - if(link and QuestHasPOIInfo(questID)) then - local areaID = QuestInZone[questID] - if(areaID and (areaID == CURRENT_MAP_ID)) then - c = x - li = questLogIndex - elseif(onContinent and (distanceSq < s)) then - s = distanceSq - c = x - li = questLogIndex - end - end - - if(not CACHED_QUESTS[x]) then - CACHED_QUESTS[x] = { 0, false, 0, 0, 0, false, {"", 100, QUEST_ICON, 0, 0, 0, 0, 0, false, 0} }; - end - - CACHED_QUESTS[x][1] = i; -- quest watch index - CACHED_QUESTS[x][2] = link; -- quest item link - CACHED_QUESTS[x][3] = mapID; -- quest location map id - CACHED_QUESTS[x][4] = floorNumber; -- quest location floor number - CACHED_QUESTS[x][5] = distanceSq; -- quest distance from player - CACHED_QUESTS[x][6] = false; -- quest closest to player - CACHED_QUESTS[x][7][1] = title; -- args: quest title - CACHED_QUESTS[x][7][2] = level; -- args: quest level - CACHED_QUESTS[x][7][3] = texture; -- args: quest item icon - CACHED_QUESTS[x][7][4] = questID; -- args: quest id - CACHED_QUESTS[x][7][5] = questLogIndex; -- args: quest log index - CACHED_QUESTS[x][7][6] = numObjectives; -- args: quest objective count - CACHED_QUESTS[x][7][7] = duration; -- args: quest timer duration - CACHED_QUESTS[x][7][8] = elapsed; -- args: quest timer elapsed - CACHED_QUESTS[x][7][9] = completed; -- args: quest is completed - CACHED_QUESTS[x][7][10] = questType; -- args: quest type - - --USED_QUESTIDS[questID] = true; - - if(questID == MOD.ActiveQuestID) then - MOD:UpdateActiveObjective('FORCED_UPDATE', CACHED_QUESTS[x][7]) - end - - x = x + 1; - end - end - - if(c ~= 0 and CACHED_QUESTS[c]) then - CACHED_QUESTS[c][6] = true; - MOD.ClosestQuest = li; - end - - tsort(CACHED_QUESTS, function(a,b) - if(a[5] and b[5]) then - return a[5] < b[5] - else - return false - end - end); - tsort(CACHED_QUESTS, function(a,b) - if(a[3] and b[3]) then - return a[3] < b[3] - else - return false - end - end); -end - -local function UpdateCachedDistance() - local s = 62500; - - for i = 1, #CACHED_QUESTS do - local data = CACHED_QUESTS[i][7]; - local questLogIndex = data[5]; - local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex) - - CACHED_QUESTS[i][5] = distanceSq; -- quest distance from player - CACHED_QUESTS[i][6] = false; -- quest closest to player - end - - tsort(CACHED_QUESTS, function(a,b) - if(a[5] and b[5]) then - return a[5] < b[5] - else - return false - end - end); - tsort(CACHED_QUESTS, function(a,b) - if(a[3] and b[3]) then - return a[3] < b[3] - else - return false - end - end); -end - -local function AddCachedQuest(questLogIndex) - local x = #CACHED_QUESTS + 1; - - if(questLogIndex) then -- and (not USED_QUESTIDS[questID]) - local i = GetQuestWatchIndex(questLogIndex) - if(i) then - local questID, _, _, numObjectives, _, completed, _, _, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(i); - local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) - local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) - local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex) - local mapID, floorNumber = 0,0 - if(not WorldMapFrame:IsShown()) then - mapID, floorNumber = GetQuestWorldMapAreaID(questID) - else - WORLDMAP_UPDATE = true; - end - - if(not CACHED_QUESTS[x]) then - CACHED_QUESTS[x] = { 0, false, 0, 0, 0, false, {"", 100, QUEST_ICON, 0, 0, 0, 0, 0, false, 0} }; - end - - CACHED_QUESTS[x][1] = i; -- quest watch index - CACHED_QUESTS[x][2] = link; -- quest item link - CACHED_QUESTS[x][3] = mapID; -- quest location map id - CACHED_QUESTS[x][4] = floorNumber; -- quest location floor number - CACHED_QUESTS[x][5] = distanceSq; -- quest distance from player - CACHED_QUESTS[x][6] = false; -- quest closest to player - CACHED_QUESTS[x][7][1] = title; -- args: quest title - CACHED_QUESTS[x][7][2] = level; -- args: quest level - CACHED_QUESTS[x][7][3] = texture; -- args: quest item icon - CACHED_QUESTS[x][7][4] = questID; -- args: quest id - CACHED_QUESTS[x][7][5] = questLogIndex; -- args: quest log index - CACHED_QUESTS[x][7][6] = numObjectives; -- args: quest objective count - CACHED_QUESTS[x][7][7] = duration; -- args: quest timer duration - CACHED_QUESTS[x][7][8] = elapsed; -- args: quest timer elapsed - CACHED_QUESTS[x][7][9] = completed; -- args: quest is completed - CACHED_QUESTS[x][7][10] = questType; -- args: quest type - return true; - end - end - - return false; -end ---[[ -########################################################## -SCRIPT HANDLERS -########################################################## -]]-- -local TimerBar_OnUpdate = function(self, elapsed) - local statusbar = self.Timer.Bar - local timeNow = GetTime(); - local timeRemaining = statusbar.duration - (timeNow - statusbar.startTime); - statusbar:SetValue(timeRemaining); - if(timeRemaining < 0) then - -- hold at 0 for a moment - if(timeRemaining > -1) then - timeRemaining = 0; - else - self:StopTimer(); - end - end - local r,g,b = MOD:GetTimerTextColor(statusbar.duration, statusbar.duration - timeRemaining) - self.Timer.TimeLeft:SetText(GetTimeStringFromSeconds(timeRemaining, nil, true)); - self.Timer.TimeLeft:SetTextColor(r,g,b); -end - -local ActiveButton_OnClick = function(self, button) - local rowIndex = self:GetID(); - if(rowIndex and (rowIndex ~= 0)) then - local questID, _, questLogIndex, numObjectives, requiredMoney, completed, startEvent, isAutoComplete, duration, elapsed, questType, isTask, isStory, isOnMap, hasLocalPOI = GetQuestWatchInfo(rowIndex); - if(questID) then - local title, level, suggestedGroup = GetQuestLogTitle(questLogIndex) - local icon = self.Icon:GetTexture() - SetSuperTrackedQuestID(questID); - local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex) - MOD.QuestItem:SetAbility(link, texture, title, level, icon, questID, questLogIndex, numObjectives, duration, elapsed) - end - end -end - -local ViewButton_OnClick = function(self, button) - local questIndex = self:GetID(); - if(questIndex and (questIndex ~= 0)) then - local questID = select(8, GetQuestLogTitle(questIndex)); - if(IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow()) then - local questLink = GetQuestLink(questIndex); - if(questLink) then - ChatEdit_InsertLink(questLink); - end - elseif(questID and button ~= "RightButton") then - CloseDropDownMenus(); - if(IsQuestComplete(questID) and GetQuestLogIsAutoComplete(questIndex)) then - AutoQuestPopupTracker_RemovePopUp(questID); - ShowQuestComplete(questIndex); - else - QuestLogPopupDetailFrame_Show(questIndex); - end - elseif(questID) then - if(IsShiftKeyDown()) then - QuestMapFrame_OpenToQuestDetails(questID); - else - RemoveQuestWatch(questIndex); - if(questID == superTrackedQuestID) then - QuestSuperTracking_OnQuestUntracked(); - end - end - end - end -end ---[[ -########################################################## -TRACKER FUNCTIONS -########################################################## -]]-- -local StartTimer = function(self, duration, elapsed) - local timeNow = GetTime(); - local startTime = timeNow - elapsed; - local timeRemaining = duration - startTime; - - self.Timer:SetHeightToScale(INNER_HEIGHT); - self.Timer:FadeIn(); - self.Timer.Bar.duration = duration or 1; - self.Timer.Bar.startTime = startTime; - self.Timer.Bar:SetMinMaxValues(0, self.Timer.Bar.duration); - self.Timer.Bar:SetValue(timeRemaining); - self.Timer.TimeLeft:SetText(GetTimeStringFromSeconds(duration, nil, true)); - self.Timer.TimeLeft:SetTextColor(MOD:GetTimerTextColor(duration, duration - timeRemaining)); - - self:SetScript("OnUpdate", TimerBar_OnUpdate); -end - -local StopTimer = function(self) - self.Timer:SetHeight(1); - self.Timer:SetAlpha(0); - self.Timer.Bar.duration = 1; - self.Timer.Bar.startTime = 0; - self.Timer.Bar:SetMinMaxValues(0, self.Timer.Bar.duration); - self.Timer.Bar:SetValue(0); - self.Timer.TimeLeft:SetText(''); - self.Timer.TimeLeft:SetTextColor(1,1,1); - - self:SetScript("OnUpdate", nil); -end - -local GetQuestRow = function(self, index) - if(not self.Rows[index]) then - local previousFrame = self.Rows[#self.Rows] - local index = #self.Rows + 1; - local yOffset = -3; - - local anchorFrame; - if(previousFrame and previousFrame.Objectives) then - anchorFrame = previousFrame.Objectives; - yOffset = -6; - else - anchorFrame = self.Header; - end - - local row = CreateFrame("Frame", nil, self) - row:SetPoint("TOPLEFT", anchorFrame, "BOTTOMLEFT", 0, yOffset); - row:SetPoint("TOPRIGHT", anchorFrame, "BOTTOMRIGHT", 0, yOffset); - row:SetHeightToScale(QUEST_ROW_HEIGHT); - - row.Badge = CreateFrame("Frame", nil, row) - row.Badge:SetPoint("TOPLEFT", row, "TOPLEFT", 0, 0); - row.Badge:SetSizeToScale(QUEST_ROW_HEIGHT, QUEST_ROW_HEIGHT); - row.Badge:SetStylePanel("Default", "Headline") - - row.Badge.Icon = row.Badge:CreateTexture(nil,"OVERLAY") - row.Badge.Icon:SetAllPoints(row.Badge); - row.Badge.Icon:SetTexture(QUEST_ICON) - row.Badge.Icon:SetTexCoord(0.05, 0.95, 0.05, 0.95) - - row.Badge.Button = CreateFrame("Button", nil, row.Badge) - row.Badge.Button:SetAllPoints(row.Badge); - row.Badge.Button:SetStylePanel("Button", true, 1, 1, 1) - row.Badge.Button:SetID(0) - row.Badge.Button.Icon = row.Badge.Icon; - row.Badge.Button:RegisterForClicks("LeftButtonUp", "RightButtonUp") - row.Badge.Button:SetScript("OnClick", ActiveButton_OnClick) - - row.Header = CreateFrame("Frame", nil, row) - row.Header:SetPoint("TOPLEFT", row, "TOPLEFT", (QUEST_ROW_HEIGHT + 6), 0); - row.Header:SetPoint("TOPRIGHT", row, "TOPRIGHT", -2, 0); - row.Header:SetHeightToScale(INNER_HEIGHT); - - row.Header.Level = row.Header:CreateFontString(nil,"OVERLAY") - row.Header.Level:SetFont(SV.Media.font.numbers, 11, "NONE") - row.Header.Level:SetShadowOffset(-1,-1) - row.Header.Level:SetShadowColor(0,0,0,0.5) - row.Header.Level:SetJustifyH('RIGHT') - row.Header.Level:SetJustifyV('MIDDLE') - row.Header.Level:SetText('') - row.Header.Level:SetPoint("TOPRIGHT", row.Header, "TOPRIGHT", -4, 0); - row.Header.Level:SetPoint("BOTTOMRIGHT", row.Header, "BOTTOMRIGHT", -4, 0); - - row.Header.Text = row.Header:CreateFontString(nil,"OVERLAY") - row.Header.Text:SetFont(SV.Media.font.default, 13, "NONE") - row.Header.Text:SetTextColor(1,1,0) - row.Header.Text:SetShadowOffset(-1,-1) - row.Header.Text:SetShadowColor(0,0,0,0.5) - row.Header.Text:SetJustifyH('LEFT') - row.Header.Text:SetJustifyV('MIDDLE') - row.Header.Text:SetText('') - row.Header.Text:SetPoint("TOPLEFT", row.Header, "TOPLEFT", 4, 0); - row.Header.Text:SetPoint("BOTTOMRIGHT", row.Header.Level, "BOTTOMLEFT", 0, 0); - - row.Header.Zone = row:CreateFontString(nil,"OVERLAY") - row.Header.Zone:SetAllPoints(row); - row.Header.Zone:SetFont(SV.Media.font.names, 11, "OUTLINE") - row.Header.Zone:SetJustifyH('LEFT') - row.Header.Zone:SetJustifyV('MIDDLE') - row.Header.Zone:SetTextColor(0.75,0.25,1) - row.Header.Zone:SetShadowOffset(-1,-1) - row.Header.Zone:SetShadowColor(0,0,0,0.5) - row.Header.Zone:SetText("") - - row.Button = CreateFrame("Button", nil, row.Header) - row.Button:SetAllPoints(row.Header); - row.Button:SetStylePanel("Button", "Headline", 1, 1, 1) - row.Button:SetID(0) - row.Button:RegisterForClicks("LeftButtonUp", "RightButtonUp") - row.Button:SetScript("OnClick", ViewButton_OnClick); - - row.Timer = CreateFrame("Frame", nil, row) - row.Timer:SetPointToScale("TOPLEFT", row, "BOTTOMLEFT", 0, 4); - row.Timer:SetPointToScale("TOPRIGHT", row, "BOTTOMRIGHT", 0, 4); - row.Timer:SetHeightToScale(INNER_HEIGHT); - - row.Timer.Bar = CreateFrame("StatusBar", nil, row.Timer); - row.Timer.Bar:SetPointToScale("TOPLEFT", row.Timer, "TOPLEFT", 4, -2); - row.Timer.Bar:SetPointToScale("BOTTOMRIGHT", row.Timer, "BOTTOMRIGHT", -4, 2); - row.Timer.Bar:SetStatusBarTexture(SV.Media.bar.default) - row.Timer.Bar:SetStatusBarColor(0.5,0,1) --1,0.15,0.08 - row.Timer.Bar:SetMinMaxValues(0, 1) - row.Timer.Bar:SetValue(0) - - local bgFrame = CreateFrame("Frame", nil, row.Timer.Bar) - bgFrame:SetAllPointsIn(row.Timer.Bar, -2, -2) - bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) - - bgFrame.bg = bgFrame:CreateTexture(nil, "BACKGROUND") - bgFrame.bg:SetAllPoints(bgFrame) - bgFrame.bg:SetTexture(SV.Media.bar.default) - bgFrame.bg:SetVertexColor(0,0,0,0.5) - - local borderB = bgFrame:CreateTexture(nil,"OVERLAY") - borderB:SetTexture(0,0,0) - borderB:SetPoint("BOTTOMLEFT") - borderB:SetPoint("BOTTOMRIGHT") - borderB:SetHeight(2) - - local borderT = bgFrame:CreateTexture(nil,"OVERLAY") - borderT:SetTexture(0,0,0) - borderT:SetPoint("TOPLEFT") - borderT:SetPoint("TOPRIGHT") - borderT:SetHeight(2) - - local borderL = bgFrame:CreateTexture(nil,"OVERLAY") - borderL:SetTexture(0,0,0) - borderL:SetPoint("TOPLEFT") - borderL:SetPoint("BOTTOMLEFT") - borderL:SetWidth(2) - - local borderR = bgFrame:CreateTexture(nil,"OVERLAY") - borderR:SetTexture(0,0,0) - borderR:SetPoint("TOPRIGHT") - borderR:SetPoint("BOTTOMRIGHT") - borderR:SetWidth(2) - - row.Timer.TimeLeft = row.Timer.Bar:CreateFontString(nil,"OVERLAY"); - row.Timer.TimeLeft:SetAllPointsIn(row.Timer.Bar); - row.Timer.TimeLeft:SetFont(SV.Media.font.numbers, 12, "OUTLINE") - row.Timer.TimeLeft:SetTextColor(1,1,1) - row.Timer.TimeLeft:SetShadowOffset(-1,-1) - row.Timer.TimeLeft:SetShadowColor(0,0,0,0.5) - row.Timer.TimeLeft:SetJustifyH('CENTER') - row.Timer.TimeLeft:SetJustifyV('MIDDLE') - row.Timer.TimeLeft:SetText('') - - row.Timer:SetHeight(1); - row.Timer:SetAlpha(0); - - row.StartTimer = StartTimer; - row.StopTimer = StopTimer; - - row.Objectives = MOD:NewObjectiveHeader(row); - row.Objectives:SetPoint("TOPLEFT", row.Timer, "BOTTOMLEFT", 0, 0); - row.Objectives:SetPoint("TOPRIGHT", row.Timer, "BOTTOMRIGHT", 0, 0); - row.Objectives:SetHeight(1); - - row.RowID = 0; - self.Rows[index] = row; - return row; - end - - return self.Rows[index]; -end - -local SetQuestRow = function(self, index, watchIndex, title, level, icon, questID, questLogIndex, subCount, duration, elapsed, completed, questType) - index = index + 1; - - local fill_height = 0; - local iscomplete = true; - local objective_rows = 0; - local row = self:Get(index); - - if(not icon) then - icon = completed and QUEST_ICON_COMPLETE or QUEST_ICON - end - local color = DEFAULT_COLOR - if(level and type(level) == 'number') then - color = GetQuestDifficultyColor(level); - end - - row.Header:SetAlpha(1); - row.Header.Zone:SetText('') - row.Header.Level:SetTextColor(color.r, color.g, color.b) - row.Header.Level:SetText(level) - row.Header.Text:SetTextColor(color.r, color.g, color.b) - row.Header.Text:SetText(title) - row.Badge.Icon:SetTexture(icon); - row.Badge.Button:Enable(); - row.Badge.Button:SetID(watchIndex); - row.Badge:SetAlpha(1); - row.Button:SetAlpha(1); - row.Button:Enable(); - row.Button:SetID(questLogIndex); - row:SetHeightToScale(QUEST_ROW_HEIGHT); - row:FadeIn(); - - local objective_block = row.Objectives; - objective_block:Reset(); - - for i = 1, subCount do - local description, category, objective_completed = GetQuestObjectiveInfo(questID, i); - if not objective_completed then iscomplete = false end - if(description) then - fill_height = fill_height + (INNER_HEIGHT + 2); - objective_rows = objective_block:SetInfo(objective_rows, description, objective_completed); - end - end - - if(duration) then - if(elapsed and elapsed < duration) then - fill_height = fill_height + (INNER_HEIGHT + 2); - row:StartTimer(duration, elapsed) - end - end - - if(objective_rows > 0) then - objective_block:SetHeightToScale(fill_height); - objective_block:FadeIn(); - end - - if(iscomplete) then MOD.QuestItem:RemoveItem(questLogIndex) end - - fill_height = fill_height + (QUEST_ROW_HEIGHT + 6); - - return index, fill_height; -end - -local SetZoneHeader = function(self, index, mapID) - index = index + 1; - local row = self:Get(index); - row.Header.Level:SetText(''); - row.Header.Text:SetText(''); - row.Badge.Icon:SetTexture(NO_ICON); - row.Badge.Button:SetID(0); - row.Badge:SetAlpha(0); - row.Button:SetID(0); - row.Button:Disable(); - row.Button:SetAlpha(0); - row.Badge.Button:Disable(); - if(not mapID or (mapID and mapID == 0)) then - return index, 4 - end - local zoneName = GetMapNameByID(mapID); ---0.75,0.31,1 - row.Header.Zone:SetTextColor(1,0.31,0.1) - row.Header.Zone:SetText(zoneName); - row:SetHeightToScale(ROW_HEIGHT); - row:SetAlpha(1); - - local objective_block = row.Objectives; - objective_block:Reset(); - return index, mapID; -end - -local RefreshQuests = function(self, event, ...) - -- print('<-----QUESTS') - -- print(event) - -- print(...) - local rows = 0; - local fill_height = 0; - local zone = 0; - - for i = 1, #CACHED_QUESTS do - local quest = CACHED_QUESTS[i]; - local args = quest[7]; - if(quest[1] ~= 0 and args[4] ~= 0) then - local add_height = 0; - if(quest[6] and (not args[9])) then - MOD.QuestItem:SetAbility(quest[2], args[3], unpack(args)) - end - - if(zone ~= quest[3]) then - rows, zone = self:SetZone(rows, quest[3]); - fill_height = fill_height + QUEST_ROW_HEIGHT; - end - rows, add_height = self:Set(rows, quest[1], unpack(args)) - fill_height = fill_height + add_height; - end - end - - if(rows == 0 or (fill_height <= 1)) then - self:SetHeight(1); - self:SetAlpha(0); - else - self:SetHeightToScale(fill_height + 2); - self:FadeIn(); - end -end - -local AddOneQuest = function(self, event, ...) - -- print('<-----QUESTS') - -- print(event) - -- print(...) - local rows = #CACHED_QUESTS; - local fill_height = self:GetHeight(); - - local quest = CACHED_QUESTS[rows]; - local args = quest[7]; - if(quest[1] ~= 0 and args[4] ~= 0) then - local add_height = 0; - rows, add_height = self:Set(rows, quest[1], unpack(args)) - fill_height = fill_height + add_height; - end - - self:SetHeightToScale(fill_height + 2); -end - -local ResetQuestBlock = function(self) - for x = 1, #self.Rows do - local row = self.Rows[x] - if(row) then - row.Header.Text:SetText(''); - row.Header:SetAlpha(0); - row.Header.Zone:SetText(''); - row.Button:SetID(0); - row.Button:Disable(); - row.Badge.Button:SetID(0); - row.Badge.Icon:SetTexture(NO_ICON); - row.Badge:SetAlpha(0); - row.Badge.Button:Disable(); - row:SetHeight(1); - row:SetAlpha(0); - row.Objectives:Reset(); - end - end -end - -local LiteResetQuestBlock = function(self) - for x = 1, #self.Rows do - local row = self.Rows[x] - if(row) then - row.Objectives:Reset(true); - end - end -end - -local _hook_WorldMapFrameOnHide = function() - if(not WORLDMAP_UPDATE) then return end - UpdateCachedQuests(); - MOD.Headers["Quests"]:Reset() - MOD.Headers["Quests"]:Refresh() - MOD:UpdateDimensions(); -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function MOD:UpdateObjectives(event, ...) - if(event == "ZONE_CHANGED_NEW_AREA") then - if(not WorldMapFrame:IsShown() and GetCVarBool("questPOI")) then - SetMapToCurrentZone(); - CURRENT_MAP_ID = GetCurrentMapAreaID(); - UpdateCachedDistance(); - self.Headers["Quests"]:LiteReset() - end - elseif(event == "ZONE_CHANGED") then - local inMicroDungeon = IsPlayerInMicroDungeon(); - if(inMicroDungeon ~= self.inMicroDungeon) then - if(not WorldMapFrame:IsShown() and GetCVarBool("questPOI")) then - SetMapToCurrentZone(); - CURRENT_MAP_ID = GetCurrentMapAreaID(); - UpdateCachedDistance(); - self.Headers["Quests"]:LiteReset() - end - self.inMicroDungeon = inMicroDungeon; - end - else --- print('<-----QUESTS') --- print(event) --- print(...) - if(event == "QUEST_ACCEPTED" or event == "QUEST_WATCH_LIST_CHANGED") then - local questLogIndex, questID, isTracked; - if(event == "QUEST_ACCEPTED") then - questLogIndex, questID = ...; - if(AUTO_QUEST_WATCH == "1") then - AddQuestWatch(questLogIndex); - QuestSuperTracking_OnQuestTracked(questID); - end - if(AddCachedQuest(questLogIndex)) then - self.Headers["Quests"]:AddQuest(event, ...) - self:UpdateDimensions(); - end - elseif(event == "QUEST_WATCH_LIST_CHANGED") then - questID, isTracked = ...; - if(questID) then - local questLogIndex = GetQuestLogIndexByID(questID) - if(isTracked and AddCachedQuest(questLogIndex)) then - self.Headers["Quests"]:AddQuest(event, ...) - else - UpdateCachedQuests(); - self.Headers["Quests"]:Refresh(event, ...) - end - self:UpdateDimensions(); - end - end - return; - elseif(event == "QUEST_TURNED_IN") then - self.Headers["Quests"]:Reset() - local questID, XP, Money = ... - self:CheckActiveQuest(questID) - UpdateCachedQuests(); - self.Headers["Quests"]:Refresh(event, ...) - self:UpdateDimensions(); - return; - elseif(event == "QUEST_LOG_UPDATE") then - self.Headers["Quests"]:Reset() - UpdateCachedQuests(); - self.Headers["Quests"]:Refresh(event, ...) - self:UpdateDimensions(); - return; - else - self:UpdateBonusObjective(event, ...) - -- UpdateCachedQuests(); - -- self.Headers["Quests"]:Refresh(event, ...) - -- self:UpdateDimensions(); - return; - end - end -end - -local function UpdateQuestLocals(...) - ROW_WIDTH, ROW_HEIGHT, INNER_HEIGHT, LARGE_ROW_HEIGHT, LARGE_INNER_HEIGHT = ...; - QUEST_ROW_HEIGHT = ROW_HEIGHT + 2; -end - -SV.Events:On("QUEST_UPVALUES_UPDATED", "UpdateQuestLocals", UpdateQuestLocals); - -function MOD:InitializeQuests() - local scrollChild = self.Docklet.ScrollFrame.ScrollChild; - - local quests = CreateFrame("Frame", nil, scrollChild) - quests:SetWidth(ROW_WIDTH); - quests:SetHeightToScale(ROW_HEIGHT); - quests:SetPoint("TOPLEFT", self.Headers["Bonus"], "BOTTOMLEFT", 0, -4); - --quests:SetStylePanel() - - quests.Header = CreateFrame("Frame", nil, quests) - quests.Header:SetPoint("TOPLEFT", quests, "TOPLEFT", 2, -2); - quests.Header:SetPoint("TOPRIGHT", quests, "TOPRIGHT", -2, -2); - quests.Header:SetHeightToScale(INNER_HEIGHT); - - quests.Header.Text = quests.Header:CreateFontString(nil,"OVERLAY") - quests.Header.Text:SetPoint("TOPLEFT", quests.Header, "TOPLEFT", 2, 0); - quests.Header.Text:SetPoint("BOTTOMLEFT", quests.Header, "BOTTOMLEFT", 2, 0); - quests.Header.Text:SetFont(SV.Media.font.narrator, 16, "OUTLINE") - quests.Header.Text:SetJustifyH('LEFT') - quests.Header.Text:SetJustifyV('MIDDLE') - quests.Header.Text:SetTextColor(0.28,0.75,1) - quests.Header.Text:SetShadowOffset(-1,-1) - quests.Header.Text:SetShadowColor(0,0,0,0.5) - quests.Header.Text:SetText(TRACKER_HEADER_QUESTS) - - quests.Header.Divider = quests.Header:CreateTexture(nil, 'BACKGROUND'); - quests.Header.Divider:SetPoint("TOPLEFT", quests.Header.Text, "TOPRIGHT", -10, 0); - quests.Header.Divider:SetPoint("BOTTOMRIGHT", quests.Header, "BOTTOMRIGHT", 0, 0); - quests.Header.Divider:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DROPDOWN-DIVIDER]]); - - quests.Rows = {}; - - quests.Get = GetQuestRow; - quests.Set = SetQuestRow; - quests.SetZone = SetZoneHeader; - quests.Refresh = RefreshQuests; - quests.AddQuest = AddOneQuest; - quests.Reset = ResetQuestBlock; - quests.LiteReset = LiteResetQuestBlock; - - self.Headers["Quests"] = quests; - - self:RegisterEvent("QUEST_LOG_UPDATE", self.UpdateObjectives); - self:RegisterEvent("QUEST_WATCH_LIST_CHANGED", self.UpdateObjectives); - self:RegisterEvent("QUEST_ACCEPTED", self.UpdateObjectives); - self:RegisterEvent("QUEST_POI_UPDATE", self.UpdateObjectives); - self:RegisterEvent("QUEST_TURNED_IN", self.UpdateObjectives); - - self:RegisterEvent("ZONE_CHANGED_NEW_AREA", self.UpdateObjectives); - self:RegisterEvent("ZONE_CHANGED", self.UpdateObjectives); - - self.Headers["Quests"]:Refresh() - - WorldMapFrame:HookScript("OnHide", _hook_WorldMapFrameOnHide) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index 015a947..0c4b204 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -310,13 +310,14 @@ local function tiplevel(this, start) end local function tipbackground(this) - this:SetBackdropColor(0, 0, 0, 1) + this:SetBackdropColor(0, 0, 0, 0.8) + --this:SetBackdropBorderColor(0, 0, 0, 1) if(this.SuperBorder) then this.SuperBorder:SetBackdropColor(0, 0, 0, 0.8) if(not GameTooltipStatusBar:IsShown()) then this.SuperBorder:ClearAllPoints() - this.SuperBorder:SetPoint("TOPLEFT", this, "TOPLEFT", 0, 0) - this.SuperBorder:SetPoint("BOTTOMRIGHT", this, "BOTTOMRIGHT", 0, 0) + this.SuperBorder:SetPoint("TOPLEFT", this, "TOPLEFT", -1, 1) + this.SuperBorder:SetPoint("BOTTOMRIGHT", this, "BOTTOMRIGHT", 1, -1) end end end @@ -331,13 +332,14 @@ local function tipupdate(this, color, hasStatusBar) local borderColor = color or NIL_COLOR local yOffset = (hasStatusBar) and mask.ToggleHeight or 0; mask:ClearAllPoints() - mask:SetPoint("TOPLEFT", this, "TOPLEFT", 0, 0) - mask:SetPoint("BOTTOMRIGHT", this, "BOTTOMRIGHT", 0, yOffset) + mask:SetPoint("TOPLEFT", this, "TOPLEFT", -1, 1) + mask:SetPoint("BOTTOMRIGHT", this, "BOTTOMRIGHT", 1, yOffset) mask:SetMaskBorderColor(borderColor.r, borderColor.g, borderColor.b, hasStatusBar) end end local _hook_GameTooltip_OnTooltipSetUnit = function(self) + --print('SetUnit: ' .. self:GetName()) tipbackground(self) local unit = select(2, self:GetUnit()) @@ -691,8 +693,8 @@ local TooltipModifierChangeHandler = function(self, event, mod) end local Override_BGColor = function(self, r, g, b, a) - if(((r ~= 0) and (g ~= 0) and (b ~= 0)) or (a and a ~= 0)) then - self:SetBackdropColor(0, 0, 0, 0) + if((r ~= 0) and (g ~= 0) and (b ~= 0)) then + self:SetBackdropColor(0, 0, 0, 0.8) self.SuperBorder:SetBackdropColor(r, g, b, 0.8) end end @@ -708,7 +710,7 @@ local _hook_OnTipCleared = function(self) end local _hook_OnTipShow = function(self) - --print('Show') + --print('Showing: ' .. self:GetName()) tipbackground(self) end @@ -749,8 +751,8 @@ local function ApplyTooltipSkins() end local mask = CreateFrame("Frame", nil, tooltip) - mask:SetPoint("TOPLEFT", tooltip, "TOPLEFT", 0, 0) - mask:SetPoint("BOTTOMRIGHT", tooltip, "BOTTOMRIGHT", 0, barOffset) + mask:SetPoint("TOPLEFT", tooltip, "TOPLEFT", -1, 1) + mask:SetPoint("BOTTOMRIGHT", tooltip, "BOTTOMRIGHT", 1, barOffset) mask:SetFrameLevel(0) mask.ToggleHeight = barOffset mask.ToggleAlpha = alpha @@ -820,7 +822,7 @@ local function ApplyTooltipSkins() tile = true, tileSize = 128, }) - mask:SetBackdropColor(0, 0, 0, 1) + mask:SetBackdropColor(0, 0, 0, 0.8) mask:SetBackdropBorderColor(0, 0, 0) mask.SetMaskBorderColor = SetMaskBorderColor @@ -875,11 +877,12 @@ local function ApplyTooltipSkins() tile = true, tileSize = 128, }) - tooltip:SetBackdropColor(0, 0, 0, 0) - --tooltip:SetBackdropBorderColor(0, 0, 0, 0) + tooltip:SetBackdropColor(0, 0, 0, 0.8) + --tooltip:SetBackdropBorderColor(0, 0, 0, 1) NewHook(tooltip, "SetBackdropColor", Override_BGColor) --NewHook(tooltip, "SetBackdropBorderColor", Override_BorderColor) + --NewHook(tooltip, "Show", _hook_OnTipShow) tooltip:HookScript("OnShow", _hook_OnTipShow) tooltip:HookScript("OnHide", _hook_OnTipHide) tooltip:HookScript("OnSizeChanged", _hook_OnSizeChanged) @@ -954,6 +957,7 @@ function MOD:Load() --NewHook("GameTooltip_ShowCompareItem", _hook_GameTooltip_ShowCompareItem) -- BROKEN IN WOD, REMOVING NOW + --NewHook(GameTooltip, "AddLine", _hook_OnTipShow) NewHook(GameTooltip, "SetUnitAura", _hook_OnSetUnitAura) NewHook(GameTooltip, "SetUnitBuff", _hook_OnSetUnitAura) NewHook(GameTooltip, "SetUnitDebuff", _hook_OnSetUnitAura) diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index 06dcf7e..3554e06 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -314,7 +314,7 @@ CONSTRUCTORS["player"] = function(self, unit) self.Resting = MOD:CreateRestingIndicator(self) self.Combat = MOD:CreateCombatIndicator(self) self.PvPText = self.TextGrip:CreateFontString(nil,'OVERLAY') - self.PvPText:FontManager("name") + self.PvPText:FontManager("dialog") self.Afflicted = MOD:CreateAfflicted(self) self.HealPrediction = MOD:CreateHealPrediction(self, true) self.AuraBars = MOD:CreateAuraBarHeader(self, key) @@ -909,7 +909,7 @@ CONSTRUCTORS["arena"] = function(self, unit) prep.SpecIcon = icon local text = prep.Health:CreateFontString(nil, "OVERLAY") - text:SetFont(SV.Media.font.names, 16, "OUTLINE") + text:SetFont(SV.Media.font.dialog, 16, "OUTLINE") text:SetTextColor(1, 1, 1) text:SetPoint("CENTER") prep.SpecClass = text diff --git a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua index 0bb9180..a8743b9 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua @@ -38,7 +38,7 @@ if(not MOD) then return end SV.SpecialFX:Register("trap_fire", [[Spells\Fireshot_missile.m2]], -12, 12, 12, -12, 0.4, 0, 0.2) SV.SpecialFX:Register("trap_ice", [[Spells\Frostshot_missile.m2]], -12, 12, 12, -12, 0.4, 0, 0.18) -SV.SpecialFX:Register("trap_frost", [[Spells\Blindingshot_missile.m2]], -12, 12, 12, -12, 0.4, 0, 0.2) +SV.SpecialFX:Register("trap_frost", [[Spells\Blindingshot_missile.m2]], -12, 12, 12, -12, 0.4, -0.2, 0.3) SV.SpecialFX:Register("trap_snake", [[Spells\Poisonshot_missile.m2]], -12, 12, 12, -12, 0.4, 0, -0.21) local specEffects = { [1] = "trap_fire", @@ -95,25 +95,27 @@ local TrapUpdate = function(self, isReady) end end -local SnakeTrapUpdate = function(self, isReady, isSnake) - if(isReady) then - if(not self.FX:IsShown()) then - self.FX:Show() +local SnakeTrapUpdate = function(self, isReady, isSnake, bypass) + if((isSnake ~= nil) and (isSnake ~= HAS_SNAKE_TRAP)) then + if(isSnake == true) then + specEffects[3] = "trap_snake" + else + specEffects[3] = "trap_frost" end - if((isSnake ~= nil) and (isSnake ~= HAS_SNAKE_TRAP)) then - if(isSnake == true) then - specEffects[3] = "trap_snake" - else - specEffects[3] = "trap_frost" - end - HAS_SNAKE_TRAP = isSnake + HAS_SNAKE_TRAP = isSnake - self.FX:SetEffect(specEffects[3]) - else + self.FX:SetEffect(specEffects[3]) + end + + if(not bypass) then + if(isReady) then + if(not self.FX:IsShown()) then + self.FX:Show() + end self.FX:UpdateEffect() + else + self.FX:Hide() end - else - self.FX:Hide() end end diff --git a/Interface/AddOns/SVUI/setup/installer.lua b/Interface/AddOns/SVUI/setup/installer.lua index b82bb18..9cda85d 100644 --- a/Interface/AddOns/SVUI/setup/installer.lua +++ b/Interface/AddOns/SVUI/setup/installer.lua @@ -319,13 +319,13 @@ function SV.Setup:ChatConfigs(mungs) local ChatFrame2 = _G.ChatFrame2; FCF_DockFrame(ChatFrame2) - FCF_SetLocked(ChatFrame2, 1) + FCF_SetLocked(ChatFrame2, 2) FCF_OpenNewWindow(LOOT) local ChatFrame3 = _G.ChatFrame3; FCF_DockFrame(ChatFrame3) - FCF_SetLocked(ChatFrame3, 1) + FCF_SetLocked(ChatFrame3, 3) for i = 1, NUM_CHAT_WINDOWS do local chat = _G["ChatFrame"..i] @@ -1190,7 +1190,7 @@ function SV.Setup:Install(autoLoaded) frame.Status:SetText(CURRENT_PAGE.." / "..MAX_PAGE) local titleHolder = frame:CreateFontString(nil, "OVERLAY") - titleHolder:SetFont(SV.Media.font.names, 22, "OUTLINE") + titleHolder:SetFont(SV.Media.font.dialog, 22, "OUTLINE") titleHolder:SetPointToScale("TOP", 0, -5) titleHolder:SetText(L["Supervillain UI Installation"]) diff --git a/Interface/AddOns/SVUI/system/media.lua b/Interface/AddOns/SVUI/system/media.lua index bbcfbfc..22f0c5a 100644 --- a/Interface/AddOns/SVUI/system/media.lua +++ b/Interface/AddOns/SVUI/system/media.lua @@ -192,11 +192,11 @@ do local ir2,ig2,ib2 = (1 - cColor2.r)*.25, (1 - cColor2.g)*.25, (1 - cColor2.b)*.25 local Shared = LSM - local NAMEFONT; + local DIALOGUE_FONT; if(GetLocale() ~= "enUS") then - NAMEFONT = Shared:Fetch("font", "SVUI Clean Font") + DIALOGUE_FONT = Shared:Fetch("font", "SVUI Default Font") else - NAMEFONT = Shared:Fetch("font", "SVUI Name Font") + DIALOGUE_FONT = Shared:Fetch("font", "SVUI Name Font") end SV.Media["color"] = { @@ -233,7 +233,7 @@ do ["pixel"] = Shared:Fetch("font", "SVUI Pixel Font"), ["caps"] = Shared:Fetch("font", "SVUI Caps Font"), ["flash"] = Shared:Fetch("font", "SVUI Flash Font"), - ["names"] = NAMEFONT, + ["dialog"] = DIALOGUE_FONT, } SV.Media["bar"] = { @@ -333,12 +333,30 @@ function SV:MediaUpdate() self.Events:Trigger("SVUI_COLORS_UPDATED"); end +local function UpdateChatFontSizes() + _G.CHAT_FONT_HEIGHTS[1] = 8 + _G.CHAT_FONT_HEIGHTS[2] = 9 + _G.CHAT_FONT_HEIGHTS[3] = 10 + _G.CHAT_FONT_HEIGHTS[4] = 11 + _G.CHAT_FONT_HEIGHTS[5] = 12 + _G.CHAT_FONT_HEIGHTS[6] = 13 + _G.CHAT_FONT_HEIGHTS[7] = 14 + _G.CHAT_FONT_HEIGHTS[8] = 15 + _G.CHAT_FONT_HEIGHTS[9] = 16 + _G.CHAT_FONT_HEIGHTS[10] = 17 + _G.CHAT_FONT_HEIGHTS[11] = 18 + _G.CHAT_FONT_HEIGHTS[12] = 19 + _G.CHAT_FONT_HEIGHTS[13] = 20 +end + +hooksecurefunc("FCF_ResetChatWindows", UpdateChatFontSizes) + function SV:RefreshSystemFonts() local fontsize = self.db.font.default.size local highlight_fontsize = fontsize + 1; local caps_fontsize = self.db.font.caps.size; local number_fontsize = self.db.font.number.size; - local name_fontsize = self.db.font.name.size; + local dialog_fontsize = self.db.font.dialog.size; local zone_fontsize = self.db.font.zone.size; local alert_fontsize = self.db.font.alert.size; local combat_fontsize = self.db.font.combat.size; @@ -346,13 +364,13 @@ function SV:RefreshSystemFonts() local NUMBER_TEXT_FONT = LSM:Fetch("font", self.db.font.number.file); local ALERT_TEXT_FONT = LSM:Fetch("font", self.db.font.alert.file); local ZONE_TEXT_FONT = LSM:Fetch("font", self.db.font.zone.file); - local CAPS_TEXT_FONT = LSM:Fetch("font", self.db.font.caps.file); + local DIALOG_FONT = LSM:Fetch("font", self.db.font.dialog.file); STANDARD_TEXT_FONT = LSM:Fetch("font", self.db.font.default.file); - UNIT_NAME_FONT = LSM:Fetch("font", self.db.font.name.file); + UNIT_NAME_FONT = LSM:Fetch("font", self.db.font.caps.file); DAMAGE_TEXT_FONT = LSM:Fetch("font", self.db.font.combat.file); NAMEPLATE_FONT = STANDARD_TEXT_FONT - CHAT_FONT_HEIGHTS = {8,9,10,11,12,13,14,15,16,17,18,19,20} + UpdateChatFontSizes() UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontsize SetFont("Game18Font", NUMBER_TEXT_FONT, 12) @@ -399,9 +417,9 @@ function SV:RefreshSystemFonts() SetFont("SystemFont_Shadow_Small", STANDARD_TEXT_FONT, fontsize) SetFont("SystemFont_Shadow_Large", STANDARD_TEXT_FONT, fontsize+3) - SetFont("QuestFont", UNIT_NAME_FONT, name_fontsize); - SetFont("SpellFont_Small", UNIT_NAME_FONT, name_fontsize, "OUTLINE", 1, 1, 1); - SetFont("SystemFont_Shadow_Outline_Huge2", UNIT_NAME_FONT, name_fontsize+14, "OUTLINE"); + SetFont("QuestFont", DIALOG_FONT, dialog_fontsize); + SetFont("SpellFont_Small", DIALOG_FONT, dialog_fontsize, "OUTLINE", 1, 1, 1); + SetFont("SystemFont_Shadow_Outline_Huge2", DIALOG_FONT, dialog_fontsize+14, "OUTLINE"); SetFont("NumberFont_OutlineThick_Mono_Small", NUMBER_TEXT_FONT, number_fontsize, "OUTLINE") SetFont("NumberFont_Outline_Huge", NUMBER_TEXT_FONT, number_fontsize+6, "OUTLINE", 28) diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/fonts.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/fonts.lua index 61cd5cc..c69b54c 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/components/fonts.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/components/fonts.lua @@ -37,19 +37,28 @@ local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists; local FONT_GROUP_SORT = { {"Default", 1, {"default"}}, - {"General", 2, {"name", "number", "aura"}}, - {"Large", 3, {"combat", "alert", "zone", "title"}}, - {"Docking", 4, {"data"}}, - {"Misc", 5, {"narrator", "caps"}}, + {"General", 2, {"dialog", "number", "aura", "chat", "chattab"}}, + {"Large", 3, {"combat", "alert", "zone", "title", "number_big"}}, + {"QuestTracker", 4, {"questdialog", "questheader", "questnumber"}}, + {"Misc", 5, {"data", "narrator", "caps"}}, {"NamePlate", 6, {"platename", "plateaura"}}, {"UnitFrame", 7, {"unitprimary", "unitsecondary", "unitaurabar", "unitaurasmall", "unitauramedium", "unitauralarge"}}, -} +}; +local FONT_GROUP_TITLES = { + ["Default"] = "The most commonly used font in SVUI.", + ["General"] = "These fonts are found more often than the rest.", + ["Large"] = "Large versions of the common fonts.", + ["QuestTracker"] = "Fonts used in the SVUI Quest Tracker.", + ["Misc"] = "Fonts used in various places including the docks.", + ["NamePlate"] = "Fonts used in SVUI Name Plates.", + ["UnitFrame"] = "Fonts used in SVUI Unit Frames.", +}; local function GenerateFontGroup() local fontGroupArgs = {}; for _, listData in pairs(FONT_GROUP_SORT) do - local orderCount = 1; + local orderCount = 3; local groupName = listData[1]; local groupCount = listData[2]; local groupList = listData[3]; @@ -57,10 +66,24 @@ local function GenerateFontGroup() order = groupCount, type = "group", name = groupName, - args = {}, + args = { + overview = { + order = 1, + name = FONT_GROUP_TITLES[groupName], + type = "description", + width = "full", + }, + spacer0 = { + order = 2, + name = "", + type = "description", + width = "full", + }, + }, }; for _, template in pairs(groupList) do local data = SV.db.font[template] + if(not data) then print(template) return end fontGroupArgs[groupName].args[template] = { order = orderCount, type = "group", diff --git a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua index c9f36e5..0e4f6db 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua @@ -306,7 +306,7 @@ function PLUGIN:ChangeModeGear() end function PLUGIN:UpdateLogWindow() - self.LogWindow:SetFont(SV.Media.font.names, self.db.fontSize, "OUTLINE") + self.LogWindow:SetFont(SV.Media.font.dialog, self.db.fontSize, "OUTLINE") end function PLUGIN:SKILL_LINES_CHANGED() diff --git a/Interface/AddOns/SVUI_FightOMatic/Loader.lua b/Interface/AddOns/SVUI_FightOMatic/Loader.lua index 9ecd284..5ded6ba 100644 --- a/Interface/AddOns/SVUI_FightOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_FightOMatic/Loader.lua @@ -46,5 +46,5 @@ SV.Options.args.plugins.args.pluginOptions.args[Schema].args["annoyingEmotes"] = desc = L["Aggravate your opponents (and team-mates) with incessant emotes"], type = "toggle", get = function(key) return PLUGIN.db.annoyingEmotes end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); end } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua index f502744..cb4b49f 100644 --- a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua +++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua @@ -607,15 +607,17 @@ local function ParseIncomingLog(timestamp, event, eGuid, eName, pGuid) end end -local function GetSourceType(guid) +local function CheckSourceType(guid, flags) if not guid then return end - local subStr, binStr, bitVal, srcType - subStr = guid:sub(3, 5) - binStr = ("0x%s"):format(subStr) - bitVal = tonumber(binStr) - if(not bitVal) then return end - srcType = band(bitVal, 0x00F) - return srcType + local isHostile = false; + if(flags) then + isHostile = CombatLog_Object_IsA(flags, COMBATLOG_FILTER_HOSTILE_PLAYERS) + end + local srcType = strsub(guid, 1,6) + if((srcType == "Player") and (isHostile == true)) then + return true + end + return false end function PLUGIN:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, _, spellName) @@ -625,9 +627,7 @@ function PLUGIN:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, event, _, srcGUID, src if(flagged) then if(srcGUID and srcName) then - local isHostile = CombatLog_Object_IsA(srcFlags, COMBATLOG_FILTER_HOSTILE_PLAYERS) - local srcType = GetSourceType(srcGUID) - if(srcType and (srcType == 0 or srcType == 8) and isHostile) then + if(CheckSourceType(srcGUID, srcFlags)) then if(event == "SPELL_AURA_APPLIED" and (spellName == L["Stealth"] or spellName == L["Prowl"])) then StealthAlarm(spellName, srcName) end @@ -640,9 +640,7 @@ function PLUGIN:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, event, _, srcGUID, src end if(PLUGIN.Scanning and dstGUID and dstName) then - local isHostile = CombatLog_Object_IsA(dstFlags, COMBATLOG_FILTER_HOSTILE_PLAYERS) - local srcType = GetSourceType(dstGUID) - if(srcType and (srcType == 0 or srcType == 8) and isHostile) then + if(CheckSourceType(dstGUID, dstFlags)) then ParseIncomingLog(timestamp, event, dstGUID, dstName, srcGUID) end end @@ -710,7 +708,7 @@ local function MakeLogWindow() output:SetClampedToScreen(false) output:SetFrameStrata("MEDIUM") output:SetAllPoints(frame) - output:SetFont(SV.Media.font.names, 11, "OUTLINE") + output:SetFont(SV.Media.font.dialog, 11, "OUTLINE") output:SetJustifyH("CENTER") output:SetJustifyV("MIDDLE") output:SetShadowColor(0, 0, 0, 0) diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index fa0ef46..c485aae 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -525,13 +525,13 @@ function PLUGIN:Load() alert:SetPoint('CENTER', UIParent, 'CENTER'); alert:SetFrameStrata('DIALOG'); alert.Text = alert:CreateFontString(nil, "OVERLAY"); - alert.Text:SetFont(SV.Media.font.names, 12); + alert.Text:SetFont(SV.Media.font.dialog, 12); alert.Text:SetPoint('TOP', alert, 'TOP', 0, -10); alert.Accept = CreateFrame('Button', nil, alert); alert.Accept:SetSize(70, 25); alert.Accept:SetPoint('RIGHT', alert, 'BOTTOM', -10, 20); alert.Accept.Text = alert.Accept:CreateFontString(nil, "OVERLAY"); - alert.Accept.Text:SetFont(SV.Media.font.names, 10); + alert.Accept.Text:SetFont(SV.Media.font.dialog, 10); alert.Accept.Text:SetPoint('CENTER'); alert.Accept.Text:SetText(_G.YES); alert.Close = CreateFrame('Button', nil, alert); @@ -539,7 +539,7 @@ function PLUGIN:Load() alert.Close:SetPoint('LEFT', alert, 'BOTTOM', 10, 20); alert.Close:SetScript('OnClick', function(this) this:GetParent():Hide() end); alert.Close.Text = alert.Close:CreateFontString(nil, "OVERLAY"); - alert.Close.Text:SetFont(SV.Media.font.names, 10); + alert.Close.Text:SetFont(SV.Media.font.dialog, 10); alert.Close.Text:SetPoint('CENTER'); alert.Close.Text:SetText(_G.NO); alert.Accept:SetStylePanel("Button"); diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua index 8d31f14..edf9b8b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DBM.lua @@ -189,7 +189,7 @@ local StyleBoss = function() bar:SetHeight(22) name:SetPointToScale('LEFT', bar, 'LEFT', 4, 0) timer:SetPointToScale('RIGHT', bar, 'RIGHT', -4, 0) - name:FontManager("name") + name:FontManager("dialog") timer:FontManager("default") count = count + 1 end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DXE.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DXE.lua index f93510f..11de4bb 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/DXE.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/DXE.lua @@ -129,7 +129,7 @@ local function StyleDXE() DXEDB["profiles"][playerKey]["Globals"]["BackgroundTexture"] = [[Interface\BUTTONS\WHITE8X8]] DXEDB["profiles"][playerKey]["Globals"]["BarTexture"] = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]] DXEDB["profiles"][playerKey]["Globals"]["Border"] = "None" - DXEDB["profiles"][playerKey]["Globals"]["Font"] = SV.Media.font.names - DXEDB["profiles"][playerKey]["Globals"]["TimerFont"] = SV.Media.font.names + DXEDB["profiles"][playerKey]["Globals"]["Font"] = SV.Media.font.dialog + DXEDB["profiles"][playerKey]["Globals"]["TimerFont"] = SV.Media.font.dialog end PLUGIN:SaveAddonStyle("DXE", StyleDXE) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua index cdc3c14..c56d408 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Skada.lua @@ -116,7 +116,7 @@ local function StyleSkada() skada.button:SetStylePanel("Default", "Transparent") --skada.button:SetPanelColor("class") local titleFont = skada.button:GetFontString() - titleFont:SetFont(SVUI.Media.font.names, 13, "NONE") + titleFont:SetFont(SVUI.Media.font.dialog, 13, "NONE") titleFont:SetShadowColor(0, 0, 0, 1) titleFont:SetShadowOffset(1, -1) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/VEM.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/VEM.lua index ad54f0a..4ae363e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/VEM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/VEM.lua @@ -114,8 +114,8 @@ local function StyleBars(self) name:SetPointToScale('LEFT', frame, 'LEFT', 4, 0) timer:SetPointToScale('RIGHT', frame, 'RIGHT', -4, 0) - name:SetFont(SV.Media.font.names, 12, 'OUTLINE') - timer:SetFont(SV.Media.font.names, 12, 'OUTLINE') + name:SetFont(SV.Media.font.dialog, 12, 'OUTLINE') + timer:SetFont(SV.Media.font.dialog, 12, 'OUTLINE') name:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) timer:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) @@ -140,7 +140,7 @@ local StyleBossTitle = function() if not anchor.styled then local header = {anchor:GetRegions()} if header[1]:IsObjectType('FontString') then - header[1]:SetFont(SV.Media.font.names, 12, 'OUTLINE') + header[1]:SetFont(SV.Media.font.dialog, 12, 'OUTLINE') header[1]:SetTextColor(1, 1, 1) header[1]:SetShadowColor(0, 0, 0, 0) anchor.styled = true @@ -190,8 +190,8 @@ local StyleBoss = function() name:SetPointToScale('LEFT', bar, 'LEFT', 4, 0) timer:SetPointToScale('RIGHT', bar, 'RIGHT', -4, 0) - name:SetFont(SV.Media.font.names, 12, 'OUTLINE') - timer:SetFont(SV.Media.font.names, 12, 'OUTLINE') + name:SetFont(SV.Media.font.dialog, 12, 'OUTLINE') + timer:SetFont(SV.Media.font.dialog, 12, 'OUTLINE') count = count + 1 end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/garrison.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/garrison.lua index 4a51729..4dc3876 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/garrison.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/garrison.lua @@ -81,13 +81,13 @@ end local function StyleFollowerPortrait(frame, color) frame.PortraitRing:SetTexture(RING_TEXTURE) frame.PortraitRingQuality:SetTexture('') - frame.LevelBorder:SetTexture('') - if(not frame.LevelCallout) then - frame.LevelCallout = frame:CreateTexture(nil, 'BORDER', 4) - frame.LevelCallout:SetAllPoints(frame) - frame.LevelCallout:SetTexture(LVL_TEXTURE) - frame.LevelBorder:SetDrawLayer('OVERLAY') - end + -- frame.LevelBorder:SetTexture('') + -- if(not frame.LevelCallout) then + -- frame.LevelCallout = frame:CreateTexture(nil, 'BORDER', 4) + -- frame.LevelCallout:SetAllPoints(frame) + -- frame.LevelCallout:SetTexture(LVL_TEXTURE) + -- frame.LevelBorder.SetAtlas = function() end + -- end if(color) then frame.PortraitRing:SetVertexColor(color.r, color.g, color.b) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua index 98c7cd7..b14f00a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua @@ -33,7 +33,7 @@ local _hook_LossOfControl = function(self, ...) self.AbilityName:ClearAllPoints() self.AbilityName:SetPoint("BOTTOM", self, 0, -28) self.AbilityName.scrollTime = nil; - self.AbilityName:SetFont(SV.Media.font.names, 20, 'OUTLINE') + self.AbilityName:SetFont(SV.Media.font.dialog, 20, 'OUTLINE') self.TimeLeft.NumberText:ClearAllPoints() self.TimeLeft.NumberText:SetPoint("BOTTOM", self, 4, -58) self.TimeLeft.NumberText.scrollTime = nil; diff --git a/Interface/AddOns/SVUI_TrackOMatic/Loader.lua b/Interface/AddOns/SVUI_TrackOMatic/Loader.lua index dfaea1d..065760b 100644 --- a/Interface/AddOns/SVUI_TrackOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_TrackOMatic/Loader.lua @@ -49,7 +49,7 @@ SV.Options.args.plugins.args.pluginOptions.args[Schema].args["groups"] = { desc = L["Use group frame GPS elements"], type = "toggle", get = function(key) return PLUGIN.db[key[#key]] end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); end } SV.Options.args.plugins.args.pluginOptions.args[Schema].args["proximity"] = { @@ -58,7 +58,7 @@ SV.Options.args.plugins.args.pluginOptions.args[Schema].args["proximity"] = { desc = L["Only point to closest low health unit"], type = "toggle", get = function(key) return PLUGIN.db[key[#key]] end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); end } SV.Options.args.plugins.args.pluginOptions.args[Schema].args["fontSize"] = { @@ -70,5 +70,5 @@ SV.Options.args.plugins.args.pluginOptions.args[Schema].args["fontSize"] = { max = 22, step = 1, get = function(key) return PLUGIN.db[key[#key]] end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); end } \ No newline at end of file