diff --git a/SVUI_!Core/system/core.lua b/SVUI_!Core/system/core.lua index 7998de5..8f557c4 100644 --- a/SVUI_!Core/system/core.lua +++ b/SVUI_!Core/system/core.lua @@ -337,24 +337,25 @@ SV.defaults = { ["stupidhat"] = true, }, ["Gear"] = { - ["primary"] = "none", - ["secondary"] = "none", - ["equipmentset"] = "none", ["durability"] = { ["enable"] = true, ["onlydamaged"] = true, }, - ["itemlevel"] = { - ["enable"] = true, - }, - ["misc"] = { - ["setoverlay"] = true, + ["labels"] = { + ["characterItemLevel"] = true, + ["inventoryItemLevel"] = true, + ["characterGearSet"] = true, + ["inventoryGearSet"] = true, }, ["specialization"] = { ["enable"] = false, + ["primary"] = "none", + ["secondary"] = "none", }, ["battleground"] = { ["enable"] = false, + ["primary"] = "none", + ["secondary"] = "none", }, }, ["FunStuff"] = { @@ -759,13 +760,14 @@ function SV:PLAYER_ENTERING_WORLD() self.GUID = UnitGUID('player'); if(not self.RoleIsSet) then self:PlayerInfoUpdate() + else + self:GearSwap() end if(not self.MediaInitialized) then self:RefreshAllMedia() end local _,instanceType = IsInInstance() if(instanceType == "pvp") then - self:GearSwap() self.BGTimer = self.Timers:ExecuteLoop(RequestBattlefieldScoreData, 5) elseif(self.BGTimer) then self.Timers:RemoveLoop(self.BGTimer) diff --git a/SVUI_!Core/system/gear.lua b/SVUI_!Core/system/gear.lua index 98a489a..6e4fccb 100644 --- a/SVUI_!Core/system/gear.lua +++ b/SVUI_!Core/system/gear.lua @@ -1,7 +1,7 @@ --[[ ########################################################## S V U I By: Munglunch -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -16,30 +16,23 @@ local math = _G.math; local find, format, match, split, join = string.find, string.format, string.match, string.split, string.join; --[[ MATH METHODS ]]-- local ceil, floor, round = math.ceil, math.floor, math.round; ---[[ -########################################################## +--[[ TABLE METHODS ]]-- +local tremove, tcopy, twipe, tsort, tcat = table.remove, table.copy, table.wipe, table.sort, table.concat; +--[[ +########################################################## GET ADDON DATA ########################################################## ]]-- local SV = select(2, ...) local L = SV.L ---[[ -########################################################## +--[[ +########################################################## LOCAL VARS ########################################################## ]]-- local NewHook = hooksecurefunc; ---[[ - Quick explaination of what Im doing with all of these locals... - Unlike many of the other modules, Inventory has to continuously - reference config settings which can start to get sluggish. What - I have done is set local variables for every database value - that the module can read efficiently. The function "UpdateLocals" - is used to refresh these any time a change is made to configs - and once when the mod is loaded. -]]-- -local COLOR_KEYS = { [0] = "|cffff0000", [1] = "|cff00ff00", [2] = "|cffffff88" }; -local LIVESET, EQUIP_SET, SPEC_SET, SHOW_LEVEL, SHOW_DURABILITY, ONLY_DAMAGED, AVG_LEVEL, MAX_LEVEL; +local ParseItemLevel, ParseGearSlots; +local GEAR_CACHE, GEARSET_LISTING = {}, {}; local EquipmentSlots = { ["HeadSlot"] = {true,true}, ["NeckSlot"] = {true,false}, @@ -58,76 +51,293 @@ local EquipmentSlots = { ["Trinket0Slot"] = {true,false,true}, ["Trinket1Slot"] = {true,false,true} } ---[[ -########################################################## +--[[ + Quick explaination of what Im doing with all of these locals... + Unlike many of the other modules, Inventory has to continuously + reference config settings which can start to get sluggish. What + I have done is set local variables for every database value + that the module can read efficiently. The function "UpdateLocals" + is used to refresh these any time a change is made to configs + and once when the mod is loaded. +]]-- +local COLOR_KEYS = { [0] = "|cffff0000", [1] = "|cff00ff00", [2] = "|cffffff88" }; +local LIVESET, LASTSET, BG_SET, SPEC_SET, SHOW_DURABILITY, ONLY_DAMAGED, AVG_LEVEL, MAX_LEVEL; +local SPEC_SWAP, BG_SWAP; +local SHOW_CHAR_LEVEL, SHOW_BAG_LEVEL, SHOW_CHAR_SET, SHOW_BAG_SET; +local iLevelFilter = ITEM_LEVEL:gsub( "%%d", "(%%d+)" ) +--[[ +########################################################## LOCAL FUNCTIONS ########################################################## ]]-- local GearHandler = CreateFrame("Frame", nil); -local function SetItemLevelDisplay(globalName, iLevel) - local frame = _G[globalName] - if(not frame) then return; end - frame.ItemLevel:SetText('') - if(SHOW_LEVEL and iLevel) then - local key = (iLevel < (AVG_LEVEL - 10)) and 0 or (iLevel > (AVG_LEVEL + 10)) and 1 or 2; - frame.ItemLevel:SetFormattedText("%s%d|r", COLOR_KEYS[key], iLevel) - end -end - -local function SetItemDurabilityDisplay(globalName, slotId) - local frame = _G[globalName] - if(not frame) then return; end - if(SHOW_DURABILITY) then - local current,total,actual,perc,r,g,b; - current,total = GetInventoryItemDurability(slotId) - if(current and total) then - frame.DurabilityInfo.bar:SetMinMaxValues(0, 100) - if(current == total and ONLY_DAMAGED) then - frame.DurabilityInfo:Hide() - else - if(current ~= total) then - actual = current / total; - perc = actual * 100; - r,g,b = SV:ColorGradient(actual,1,0,0,1,1,0,0,1,0) - frame.DurabilityInfo.bar:SetValue(perc) - frame.DurabilityInfo.bar:SetStatusBarColor(r,g,b) - if not frame.DurabilityInfo:IsShown() then - frame.DurabilityInfo:Show() - end - else - frame.DurabilityInfo.bar:SetValue(100) - frame.DurabilityInfo.bar:SetStatusBarColor(0, 1, 0) - end - end +local function encodeSub(i, j, k) + local l = j; + while((k > 0) and (l <= #i)) do + local m = byte(i, l) + if(m > 240) then + l = l + 4; + elseif(m > 225) then + l = l + 3; + elseif(m > 192) then + l = l + 2; else - frame.DurabilityInfo:Hide() + l = l + 1; end - else - frame.DurabilityInfo:Hide() + k = k - 1; end + return i:sub(j, (l - 1)) +end + +do + local _heirlooms80 = { + 44102,42944,44096,42943,42950,48677,42946,42948,42947,42992, + 50255,44103,44107,44095,44098,44097,44105,42951,48683,48685, + 42949,48687,42984,44100,44101,44092,48718,44091,42952,48689, + 44099,42991,42985,48691,44094,44093,42945,48716 + } + local _heirlooms90h = {105689,105683,105686,105687,105688,105685,105690,105691,105684,105692,105693} + local _heirlooms90n = {104399,104400,104401,104402,104403,104404,104405,104406,104407,104408,104409} + local _heirlooms90f = {105675,105670,105672,105671,105674,105673,105676,105677,105678,105679,105680} + + -- DEPRECATED + -- local _heirloom_regex = "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?"; + + local _slots = { + ["HeadSlot"] = {true, true}, ["NeckSlot"] = {true, false}, + ["ShoulderSlot"] = {true, true}, ["BackSlot"] = {true, false}, + ["ChestSlot"] = {true, true}, ["WristSlot"] = {true, true}, + ["MainHandSlot"] = {true, true, true}, ["SecondaryHandSlot"] = {true, true}, + ["HandsSlot"] = {true, true, true}, ["WaistSlot"] = {true, true, true}, + ["LegsSlot"] = {true, true, true}, ["FeetSlot"] = {true, true, true}, + ["Finger0Slot"] = {true, false, true}, ["Finger1Slot"] = {true, false, true}, + ["Trinket0Slot"] = {true, false, true}, ["Trinket1Slot"] = {true, false, true} + } + + local function _justthetip() + for i=1, #GameTooltip.shoppingTooltips do + if(not GameTooltip.shoppingTooltips[i]:IsShown()) then + return GameTooltip.shoppingTooltips[i] + end + end + end + + local function _getHeirloomLevel(unit, itemId) + if(not itemId) then return; end + + local baseLevel = UnitLevel(unit) + if baseLevel > 85 then + for i=1, #_heirlooms90h do + if(_heirlooms90h[i] == itemId) then + baseLevel = 582 + break + end + end + + for i=1, #_heirlooms90n do + if(_heirlooms90n[i] == itemId) then + baseLevel = 569 + break + end + end + + for i=1, #_heirlooms90f do + if(_heirlooms90f[i] == itemId) then + baseLevel = 548 + break + end + end + + return baseLevel + elseif baseLevel > 80 then + for i=1, #_heirlooms80 do + if(_heirlooms80[i] == itemId) then + baseLevel = 80; + break + end + end + end + + if(baseLevel > 80) then + return (((baseLevel - 81) * 12.2) + 272) + elseif(baseLevel > 67) then + return (((baseLevel - 68) * 6) + 130) + elseif(baseLevel > 59) then + return (((baseLevel - 60) * 3) + 85) + end + return baseLevel + end + + function ParseItemLevel(unit, itemLink) + local name, link, quality; + local iLevel = 0; + if(itemLink and type(itemLink) == "string") then + name, link, quality, iLevel = GetItemInfo(itemLink) + local itemId = tonumber(itemLink:match("item:%d+:%d+:%d+:%d+:%d+:%d+:%-?%d+:%-?%d+:%d+:%d+:(%d+)")) + if iLevel and itemId then + if(quality == 7) then + iLevel = _getHeirloomLevel(unit, itemId) + end + end + end + return iLevel or 0 + end + + local function _getEquippedItemLevel(unit, itemLink) + local tooltip = _justthetip(); + if(not tooltip) then return ParseItemLevel(unit, itemLink) end + tooltip:SetOwner(UIParent, "ANCHOR_NONE"); + tooltip:SetHyperlink(itemLink); + tooltip:Show(); + + local iLevel = 0; + local tname = tooltip:GetName().."TextLeft%s"; + for i = 2, tooltip:NumLines() do + local text = _G[tname:format(i)]:GetText(); + if(text and text ~= "") then + local value = tonumber(text:match(iLevelFilter)); + if(value) then + iLevel = value; + end + end + end + + tooltip:Hide(); + return iLevel + end + + local function _setLevelDisplay(frame, iLevel) + if(not frame or (not frame.ItemLevel)) then return; end + frame.ItemLevel:SetText('') + if(SHOW_CHAR_LEVEL and iLevel) then + local key = (iLevel < (AVG_LEVEL - 10)) and 0 or (iLevel > (AVG_LEVEL + 10)) and 1 or 2; + frame.ItemLevel:SetFormattedText("%s%d|r", COLOR_KEYS[key], iLevel) + end + end + + local function _setDurabilityDisplay(frame, slotId) + if(not frame or (not frame.DurabilityInfo)) then return; end + if(SHOW_DURABILITY) then + local current,total,actual,perc,r,g,b; + current,total = GetInventoryItemDurability(slotId) + if(current and total) then + frame.DurabilityInfo.bar:SetMinMaxValues(0, 100) + if(current == total and ONLY_DAMAGED) then + frame.DurabilityInfo:Hide() + else + if(current ~= total) then + actual = current / total; + perc = actual * 100; + r,g,b = SV:ColorGradient(actual,1,0,0,1,1,0,0,1,0) + frame.DurabilityInfo.bar:SetValue(perc) + frame.DurabilityInfo.bar:SetStatusBarColor(r,g,b) + if not frame.DurabilityInfo:IsShown() then + frame.DurabilityInfo:Show() + end + else + frame.DurabilityInfo.bar:SetValue(100) + frame.DurabilityInfo.bar:SetStatusBarColor(0, 1, 0) + end + end + else + frame.DurabilityInfo:Hide() + end + else + frame.DurabilityInfo:Hide() + end + end + + function ParseGearSlots(unit, category, setLevel, setDurability) + local averageLevel,totalSlots = 0,0; + + for slotName, flags in pairs(_slots) do + local slotId = GetInventorySlotInfo(slotName); + local iLink = GetInventoryItemLink(unit, slotId) + local iLevel; + if(iLink and type(iLink) == "string") then + iLevel = _getEquippedItemLevel(unit, iLink) + if(iLevel and iLevel > 0) then + totalSlots = totalSlots + 1; + averageLevel = averageLevel + iLevel + end + end + + if(setLevel and flags[1]) then + _setLevelDisplay(_G[category .. slotName], iLevel) + end + if(setDurability and (slotId ~= nil) and (not inspecting) and flags[2]) then + _setDurabilityDisplay(_G[category .. slotName], slotId) + end + end + return averageLevel,totalSlots + end +end + +function SV:ParseGearSlots(unit, inspecting, setLevel, setDurability) + local category = (inspecting) and "Inspect" or "Character"; + local averageLevel,totalSlots = ParseGearSlots(unit, category, setLevel, setDurability); + if(averageLevel < 1 or totalSlots < 15) then return end + return floor(averageLevel / totalSlots) +end + +function SV:SetGearLabels(frame, bagID, slotID, itemLink, quality, equipSlot) + quality = quality or 0; + equipSlot = equipSlot or ''; + + if(frame.GearInfo) then + local loc = format("%d_%d", bagID, slotID); + if((not SHOW_BAG_SET) or (not GEARSET_LISTING[loc])) then + frame.GearInfo:SetText('') + else + local setNumber = #GEARSET_LISTING[loc] < 4 and #GEARSET_LISTING[loc] or 3; + if(setNumber == 1) then + frame.GearInfo:SetFormattedText("|cffffffaa%s|r", encodeSub(GEARSET_LISTING[loc][1], 1, 4)) + elseif(setNumber == 2) then + frame.GearInfo:SetFormattedText("|cffffffaa%s %s|r", encodeSub(GEARSET_LISTING[loc][1], 1, 4), encodeSub(GEARSET_LISTING[loc][2], 1, 4)) + elseif(setNumber == 3) then + frame.GearInfo:SetFormattedText("|cffffffaa%s %s %s|r", encodeSub(GEARSET_LISTING[loc][1], 1, 4), encodeSub(GEARSET_LISTING[loc][2], 1, 4), encodeSub(GEARSET_LISTING[loc][3], 1, 4)) + else + frame.GearInfo:SetText('') + end + end + end + + if(frame.ItemLevel) then + local iLevel = ParseItemLevel('player', itemLink) + if((not SHOW_BAG_LEVEL) or (iLevel <= 1) or (quality == 7) or (not equipSlot:find('INVTYPE'))) then + frame.ItemLevel:SetText('') + else + local key = (iLevel < (AVG_LEVEL - 10)) and 0 or (iLevel > (AVG_LEVEL + 10)) and 1 or 2; + frame.ItemLevel:SetFormattedText("%s%d|r", COLOR_KEYS[key], iLevel) + end + end end local function GetActiveGear() local count = GetNumEquipmentSets() local resultSpec = GetActiveSpecGroup() local resultSet - EQUIP_SET = SV.db.Gear.equipmentset - SPEC_SET = nil - if(resultSpec and GetSpecializationInfo(resultSpec)) then - SPEC_SET = resultSpec == 1 and SV.db.Gear.primary or SV.db.Gear.secondary + BG_SET = "none" + SPEC_SET = "none" + if(resultSpec and GetSpecializationInfo(resultSpec) and (resultSpec ~= 1)) then + SPEC_SET = SV.db.Gear.specialization.secondary + BG_SET = SV.db.Gear.battleground.secondary + else + SPEC_SET = SV.db.Gear.specialization.primary + BG_SET = SV.db.Gear.battleground.primary end - if(count == 0) then + if(count == 0) then return resultSpec,false - end - for i=1, count do + end + for i=1, count do local setName,_,_,setUsed = GetEquipmentSetInfo(i) - if setUsed then + if setUsed then resultSet = setName break end - end - return resultSpec,resultSet + end + return resultSpec,resultSet end local function SetDisplayStats(arg) @@ -135,12 +345,12 @@ local function SetDisplayStats(arg) local globalName = format("%s%s", arg, slotName) local frame = _G[globalName] - if(flags[1]) then + if(flags[1]) then frame.ItemLevel = frame:CreateFontString(nil, "OVERLAY") frame.ItemLevel:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 2, 1) frame.ItemLevel:SetFontObject(SVUI_Font_Default) - end - + end + if(arg == "Character" and flags[2]) then frame.DurabilityInfo = CreateFrame("Frame", nil, frame) frame.DurabilityInfo:SetWidth(7) @@ -163,52 +373,73 @@ local function SetDisplayStats(arg) frame.DurabilityInfo.bg:InsetPoints(frame.DurabilityInfo, 2, 2) frame.DurabilityInfo.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) frame.DurabilityInfo.bg:SetVertexColor("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - end - end -end ---[[ -########################################################## + end + end +end +--[[ +########################################################## CORE FUNCTIONS ########################################################## ]]-- local function RefreshInspectedGear() - if(not SV.GearBuildComplete) then return end - if(InCombatLockdown()) then + if(not SV.GearBuildComplete) then return end + if(InCombatLockdown()) then GearHandler:RegisterEvent("PLAYER_REGEN_ENABLED", RefreshInspectedGear) - return - else + return + else GearHandler.WaitingOnInspect = nil - end + end local unit = InspectFrame and InspectFrame.unit or "player"; - if(not unit or (unit and not CanInspect(unit,false))) then return end + if(not unit or (unit and not CanInspect(unit,false))) then return end - if(SHOW_LEVEL) then - SV:ParseGearSlots(unit, true, SetItemLevelDisplay) - else - SV:ParseGearSlots(unit, true) - end + SV:ParseGearSlots(unit, true, true) end local function UpdateLocals() - SHOW_LEVEL = SV.db.Gear.itemlevel.enable + SPEC_SWAP = SV.db.Gear.specialization.enable + BG_SWAP = SV.db.Gear.battleground.enable + SHOW_CHAR_LEVEL = SV.db.Gear.labels.characterItemLevel + SHOW_BAG_LEVEL = SV.db.Gear.labels.inventoryItemLevel + SHOW_CHAR_SET = SV.db.Gear.labels.characterGearSet + SHOW_BAG_SET = SV.db.Gear.labels.inventoryGearSet SHOW_DURABILITY = SV.db.Gear.durability.enable ONLY_DAMAGED = SV.db.Gear.durability.onlydamaged MAX_LEVEL, AVG_LEVEL = GetAverageItemLevel() end +function SV:BuildEquipmentMap() + UpdateLocals() + for key, gearData in pairs(GEARSET_LISTING) do + twipe(gearData); + end + local set, player, bank, bags, slotIndex, bagIndex, loc, _; + for i = 1, GetNumEquipmentSets() do + set = GetEquipmentSetInfo(i); + GEAR_CACHE = GetEquipmentSetLocations(set); + if(GEAR_CACHE) then + for key, location in pairs(GEAR_CACHE) do + if(type(location) ~= "string") then + player, bank, bags, _, slotIndex, bagIndex = EquipmentManager_UnpackLocation(location); + if((bank or bags) and (slotIndex and bagIndex)) then + loc = format("%d_%d", bagIndex, slotIndex); + GEARSET_LISTING[loc] = (GEARSET_LISTING[loc] or {}); + tinsert(GEARSET_LISTING[loc], set); + end + end + end + end + end +end + function SV:UpdateGearInfo() - if(not SV.GearBuildComplete) then return end - if(InCombatLockdown()) then + if(not SV.GearBuildComplete) then return end + if(InCombatLockdown()) then GearHandler:RegisterEvent("PLAYER_REGEN_ENABLED") - return - end - UpdateLocals() - if(SHOW_LEVEL) then - SV:ParseGearSlots("player", false, SetItemLevelDisplay, SetItemDurabilityDisplay) - else - SV:ParseGearSlots("player", false, nil, SetItemDurabilityDisplay) + return end + UpdateLocals() + SV:ParseGearSlots("player", false, true, true) end local Gear_UpdateTabs = function() @@ -220,17 +451,19 @@ function SV:GearSwap() if(InCombatLockdown()) then return; end local gearSpec, gearSet = GetActiveGear() if(not gearSet) then return; end - if SV.db.Gear.battleground.enable then + + if(BG_SWAP and (BG_SET ~= "none" and BG_SET ~= gearSet)) then local inDungeon,dungeonType = IsInInstance() - if(inDungeon and dungeonType == "pvp" or dungeonType == "arena") then - if EQUIP_SET ~= "none" and EQUIP_SET ~= gearSet then - LIVESET = EQUIP_SET; - UseEquipmentSet(EQUIP_SET) - end - return - end + if(inDungeon and dungeonType == "pvp" or dungeonType == "arena") then + if BG_SET ~= "none" and BG_SET ~= gearSet then + LIVESET = BG_SET; + UseEquipmentSet(BG_SET) + end + return + end end - if(SPEC_SET and SPEC_SET ~= "none" and SPEC_SET ~= gearSet) then + + if(SPEC_SWAP and (SPEC_SET ~= "none" and SPEC_SET ~= gearSet)) then LIVESET = SPEC_SET; UseEquipmentSet(SPEC_SET) end @@ -250,7 +483,7 @@ local GearHandler_OnEvent = function(self, event, ...) if LIVESET then local strMsg = ("%s%s"):format(MSG_PREFIX, LIVESET) SV:AddonMessage(strMsg) - LIVESET = nil + LIVESET = nil end else SV:UpdateGearInfo() @@ -259,7 +492,10 @@ end local function InitializeGearInfo() MSG_PREFIX = L["You have equipped equipment set: "] - SHOW_LEVEL = SV.db.Gear.itemlevel.enable + SHOW_CHAR_LEVEL = SV.db.Gear.labels.characterItemLevel + SHOW_BAG_LEVEL = SV.db.Gear.labels.inventoryItemLevel + SHOW_CHAR_SET = SV.db.Gear.labels.characterGearSet + SHOW_BAG_SET = SV.db.Gear.labels.inventoryGearSet SHOW_DURABILITY = SV.db.Gear.durability.enable ONLY_DAMAGED = SV.db.Gear.durability.onlydamaged MAX_LEVEL, AVG_LEVEL = GetAverageItemLevel() @@ -281,4 +517,4 @@ local function InitializeGearInfo() SV.GearBuildComplete = true end -SV:NewScript(InitializeGearInfo) \ No newline at end of file +SV:NewScript(InitializeGearInfo) diff --git a/SVUI_!Core/system/utilities.lua b/SVUI_!Core/system/utilities.lua index 286f973..5ed8440 100644 --- a/SVUI_!Core/system/utilities.lua +++ b/SVUI_!Core/system/utilities.lua @@ -49,11 +49,10 @@ local UnitExists = _G.UnitExists; local UnitLevel = _G.UnitLevel; local UnitInRaid = _G.UnitInRaid; local GetItemInfo = _G.GetItemInfo; -local GetInventorySlotInfo = _G.GetInventorySlotInfo; -local GetInventoryItemLink = _G.GetInventoryItemLink; +local GetInventorySlotInfo = _G.GetInventorySlotInfo; +local GetInventoryItemLink = _G.GetInventoryItemLink; local GetSpecialization = _G.GetSpecialization; local GetSpecializationInfo = _G.GetSpecializationInfo; -local iLevelFilter = ITEM_LEVEL:gsub( "%%d", "(%%d+)" ) --[[ ########################################################## GET ADDON DATA @@ -333,196 +332,6 @@ function SV:AnchorToCursor(frame) end --[[ ########################################################## -ITEM UTILITY FUNCTIONS -########################################################## -]]-- -do - local _failsafe = {0} - - local _upgrades = { - [ 1] = {8, 1, 1}, [373] = {4, 1, 2}, [374] = {8, 2, 2}, [375] = {4, 1, 3}, [376] = {4, 2, 3}, - [377] = {4, 3, 3}, [378] = {7, 0, 0}, [379] = {4, 1, 2}, [380] = {4, 2, 2}, [445] = {0, 0, 2}, - [446] = {4, 1, 2}, [447] = {8, 2, 2}, [451] = {0, 0, 1}, [452] = {8, 1, 1}, [453] = {0, 0, 2}, - [454] = {4, 1, 2}, [455] = {8, 2, 2}, [456] = {0, 0, 1}, [457] = {8, 1, 1}, [458] = {0, 0, 4}, - [459] = {4, 1, 4}, [460] = {8, 2, 4}, [461] = {12, 3, 4}, [462] = {16, 4, 4}, - [465] = {0, 0, 2}, [466] = {4, 1, 2}, [467] = {8, 2, 2}, [468] = {0, 0, 4}, - [469] = {4, 1, 4}, [470] = {8, 2, 4}, [471] = {12, 3, 4}, [472] = {16, 4, 4}, - [491] = {0, 0, 4}, [492] = {4, 1, 4}, [493] = {8, 2, 4}, [494] = {0, 0, 6}, - [495] = {4, 1, 6}, [496] = {8, 2, 6}, [497] = {12, 3, 6}, [498] = {16, 4, 6}, - [504] = {12, 3, 4}, [505] = {16, 4, 4}, [506] = {20, 5, 6}, [507] = {24, 6, 6} - } - - local _heirlooms80 = { - 44102,42944,44096,42943,42950,48677,42946,42948,42947,42992, - 50255,44103,44107,44095,44098,44097,44105,42951,48683,48685, - 42949,48687,42984,44100,44101,44092,48718,44091,42952,48689, - 44099,42991,42985,48691,44094,44093,42945,48716 - } - - local _heirlooms90h = {105689,105683,105686,105687,105688,105685,105690,105691,105684,105692,105693} - local _heirlooms90n = {104399,104400,104401,104402,104403,104404,104405,104406,104407,104408,104409} - local _heirlooms90f = {105675,105670,105672,105671,105674,105673,105676,105677,105678,105679,105680} - - -- DEPRECATED - -- local _heirloom_regex = "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?"; - - local _slots = { - ["HeadSlot"] = {true, true}, ["NeckSlot"] = {true, false}, - ["ShoulderSlot"] = {true, true}, ["BackSlot"] = {true, false}, - ["ChestSlot"] = {true, true}, ["WristSlot"] = {true, true}, - ["MainHandSlot"] = {true, true, true}, ["SecondaryHandSlot"] = {true, true}, - ["HandsSlot"] = {true, true, true}, ["WaistSlot"] = {true, true, true}, - ["LegsSlot"] = {true, true, true}, ["FeetSlot"] = {true, true, true}, - ["Finger0Slot"] = {true, false, true}, ["Finger1Slot"] = {true, false, true}, - ["Trinket0Slot"] = {true, false, true}, ["Trinket1Slot"] = {true, false, true} - } - - setmetatable(_upgrades, { __index = function(t, k) - return _failsafe - end}) - - local function _justthetip() - for i=1, #GameTooltip.shoppingTooltips do - if(not GameTooltip.shoppingTooltips[i]:IsShown()) then - return GameTooltip.shoppingTooltips[i] - end - end - end - - local function _getHeirloomLevel(unit, itemId) - if(not itemId) then return; end - - local baseLevel = UnitLevel(unit) - if baseLevel > 85 then - for i=1, #_heirlooms90h do - if(_heirlooms90h[i] == itemId) then - baseLevel = 582 - break - end - end - - for i=1, #_heirlooms90n do - if(_heirlooms90n[i] == itemId) then - baseLevel = 569 - break - end - end - - for i=1, #_heirlooms90f do - if(_heirlooms90f[i] == itemId) then - baseLevel = 548 - break - end - end - - return baseLevel - elseif baseLevel > 80 then - for i=1, #_heirlooms80 do - if(_heirlooms80[i] == itemId) then - baseLevel = 80; - break - end - end - end - - if(baseLevel > 80) then - return (((baseLevel - 81) * 12.2) + 272) - elseif(baseLevel > 67) then - return (((baseLevel - 68) * 6) + 130) - elseif(baseLevel > 59) then - return (((baseLevel - 60) * 3) + 85) - end - return baseLevel - end - - local function _getItemInfo(itemString) - local itemId = tonumber(itemString:match("item:%d+:%d+:%d+:%d+:%d+:%d+:%-?%d+:%-?%d+:%d+:%d+:(%d+)")) - if itemId then - local lvl = _upgrades[itemId][1] - local cur = _upgrades[itemId][2] - local max = _upgrades[itemId][3] - return cur, max, lvl - end - return nil - end - - local function _getItemLevel(unit, itemLink) - local name, link, quality, iLevel = GetItemInfo(itemLink) - local itemId = tonumber(itemLink:match("item:%d+:%d+:%d+:%d+:%d+:%d+:%-?%d+:%-?%d+:%d+:%d+:(%d+)")) - if iLevel and itemId then - if(quality == 7) then - iLevel = _getHeirloomLevel(unit, itemId) - else - iLevel = iLevel + _upgrades[itemId][1] - end - end - return iLevel - end - - local function _scanItemLevel(unit, itemString) - local tooltip = _justthetip(); - if(not tooltip) then return _getItemLevel(unit, itemString) end - tooltip:SetOwner(UIParent, "ANCHOR_NONE"); - tooltip:SetHyperlink(itemString); - tooltip:Show(); - - local iLevel = 0; - local tname = tooltip:GetName().."TextLeft%s"; - for i = 2, tooltip:NumLines() do - local text = _G[tname:format(i)]:GetText(); - if(text and text ~= "") then - local value = tonumber(text:match(iLevelFilter)); - if(value) then - iLevel = value; - end - end - end - - tooltip:Hide(); - return iLevel - end - - function SV:ParseItemLevel(unit, iLink) - local iLevel = 0; - if(iLink and type(iLink) == "string") then - iLevel = _getItemLevel(unit, iLink) - end - return iLevel - end - - function SV:ParseGearSlots(unit, inspecting, firstCallback, secondCallback) - local category = (inspecting) and "Inspect" or "Character"; - local averageLevel,totalSlots,upgradeAdjust = 0,0,0; - for slotName, flags in pairs(_slots) do - local globalName = ("%s%s"):format(category, slotName) - local slotId = GetInventorySlotInfo(slotName); - local iLink = GetInventoryItemLink(unit, slotId) - local iLevel; - if(iLink and type(iLink) == "string") then - iLevel = _scanItemLevel(unit, iLink) - if(iLevel and iLevel > 0) then - totalSlots = totalSlots + 1; - averageLevel = averageLevel + iLevel - end - end - - if(flags[1] and firstCallback and type(firstCallback) == "function") then - firstCallback(globalName, iLevel) - end - if(slotId ~= nil) then - if((not inspecting) and flags[2] and secondCallback and type(secondCallback) == "function") then - secondCallback(globalName, slotId) - end - end - end - if(averageLevel < 1 or totalSlots < 15) then - return - end - return floor(averageLevel / totalSlots) - end -end ---[[ -########################################################## TIME UTILITIES ########################################################## ]]-- diff --git a/SVUI_!Options/SVUI_!Options.lua b/SVUI_!Options/SVUI_!Options.lua index b7c1163..3c0d31f 100644 --- a/SVUI_!Options/SVUI_!Options.lua +++ b/SVUI_!Options/SVUI_!Options.lua @@ -488,6 +488,7 @@ SV.Options.args.primary = { }, } } + SV.Options.args.Core = { type = "group", order = 2, @@ -495,686 +496,680 @@ SV.Options.args.Core = { childGroups = "tab", get = function(key) return SV.db[key[#key]] end, set = function(key, value) SV.db[key[#key]] = value end, + args = {} +} + +SV.Options.args.Core.args.mostCommon = { + type = "group", + order = 1, + name = "Most Common", + guiInline = true, args = { - mostCommon = { + LoginMessage = { + order = 1, + type = 'toggle', + name = L['Login Messages'], + get = function(j)return SV.db.general.loginmessage end, + set = function(j,value)SV.db.general.loginmessage = value end + }, + LoginCredits = { + order = 2, + type = 'toggle', + name = L['Login Credits'], + get = function(j)return SV.db.general.logincredits end, + set = function(j,value)SV.db.general.logincredits = value end + }, + saveDraggable = { + order = 3, + type = "toggle", + name = L["Save Draggable"], + desc = L["Save the positions of draggable frames when they are moved. NOTE: THIS WILL OVERRIDE BLIZZARD FRAME SNAPPING!"], + get = function(j)return SV.db.general.saveDraggable end, + set = function(j,value)SV.db.general.saveDraggable = value; SV:StaticPopup_Show("RL_CLIENT") end + }, + cooldownText = { + order = 4, + type = "toggle", + name = L['Cooldown Text'], + desc = L["Display cooldown text on anything with the cooldown spiral."], + get = function(j)return SV.db.general.cooldown end, + set = function(j,value)SV.db.general.cooldown = value; SV:StaticPopup_Show("RL_CLIENT")end + }, + texture = { + order = 5, type = "group", + name = L["Textures"], + guiInline = true, + get = function(key) + return SV.media.shared.background[key[#key]].file + end, + set = function(key, value) + SV.media.shared.background[key[#key]].file = value + SV:RefreshEverything(true) + end, + args = { + pattern = { + type = "select", + dialogControl = 'LSM30_Background', + order = 1, + name = L["Primary Texture"], + values = AceGUIWidgetLSMlists.background + }, + premium = { + type = "select", + dialogControl = 'LSM30_Background', + order = 1, + name = L["Secondary Texture"], + values = AceGUIWidgetLSMlists.background + } + } + }, + colors = { + order = 6, + type = "group", + name = L["Colors"], + guiInline = true, + args = { + customClassColor = { + type = "toggle", + order = 1, + name = L["Use Custom Class Colors"], + desc = L["Use the enhanced class colors provided by SVUI"], + get = function(key) return SV.db.general.customClassColor end, + set = function(key, value) SV.db.general.customClassColor = value; SV:StaticPopup_Show("RL_CLIENT") end, + }, + default = { + type = "color", + order = 2, + name = L["Default Color"], + desc = L["Main color used by most UI elements. (ex: Backdrop Color)"], + hasAlpha = true, + get = function(key) + local color = SV.media.color.default + return color[1],color[2],color[3],color[4] + end, + set = function(key, rValue, gValue, bValue, aValue) + SV.media.color.default = {rValue, gValue, bValue, aValue} + SV:UpdateSharedMedia() + end, + }, + special = { + type = "color", + order = 3, + name = L["Accent Color"], + desc = L["Color used in various frame accents. (ex: Dressing Room Backdrop Color)"], + hasAlpha = true, + get = function(key) + local color = SV.media.color.special + return color[1],color[2],color[3],color[4] + end, + set = function(key, rValue, gValue, bValue, aValue) + SV.media.color.special = {rValue, gValue, bValue, aValue} + SV.media.color.specialdark = {(rValue * 0.75), (gValue * 0.75), (bValue * 0.75), aValue} + SV:UpdateSharedMedia() + end, + }, + resetbutton = { + type = "execute", + order = 4, + name = L["Restore Defaults"], + func = function() + SV.media.color.default = {0.15, 0.15, 0.15, 1}; + SV.media.color.special = {0.4, 0.32, 0.2, 1}; + SV:UpdateSharedMedia() + end + } + } + }, + loot = { + order = 7, + type = "toggle", + name = L['Loot Frame'], + desc = L['Enable/Disable the loot frame.'], + get = function()return SV.db.general.loot end, + set = function(j,value)SV.db.general.loot = value;SV:StaticPopup_Show("RL_CLIENT")end + }, + lootRoll = { + order = 8, + type = "toggle", + name = L['Loot Roll'], + desc = L['Enable/Disable the loot roll frame.'], + get = function()return SV.db.general.lootRoll end, + set = function(j,value)SV.db.general.lootRoll = value;SV:StaticPopup_Show("RL_CLIENT")end + }, + lootRollWidth = { + order = 9, + type = 'range', + width = "full", + name = L["Roll Frame Width"], + min = 100, + max = 328, + step = 1, + get = function()return SV.db.general.lootRollWidth end, + set = function(a,b) SV.db.general.lootRollWidth = b; end, + }, + lootRollHeight = { + order = 10, + type = 'range', + width = "full", + name = L["Roll Frame Height"], + min = 14, + max = 58, + step = 1, + get = function()return SV.db.general.lootRollHeight end, + set = function(a,b) SV.db.general.lootRollHeight = b; end, + }, + } +}; + +SV.Options.args.Core.args.Extras = { + type = "group", + order = 2, + name = "Extras", + guiInline = true, + get = function(a)return SV.db["Extras"][a[#a]]end, + set = function(a,b)SV:ChangeDBVar(b,a[#a]); end, + args = { + common = { order = 1, - name = "Most Common", + type = "group", + name = L["General"], guiInline = true, args = { - LoginMessage = { + threatbar = { order = 1, type = 'toggle', - name = L['Login Messages'], - get = function(j)return SV.db.general.loginmessage end, - set = function(j,value)SV.db.general.loginmessage = value end + name = L["Threat Thermometer"], + desc = L["Enable/disable the custom SVUI threat meter"], + get = function(j)return SV.db["Extras"].threatbar end, + set = function(j,value)SV.db["Extras"].threatbar = value; SV:StaticPopup_Show("RL_CLIENT") end }, - LoginCredits = { + woot = { order = 2, type = 'toggle', - name = L['Login Credits'], - get = function(j)return SV.db.general.logincredits end, - set = function(j,value)SV.db.general.logincredits = value end + name = L["Say Thanks"], + desc = L["Thank someone when they cast specific spells on you. Typically resurrections"], + get = function(j)return SV.db["Extras"].woot end, + set = function(j,value)SV.db["Extras"].woot = value;SV:ToggleReactions()end }, - saveDraggable = { + pvpinterrupt = { order = 3, - type = "toggle", - name = L["Save Draggable"], - desc = L["Save the positions of draggable frames when they are moved. NOTE: THIS WILL OVERRIDE BLIZZARD FRAME SNAPPING!"], - get = function(j)return SV.db.general.saveDraggable end, - set = function(j,value)SV.db.general.saveDraggable = value; SV:StaticPopup_Show("RL_CLIENT") end + type = 'toggle', + name = L["Report PVP Actions"], + desc = L["Announce your interrupts, as well as when you have been sapped!"], + get = function(j)return SV.db["Extras"].pvpinterrupt end, + set = function(j,value)SV.db["Extras"].pvpinterrupt = value;SV:ToggleReactions()end }, - cooldownText = { + lookwhaticando = { order = 4, - type = "toggle", - name = L['Cooldown Text'], - desc = L["Display cooldown text on anything with the cooldown spiral."], - get = function(j)return SV.db.general.cooldown end, - set = function(j,value)SV.db.general.cooldown = value; SV:StaticPopup_Show("RL_CLIENT")end + type = 'toggle', + name = L["Report Spells"], + desc = L["Announce various helpful spells cast by players in your party/raid"], + get = function(j)return SV.db["Extras"].lookwhaticando end, + set = function(j,value)SV.db["Extras"].lookwhaticando = value;SV:ToggleReactions()end }, - texture = { + sharingiscaring = { order = 5, - type = "group", - name = L["Textures"], - guiInline = true, - get = function(key) - return SV.media.shared.background[key[#key]].file - end, - set = function(key, value) - SV.media.shared.background[key[#key]].file = value - SV:RefreshEverything(true) - end, - args = { - pattern = { - type = "select", - dialogControl = 'LSM30_Background', - order = 1, - name = L["Primary Texture"], - values = AceGUIWidgetLSMlists.background - }, - premium = { - type = "select", - dialogControl = 'LSM30_Background', - order = 1, - name = L["Secondary Texture"], - values = AceGUIWidgetLSMlists.background - } - } + type = 'toggle', + name = L["Report Shareables"], + desc = L["Announce when someone in your party/raid has laid a feast or repair bot"], + get = function(j)return SV.db["Extras"].sharingiscaring end, + set = function(j,value)SV.db["Extras"].sharingiscaring = value;SV:ToggleReactions()end }, - colors = { + reactionChat = { order = 6, - type = "group", - name = L["Colors"], - guiInline = true, - args = { - customClassColor = { - type = "toggle", - order = 1, - name = L["Use Custom Class Colors"], - desc = L["Use the enhanced class colors provided by SVUI"], - get = function(key) return SV.db.general.customClassColor end, - set = function(key, value) SV.db.general.customClassColor = value; SV:StaticPopup_Show("RL_CLIENT") end, - }, - default = { - type = "color", - order = 2, - name = L["Default Color"], - desc = L["Main color used by most UI elements. (ex: Backdrop Color)"], - hasAlpha = true, - get = function(key) - local color = SV.media.color.default - return color[1],color[2],color[3],color[4] - end, - set = function(key, rValue, gValue, bValue, aValue) - SV.media.color.default = {rValue, gValue, bValue, aValue} - SV:UpdateSharedMedia() - end, - }, - special = { - type = "color", - order = 3, - name = L["Accent Color"], - desc = L["Color used in various frame accents. (ex: Dressing Room Backdrop Color)"], - hasAlpha = true, - get = function(key) - local color = SV.media.color.special - return color[1],color[2],color[3],color[4] - end, - set = function(key, rValue, gValue, bValue, aValue) - SV.media.color.special = {rValue, gValue, bValue, aValue} - SV.media.color.specialdark = {(rValue * 0.75), (gValue * 0.75), (bValue * 0.75), aValue} - SV:UpdateSharedMedia() - end, - }, - resetbutton = { - type = "execute", - order = 4, - name = L["Restore Defaults"], - func = function() - SV.media.color.default = {0.15, 0.15, 0.15, 1}; - SV.media.color.special = {0.4, 0.32, 0.2, 1}; - SV:UpdateSharedMedia() - end - } - } + type = 'toggle', + name = L["Report in Chat"], + desc = L["Announcements will be sent to group chat channels"], + get = function(j)return SV.db["Extras"].reactionChat end, + set = function(j,value)SV.db["Extras"].reactionChat = value;SV:ToggleReactions()end }, - loot = { + reactionEmote = { order = 7, - type = "toggle", - name = L['Loot Frame'], - desc = L['Enable/Disable the loot frame.'], - get = function()return SV.db.general.loot end, - set = function(j,value)SV.db.general.loot = value;SV:StaticPopup_Show("RL_CLIENT")end - }, - lootRoll = { - order = 8, - type = "toggle", - name = L['Loot Roll'], - desc = L['Enable/Disable the loot roll frame.'], - get = function()return SV.db.general.lootRoll end, - set = function(j,value)SV.db.general.lootRoll = value;SV:StaticPopup_Show("RL_CLIENT")end - }, - lootRollWidth = { - order = 9, - type = 'range', - width = "full", - name = L["Roll Frame Width"], - min = 100, - max = 328, - step = 1, - get = function()return SV.db.general.lootRollWidth end, - set = function(a,b) SV.db.general.lootRollWidth = b; end, - }, - lootRollHeight = { - order = 10, - type = 'range', - width = "full", - name = L["Roll Frame Height"], - min = 14, - max = 58, - step = 1, - get = function()return SV.db.general.lootRollHeight end, - set = function(a,b) SV.db.general.lootRollHeight = b; end, + type = 'toggle', + name = L["Auto Emotes"], + desc = L["Some announcements are accompanied by player emotes."], + get = function(j)return SV.db["Extras"].reactionEmote end, + set = function(j,value)SV.db["Extras"].reactionEmote = value;SV:ToggleReactions()end }, } }, - Extras = { - type = "group", + automations = { order = 2, - name = "Extras", + type = "group", + name = L["Automations"], guiInline = true, - get = function(a)return SV.db["Extras"][a[#a]]end, - set = function(a,b)SV:ChangeDBVar(b,a[#a]); end, args = { - common = { + intro = { order = 1, + type = "description", + name = L["Adjust the behavior of the many automations."] + }, + automationGroup1 = { + order = 2, type = "group", - name = L["General"], guiInline = true, + name = L["Task Minions"], + desc = L['Minions that can make certain tasks easier by handling them automatically.'], args = { - threatbar = { + mailOpener = { order = 1, type = 'toggle', - name = L["Threat Thermometer"], - desc = L["Enable/disable the custom SVUI threat meter"], - get = function(j)return SV.db["Extras"].threatbar end, - set = function(j,value)SV.db["Extras"].threatbar = value; SV:StaticPopup_Show("RL_CLIENT") end + name = L["Enable Mail Helper"], + get = function(j) return SV.db["Extras"].mailOpener end, + set = function(j,value) SV.db["Extras"].mailOpener = value; SV:ToggleMailMinions() end }, - woot = { + autoAcceptInvite = { order = 2, + name = L['Accept Invites'], + desc = L['Automatically accept invites from guild/friends.'], type = 'toggle', - name = L["Say Thanks"], - desc = L["Thank someone when they cast specific spells on you. Typically resurrections"], - get = function(j)return SV.db["Extras"].woot end, - set = function(j,value)SV.db["Extras"].woot = value;SV:ToggleReactions()end + get = function(j) return SV.db["Extras"].autoAcceptInvite end, + set = function(j,value) SV.db["Extras"].autoAcceptInvite = value end }, - pvpinterrupt = { + vendorGrays = { order = 3, + name = L['Vendor Grays'], + desc = L['Automatically vendor gray items when visiting a vendor.'], type = 'toggle', - name = L["Report PVP Actions"], - desc = L["Announce your interrupts, as well as when you have been sapped!"], - get = function(j)return SV.db["Extras"].pvpinterrupt end, - set = function(j,value)SV.db["Extras"].pvpinterrupt = value;SV:ToggleReactions()end + get = function(j) return SV.db["Extras"].vendorGrays end, + set = function(j,value) SV.db["Extras"].vendorGrays = value end }, - lookwhaticando = { + pvpautorelease = { order = 4, - type = 'toggle', - name = L["Report Spells"], - desc = L["Announce various helpful spells cast by players in your party/raid"], - get = function(j)return SV.db["Extras"].lookwhaticando end, - set = function(j,value)SV.db["Extras"].lookwhaticando = value;SV:ToggleReactions()end + type = "toggle", + name = L['PvP Autorelease'], + desc = L['Automatically release body when killed inside a battleground.'], + get = function(j) return SV.db["Extras"].pvpautorelease end, + set = function(j,value) SV.db["Extras"].pvpautorelease = value; SV:StaticPopup_Show("RL_CLIENT") end }, - sharingiscaring = { + autorepchange = { order = 5, - type = 'toggle', - name = L["Report Shareables"], - desc = L["Announce when someone in your party/raid has laid a feast or repair bot"], - get = function(j)return SV.db["Extras"].sharingiscaring end, - set = function(j,value)SV.db["Extras"].sharingiscaring = value;SV:ToggleReactions()end + type = "toggle", + name = L['Track Reputation'], + desc = L['Automatically change your watched faction on the reputation bar to the faction you got reputation points for.'], + get = function(j)return SV.db["Extras"].autorepchange end, + set = function(j,value)SV.db["Extras"].autorepchange = value end }, - reactionChat = { + skipcinematics = { order = 6, - type = 'toggle', - name = L["Report in Chat"], - desc = L["Announcements will be sent to group chat channels"], - get = function(j)return SV.db["Extras"].reactionChat end, - set = function(j,value)SV.db["Extras"].reactionChat = value;SV:ToggleReactions()end + type = "toggle", + name = L['Skip Cinematics'], + desc = L['Automatically skip any cinematic sequences.'], + get = function(j)return SV.db["Extras"].skipcinematics end, + set = function(j,value) SV.db["Extras"].skipcinematics = value; SV:StaticPopup_Show("RL_CLIENT") end }, - reactionEmote = { + autoRepair = { order = 7, - type = 'toggle', - name = L["Auto Emotes"], - desc = L["Some announcements are accompanied by player emotes."], - get = function(j)return SV.db["Extras"].reactionEmote end, - set = function(j,value)SV.db["Extras"].reactionEmote = value;SV:ToggleReactions()end + name = L['Auto Repair'], + desc = L['Automatically repair using the following method when visiting a merchant.'], + type = 'select', + values = { + ['NONE'] = NONE, + ['GUILD'] = GUILD, + ['PLAYER'] = PLAYER + }, + get = function(j)return SV.db["Extras"].autoRepair end, + set = function(j,value)SV.db["Extras"].autoRepair = value end }, } }, - automations = { - order = 2, + automationGroup2 = { + order = 3, type = "group", - name = L["Automations"], guiInline = true, + name = L["Looting Minions"], + desc = L['Minions that can make looting easier by rolling automatically.'], + get = function(key) return SV.db.Extras[key[#key]] end, + set = function(key,value) SV.db.Extras[key[#key]] = value; SV.Events:Trigger("LOOTING_UPVALUES_UPDATED"); end, + disabled = function() return not SV.db.general.lootRoll end, args = { - intro = { + autoRoll = { order = 1, - type = "description", - name = L["Adjust the behavior of the many automations."] + name = L['Auto Greed'], + desc = L['Automatically select greed on loot rolls.'], + type = 'toggle', }, - automationGroup1 = { + autoRollDisenchant = { order = 2, - type = "group", - guiInline = true, - name = L["Task Minions"], - desc = L['Minions that can make certain tasks easier by handling them automatically.'], - args = { - mailOpener = { - order = 1, - type = 'toggle', - name = L["Enable Mail Helper"], - get = function(j) return SV.db["Extras"].mailOpener end, - set = function(j,value) SV.db["Extras"].mailOpener = value; SV:ToggleMailMinions() end - }, - autoAcceptInvite = { - order = 2, - name = L['Accept Invites'], - desc = L['Automatically accept invites from guild/friends.'], - type = 'toggle', - get = function(j) return SV.db["Extras"].autoAcceptInvite end, - set = function(j,value) SV.db["Extras"].autoAcceptInvite = value end - }, - vendorGrays = { - order = 3, - name = L['Vendor Grays'], - desc = L['Automatically vendor gray items when visiting a vendor.'], - type = 'toggle', - get = function(j) return SV.db["Extras"].vendorGrays end, - set = function(j,value) SV.db["Extras"].vendorGrays = value end - }, - pvpautorelease = { - order = 4, - type = "toggle", - name = L['PvP Autorelease'], - desc = L['Automatically release body when killed inside a battleground.'], - get = function(j) return SV.db["Extras"].pvpautorelease end, - set = function(j,value) SV.db["Extras"].pvpautorelease = value; SV:StaticPopup_Show("RL_CLIENT") end - }, - autorepchange = { - order = 5, - type = "toggle", - name = L['Track Reputation'], - desc = L['Automatically change your watched faction on the reputation bar to the faction you got reputation points for.'], - get = function(j)return SV.db["Extras"].autorepchange end, - set = function(j,value)SV.db["Extras"].autorepchange = value end - }, - skipcinematics = { - order = 6, - type = "toggle", - name = L['Skip Cinematics'], - desc = L['Automatically skip any cinematic sequences.'], - get = function(j)return SV.db["Extras"].skipcinematics end, - set = function(j,value) SV.db["Extras"].skipcinematics = value; SV:StaticPopup_Show("RL_CLIENT") end - }, - autoRepair = { - order = 7, - name = L['Auto Repair'], - desc = L['Automatically repair using the following method when visiting a merchant.'], - type = 'select', - values = { - ['NONE'] = NONE, - ['GUILD'] = GUILD, - ['PLAYER'] = PLAYER - }, - get = function(j)return SV.db["Extras"].autoRepair end, - set = function(j,value)SV.db["Extras"].autoRepair = value end - }, - } + name = L['Auto Disenchant'], + desc = L['"Auto Greed" will select disenchant (when available).'], + type = 'toggle', }, - automationGroup2 = { + autoRollMaxLevel = { order = 3, - type = "group", - guiInline = true, - name = L["Looting Minions"], - desc = L['Minions that can make looting easier by rolling automatically.'], - get = function(key) return SV.db.Extras[key[#key]] end, - set = function(key,value) SV.db.Extras[key[#key]] = value; SV.Events:Trigger("LOOTING_UPVALUES_UPDATED"); end, - disabled = function() return not SV.db.general.lootRoll end, - args = { - autoRoll = { - order = 1, - name = L['Auto Greed'], - desc = L['Automatically select greed on loot rolls.'], - type = 'toggle', - }, - autoRollDisenchant = { - order = 2, - name = L['Auto Disenchant'], - desc = L['"Auto Greed" will select disenchant (when available).'], - type = 'toggle', - }, - autoRollMaxLevel = { - order = 3, - name = L['Only Max Level'], - desc = L['When set, "Auto Greed" will only operate if you are at max player level.'], - type = 'toggle', - }, - autoRollSoulbound = { - order = 4, - name = L['Allow Soulbound'], - desc = L['When set, "Auto Greed" will include items that are BoP.'], - type = 'toggle', - }, - autoRollQuality = { - order = 5, - name = L['Max Quality'], - desc = L['Set the highest item quality that "Auto Greed" will activate on.'], - type = 'select', - values = { - ['2'] = ITEM_QUALITY2_DESC, - ['3'] = ITEM_QUALITY3_DESC, - ['4'] = ITEM_QUALITY4_DESC - }, - }, - } + name = L['Only Max Level'], + desc = L['When set, "Auto Greed" will only operate if you are at max player level.'], + type = 'toggle', }, - automationGroup3 = { + autoRollSoulbound = { order = 4, - type = "group", - guiInline = true, - name = L["Quest Minions"], - desc = L['Minions that can make questing easier by automatically accepting/completing quests.'], - args = { - autoquestaccept = { - order = 1, - type = "toggle", - name = L['Accept Quests'], - desc = L['Automatically accepts quests as they are presented to you.'], - get = function(j)return SV.db["Extras"].autoquestaccept end, - set = function(j,value) SV.db["Extras"].autoquestaccept = value end - }, - autoquestcomplete = { - order = 2, - type = "toggle", - name = L['Complete Quests'], - desc = L['Automatically complete quests when possible.'], - get = function(j)return SV.db["Extras"].autoquestcomplete end, - set = function(j,value)SV.db["Extras"].autoquestcomplete = value end - }, - autoquestreward = { - order = 3, - type = "toggle", - name = L['Select Quest Reward'], - desc = L['Automatically select the quest reward with the highest vendor sell value.'], - get = function(j)return SV.db["Extras"].autoquestreward end, - set = function(j,value)SV.db["Extras"].autoquestreward = value end - }, - autodailyquests = { - order = 4, - type = "toggle", - name = L['Only Automate Dailies'], - desc = L['Force the auto accept functions to only respond to daily quests. NOTE: This does not apply to daily heroics for some reason.'], - get = function(j)return SV.db["Extras"].autodailyquests end, - set = function(j,value)SV.db["Extras"].autodailyquests = value end - }, - autopvpquests = { - order = 5, - type = "toggle", - name = L['Accept PVP Quests'], - get = function(j)return SV.db["Extras"].autopvpquests end, - set = function(j,value)SV.db["Extras"].autopvpquests = value end - }, - } + name = L['Allow Soulbound'], + desc = L['When set, "Auto Greed" will include items that are BoP.'], + type = 'toggle', + }, + autoRollQuality = { + order = 5, + name = L['Max Quality'], + desc = L['Set the highest item quality that "Auto Greed" will activate on.'], + type = 'select', + values = { + ['2'] = ITEM_QUALITY2_DESC, + ['3'] = ITEM_QUALITY3_DESC, + ['4'] = ITEM_QUALITY4_DESC + }, }, } }, - FunStuff = { + automationGroup3 = { + order = 4, type = "group", - order = 12, - name = L["Fun Stuff"], guiInline = true, + name = L["Quest Minions"], + desc = L['Minions that can make questing easier by automatically accepting/completing quests.'], args = { - drunk = { + autoquestaccept = { order = 1, - type = 'toggle', - name = L["Drunk Mode"], - get = function(j)return SV.db.FunStuff.drunk end, - set = function(j,value) SV.db.FunStuff.drunk = value; SV.Drunk:Toggle() end, + type = "toggle", + name = L['Accept Quests'], + desc = L['Automatically accepts quests as they are presented to you.'], + get = function(j)return SV.db["Extras"].autoquestaccept end, + set = function(j,value) SV.db["Extras"].autoquestaccept = value end }, - comix = { + autoquestcomplete = { order = 2, - type = 'select', - name = L["Comic Popups"], - get = function(j)return SV.db.FunStuff.comix end, - set = function(j,value) SV.db.FunStuff.comix = value; SV.Comix:Toggle() end, - values = { - ['NONE'] = NONE, - ['1'] = 'All Popups', - ['2'] = 'Only Small Popups', - } + type = "toggle", + name = L['Complete Quests'], + desc = L['Automatically complete quests when possible.'], + get = function(j)return SV.db["Extras"].autoquestcomplete end, + set = function(j,value)SV.db["Extras"].autoquestcomplete = value end }, - afk = { + autoquestreward = { order = 3, - type = 'select', - name = L["AFK Screen"], - get = function(j)return SV.db.FunStuff.afk end, - set = function(j,value) SV.db.FunStuff.afk = value; SV.AFK:Toggle() end, - values = { - ['NONE'] = NONE, - ['1'] = 'Fully Enabled', - ['2'] = 'Enabled (No Spinning)', - } + type = "toggle", + name = L['Select Quest Reward'], + desc = L['Automatically select the quest reward with the highest vendor sell value.'], + get = function(j)return SV.db["Extras"].autoquestreward end, + set = function(j,value)SV.db["Extras"].autoquestreward = value end }, - gamemenu = { + autodailyquests = { order = 4, - type = 'select', - name = L["Game Menu"], - get = function(j)return SV.db.FunStuff.gamemenu end, - set = function(j,value) SV.db.FunStuff.gamemenu = value; SV:StaticPopup_Show("RL_CLIENT") end, - values = { - ['NONE'] = NONE, - ['1'] = 'You + Henchman', - ['2'] = 'You x2', - } + type = "toggle", + name = L['Only Automate Dailies'], + desc = L['Force the auto accept functions to only respond to daily quests. NOTE: This does not apply to daily heroics for some reason.'], + get = function(j)return SV.db["Extras"].autodailyquests end, + set = function(j,value)SV.db["Extras"].autodailyquests = value end + }, + autopvpquests = { + order = 5, + type = "toggle", + name = L['Accept PVP Quests'], + get = function(j)return SV.db["Extras"].autopvpquests end, + set = function(j,value)SV.db["Extras"].autopvpquests = value end }, } }, } }, - Gear = { - order = 3, - type = 'group', - name = "Gear", + FunStuff = { + type = "group", + order = 12, + name = L["Fun Stuff"], guiInline = true, - get = function(key) return SV.db.Gear[key[#key]]end, - set = function(key, value) SV.db.Gear[key[#key]] = value; SV:UpdateGearInfo() end, - args={ - intro={ + args = { + drunk = { order = 1, - type = 'description', - name = function() - if(GetNumEquipmentSets()==0) then - return ("%s\n|cffFF0000Must create an equipment set to use some of these features|r"):format(L["EQUIPMENT_DESC"]) - else - return L["EQUIPMENT_DESC"] - end - end + type = 'toggle', + name = L["Drunk Mode"], + get = function(j)return SV.db.FunStuff.drunk end, + set = function(j,value) SV.db.FunStuff.drunk = value; SV.Drunk:Toggle() end, }, - specialization = { + comix = { order = 2, - type = "group", - name = L["Specialization"], - guiInline = true, - disabled = function() return GetNumEquipmentSets() == 0 end, - args = { - enable = { - type = "toggle", - order = 1, - name = L["Enable"], - desc = L["Enable/Disable the specialization switch."], - get = function(key) - return SV.db.Gear.specialization.enable - end, - set = function(key, value) - SV.db.Gear.specialization.enable = value - end - }, - primary = { - type = "select", - order = 2, - name = L["Primary Talent"], - desc = L["Choose the equipment set to use for your primary specialization."], - disabled = function() - return not SV.db.Gear.specialization.enable - end, - values = function() - local h = {["none"] = L["No Change"]} - for i = 1, GetNumEquipmentSets()do - local name = GetEquipmentSetInfo(i) - if name then - h[name] = name - end - end - tsort(h, sortingFunction) - return h - end - }, - secondary = { - type = "select", - order = 3, - name = L["Secondary Talent"], - desc = L["Choose the equipment set to use for your secondary specialization."], - disabled = function() return not SV.db.Gear.specialization.enable end, - values = function() - local h = {["none"] = L["No Change"]} - for i = 1, GetNumEquipmentSets()do - local name = GetEquipmentSetInfo(i) - if name then h[name] = name end - end - tsort(h, sortingFunction) - return h - end - } + type = 'select', + name = L["Comic Popups"], + get = function(j)return SV.db.FunStuff.comix end, + set = function(j,value) SV.db.FunStuff.comix = value; SV.Comix:Toggle() end, + values = { + ['NONE'] = NONE, + ['1'] = 'All Popups', + ['2'] = 'Only Small Popups', } }, - battleground = { + afk = { order = 3, - type = "group", - name = L["Battleground"], - guiInline = true, - disabled = function()return GetNumEquipmentSets() == 0 end, - args = { - enable = { - type = "toggle", - order = 1, - name = L["Enable"], - desc = L["Enable/Disable the battleground switch."], - get = function(e)return SV.db.Gear.battleground.enable end, - set = function(e,value)SV.db.Gear.battleground.enable = value end - }, - equipmentset = { - type = "select", - order = 2, - name = L["Equipment Set"], - desc = L["Choose the equipment set to use when you enter a battleground or arena."], - disabled = function()return not SV.db.Gear.battleground.enable end, - values = function() - local h = {["none"] = L["No Change"]} - for i = 1,GetNumEquipmentSets()do - local name = GetEquipmentSetInfo(i) - if name then h[name] = name end - end - tsort(h, sortingFunction) - return h - end - } + type = 'select', + name = L["AFK Screen"], + get = function(j)return SV.db.FunStuff.afk end, + set = function(j,value) SV.db.FunStuff.afk = value; SV.AFK:Toggle() end, + values = { + ['NONE'] = NONE, + ['1'] = 'Fully Enabled', + ['2'] = 'Enabled (No Spinning)', } }, - intro2 = { - type = "description", - name = L["DURABILITY_DESC"], - order = 4 - }, - durability = { - type = "group", - name = DURABILITY, - guiInline = true, - order = 5, - get = function(e)return SV.db.Gear.durability[e[#e]]end, - set = function(e,value)SV.db.Gear.durability[e[#e]] = value; SV:UpdateGearInfo() end, - args = { - enable = { - type = "toggle", - order = 1, - name = L["Enable"], - desc = L["Enable/Disable the display of durability information on the character screen."] - }, - onlydamaged = { - type = "toggle", - order = 2, - name = L["Damaged Only"], - desc = L["Only show durability information for items that are damaged."], - disabled = function()return not SV.db.Gear.durability.enable end - } + gamemenu = { + order = 4, + type = 'select', + name = L["Game Menu"], + get = function(j)return SV.db.FunStuff.gamemenu end, + set = function(j,value) SV.db.FunStuff.gamemenu = value; SV:StaticPopup_Show("RL_CLIENT") end, + values = { + ['NONE'] = NONE, + ['1'] = 'You + Henchman', + ['2'] = 'You x2', } }, - intro3 = { - type = "description", - name = L["ITEMLEVEL_DESC"], - order = 6 + } + }, + } +}; + +local function GetGearSetList() + local t = {["none"] = L["No Change"]} + for i = 1, GetNumEquipmentSets() do + local name = GetEquipmentSetInfo(i) + if name then + t[name] = name + end + end + tsort(t, sortingFunction) + return t +end + +SV.Options.args.Core.args.Gear = { + order = 3, + type = 'group', + name = "Gear", + guiInline = true, + get = function(key) return SV.db.Gear[key[#key]]end, + set = function(key, value) SV.db.Gear[key[#key]] = value; SV:UpdateGearInfo() end, + args = { + intro = { + order = 1, + type = 'description', + name = function() + if(GetNumEquipmentSets()==0) then + return ("%s\n|cffFF0000Must create an equipment set to use some of these features|r"):format(L["EQUIPMENT_DESC"]) + else + return L["EQUIPMENT_DESC"] + end + end + }, + specialization = { + order = 2, + type = "group", + name = L["Specialization"], + guiInline = true, + disabled = function() return GetNumEquipmentSets() == 0 end, + args = { + enable = { + type = "toggle", + order = 1, + name = L["Enable"], + desc = L["Enable/Disable auto swapping gear sets when switching specializations."], + get = function(key) return SV.db.Gear.specialization.enable end, + set = function(key, value) SV.db.Gear.specialization.enable = value; SV:UpdateGearInfo() end }, - itemlevel = { - type = "group", - name = STAT_AVERAGE_ITEM_LEVEL, - guiInline = true, - order = 7, - get = function(e)return SV.db.Gear.itemlevel[e[#e]]end, - set = function(e,value)SV.db.Gear.itemlevel[e[#e]] = value; SV:UpdateGearInfo() end, - args = { - enable = { - type = "toggle", - order = 1, - name = L["Enable"], - desc = L["Enable/Disable the display of item levels on the character screen."] - } - } + primary = { + type = "select", + order = 2, + name = L["Primary Gear Set"], + desc = L["Choose the equipment set to use for your primary specialization."], + disabled = function() return not SV.db.Gear.specialization.enable end, + values = GetGearSetList(), + get = function(e) return SV.db.Gear.specialization.primary end, + set = function(e,value) SV.db.Gear.specialization.primary = value; SV:UpdateGearInfo() end }, - misc = { - type = "group", - name = L["Miscellaneous"], - guiInline = true, - order = 8, - get = function(e) return SV.db.Gear.misc[e[#e]] end, - set = function(e,value) SV.db.Gear.misc[e[#e]] = value end, - args = { - setoverlay = { - type = "toggle", - order = 1, - name = L["Equipment Set Overlay"], - desc = L["Show the associated equipment sets for the items in your bags (or bank)."], - set = function(e,value) - SV.db.Gear.misc[e[#e]] = value; - SV:StaticPopup_Show("RL_CLIENT"); - end - } - } + secondary = { + type = "select", + order = 3, + name = L["Secondary Gear Set"], + desc = L["Choose the equipment set to use for your secondary specialization."], + disabled = function() return not SV.db.Gear.specialization.enable end, + values = GetGearSetList(), + get = function(e) return SV.db.Gear.specialization.secondary end, + set = function(e,value) SV.db.Gear.specialization.secondary = value; SV:UpdateGearInfo() end } } }, - errors = { - order = 4, + battleground = { + order = 3, type = "group", - name = L["Error Handling"], + name = L["Battleground"], guiInline = true, + disabled = function()return GetNumEquipmentSets() == 0 end, args = { - filterErrors = { - order = 1, - name = L["Filter Errors"], - desc = L["Choose specific errors from the list below to hide/ignore"], + enable = { type = "toggle", - get = function(key)return SV.db.general.filterErrors end, - set = function(key,value)SV.db.general.filterErrors = value; SV:UpdateErrorFilters() end + order = 1, + name = L["Enable"], + desc = L["Enable/Disable auto swapping gear sets in battlegrounds."], + get = function(e) return SV.db.Gear.battleground.enable end, + set = function(e,value) SV.db.Gear.battleground.enable = value; SV:UpdateGearInfo() end }, - hideErrorFrame = { + equipmentset = { + type = "select", order = 2, - name = L["Combat Hide All"], - desc = L["Hides all errors regardless of filtering while in combat."], + name = L["Battleground Gear Set"], + desc = L["Choose the equipment set to use when you enter a battleground or arena."], + disabled = function() return not SV.db.Gear.battleground.enable end, + values = GetGearSetList(), + get = function(e) return SV.db.Gear.battleground.equipmentset end, + set = function(e,value) SV.db.Gear.battleground.equipmentset = value; SV:UpdateGearInfo() end + } + } + }, + intro2 = { + type = "description", + name = L["DURABILITY_DESC"], + order = 4 + }, + durability = { + type = "group", + name = DURABILITY, + guiInline = true, + order = 5, + get = function(e)return SV.db.Gear.durability[e[#e]]end, + set = function(e,value)SV.db.Gear.durability[e[#e]] = value; SV:UpdateGearInfo() end, + args = { + enable = { type = "toggle", - disabled = function() return not SV.db.general.filterErrors end, - get = function(key) return SV.db.general.hideErrorFrame end, - set = function(key,value)SV.db.general.hideErrorFrame = value; SV:UpdateErrorFilters() end + order = 1, + name = L["Enable"], + desc = L["Enable/Disable the display of durability information on the character screen."] }, - filterGroup = { - order = 3, - type = "group", - guiInline = true, - name = L["Filters"], - disabled = function() return not SV.db.general.filterErrors end, - args = {} + onlydamaged = { + type = "toggle", + order = 2, + name = L["Damaged Only"], + desc = L["Only show durability information for items that are damaged."], + disabled = function()return not SV.db.Gear.durability.enable end + } + } + }, + intro3 = { + type = "description", + name = L["ITEMLEVEL_DESC"], + order = 6 + }, + itemlevels = { + type = "group", + name = STAT_AVERAGE_ITEM_LEVEL, + guiInline = true, + order = 7, + args = { + characterItemLevel = { + type = "toggle", + order = 1, + name = L["Character Screen iLevels"], + desc = L["Enable/Disable the display of item levels on the character screen."], + get = function(e)return SV.db.Gear.labels.characterItemLevel end, + set = function(e,value)SV.db.Gear.labels.characterItemLevel = value; SV:UpdateGearInfo() end, }, + inventoryItemLevel = { + type = "toggle", + order = 2, + name = L["Inventory iLevels"], + desc = L["Enable/Disable the display of item levels in your bags (or bank)."], + get = function(e)return SV.db.Gear.labels.inventoryItemLevel end, + set = function(e,value)SV.db.Gear.labels.inventoryItemLevel = value; SV:UpdateGearInfo() end, + } + } + }, + setNames = { + type = "group", + name = L["Set Labels"], + guiInline = true, + order = 8, + args = { + inventoryGearSet = { + type = "toggle", + order = 1, + name = L["Equipment Set Overlay"], + desc = L["Show the associated equipment sets for the items in your bags (or bank)."], + get = function(e)return SV.db.Gear.labels.inventoryGearSet end, + set = function(e,value)SV.db.Gear.labels.inventoryGearSet = value; SV:UpdateGearInfo() end, + } } + } + } +}; + +SV.Options.args.Core.args.errors = { + order = 4, + type = "group", + name = L["Error Handling"], + guiInline = true, + args = { + filterErrors = { + order = 1, + name = L["Filter Errors"], + desc = L["Choose specific errors from the list below to hide/ignore"], + type = "toggle", + get = function(key)return SV.db.general.filterErrors end, + set = function(key,value)SV.db.general.filterErrors = value; SV:UpdateErrorFilters() end + }, + hideErrorFrame = { + order = 2, + name = L["Combat Hide All"], + desc = L["Hides all errors regardless of filtering while in combat."], + type = "toggle", + disabled = function() return not SV.db.general.filterErrors end, + get = function(key) return SV.db.general.hideErrorFrame end, + set = function(key,value)SV.db.general.hideErrorFrame = value; SV:UpdateErrorFilters() end + }, + filterGroup = { + order = 3, + type = "group", + guiInline = true, + name = L["Filters"], + disabled = function() return not SV.db.general.filterErrors end, + args = {} }, } -} +}; + SV.Options.args.Screen = { type = 'group', name = 'Screen', diff --git a/SVUI_Inventory/Loader.lua b/SVUI_Inventory/Loader.lua index 563240f..ff4b333 100644 --- a/SVUI_Inventory/Loader.lua +++ b/SVUI_Inventory/Loader.lua @@ -1,7 +1,7 @@ --[[ ########################################################## S V U I By: Munglunch -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -48,34 +48,35 @@ SV.defaults[Schema] = { ["ArkInventory"] = true, ["Bagnon"] = true, }, - ["sortInverted"] = false, + ["sortInverted"] = false, ["bags"] = { - ["xOffset"] = -40, + ["xOffset"] = -40, ["yOffset"] = 40, ["point"] = "BOTTOMRIGHT", }, ["bank"] = { - ["xOffset"] = 40, + ["xOffset"] = 40, ["yOffset"] = 40, ["point"] = "BOTTOMLEFT", }, - ["bagSize"] = 34, - ["bankSize"] = 34, - ["alignToChat"] = false, - ["bagWidth"] = 525, - ["bankWidth"] = 525, - ["currencyFormat"] = "ICON", - ["ignoreItems"] = "", + ["bagSize"] = 34, + ["bankSize"] = 34, + ["alignToChat"] = false, + ["bagWidth"] = 525, + ["bankWidth"] = 525, + ["currencyFormat"] = "ICON", + ["ignoreItems"] = "", ["bagTools"] = true, + ["iLevels"] = true, ["bagBar"] = { - ["enable"] = false, - ["showBy"] = "VERTICAL", - ["sortDirection"] = "ASCENDING", - ["size"] = 30, - ["spacing"] = 4, - ["showBackdrop"] = false, - ["mouseover"] = false, - }, + ["enable"] = false, + ["showBy"] = "VERTICAL", + ["sortDirection"] = "ASCENDING", + ["size"] = 30, + ["spacing"] = 4, + ["showBackdrop"] = false, + ["mouseover"] = false, + }, }; function MOD:LoadOptions() @@ -93,7 +94,7 @@ function MOD:LoadOptions() }; SV:GenerateFontOptionGroup("Bags", 7, "Fonts used in bag slots.", bagFonts) - + SV.Options.args[Schema] = { type = 'group', name = Schema, @@ -102,185 +103,185 @@ function MOD:LoadOptions() set = function(a,b)MOD:ChangeDBVar(b,a[#a]) end, args = { intro = { - order = 1, - type = "description", + order = 1, + type = "description", name = L["BAGS_DESC"] }, bagGroups={ order = 2, type = 'group', name = L['Bag Options'], - guiInline = true, + guiInline = true, args = { common = { - order = 1, + order = 1, type = "group", - guiInline = true, + guiInline = true, name = L["General"], args = { bagSize = { - order = 1, - type = "range", - name = L["Button Size (Bag)"], - desc = L["The size of the individual buttons on the bag frame."], - min = 15, - max = 45, - step = 1, + order = 1, + type = "range", + name = L["Button Size (Bag)"], + desc = L["The size of the individual buttons on the bag frame."], + min = 15, + max = 45, + step = 1, set = function(a,b) MOD:ChangeDBVar(b,a[#a]) MOD:RefreshBagFrames("BagFrame") end, disabled = function()return SV.db[Schema].alignToChat end }, bankSize = { - order = 2, - type = "range", - name = L["Button Size (Bank)"], - desc = L["The size of the individual buttons on the bank frame."], - min = 15, - max = 45, - step = 1, + order = 2, + type = "range", + name = L["Button Size (Bank)"], + desc = L["The size of the individual buttons on the bank frame."], + min = 15, + max = 45, + step = 1, set = function(a,b) MOD:ChangeDBVar(b,a[#a]) MOD:RefreshBagFrames("BankFrame") end, disabled = function()return SV.db[Schema].alignToChat end }, bagWidth = { - order = 3, - type = "range", - name = L["Panel Width (Bags)"], - desc = L["Adjust the width of the bag frame."], - min = 150, - max = 700, - step = 1, - set = function(a,b) MOD:ChangeDBVar(b,a[#a]) MOD:RefreshBagFrames("BagFrame") end, + order = 3, + type = "range", + name = L["Panel Width (Bags)"], + desc = L["Adjust the width of the bag frame."], + min = 150, + max = 700, + step = 1, + set = function(a,b) MOD:ChangeDBVar(b,a[#a]) MOD:RefreshBagFrames("BagFrame") end, disabled = function()return SV.db[Schema].alignToChat end }, bankWidth = { - order = 4, - type = "range", - name = L["Panel Width (Bank)"], - desc = L["Adjust the width of the bank frame."], - min = 150, - max = 700, - step = 1, - set = function(a,b) MOD:ChangeDBVar(b,a[#a]) MOD:RefreshBagFrames("BankFrame") end, + order = 4, + type = "range", + name = L["Panel Width (Bank)"], + desc = L["Adjust the width of the bank frame."], + min = 150, + max = 700, + step = 1, + set = function(a,b) MOD:ChangeDBVar(b,a[#a]) MOD:RefreshBagFrames("BankFrame") end, disabled = function() return SV.db[Schema].alignToChat end }, currencyFormat = { - order = 5, - type = "select", - name = L["Currency Format"], - desc = L["The display format of the currency icons that get displayed below the main bag. (You have to be watching a currency for this to display)"], + order = 5, + type = "select", + name = L["Currency Format"], + desc = L["The display format of the currency icons that get displayed below the main bag. (You have to be watching a currency for this to display)"], values = { - ["ICON"] = L["Icons Only"], + ["ICON"] = L["Icons Only"], ["ICON_TEXT"] = L["Icons and Text"] }, set = function(a,b)MOD:ChangeDBVar(b,a[#a]) MOD:RefreshTokens() end }, sortInverted = { - order = 6, - type = "toggle", - name = L["Sort Inverted"], + order = 6, + type = "toggle", + name = L["Sort Inverted"], desc = L["Direction the bag sorting will use to allocate the items."] }, bagTools = { - order = 7, - type = "toggle", - name = L["Profession Tools"], - desc = L["Enable/Disable Prospecting, Disenchanting and Milling buttons on the bag frame."], + order = 7, + type = "toggle", + name = L["Profession Tools"], + desc = L["Enable/Disable Prospecting, Disenchanting and Milling buttons on the bag frame."], set = function(a,b)MOD:ChangeDBVar(b,a[#a])SV:StaticPopup_Show("RL_CLIENT")end }, ignoreItems = { - order = 8, - name = L["Ignore Items"], - desc = L["List of items to ignore when sorting. If you wish to add multiple items you must seperate the word with a comma."], - type = "input", - width = "full", - multiline = true, + order = 8, + name = L["Ignore Items"], + desc = L["List of items to ignore when sorting. If you wish to add multiple items you must seperate the word with a comma."], + type = "input", + width = "full", + multiline = true, set = function(a,b) SV.db[Schema][a[#a]] = b end } } }, position = { - order = 2, - type = "group", - guiInline = true, - name = L["Bag/Bank Positioning"], + order = 2, + type = "group", + guiInline = true, + name = L["Bag/Bank Positioning"], args = { alignToChat = { - order = 1, - type = "toggle", - name = L["Align To Docks"], - desc = L["Align the width of the bag frame to fit inside dock windows."], + order = 1, + type = "toggle", + name = L["Align To Docks"], + desc = L["Align the width of the bag frame to fit inside dock windows."], set = function(a,b)MOD:ChangeDBVar(b,a[#a]) MOD:RefreshBagFrames() end }, bags = { - order = 2, - type = "group", + order = 2, + type = "group", name = L["Bag Position"], - guiInline = true, + guiInline = true, get = function(key) return SV.db[Schema].bags[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bags"); MOD:ModifyBags() end, args = { point = { - order = 1, - name = L["Anchor Point"], + order = 1, + name = L["Anchor Point"], type = "select", - values = pointList, + values = pointList, }, xOffset = { - order = 2, - type = "range", + order = 2, + type = "range", name = L["X Offset"], - min = -600, - max = 600, + min = -600, + max = 600, step = 1, }, yOffset = { - order = 3, - type = "range", + order = 3, + type = "range", name = L["Y Offset"], - min = -600, - max = 600, + min = -600, + max = 600, step = 1, }, } }, bank = { - order = 3, - type = "group", + order = 3, + type = "group", name = L["Bank Position"], - guiInline = true, + guiInline = true, get = function(key) return SV.db[Schema].bank[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bank"); MOD:ModifyBags() end, args = { point = { - order = 1, - name = L["Anchor Point"], + order = 1, + name = L["Anchor Point"], type = "select", - values = pointList, + values = pointList, }, xOffset = { - order = 2, - type = "range", + order = 2, + type = "range", name = L["X Offset"], - min = -600, - max = 600, + min = -600, + max = 600, step = 1, }, yOffset = { - order = 3, - type = "range", + order = 3, + type = "range", name = L["Y Offset"], - min = -600, - max = 600, + min = -600, + max = 600, step = 1, }, } - }, + }, } }, bagBar = { order = 4, type = "group", name = L["Bag-Bar"], - guiInline = true, + guiInline = true, get = function(key) return SV.db[Schema].bagBar[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bagBar"); MOD:ModifyBagBar() end, args={ @@ -293,58 +294,58 @@ function MOD:LoadOptions() set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bagBar"); SV:StaticPopup_Show("RL_CLIENT")end }, mouseover = { - order = 2, - name = L["Mouse Over"], - desc = L["Hidden unless you mouse over the frame."], + order = 2, + name = L["Mouse Over"], + desc = L["Hidden unless you mouse over the frame."], type = "toggle" }, showBackdrop = { - order = 3, - name = L["Backdrop"], - desc = L["Show/Hide bag bar backdrop"], + order = 3, + name = L["Backdrop"], + desc = L["Show/Hide bag bar backdrop"], type = "toggle" }, spacer = { - order = 4, - name = "", - type = "description", - width = "full", + order = 4, + name = "", + type = "description", + width = "full", }, size = { - order = 5, - type = "range", - name = L["Button Size"], - desc = L["Set the size of your bag buttons."], - min = 24, - max = 60, + order = 5, + type = "range", + name = L["Button Size"], + desc = L["Set the size of your bag buttons."], + min = 24, + max = 60, step = 1 }, spacing = { - order = 6, - type = "range", - name = L["Button Spacing"], - desc = L["The spacing between buttons."], - min = 1, - max = 10, + order = 6, + type = "range", + name = L["Button Spacing"], + desc = L["The spacing between buttons."], + min = 1, + max = 10, step = 1 }, sortDirection = { - order = 7, - type = "select", - name = L["Sort Direction"], - desc = L["The direction that the bag frames will grow from the anchor."], + order = 7, + type = "select", + name = L["Sort Direction"], + desc = L["The direction that the bag frames will grow from the anchor."], values = { - ["ASCENDING"] = L["Ascending"], + ["ASCENDING"] = L["Ascending"], ["DESCENDING"] = L["Descending"] } }, showBy = { - order = 8, - type = "select", - name = L["Bar Direction"], - desc = L["The direction that the bag frames be (Horizontal or Vertical)."], + order = 8, + type = "select", + name = L["Bar Direction"], + desc = L["The direction that the bag frames be (Horizontal or Vertical)."], values = { - ["VERTICAL"] = L["Vertical"], + ["VERTICAL"] = L["Vertical"], ["HORIZONTAL"] = L["Horizontal"] } } @@ -354,4 +355,4 @@ function MOD:LoadOptions() } } }; -end \ No newline at end of file +end diff --git a/SVUI_Inventory/SVUI_Inventory.lua b/SVUI_Inventory/SVUI_Inventory.lua index d3b631f..16cd572 100644 --- a/SVUI_Inventory/SVUI_Inventory.lua +++ b/SVUI_Inventory/SVUI_Inventory.lua @@ -71,7 +71,6 @@ local RefProfessionColors = { [0x10000] = {222/255,13/255,65/255}, [0x100000] = {18/255,224/255,180/255} } -local ILEVEL_COLOR_KEYS = { [0] = "|cffff0000", [1] = "|cff00ff00", [2] = "|cffffff88" }; --[[ ########################################################## LOCAL FUNCTIONS @@ -157,73 +156,6 @@ local function StyleBagToolButton(button, iconTex) end button.styled = true end - -local function encodeSub(i, j, k) - local l = j; - while k>0 and l <= #i do - local m = byte(i, l) - if m>240 then - l = l + 4; - elseif m>225 then - l = l + 3; - elseif m>192 then - l = l + 2; - else - l = l + 1; - end - k = k-1; - end - return i:sub(j, (l-1)) -end - -local function SetGearLabel(font, level, saveTo) - if(not saveTo) then - font:SetText() - else - if level == 1 then - font:SetFormattedText("|cffffffaa%s|r", encodeSub(saveTo[1], 1, 4)) - elseif level == 2 then - font:SetFormattedText("|cffffffaa%s %s|r", encodeSub(saveTo[1], 1, 4), encodeSub(saveTo[2], 1, 4)) - elseif level == 3 then - font:SetFormattedText("|cffffffaa%s %s %s|r", encodeSub(saveTo[1], 1, 4), encodeSub(saveTo[2], 1, 4), encodeSub(saveTo[3], 1, 4)) - else - font:SetText() - end - end -end - -local function SetItemLevelLabel(font, iLevel, quality, equipSlot) - if((not iLevel) or (iLevel <= 1) or (quality and quality == 7) or (not equipSlot) or (not equipSlot:find('INVTYPE'))) then - font:SetText() - else - local avgILevel = floor(select(2, GetAverageItemLevel())); - local key = (iLevel < (avgILevel - 10)) and 0 or (iLevel > (avgILevel + 10)) and 1 or 2; - font:SetFormattedText("%s%d|r", ILEVEL_COLOR_KEYS[key], iLevel) - end -end - -function MOD:BuildEquipmentMap() - for key, gearData in pairs(GEARSET_LISTING) do - twipe(gearData); - end - local set, player, bank, bags, slotIndex, bagIndex, loc, _; - for i = 1, GetNumEquipmentSets() do - set = GetEquipmentSetInfo(i); - GEAR_CACHE = GetEquipmentSetLocations(set); - if(GEAR_CACHE) then - for key, location in pairs(GEAR_CACHE) do - if(type(location) ~= "string") then - player, bank, bags, _, slotIndex, bagIndex = EquipmentManager_UnpackLocation(location); - if((bank or bags) and (slotIndex and bagIndex)) then - loc = format("%d_%d", bagIndex, slotIndex); - GEARSET_LISTING[loc] = (GEARSET_LISTING[loc] or {}); - tinsert(GEARSET_LISTING[loc], set); - end - end - end - end - end -end --[[ ########################################################## CORE FUNCTIONS @@ -330,26 +262,13 @@ local SlotUpdate = function(self, slotID) if(slot.NewItemTexture) then slot.NewItemTexture:Hide() end; if(slot.flashAnim) then slot.flashAnim:Stop() end; - if(slot.newitemglowAnim) then slot.newitemglowAnim:Stop() end; + if(slot.newitemglowAnim) then slot.newitemglowAnim:Stop() end; SetItemButtonTexture(slot, texture) SetItemButtonCount(slot, count) SetItemButtonDesaturated(slot, locked, 0.5, 0.5, 0.5) - if(slot.GearInfo) then - local loc = format("%d_%d", bagID, slotID) - if(GEARSET_LISTING[loc]) then - local level = #GEARSET_LISTING[loc] < 4 and #GEARSET_LISTING[loc] or 3; - SetGearLabel(slot.GearInfo, level, GEARSET_LISTING[loc]) - else - SetGearLabel(slot.GearInfo, 0) - end - end - - if(slot.iLevel) then - local iLevel = SV:ParseItemLevel('player', itemLink) - SetItemLevelLabel(slot.iLevel, iLevel, quality, equipSlot) - end + SV:SetGearLabels(slot, bagID, slotID, itemLink, quality, equipSlot) end local ContainerFrame_RefreshSlots = function(self) @@ -596,13 +515,13 @@ local ContainerFrame_UpdateLayout = function(self) self.Bags[bagID][slotID].GearInfo:SetJustifyV('TOP') end - if(not self.Bags[bagID][slotID].iLevel) then - self.Bags[bagID][slotID].iLevel = self.Bags[bagID][slotID]:CreateFontString(nil,"OVERLAY") - self.Bags[bagID][slotID].iLevel:SetFontObject(SVUI_Font_Default) - self.Bags[bagID][slotID].iLevel:SetAllPoints(self.Bags[bagID][slotID]) - self.Bags[bagID][slotID].iLevel:SetWordWrap(true) - self.Bags[bagID][slotID].iLevel:SetJustifyH('LEFT') - self.Bags[bagID][slotID].iLevel:SetJustifyV('BOTTOM') + if(not self.Bags[bagID][slotID].ItemLevel) then + self.Bags[bagID][slotID].ItemLevel = self.Bags[bagID][slotID]:CreateFontString(nil,"OVERLAY") + self.Bags[bagID][slotID].ItemLevel:SetFontObject(SVUI_Font_Default) + self.Bags[bagID][slotID].ItemLevel:SetAllPoints(self.Bags[bagID][slotID]) + self.Bags[bagID][slotID].ItemLevel:SetWordWrap(true) + self.Bags[bagID][slotID].ItemLevel:SetJustifyH('LEFT') + self.Bags[bagID][slotID].ItemLevel:SetJustifyV('BOTTOM') end self.Bags[bagID][slotID]:SetID(slotID); diff --git a/SVUI_Inventory/components/organization.lua b/SVUI_Inventory/components/organization.lua index bbb1b85..b6c7135 100644 --- a/SVUI_Inventory/components/organization.lua +++ b/SVUI_Inventory/components/organization.lua @@ -246,26 +246,10 @@ end local Container_OnEvent = function(self, event, ...) if(event == "ITEM_LOCK_CHANGED" or event == "ITEM_UNLOCKED") then - -- if(self.isBank and self.BagMenu) then - -- for i, bagID in ipairs(self.BagIDs) do - -- local bagSlot = self.BagMenu[i]; - -- if(bagSlot) then - -- BankFrameItemButton_Update(bagSlot) - -- BankFrameItemButton_UpdateLocked(bagSlot) - -- end - -- end - -- end UpdateSlot(self, ...) elseif(event == "BAG_UPDATE" or event == "EQUIPMENT_SETS_CHANGED") then - MOD:BuildEquipmentMap() + SV:BuildEquipmentMap() for i, bagID in ipairs(self.BagIDs) do - -- if(self.isBank and self.BagMenu) then - -- local bagSlot = self.BagMenu[i]; - -- if(bagSlot) then - -- BankFrameItemButton_Update(bagSlot) - -- BankFrameItemButton_UpdateLocked(bagSlot) - -- end - -- end local numSlots = GetContainerNumSlots(bagID) if(not self.Bags[bagID] and numSlots ~= 0) or (self.Bags[bagID] and (numSlots ~= self.Bags[bagID].numSlots)) then self:UpdateLayout(); diff --git a/SVUI_QuestTracker/Loader.lua b/SVUI_QuestTracker/Loader.lua index a79372b..b46d172 100644 --- a/SVUI_QuestTracker/Loader.lua +++ b/SVUI_QuestTracker/Loader.lua @@ -1,7 +1,7 @@ --[[ ########################################################## S V U I By: Munglunch -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -24,7 +24,7 @@ MOD.media.completeIcon = [[Interface\AddOns\SVUI_QuestTracker\assets\QUEST-COMPL MOD.media.incompleteIcon = [[Interface\AddOns\SVUI_QuestTracker\assets\QUEST-INCOMPLETE-ICON]]; SV.defaults[Schema] = { - ["itemBarDirection"] = 'VERTICAL', + ["itemBarDirection"] = 'VERTICAL', }; SV:AssignMedia("font", "questdialog", "SVUI Default Font", 12, "OUTLINE"); @@ -46,31 +46,31 @@ function MOD:LoadOptions() order = 2, name = "Quest Tracker Titles", desc = "Font used in the quest tracker for listing headers." - }, + }, ["questnumber"] = { order = 3, name = "Quest Tracker Numbers", desc = "Font used in the quest tracker to display numeric values." }, }; - + SV:GenerateFontOptionGroup("QuestTracker", 6, "Fonts used in the SVUI Quest Tracker.", questFonts) - + SV.Options.args[Schema] = { - type = "group", - name = Schema, - get = function(a)return SV.db[Schema][a[#a]]end, - set = function(a,b)MOD:ChangeDBVar(b,a[#a]); end, + type = "group", + name = Schema, + get = function(a)return SV.db[Schema][a[#a]] end, + set = function(a,b)MOD:ChangeDBVar(b,a[#a]); SV:StaticPopup_Show("RL_CLIENT") end, args = { itemBarDirection = { - order = 1, - type = 'select', - name = L["Item Bar Direction"], + order = 1, + type = 'select', + name = L["Item Bar Direction"], values = { - ['VERTICAL'] = L['Vertical'], + ['VERTICAL'] = L['Vertical'], ['HORIZONTAL'] = L['Horizontal'] }, }, } } -end \ No newline at end of file +end diff --git a/SVUI_QuestTracker/components/quests.lua b/SVUI_QuestTracker/components/quests.lua index 46e6918..4abeff6 100644 --- a/SVUI_QuestTracker/components/quests.lua +++ b/SVUI_QuestTracker/components/quests.lua @@ -1141,6 +1141,7 @@ function MOD:InitializeQuests() end SV:NewAnchor(ItemBar, L["Quest Items"]); + for i = 1, 5 do ItemBar.Buttons[i] = CreateQuestItemButton(i) end diff --git a/SVUI_Skins/artwork/UI-LFG-ICON-ROLES.blp b/SVUI_Skins/artwork/UI-LFG-ICON-ROLES.blp new file mode 100644 index 0000000..4ba2a09 Binary files /dev/null and b/SVUI_Skins/artwork/UI-LFG-ICON-ROLES.blp differ diff --git a/SVUI_Skins/artwork/UI-LFG-ICONS-ROLEBACKGROUNDS.blp b/SVUI_Skins/artwork/UI-LFG-ICONS-ROLEBACKGROUNDS.blp new file mode 100644 index 0000000..607f5da Binary files /dev/null and b/SVUI_Skins/artwork/UI-LFG-ICONS-ROLEBACKGROUNDS.blp differ diff --git a/SVUI_Skins/components/blizzard/lfd.lua b/SVUI_Skins/components/blizzard/lfd.lua index 4325882..0388757 100644 --- a/SVUI_Skins/components/blizzard/lfd.lua +++ b/SVUI_Skins/components/blizzard/lfd.lua @@ -14,8 +14,8 @@ local SV = _G['SVUI']; local L = SV.L; local MOD = SV.Skins; local Schema = MOD.Schema; ---[[ -########################################################## +--[[ +########################################################## HELPERS ########################################################## ]]-- @@ -47,7 +47,7 @@ local function StyleMoneyRewards(frameName) icon:ClearAllPoints() icon:SetPoint("TOPLEFT", frame, "TOPLEFT", 3, -3) icon:SetSize(size, size) - if(not frame.IconSlot) then + if(not frame.IconSlot) then frame.IconSlot = CreateFrame("Frame", nil, frame) frame.IconSlot:WrapPoints(icon) frame.IconSlot:SetStyle("Icon") @@ -60,21 +60,21 @@ local Incentive_OnShow = function(button) local parent = button:GetParent() local check = parent.checkButton or parent.CheckButton ActionButton_ShowOverlayGlow(check) -end +end local Incentive_OnHide = function(button) local parent = button:GetParent() local check = parent.checkButton or parent.CheckButton ActionButton_HideOverlayGlow(check) -end +end local LFDQueueRandom_OnUpdate = function() LFDQueueFrame:RemoveTextures() - for u = 1, LFD_MAX_REWARDS do + for u = 1, LFD_MAX_REWARDS do local t = _G["LFDQueueFrameRandomScrollFrameChildFrameItem"..u] local icon = _G["LFDQueueFrameRandomScrollFrameChildFrameItem"..u.."IconTexture"] if t then - if not t.restyled then + if not t.restyled then local x = _G["LFDQueueFrameRandomScrollFrameChildFrameItem"..u.."ShortageBorder"] local y = _G["LFDQueueFrameRandomScrollFrameChildFrameItem"..u.."Count"] local z = _G["LFDQueueFrameRandomScrollFrameChildFrameItem"..u.."NameFrame"] @@ -90,24 +90,24 @@ local LFDQueueRandom_OnUpdate = function() icon:SetParent(t.border) y:SetParent(t.border) t.restyled = true; - for A = 1, 3 do + for A = 1, 3 do local B = _G["LFDQueueFrameRandomScrollFrameChildFrameItem"..u.."RoleIcon"..A] if B then B:SetParent(t.border) - end - end - end - end - end -end + end + end + end + end + end +end local ScenarioQueueRandom_OnUpdate = function() LFDQueueFrame:RemoveTextures() - for u = 1, LFD_MAX_REWARDS do + for u = 1, LFD_MAX_REWARDS do local t = _G["ScenarioQueueFrameRandomScrollFrameChildFrameItem"..u] local icon = _G["ScenarioQueueFrameRandomScrollFrameChildFrameItem"..u.."IconTexture"] if t then - if not t.restyled then + if not t.restyled then local x = _G["ScenarioQueueFrameRandomScrollFrameChildFrameItem"..u.."ShortageBorder"] local y = _G["ScenarioQueueFrameRandomScrollFrameChildFrameItem"..u.."Count"] local z = _G["ScenarioQueueFrameRandomScrollFrameChildFrameItem"..u.."NameFrame"]icon:SetTexCoord(unpack(_G.SVUI_ICON_COORDS)) @@ -121,27 +121,27 @@ local ScenarioQueueRandom_OnUpdate = function() t.border:WrapPoints(icon) icon:SetParent(t.border) y:SetParent(t.border) - t.restyled = true - end - end + t.restyled = true + end + end end StyleMoneyRewards("LFDQueueFrameRandomScrollFrameChildFrameMoneyReward") StyleMoneyRewards("RaidFinderQueueFrameScrollFrameChildFrameMoneyReward") StyleMoneyRewards("ScenarioQueueFrameRandomScrollFrameChildFrameMoneyReward") end ---[[ -########################################################## +--[[ +########################################################## LFD MODR ########################################################## ]]-- local function LFDFrameStyle() if SV.db.Skins.blizzard.enable ~= true or SV.db.Skins.blizzard.lfg ~= true then return end - + SV.API:Set("Window", PVEFrame) - + LFGDungeonReadyDialog:RemoveTextures() LFGDungeonReadyDialog:SetStyle("Frame", "Pattern", true, 2, 4, 4) - + PVEFrameLeftInset:RemoveTextures() RaidFinderQueueFrame:RemoveTextures(true) PVEFrameBg:Hide() @@ -172,23 +172,27 @@ local function LFDFrameStyle() LFGDungeonReadyStatus:RemoveTextures() LFGDungeonReadyStatus:SetStyle("Frame", "Pattern", true, 2, 4, 4) - LFGDungeonReadyDialogRoleIconTexture:SetTexture("Interface\\LFGFrame\\UI-LFG-ICONS-ROLEBACKGROUNDS") - LFGDungeonReadyDialogRoleIconTexture:SetAlpha(0.5) - + --/script StaticPopupSpecial_Show(LFGDungeonReadyStatus); LFGDungeonReadyPopup:RemoveTextures() LFGDungeonReadyPopup:SetStyle("Frame", "Pattern", true, 2, 4, 4) + --LFGDungeonReadyPopup:SetScript('OnShow', nil) + --/script StaticPopupSpecial_Show(LFGDungeonReadyPopup); + -- LFGDungeonReadyDialogRoleIconTexture:SetTexture("Interface\\AddOns\\SVUI_Skins\\artwork\\UI-LFG-ICONS-ROLEBACKGROUNDS") + -- LFGDungeonReadyDialogRoleIconTexture:SetAlpha(0.5) + -- LFGDungeonReadyDialogRoleIconTexture:SetTexCoord(LFDQueueFrameRoleButtonDPS.background:GetTexCoord()) + -- -- hooksecurefunc("LFGDungeonReadyPopup_Update", function() - -- local proposalExists, id, typeID, subtypeID, name, texture, role, hasResponded, totalEncounters, completedEncounters, numMembers, isLeader, isHoliday, proposalCategory = GetLFGProposal(); - -- if LFGDungeonReadyDialogRoleIcon:IsShown() then - -- if(role == "DAMAGER") then + -- local proposalExists, _, _, _, _, _, role = GetLFGProposal(); + -- if proposalExists and role and LFGDungeonReadyDialogRoleIcon:IsShown() then + -- if(role == "DAMAGER") then -- LFGDungeonReadyDialogRoleIconTexture:SetTexCoord(LFDQueueFrameRoleButtonDPS.background:GetTexCoord()) - -- elseif(role == "TANK") then + -- elseif(role == "TANK") then -- LFGDungeonReadyDialogRoleIconTexture:SetTexCoord(LFDQueueFrameRoleButtonTank.background:GetTexCoord()) - -- elseif(role == "HEALER") then + -- elseif(role == "HEALER") then -- LFGDungeonReadyDialogRoleIconTexture:SetTexCoord(LFDQueueFrameRoleButtonHealer.background:GetTexCoord()) - -- end - -- end + -- end + -- end -- end) LFDQueueFrameRoleButtonTankIncentiveIcon:SetAlpha(0) @@ -237,7 +241,7 @@ local function LFDFrameStyle() end if self.background then self.background:Show() - end + end end) hooksecurefunc('LFG_EnableRoleButton', function(self) @@ -251,7 +255,7 @@ local function LFDFrameStyle() if self.background then self.background:Show() self.background:SetDesaturated(true) - end + end end) for i = 1, 4 do @@ -286,7 +290,7 @@ local function LFDFrameStyle() LFDQueueFrameSpecificListScrollFrame:RemoveTextures() LFDQueueFrameFindGroupButton:SetStyle("Button") hooksecurefunc("LFDQueueFrameRandom_UpdateFrame", LFDQueueRandom_OnUpdate) - + SV.API:Set("DropDown", LFDQueueFrameTypeDropDown) RaidFinderFrame:RemoveTextures() @@ -302,11 +306,11 @@ local function LFDFrameStyle() RaidFinderFrameFindRaidButton:SetStyle("Button") RaidFinderQueueFrame:RemoveTextures() - for u = 1, LFD_MAX_REWARDS do + for u = 1, LFD_MAX_REWARDS do local t = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u] local icon = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u.."IconTexture"] if t then - if not t.restyled then + if not t.restyled then local x = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u.."ShortageBorder"] local y = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u.."Count"] local z = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u.."NameFrame"] @@ -322,9 +326,9 @@ local function LFDFrameStyle() t.border:WrapPoints(icon) icon:SetParent(t.border) y:SetParent(t.border) - t.restyled = true - end - end + t.restyled = true + end + end end StyleMoneyRewards("LFDQueueFrameRandomScrollFrameChildFrameMoneyReward") @@ -348,10 +352,10 @@ local function LFDFrameStyle() LFRQueueFrameSpecificListScrollFrameScrollBackgroundBottomRight:Hide() LFRBrowseFrameRoleInsetBg:Hide() - for u = 1, 14 do + for u = 1, 14 do if u ~= 6 and u ~= 8 then select(u, RaidBrowserFrame:GetRegions()):Hide() - end + end end RaidBrowserFrame:SetStyle("Frame", 'Pattern') @@ -365,7 +369,7 @@ local function LFDFrameStyle() if not LFRQueueFrameSpecificListScrollFrameScrollBar.styled then SV.API:Set("ScrollBar", LFRQueueFrameSpecificListScrollFrameScrollBar) LFRBrowseFrame:RemoveTextures() - for u = 1, 2 do + for u = 1, 2 do local C = _G['LFRParentFrameSideTab'..u] C:DisableDrawLayer('BACKGROUND') C:GetNormalTexture():SetTexCoord(unpack(_G.SVUI_ICON_COORDS)) @@ -377,23 +381,25 @@ local function LFDFrameStyle() hooksecurefunc(C:GetHighlightTexture(), "SetTexture", function(o, D) if D ~= nil then o:SetTexture("") - end + end end) - end - for u = 1, 7 do + end + for u = 1, 7 do local C = _G['LFRBrowseFrameColumnHeader'..u] C:DisableDrawLayer('BACKGROUND') - end + end SV.API:Set("DropDown", LFRBrowseFrameRaidDropDown) LFRBrowseFrameRefreshButton:SetStyle("Button") LFRBrowseFrameInviteButton:SetStyle("Button") LFRBrowseFrameSendMessageButton:SetStyle("Button") - LFRQueueFrameSpecificListScrollFrameScrollBar.styled = true - end + LFRQueueFrameSpecificListScrollFrameScrollBar.styled = true + end end) LFGInvitePopup:RemoveTextures() LFGInvitePopup:SetStyle("Frame", "Pattern", true, 2, 4, 4) + LFGInvitePopup.timeOut = 60; + --/script StaticPopupSpecial_Show(LFGInvitePopup); LFGInvitePopupAcceptButton:SetStyle("Button") LFGInvitePopupDeclineButton:SetStyle("Button") @@ -403,7 +409,7 @@ local function LFDFrameStyle() _G[RaidFinderQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetStyle("Button") _G[ScenarioQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetStyle("Button") _G[ScenarioQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetStyle("Button") - + SV.API:Set("ScrollBar", LFDQueueFrameRandomScrollFrameScrollBar) SV.API:Set("ScrollBar", ScenarioQueueFrameSpecificScrollFrameScrollBar) LFDQueueFrameRandomScrollFrame:SetStyle("Frame", 'Transparent') @@ -419,7 +425,7 @@ local function LFDFrameStyle() -- end -- end - -- for u = 1, NUM_LFR_CHOICE_BUTTONS do + -- for u = 1, NUM_LFR_CHOICE_BUTTONS do -- local box = _G["LFRQueueFrameSpecificListButton"..u.."EnableButton"] -- if(box and (not box.Panel)) then -- box:RemoveTextures() @@ -434,9 +440,9 @@ local function LFDFrameStyle() LFGListFrame.CategorySelection.FindGroupButton:RemoveTextures() LFGListFrame.CategorySelection.FindGroupButton:SetStyle("Button") end ---[[ -########################################################## +--[[ +########################################################## MOD LOADING ########################################################## ]]-- -MOD:SaveCustomStyle(LFDFrameStyle) \ No newline at end of file +MOD:SaveCustomStyle(LFDFrameStyle)