This commit is contained in:
Crum
2019-01-12 02:18:46 -06:00
parent 79a61c59a8
commit eebdf23364
14 changed files with 417 additions and 251 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ function E:UpdateBlizzardFonts()
local MONOCHROME = "" local MONOCHROME = ""
UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = 12 UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = 12
CHAT_FONT_HEIGHTS = {10, 12, 13, 14, 15, 16, 17, 18, 19, 20} CHAT_FONT_HEIGHTS = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
UNIT_NAME_FONT = NAMEFONT UNIT_NAME_FONT = NAMEFONT
NAMEPLATE_FONT = NAMEFONT NAMEPLATE_FONT = NAMEFONT
+1 -4
View File
@@ -61,11 +61,8 @@ function E:Height(frame, height)
end end
function E:Point(obj, arg1, arg2, arg3, arg4, arg5) function E:Point(obj, arg1, arg2, arg3, arg4, arg5)
if arg2 == nil then if arg2 == nil then arg2 = obj:GetParent() end
arg2 = obj:GetParent()
end
if type(arg1)=="number" then arg1 = E:Scale(arg1) end
if type(arg2)=="number" then arg2 = E:Scale(arg2) end if type(arg2)=="number" then arg2 = E:Scale(arg2) end
if type(arg3)=="number" then arg3 = E:Scale(arg3) end if type(arg3)=="number" then arg3 = E:Scale(arg3) end
if type(arg4)=="number" then arg4 = E:Scale(arg4) end if type(arg4)=="number" then arg4 = E:Scale(arg4) end
+7 -8
View File
@@ -598,9 +598,8 @@ function B:Layout(isBank)
f.Bags[bagID][slotID]:ClearAllPoints() f.Bags[bagID][slotID]:ClearAllPoints()
end end
local anchorPoint, relativePoint
if lastButton then if lastButton then
anchorPoint, relativePoint = (self.db.reverseSlots and "BOTTOM" or "TOP"), (self.db.reverseSlots and "TOP" or "BOTTOM") local anchorPoint, relativePoint = (self.db.reverseSlots and "BOTTOM" or "TOP"), (self.db.reverseSlots and "TOP" or "BOTTOM")
if isSplit and newBag and slotID == 1 then if isSplit and newBag and slotID == 1 then
E:Point(f.Bags[bagID][slotID], anchorPoint, lastRowButton, relativePoint, 0, self.db.reverseSlots and (buttonSpacing + bagSpacing) or -(buttonSpacing + bagSpacing)) E:Point(f.Bags[bagID][slotID], anchorPoint, lastRowButton, relativePoint, 0, self.db.reverseSlots and (buttonSpacing + bagSpacing) or -(buttonSpacing + bagSpacing))
lastRowButton = f.Bags[bagID][slotID] lastRowButton = f.Bags[bagID][slotID]
@@ -620,7 +619,7 @@ function B:Layout(isBank)
E:Point(f.Bags[bagID][slotID], anchorPoint, lastButton, relativePoint, self.db.reverseSlots and -buttonSpacing or buttonSpacing, 0) E:Point(f.Bags[bagID][slotID], anchorPoint, lastButton, relativePoint, self.db.reverseSlots and -buttonSpacing or buttonSpacing, 0)
end end
else else
anchorPoint = self.db.reverseSlots and "BOTTOMRIGHT" or "TOPLEFT" local anchorPoint = self.db.reverseSlots and "BOTTOMRIGHT" or "TOPLEFT"
E:Point(f.Bags[bagID][slotID], anchorPoint, f.holderFrame, anchorPoint) E:Point(f.Bags[bagID][slotID], anchorPoint, f.holderFrame, anchorPoint)
lastRowButton = f.Bags[bagID][slotID] lastRowButton = f.Bags[bagID][slotID]
numContainerRows = numContainerRows + 1 numContainerRows = numContainerRows + 1
@@ -1336,7 +1335,7 @@ function B:PLAYER_ENTERING_WORLD()
end end
function B:updateContainerFrameAnchors() function B:updateContainerFrameAnchors()
local frame, xOffset, yOffset, screenHeight, freeScreenHeight, leftMostPoint, column local xOffset, yOffset, screenHeight, freeScreenHeight, leftMostPoint, column
local screenWidth = GetScreenWidth() local screenWidth = GetScreenWidth()
local containerScale = 1 local containerScale = 1
local leftLimit = 0 local leftLimit = 0
@@ -1357,7 +1356,7 @@ function B:updateContainerFrameAnchors()
local frameHeight local frameHeight
for _, frameName in ipairs(ContainerFrame1.bags) do for _, frameName in ipairs(ContainerFrame1.bags) do
frameHeight = _G[frameName]:GetHeight() local frameHeight = _G[frameName]:GetHeight()
if freeScreenHeight < frameHeight then if freeScreenHeight < frameHeight then
-- Start a new column -- Start a new column
@@ -1390,7 +1389,7 @@ function B:updateContainerFrameAnchors()
local bagsPerColumn = 0 local bagsPerColumn = 0
for index, frameName in ipairs(ContainerFrame1.bags) do for index, frameName in ipairs(ContainerFrame1.bags) do
frame = _G[frameName] local frame = _G[frameName]
frame:SetScale(1) frame:SetScale(1)
if index == 1 then if index == 1 then
@@ -1465,12 +1464,12 @@ function B:ProgressQuickVendor()
if not item then return nil, true end --No more to sell if not item then return nil, true end --No more to sell
local bag, slot, itemPrice, itemLink = unpack(item) local bag, slot, itemPrice, itemLink = unpack(item)
local stackPrice local stackPrice = 0
local stackCount = select(2, GetContainerItemInfo(bag, slot)) or 1
if B.SellFrame.Info.delete then if B.SellFrame.Info.delete then
PickupContainerItem(bag, slot) PickupContainerItem(bag, slot)
DeleteCursorItem() DeleteCursorItem()
else else
local stackCount = select(2, GetContainerItemInfo(bag, slot)) or 1
stackPrice = (itemPrice or 0) * stackCount stackPrice = (itemPrice or 0) * stackCount
if E.db.bags.vendorGrays.details and itemLink then if E.db.bags.vendorGrays.details and itemLink then
E:Print(format("%s|cFF00DDDDx%d|r %s", itemLink, stackCount, B:FormatMoney(stackPrice))) E:Print(format("%s|cFF00DDDDx%d|r %s", itemLink, stackCount, B:FormatMoney(stackPrice)))
+3 -3
View File
@@ -15,7 +15,7 @@ local chanceString = "%.2f%%"
local displayString = "" local displayString = ""
local _, effectiveArmor local _, effectiveArmor
local function GetArmorReduction(armor, attackerLevel) local function PaperDollFrame_GetArmorReduction(armor, attackerLevel)
local levelModifier = attackerLevel local levelModifier = attackerLevel
if levelModifier > 59 then if levelModifier > 59 then
levelModifier = levelModifier + (4.5 * (levelModifier - 59)) levelModifier = levelModifier + (4.5 * (levelModifier - 59))
@@ -44,14 +44,14 @@ local function OnEnter(self)
local playerLevel = UnitLevel("player") + 3 local playerLevel = UnitLevel("player") + 3
for i = 1, 4 do for i = 1, 4 do
local armorReduction = GetArmorReduction(effectiveArmor, playerLevel) local armorReduction = PaperDollFrame_GetArmorReduction(effectiveArmor, playerLevel)
DT.tooltip:AddDoubleLine(playerLevel, format(chanceString, armorReduction), 1, 1, 1) DT.tooltip:AddDoubleLine(playerLevel, format(chanceString, armorReduction), 1, 1, 1)
playerLevel = playerLevel - 1 playerLevel = playerLevel - 1
end end
local targetLevel = UnitLevel("target") local targetLevel = UnitLevel("target")
if targetLevel and targetLevel > 0 and (targetLevel > playerLevel + 3 or targetLevel < playerLevel) then if targetLevel and targetLevel > 0 and (targetLevel > playerLevel + 3 or targetLevel < playerLevel) then
local armorReduction = GetArmorReduction(effectiveArmor, targetLevel) local armorReduction = PaperDollFrame_GetArmorReduction(effectiveArmor, targetLevel)
DT.tooltip:AddDoubleLine(targetLevel, format(chanceString, armorReduction), 1, 1, 1) DT.tooltip:AddDoubleLine(targetLevel, format(chanceString, armorReduction), 1, 1, 1)
end end
+16 -17
View File
@@ -3,42 +3,41 @@ local DT = E:GetModule("DataTexts");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local find, format, join, match = string.find, string.format, string.join, string.match local format, join, match = string.format, string.join, string.match
local abs = math.abs local abs = math.abs
--WoW API / Variables --WoW API / Variables
local GetBlockChance = GetBlockChance
local GetBonusBarOffset = GetBonusBarOffset
local GetDodgeChance = GetDodgeChance
local GetInventoryItemLink = GetInventoryItemLink local GetInventoryItemLink = GetInventoryItemLink
local GetInventorySlotInfo = GetInventorySlotInfo local GetInventorySlotInfo = GetInventorySlotInfo
local GetItemInfo = GetItemInfo local GetItemInfo = GetItemInfo
local UnitLevel = UnitLevel
local GetDodgeChance = GetDodgeChance
local GetParryChance = GetParryChance local GetParryChance = GetParryChance
local GetBlockChance = GetBlockChance local UnitLevel = UnitLevel
local GetBonusBarOffset = GetBonusBarOffset
local BOSS = BOSS local BOSS = BOSS
local DEFENSE = DEFENSE
local DODGE_CHANCE = DODGE_CHANCE local DODGE_CHANCE = DODGE_CHANCE
local PARRY_CHANCE = PARRY_CHANCE local PARRY_CHANCE = PARRY_CHANCE
local BLOCK_CHANCE = BLOCK_CHANCE local BLOCK_CHANCE = BLOCK_CHANCE
DEFENSE = "Defense"; DEFENSE = "Defense"
DODGE_CHANCE = "Dodge Chance"; DODGE_CHANCE = "Dodge Chance"
PARRY_CHANCE = "Parry Chance"; PARRY_CHANCE = "Parry Chance"
BLOCK_CHANCE = "Block Chance"; BLOCK_CHANCE = "Block Chance"
local displayString, lastPanel local lastPanel
local targetlv, playerlv local targetlv, playerlv
local baseMissChance, levelDifference, dodge, parry, block, avoidance, unhittable local baseMissChance, levelDifference, dodge, parry, block, avoidance, unhittable
local displayString = ""
local chanceString = "%.2f%%" local chanceString = "%.2f%%"
local AVD_DECAY_RATE = 0.2 local AVD_DECAY_RATE = 0.2
local function IsWearingShield() local function IsWearingShield()
local slotID = GetInventorySlotInfo("SecondaryHandSlot") local slotID = GetInventorySlotInfo("SecondaryHandSlot")
local link = GetInventoryItemLink("player", slotID) local itemLink = GetInventoryItemLink("player", slotID)
if link then
local _, _, itemID = find(link, "(%d+):")
if itemID then if itemLink then
return select(9, GetItemInfo(itemID)) return select(9, GetItemInfo(match(itemLink, "item:(%d+)")))
end
end end
end end
@@ -107,7 +106,7 @@ local function OnEnter(self)
DT.tooltip:AddLine(" ") DT.tooltip:AddLine(" ")
if unhittable > 0 then if unhittable > 0 then
DT.tooltip:AddDoubleLine(L["Unhittable:"], "+" .. format(chanceString, unhittable), 1, 1, 1, 0, 1, 0) DT.tooltip:AddDoubleLine(L["Unhittable:"], "+"..format(chanceString, unhittable), 1, 1, 1, 0, 1, 0)
else else
DT.tooltip:AddDoubleLine(L["Unhittable:"], format(chanceString, unhittable), 1, 1, 1, 1, 0, 0) DT.tooltip:AddDoubleLine(L["Unhittable:"], format(chanceString, unhittable), 1, 1, 1, 1, 0, 0)
end end
+3 -3
View File
@@ -36,7 +36,7 @@ local function OnEvent(self)
lastPanel = self lastPanel = self
totalDurability = 100 totalDurability = 100
for _, value in ipairs(slots) do for _, value in pairs(slots) do
local slot = GetInventorySlotInfo(value) local slot = GetInventorySlotInfo(value)
current, max = GetInventoryItemDurability(slot) current, max = GetInventoryItemDurability(slot)
@@ -67,7 +67,7 @@ local function OnEnter(self)
end end
local function ValueColorUpdate(hex) local function ValueColorUpdate(hex)
displayString = join("", DURABILITY, ": ", hex, "%d%%|r") displayString = join("", L["Durability"], ": ", hex, "%d%%|r")
if lastPanel ~= nil then if lastPanel ~= nil then
OnEvent(lastPanel, "ELVUI_COLOR_UPDATE") OnEvent(lastPanel, "ELVUI_COLOR_UPDATE")
@@ -75,4 +75,4 @@ local function ValueColorUpdate(hex)
end end
E.valueColorUpdateFuncs[ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Durability", {"PLAYER_ENTERING_WORLD", "UPDATE_INVENTORY_ALERTS", "MERCHANT_SHOW"}, OnEvent, nil, OnClick, OnEnter, nil, DURABILITY) DT:RegisterDatatext("Durability", {"PLAYER_LOGIN", "UPDATE_INVENTORY_ALERTS", "MERCHANT_SHOW"}, OnEvent, nil, OnClick, OnEnter, nil, L["Durability"])
+91 -44
View File
@@ -3,8 +3,8 @@ local DT = E:GetModule("DataTexts");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local pairs = pairs local type, pairs, select, next = type, pairs, select, next
local tinsert, sort, wipe, next = table.insert, table.sort, wipe, next local getn, tinsert, sort, wipe = table.getn, table.insert, table.sort, table.wipe
local format, find, join, gsub = string.format, string.find, string.join, string.gsub local format, find, join, gsub = string.format, string.find, string.join, string.gsub
--WoW API / Variables --WoW API / Variables
local SendChatMessage = SendChatMessage local SendChatMessage = SendChatMessage
@@ -13,15 +13,30 @@ local SetItemRef = SetItemRef
local GetFriendInfo = GetFriendInfo local GetFriendInfo = GetFriendInfo
local GetNumFriends = GetNumFriends local GetNumFriends = GetNumFriends
local GetQuestDifficultyColor = GetQuestDifficultyColor local GetQuestDifficultyColor = GetQuestDifficultyColor
local UnitInParty = UnitInParty
local UnitInRaid = UnitInRaid
local ToggleFriendsFrame = ToggleFriendsFrame local ToggleFriendsFrame = ToggleFriendsFrame
local CHAT_MSG_AFK = CHAT_MSG_AFK
local CHAT_MSG_DND = CHAT_MSG_DND
local FRIENDS = FRIENDS
local LOCALIZED_CLASS_NAMES_FEMALE = LOCALIZED_CLASS_NAMES_FEMALE
local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE
local L_EasyMenu = L_EasyMenu local L_EasyMenu = L_EasyMenu
local CHAT_MSG_AFK, CHAT_MSG_DND = CHAT_MSG_AFK, CHAT_MSG_DND
local FRIENDS = FRIENDS
local OPTIONS_MENU, OPTIONS_MENU, PLAYER_STATUS, PARTY_INVITE = OPTIONS_MENU, OPTIONS_MENU, PLAYER_STATUS, PARTY_INVITE
local CHAT_MSG_WHISPER_INFORM = CHAT_MSG_WHISPER_INFORM
local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE
local LOCALIZED_CLASS_NAMES_FEMALE = LOCALIZED_CLASS_NAMES_FEMALE
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local menuFrame = CreateFrame("Frame", "FriendDatatextRightClickMenu", E.UIParent, "L_UIDropDownMenuTemplate")
local menuList = {
{text = OPTIONS_MENU, isTitle = true, notCheckable = true},
{text = PARTY_INVITE, hasArrow = true, notCheckable = true},
{text = CHAT_MSG_WHISPER_INFORM, hasArrow = true, notCheckable = true},
{text = PLAYER_STATUS, hasArrow = true, notCheckable = true,
menuList = {
{text = "|cffE7E716"..CHAT_MSG_AFK.."|r", notCheckable = true, func = function() SendChatMessage("", "AFK") end},
{text = "|cffFF0000"..CHAT_MSG_DND.."|r", notCheckable = true, func = function() SendChatMessage("", "DND") end}
}
}
}
local function GetNumberFriends() local function GetNumberFriends()
local numFriends = GetNumFriends() local numFriends = GetNumFriends()
@@ -39,41 +54,31 @@ local function GetNumberFriends()
return numFriends, onlineFriends return numFriends, onlineFriends
end end
local menuFrame = CreateFrame("Frame", "FriendDatatextRightClickMenu", E.UIParent, "L_UIDropDownMenuTemplate") local function inviteClick(name)
local menuList = {
{text = OPTIONS_MENU, isTitle = true, notCheckable = true},
{text = PARTY_INVITE, hasArrow = true, notCheckable = true},
{text = CHAT_MSG_WHISPER_INFORM, hasArrow = true, notCheckable = true},
{text = PLAYER_STATUS, hasArrow = true, notCheckable = true,
menuList = {
-- {text = "|cff2BC226"..AVAILABLE.."|r", notCheckable = true, func = function() end}, -- TODO
{text = "|cffE7E716"..CHAT_MSG_AFK.."|r", notCheckable = true, func = function() SendChatMessage("", "AFK") end},
{text = "|cffFF0000"..CHAT_MSG_DND.."|r", notCheckable = true, func = function() SendChatMessage("", "DND") end}
}
}
}
local function inviteClick(playerName)
menuFrame:Hide() menuFrame:Hide()
InviteByName(playerName)
if type(name) ~= "number" then
InviteByName(name)
end
end end
local function whisperClick(playerName) local function whisperClick(name)
menuFrame:Hide() menuFrame:Hide()
SetItemRef("player:"..playerName, format("|Hplayer:%1$s|h[%1$s]|h", playerName), "LeftButton")
SetItemRef("player:"..name, format("|Hplayer:%1$s|h[%1$s]|h", name), "LeftButton")
end end
local lastPanel
local levelNameString = "|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r" local levelNameString = "|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r"
local levelNameClassString = "|cff%02x%02x%02x%d|r %s" local levelNameClassString = "|cff%02x%02x%02x%d|r %s%s%s"
local totalOnlineString = join("", GUILD_ONLINE_LABEL, ": %s/%s") local totalOnlineString = join("", GUILD_ONLINE_LABEL, ": %s/%s")
local tthead = {r = 0.4, g = 0.78, b = 1} local tthead = {r = 0.4, g = 0.78, b = 1}
local activezone, inactivezone = {r = 0.3, g = 1.0, b = 0.3}, {r = 0.65, g = 0.65, b = 0.65} local activezone, inactivezone = {r = 0.3, g = 1.0, b = 0.3}, {r = 0.65, g = 0.65, b = 0.65}
local displayString = "" local displayString = ""
local groupedTable = {"|cffaaaaaa*|r", ""} local statusTable = {" |cffFFFFFF[|r|cffFF9900"..L["AFK"].."|r|cffFFFFFF]|r", " |cffFFFFFF[|r|cffFF3333"..L["DND"].."|r|cffFFFFFF]|r", ""}
local friendTable = {} local friendTable = {}
local friendOnline, friendOffline = gsub(ERR_FRIEND_ONLINE_SS, "\124Hplayer:%%s\124h%[%%s%]\124h", ""), gsub(ERR_FRIEND_OFFLINE_S, "%%s", "") local friendOnline, friendOffline = gsub(ERR_FRIEND_ONLINE_SS, "\124Hplayer:%%s\124h%[%%s%]\124h", ""), gsub(ERR_FRIEND_OFFLINE_S, "%%s", "")
local dataValid = false local dataValid = false
local lastPanel
local function SortAlphabeticName(a, b) local function SortAlphabeticName(a, b)
if a[1] and b[1] then if a[1] and b[1] then
@@ -83,14 +88,24 @@ end
local function BuildFriendTable(total) local function BuildFriendTable(total)
wipe(friendTable) wipe(friendTable)
local name, level, class, area, online local name, level, class, area, connected, status
for i = 1, total do for i = 1, total do
name, level, class, area, online = GetFriendInfo(i) name, level, class, area, connected, status = GetFriendInfo(i)
if online then if status == "<"..CHAT_MSG_AFK..">" then
status = statusTable[1]
elseif status == "<"..CHAT_MSG_DND..">" then
status = statusTable[2]
else
status = statusTable[3]
end
if connected then
--other non-english locales require this
for k, v in pairs(LOCALIZED_CLASS_NAMES_MALE) do if class == v then class = k end end for k, v in pairs(LOCALIZED_CLASS_NAMES_MALE) do if class == v then class = k end end
for k, v in pairs(LOCALIZED_CLASS_NAMES_FEMALE) do if class == v then class = k end end for k, v in pairs(LOCALIZED_CLASS_NAMES_FEMALE) do if class == v then class = k end end
friendTable[i] = {name, level, class, area, online}
friendTable[i] = {name, level, class, area, connected, status}
end end
end end
if next(friendTable) then if next(friendTable) then
@@ -101,10 +116,14 @@ end
local function OnEvent(self, event) local function OnEvent(self, event)
local _, onlineFriends = GetNumberFriends() local _, onlineFriends = GetNumberFriends()
-- special handler to detect friend coming online or going offline
-- when this is the case, we invalidate our buffered table and update the
-- datatext information
if event == "CHAT_MSG_SYSTEM" then if event == "CHAT_MSG_SYSTEM" then
if not (find(arg1, friendOnline) or find(arg1, friendOffline)) then return end if not (find(arg1, friendOnline) or find(arg1, friendOffline)) then return end
end end
-- force update when showing tooltip
dataValid = false dataValid = false
self.text:SetText(format(displayString, FRIENDS, onlineFriends)) self.text:SetText(format(displayString, FRIENDS, onlineFriends))
@@ -116,20 +135,36 @@ local function OnClick()
DT.tooltip:Hide() DT.tooltip:Hide()
if arg1 == "RightButton" then if arg1 == "RightButton" then
local classc, levelc local menuCountWhispers = 0
local menuCountInvites = 0
local classc, levelc, info, shouldSkip
menuList[2].menuList = {} menuList[2].menuList = {}
menuList[3].menuList = {} menuList[3].menuList = {}
for _, info in friendTable do if getn(friendTable) > 0 then
for i = 1, getn(friendTable) do
info = friendTable[i]
if info[5] then if info[5] then
classc, levelc = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[info[3]], GetQuestDifficultyColor(info[2]) shouldSkip = false
if (info[6] == statusTable[1]) and E.db.datatexts.friends.hideAFK then
shouldSkip = true
elseif (info[6] == statusTable[2]) and E.db.datatexts.friends.hideDND then
shouldSkip = true
end
if not shouldSkip then
classc, levelc = (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[info[3]]) or RAID_CLASS_COLORS[info[3]], GetQuestDifficultyColor(info[2])
classc = classc or GetQuestDifficultyColor(info[2]) classc = classc or GetQuestDifficultyColor(info[2])
tinsert(menuList[2].menuList, {text = format(levelNameString, levelc.r*255,levelc.g*255,levelc.b*255, info[2],classc.r*255,classc.g*255,classc.b*255, info[1]), arg1 = info[1], notCheckable = true, func = inviteClick}) menuCountWhispers = menuCountWhispers + 1
tinsert(menuList[3].menuList, {text = format(levelNameString, levelc.r*255,levelc.g*255,levelc.b*255, info[2],classc.r*255,classc.g*255,classc.b*255, info[1]), arg1 = info[1], notCheckable = true, func = whisperClick}) menuList[3].menuList[menuCountWhispers] = {text = format(levelNameString, levelc.r*255, levelc.g*255, levelc.b*255, info[2], classc.r*255, classc.g*255, classc.b*255, info[1]), arg1 = info[1], notCheckable = true, func = whisperClick}
menuCountInvites = menuCountInvites + 1
menuList[2].menuList[menuCountInvites] = {text = format(levelNameString, levelc.r*255, levelc.g*255, levelc.b*255, info[2], classc.r*255, classc.g*255, classc.b*255, info[1]), arg1 = info[1], notCheckable = true, func = inviteClick}
end end
end end
end
end
L_EasyMenu(menuList, menuFrame, "cursor", 0, 0, "MENU", 2) L_EasyMenu(menuList, menuFrame, "cursor", 0, 0, "MENU", 2)
else else
ToggleFriendsFrame(1) ToggleFriendsFrame(1)
@@ -140,24 +175,36 @@ local function OnEnter(self)
DT:SetupTooltip(self) DT:SetupTooltip(self)
local numberOfFriends, onlineFriends = GetNumberFriends() local numberOfFriends, onlineFriends = GetNumberFriends()
-- no friends online, quick exit
if onlineFriends == 0 then return end if onlineFriends == 0 then return end
if not dataValid then if not dataValid then
-- only retrieve information for all on-line members when we actually view the tooltip
if numberOfFriends > 0 then BuildFriendTable(numberOfFriends) end if numberOfFriends > 0 then BuildFriendTable(numberOfFriends) end
dataValid = true dataValid = true
end end
local zonec, classc, levelc local zonec, classc, levelc, info, shouldSkip
DT.tooltip:AddDoubleLine(FRIENDS_LIST, format(totalOnlineString, onlineFriends, numberOfFriends), tthead.r, tthead.g, tthead.b, tthead.r, tthead.g, tthead.b) DT.tooltip:AddDoubleLine(L["Friends List"], format(totalOnlineString, onlineFriends, numberOfFriends), tthead.r, tthead.g, tthead.b, tthead.r, tthead.g, tthead.b)
if onlineFriends > 0 then if onlineFriends > 0 then
for _, info in friendTable do for i = 1, getn(friendTable) do
info = friendTable[i]
if info[5] then if info[5] then
shouldSkip = false
if (info[6] == statusTable[1]) and E.db.datatexts.friends.hideAFK then
shouldSkip = true
elseif (info[6] == statusTable[2]) and E.db.datatexts.friends.hideDND then
shouldSkip = true
end
if not shouldSkip then
if GetRealZoneText() == info[4] then zonec = activezone else zonec = inactivezone end if GetRealZoneText() == info[4] then zonec = activezone else zonec = inactivezone end
classc, levelc = (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[info[3]]) or RAID_CLASS_COLORS[info[3]], GetQuestDifficultyColor(info[2])
classc, levelc = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[info[3]], GetQuestDifficultyColor(info[2])
classc = classc or GetQuestDifficultyColor(info[2]) classc = classc or GetQuestDifficultyColor(info[2])
DT.tooltip:AddDoubleLine(format(levelNameClassString, levelc.r*255,levelc.g*255,levelc.b*255, info[2], info[1]), info[4], classc.r,classc.g,classc.b, zonec.r,zonec.g,zonec.b) DT.tooltip:AddDoubleLine(format(levelNameClassString, levelc.r*255, levelc.g*255, levelc.b*255, info[2], info[1], "", " " .. info[6]), info[4], classc.r, classc.g, classc.b, zonec.r, zonec.g, zonec.b)
end
end end
end end
end end
+25 -1
View File
@@ -5,9 +5,11 @@ local DT = E:GetModule("DataTexts");
--Lua functions --Lua functions
local pairs = pairs local pairs = pairs
local join = string.join local join = string.join
local tinsert, wipe = table.insert, table.wipe
--WoW API / Variables --WoW API / Variables
local GetMoney = GetMoney local GetMoney = GetMoney
local IsShiftKeyDown = IsShiftKeyDown local IsShiftKeyDown = IsShiftKeyDown
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local Profit = 0 local Profit = 0
local Spent = 0 local Spent = 0
@@ -20,6 +22,10 @@ local function OnEvent(self)
ElvDB.gold[E.myrealm] = ElvDB.gold[E.myrealm] or {} ElvDB.gold[E.myrealm] = ElvDB.gold[E.myrealm] or {}
ElvDB.gold[E.myrealm][E.myname] = ElvDB.gold[E.myrealm][E.myname] or NewMoney ElvDB.gold[E.myrealm][E.myname] = ElvDB.gold[E.myrealm][E.myname] or NewMoney
ElvDB.class = ElvDB.class or {}
ElvDB.class[E.myrealm] = ElvDB.class[E.myrealm] or {}
ElvDB.class[E.myrealm][E.myname] = E.myclass
local OldMoney = ElvDB.gold[E.myrealm][E.myname] or NewMoney local OldMoney = ElvDB.gold[E.myrealm][E.myname] or NewMoney
local Change = NewMoney - OldMoney local Change = NewMoney - OldMoney
@@ -44,28 +50,46 @@ local function OnClick(self)
end end
end end
local myGold = {}
local function OnEnter(self) local function OnEnter(self)
DT:SetupTooltip(self) DT:SetupTooltip(self)
local style = E.db.datatexts.goldFormat or "BLIZZARD" local style = E.db.datatexts.goldFormat or "BLIZZARD"
DT.tooltip:AddLine(L["Session:"]) DT.tooltip:AddLine(L["Session:"])
DT.tooltip:AddDoubleLine(L["Earned:"], E:FormatMoney(Profit, style), 1, 1, 1, 1, 1, 1) DT.tooltip:AddDoubleLine(L["Earned:"], E:FormatMoney(Profit, style), 1, 1, 1, 1, 1, 1)
DT.tooltip:AddDoubleLine(L["Spent:"], E:FormatMoney(Spent, style), 1, 1, 1, 1, 1, 1) DT.tooltip:AddDoubleLine(L["Spent:"], E:FormatMoney(Spent, style), 1, 1, 1, 1, 1, 1)
if Profit < Spent then if Profit < Spent then
DT.tooltip:AddDoubleLine(L["Deficit:"], E:FormatMoney(Profit - Spent, style), 1, 0, 0, 1, 1, 1) DT.tooltip:AddDoubleLine(L["Deficit:"], E:FormatMoney(Profit - Spent, style), 1, 0, 0, 1, 1, 1)
elseif (Profit - Spent) > 0 then elseif (Profit - Spent) > 0 then
DT.tooltip:AddDoubleLine(L["Profit:"], E:FormatMoney(Profit - Spent, style), 0, 1, 0, 1, 1, 1) DT.tooltip:AddDoubleLine(L["Profit:"], E:FormatMoney(Profit - Spent, style), 0, 1, 0, 1, 1, 1)
end end
DT.tooltip:AddLine(" ") DT.tooltip:AddLine(" ")
local totalGold = 0; local totalGold = 0;
DT.tooltip:AddLine(L["Character: "]) DT.tooltip:AddLine(L["Character: "])
wipe(myGold)
for k in pairs(ElvDB.gold[E.myrealm]) do for k in pairs(ElvDB.gold[E.myrealm]) do
if ElvDB.gold[E.myrealm][k] then if ElvDB.gold[E.myrealm][k] then
DT.tooltip:AddDoubleLine(k, E:FormatMoney(ElvDB.gold[E.myrealm][k], style), 1, 1, 1, 1, 1, 1) local class = ElvDB.class[E.myrealm][k] or "PRIEST"
local color = class and (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class])
tinsert (myGold,
{
name = k,
amount = ElvDB.gold[E.myrealm][k],
amountText = E:FormatMoney(ElvDB.gold[E.myrealm][k], E.db.datatexts.goldFormat or "BLIZZARD", not E.db.datatexts.goldCoins),
r = color.r, g = color.g, b = color.b,
}
)
end
totalGold = totalGold + ElvDB.gold[E.myrealm][k] totalGold = totalGold + ElvDB.gold[E.myrealm][k]
end end
for _, g in ipairs(myGold) do
DT.tooltip:AddDoubleLine(g.name == E.myname and g.name or g.name, g.amountText, g.r, g.g, g.b, 1, 1, 1)
end end
DT.tooltip:AddLine(" ") DT.tooltip:AddLine(" ")
+57 -44
View File
@@ -3,10 +3,11 @@ local DT = E:GetModule("DataTexts");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local unpack = unpack local select, unpack = select, unpack
local format, join = string.format, string.join local format, find, join, split, upper = string.format, string.find, string.join, string.split, string.upper
local getn, tinsert, sort, wipe = table.getn, table.insert, table.sort, table.wipe local getn, sort, wipe = table.getn, table.sort, table.wipe
--WoW API / Variables --WoW API / Variables
local L_EasyMenu = L_EasyMenu
local GetGuildInfo = GetGuildInfo local GetGuildInfo = GetGuildInfo
local GetGuildRosterInfo = GetGuildRosterInfo local GetGuildRosterInfo = GetGuildRosterInfo
local GetGuildRosterMOTD = GetGuildRosterMOTD local GetGuildRosterMOTD = GetGuildRosterMOTD
@@ -19,35 +20,33 @@ local InviteByName = InviteByName
local IsInGuild = IsInGuild local IsInGuild = IsInGuild
local IsShiftKeyDown = IsShiftKeyDown local IsShiftKeyDown = IsShiftKeyDown
local SetItemRef = SetItemRef local SetItemRef = SetItemRef
local ToggleFriendsFrame = ToggleFriendsFrame --[[local ToggleFriendsFrame = ToggleFriendsFrame
local GUILD = GUILD local GUILD = GUILD
local GUILD_MOTD = GUILD_MOTD local GUILD_MOTD = GUILD_MOTD
local LOCALIZED_CLASS_NAMES_FEMALE = LOCALIZED_CLASS_NAMES_FEMALE local PARTY_INVITE, OPTIONS_MENU = PARTY_INVITE, OPTIONS_MENU
local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE local CHAT_MSG_WHISPER_INFORM = CHAT_MSG_WHISPER_INFORM
local RAID_CLASS_COLORS = RAID_CLASS_COLORS--]]
local L_EasyMenu = L_EasyMenu local tthead, ttsubh, ttoff = {r = 0.4, g = 0.78, b = 1}, {r = 0.75, g = 0.9, b = 1}, {r = .3, g = 1, b = .3}
local activezone, inactivezone = {r = 0.3, g = 1.0, b = 0.3}, {r = 0.65, g = 0.65, b = 0.65}
local tthead, ttsubh, ttoff = {r=0.4, g=0.78, b=1}, {r=0.75, g=0.9, b=1}, {r=.3,g=1,b=.3}
local activezone, inactivezone = {r=0.3, g=1.0, b=0.3}, {r=0.65, g=0.65, b=0.65}
local groupedTable = { "|cffaaaaaa*|r", "" }
local displayString = "" local displayString = ""
local noGuildString = "" local noGuildString = ""
local guildInfoString = "%s" local guildInfoString = "%s"
local guildInfoString2 = join("", GUILD, ": %d/%d") local guildInfoString2 = join("", GUILD, ": %d/%d")
local guildMotDString = "%s |cffaaaaaa- |cffffffff%s" local guildMotDString = "%s |cffaaaaaa- |cffffffff%s"
local levelNameString = "|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r %s" local levelNameString = "|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r %s"
local levelNameStatusString = "|cff%02x%02x%02x%d|r %s" local levelNameStatusString = "|cff%02x%02x%02x%d|r %s%s "
local nameRankString = "%s |cff999999-|cffffffff %s" local nameRankString = "%s |cff999999-|cffffffff %s"
local moreMembersOnlineString = join("", "+ %d ", GUILD_ONLINE_LABEL, "...") local moreMembersOnlineString = join("", "+ %d ", GUILD_ONLINE_LABEL, "...")
local noteString = join("", "|cff999999 ", LABEL_NOTE, ":|r %s") local noteString = join("", "|cff999999 ", LABEL_NOTE, ":|r %s")
local officerNoteString = join("", "|cff999999 ", GUILD_RANK1_DESC, ":|r %s") local officerNoteString = join("", "|cff999999 ", GUILD_RANK1_DESC, ":|r %s")
local FRIEND_ONLINE, FRIEND_OFFLINE = select(2, split(" ", ERR_FRIEND_ONLINE_SS, 2)), select(2, split(" ", ERR_FRIEND_OFFLINE_S, 2))
local guildTable, guildMotD = {}, "" local guildTable, guildMotD = {}, ""
local lastPanel local lastPanel
local function sortByRank(a, b) local function sortByRank(a, b)
if a and b then if a and b then
return a[9] < b[9] return a[10] < b[10]
end end
end end
@@ -65,37 +64,48 @@ local function SortGuildTable(shift)
end end
end end
local onlinestatusstring = "|cffFFFFFF[|r|cffFF0000%s|r|cffFFFFFF]|r"
local onlinestatus = {
[0] = "",
[1] = format(onlinestatusstring, L["AFK"]),
[2] = format(onlinestatusstring, L["DND"]),
}
local function BuildGuildTable() local function BuildGuildTable()
wipe(guildTable) wipe(guildTable)
local name, rank, rankIndex, level, class, zone, note, officernote, online local _, name, rank, rankIndex, level, zone, note, officernote, connected, status, englishClass
local totalMembers = GetNumGuildMembers() local totalMembers = GetNumGuildMembers()
for i = 1, totalMembers do for i = 1, totalMembers do
name, rank, rankIndex, level, class, zone, note, officernote, online = GetGuildRosterInfo(i) name, rank, rankIndex, level, englishClass, zone, note, officernote, connected, status = GetGuildRosterInfo(i)
if not name then return end if not name then break end
if englishClass then
if online then englishClass = upper(englishClass)
for k, v in pairs(LOCALIZED_CLASS_NAMES_MALE) do if class == v then class = k end end end
for k, v in pairs(LOCALIZED_CLASS_NAMES_FEMALE) do if class == v then class = k end end if connected then
tinsert(guildTable, {name, rank, level, zone, note, officernote, online, class, rankIndex}) guildTable[getn(guildTable) + 1] = {name, rank, level, zone, note, officernote, connected, onlinestatus[status], englishClass, rankIndex}
end end
end end
end end
local function UpdateGuildMessage()
guildMotD = GetGuildRosterMOTD()
end
local eventHandlers = { local eventHandlers = {
["CHAT_MSG_SYSTEM"] = function(_, arg1)
if (FRIEND_ONLINE ~= nil or FRIEND_OFFLINE ~= nil) and arg1 and (find(arg1, FRIEND_ONLINE) or find(arg1, FRIEND_OFFLINE)) then
E:Delay(10, function()
GuildRoster()
end)
end
end,
-- when we enter the world and guildframe is not available then -- when we enter the world and guildframe is not available then
-- load guild frame, update guild message -- load guild frame, update guild message
["PLAYER_ENTERING_WORLD"] = function() ["PLAYER_LOGIN"] = function()
GuildRoster() guildMotD = GetGuildRosterMOTD()
end, end,
-- Guild Roster updated, so rebuild the guild table -- Guild Roster updated, so rebuild the guild table
["GUILD_ROSTER_UPDATE"] = function(self) ["GUILD_ROSTER_UPDATE"] = function(self)
GuildRoster()
BuildGuildTable() BuildGuildTable()
UpdateGuildMessage() guildMotD = GetGuildRosterMOTD()
if GetMouseFocus() == self then if GetMouseFocus() == self then
self:GetScript("OnEnter")(self, nil, true) self:GetScript("OnEnter")(self, nil, true)
@@ -103,20 +113,18 @@ local eventHandlers = {
end, end,
["PLAYER_GUILD_UPDATE"] = GuildRoster, ["PLAYER_GUILD_UPDATE"] = GuildRoster,
-- our guild message of the day changed -- our guild message of the day changed
["GUILD_MOTD"] = function(self) ["GUILD_MOTD"] = function()
guildMotD = arg1 guildMotD = arg1
end, end,
["ELVUI_FORCE_RUN"] = E.noop, ["ELVUI_FORCE_RUN"] = GuildRoster,
["ELVUI_COLOR_UPDATE"] = E.noop, ["ELVUI_COLOR_UPDATE"] = E.noop,
["PLAYER_LOGIN"] = GuildRoster, -- Temporarily
} }
local function OnEvent(self, event) local function OnEvent(self, event, ...)
lastPanel = self lastPanel = self
if IsInGuild() then if IsInGuild() then
eventHandlers[event](self, event) eventHandlers[event](self, unpack(arg))
self.text:SetText(format(displayString, getn(guildTable))) self.text:SetText(format(displayString, getn(guildTable)))
else else
@@ -146,6 +154,8 @@ local function OnClick()
DT.tooltip:Hide() DT.tooltip:Hide()
local classc, levelc, info local classc, levelc, info
local menuCountWhispers = 0
local menuCountInvites = 0
menuList[2].menuList = {} menuList[2].menuList = {}
menuList[3].menuList = {} menuList[3].menuList = {}
@@ -153,10 +163,13 @@ local function OnClick()
for i = 1, getn(guildTable) do for i = 1, getn(guildTable) do
info = guildTable[i] info = guildTable[i]
if info[7] and info[1] ~= E.myname then if info[7] and info[1] ~= E.myname then
classc, levelc = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[info[8]], GetQuestDifficultyColor(info[3]) classc, levelc = (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[info[9]]) or RAID_CLASS_COLORS[info[9]], GetQuestDifficultyColor(info[3])
if not info[11] then
tinsert(menuList[2].menuList, {text = format(levelNameString, levelc.r*255,levelc.g*255,levelc.b*255, info[3], classc.r*255,classc.g*255,classc.b*255, info[1], ""), arg1 = info[1],notCheckable=true, func = inviteClick}) menuCountInvites = menuCountInvites + 1
tinsert(menuList[3].menuList, {text = format(levelNameString, levelc.r*255,levelc.g*255,levelc.b*255, info[3], classc.r*255,classc.g*255,classc.b*255, info[1], ""), arg1 = info[1],notCheckable=true, func = whisperClick}) menuList[2].menuList[menuCountInvites] = {text = format(levelNameString, levelc.r*255, levelc.g*255, levelc.b*255, info[3], classc.r*255, classc.g*255, classc.b*255, info[1], ""), arg1 = info[1],notCheckable = true, func = inviteClick}
end
menuCountWhispers = menuCountWhispers + 1
menuList[3].menuList[menuCountWhispers] = {text = format(levelNameString, levelc.r*255, levelc.g*255, levelc.b*255, info[3], classc.r*255, classc.g*255, classc.b*255, info[1], ""), arg1 = info[1],notCheckable = true, func = whisperClick}
end end
end end
@@ -172,8 +185,8 @@ local function OnEnter(self, _, noUpdate)
DT:SetupTooltip(self) DT:SetupTooltip(self)
local online, total = 0, GetNumGuildMembers(true) local online, total = 0, GetNumGuildMembers(true)
for i = 0, total do local _, _, _, _, _, _, _, _, connected = GetGuildRosterInfo(i) if connected then online = online + 1 end end for i = 0, total do if select(9, GetGuildRosterInfo(i)) then online = online + 1 end end
if not guildTable[1] then BuildGuildTable() end if getn(guildTable) == 0 then BuildGuildTable() end
SortGuildTable(IsShiftKeyDown()) SortGuildTable(IsShiftKeyDown())
@@ -202,14 +215,14 @@ local function OnEnter(self, _, noUpdate)
info = guildTable[i] info = guildTable[i]
if GetRealZoneText() == info[4] then zonec = activezone else zonec = inactivezone end if GetRealZoneText() == info[4] then zonec = activezone else zonec = inactivezone end
classc, levelc = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[info[8]], GetQuestDifficultyColor(info[3]) classc, levelc = (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[info[9]]) or RAID_CLASS_COLORS[info[9]], GetQuestDifficultyColor(info[3])
if IsShiftKeyDown() then if IsShiftKeyDown() then
DT.tooltip:AddDoubleLine(format(nameRankString, info[1], info[2]), info[4], classc.r, classc.g, classc.b, zonec.r, zonec.g, zonec.b) DT.tooltip:AddDoubleLine(format(nameRankString, info[1], info[2]), info[4], classc.r, classc.g, classc.b, zonec.r, zonec.g, zonec.b)
if info[5] ~= "" then DT.tooltip:AddLine(format(noteString, info[5]), ttsubh.r, ttsubh.g, ttsubh.b, 1) end if info[5] ~= "" then DT.tooltip:AddLine(format(noteString, info[5]), ttsubh.r, ttsubh.g, ttsubh.b, 1) end
if info[6] ~= "" then DT.tooltip:AddLine(format(officerNoteString, info[6]), ttoff.r, ttoff.g, ttoff.b, 1) end if info[6] ~= "" then DT.tooltip:AddLine(format(officerNoteString, info[6]), ttoff.r, ttoff.g, ttoff.b, 1) end
else else
DT.tooltip:AddDoubleLine(format(levelNameStatusString, levelc.r*255, levelc.g*255, levelc.b*255, info[3], info[1], " " .. info[8]), info[4], classc.r,classc.g,classc.b, zonec.r,zonec.g,zonec.b) DT.tooltip:AddDoubleLine(format(levelNameStatusString, levelc.r*255, levelc.g*255, levelc.b*255, info[3], info[1], "", info[8]), info[4], classc.r, classc.g, classc.b, zonec.r, zonec.g, zonec.b)
end end
shown = shown + 1 shown = shown + 1
end end
@@ -231,4 +244,4 @@ local function ValueColorUpdate(hex)
end end
E.valueColorUpdateFuncs[ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Guild", {"PLAYER_ENTERING_WORLD", "GUILD_ROSTER_UPDATE", "PLAYER_GUILD_UPDATE", "GUILD_MOTD"}, OnEvent, nil, OnClick, OnEnter, nil, GUILD) DT:RegisterDatatext("Guild", {"PLAYER_LOGIN", "CHAT_MSG_SYSTEM", "GUILD_ROSTER_UPDATE", "PLAYER_GUILD_UPDATE", "GUILD_MOTD"}, OnEvent, nil, OnClick, OnEnter, nil, GUILD)
+46 -9
View File
@@ -3,15 +3,21 @@ local DT = E:GetModule("DataTexts");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local collectgarbage = collectgarbage local select, collectgarbage = select, collectgarbage
local sort, wipe = table.sort, wipe
local floor = math.floor local floor = math.floor
local format = string.format local format = string.format
local gcinfo = gcinfo local gcinfo = gcinfo
--WoW API / Variables --WoW API / Variables
local GetNetStats = GetNetStats local GetAddOnInfo = GetAddOnInfo
local GetCVar = GetCVar
local GetFramerate = GetFramerate local GetFramerate = GetFramerate
local GetNetStats = GetNetStats
local GetNumAddOns = GetNumAddOns
local IsAddOnLoaded = IsAddOnLoaded
local IsShiftKeyDown = IsShiftKeyDown
local int = 6 local int, int2 = 6, 5
local statusColors = { local statusColors = {
"|cff0CD809", "|cff0CD809",
"|cffE8DA0F", "|cffE8DA0F",
@@ -23,10 +29,11 @@ local enteredFrame = false
local homeLatencyString = "%d ms" local homeLatencyString = "%d ms"
local kiloByteString = "%d kb" local kiloByteString = "%d kb"
local megaByteString = "%.2f mb" local megaByteString = "%.2f mb"
local totalMemory = 0
local function formatMem(memory) local function formatMem(memory)
local mult = 10 ^ 1 local mult = 10 ^ 1
if(memory > 999) then if memory > 999 then
local mem = ((memory / 1024) * mult) / mult local mem = ((memory / 1024) * mult) / mult
return format(megaByteString, mem) return format(megaByteString, mem)
else else
@@ -35,6 +42,23 @@ local function formatMem(memory)
end end
end end
local function sortByMemoryOrCPU(a, b)
if a and b then
return (a[3] == b[3] and a[2] < b[2]) or a[3] > b[3]
end
end
local memoryTable = {}
local function RebuildAddonList()
local addOnCount = GetNumAddOns()
if addOnCount == getn(memoryTable) then return end
wipe(memoryTable)
for i = 1, addOnCount do
memoryTable[i] = {i, select(2, GetAddOnInfo(i)), 0}
end
end
local function ToggleGameMenuFrame() local function ToggleGameMenuFrame()
if GameMenuFrame:IsShown() then if GameMenuFrame:IsShown() then
PlaySound("igMainMenuQuit") PlaySound("igMainMenuQuit")
@@ -57,11 +81,19 @@ local function OnEnter(self)
enteredFrame = true enteredFrame = true
DT:SetupTooltip(self) DT:SetupTooltip(self)
local totalMemory = gcinfo() totalMemory = gcinfo()
local _, _, latency = GetNetStats() DT.tooltip:AddDoubleLine(L["Home Latency:"], format(homeLatencyString, select(3, GetNetStats())), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65)
DT.tooltip:AddDoubleLine(L["Home Latency:"], format(homeLatencyString, latency), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65)
DT.tooltip:AddDoubleLine(L["Total Memory:"], formatMem(totalMemory), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65) DT.tooltip:AddDoubleLine(L["Total Memory:"], formatMem(totalMemory), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65)
local ele
DT.tooltip:AddLine(" ")
for i = 1, getn(memoryTable) do
ele = memoryTable[i]
if ele and IsAddOnLoaded(ele[1]) then
DT.tooltip:AddLine(ele[2])
end
end
DT.tooltip:Show() DT.tooltip:Show()
end end
@@ -72,17 +104,22 @@ end
local function OnUpdate(self, t) local function OnUpdate(self, t)
int = int - t int = int - t
int2 = int2 - t
if int < 0 then if int < 0 then
RebuildAddonList()
int = 10
end
if int2 < 0 then
local framerate = floor(GetFramerate()) local framerate = floor(GetFramerate())
local _, _, latency = GetNetStats() local latency = select(3, GetNetStats())
self.text:SetText(format("FPS: %s%d|r MS: %s%d|r", self.text:SetText(format("FPS: %s%d|r MS: %s%d|r",
statusColors[framerate >= 30 and 1 or (framerate >= 20 and framerate < 30) and 2 or (framerate >= 10 and framerate < 20) and 3 or 4], statusColors[framerate >= 30 and 1 or (framerate >= 20 and framerate < 30) and 2 or (framerate >= 10 and framerate < 20) and 3 or 4],
framerate, framerate,
statusColors[latency < 150 and 1 or (latency >= 150 and latency < 300) and 2 or (latency >= 300 and latency < 500) and 3 or 4], statusColors[latency < 150 and 1 or (latency >= 150 and latency < 300) and 2 or (latency >= 300 and latency < 500) and 3 or 4],
latency)) latency))
int = 1 int2 = 1
if enteredFrame then if enteredFrame then
OnEnter(this) OnEnter(this)
end end
+33 -23
View File
@@ -3,11 +3,8 @@ local DT = E:GetModule("DataTexts");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local next, unpack = next, unpack
local time = time local time = time
local format, gsub, join = string.format, string.gsub, string.join local format, gsub, join = string.format, string.gsub, string.join
local abs = math.abs
local getn, tinsert = table.getn, table.insert
--WoW API / Variables --WoW API / Variables
local GetGameTime = GetGameTime local GetGameTime = GetGameTime
local GetNumSavedInstances = GetNumSavedInstances local GetNumSavedInstances = GetNumSavedInstances
@@ -15,11 +12,13 @@ local GetSavedInstanceInfo = GetSavedInstanceInfo
local IsAddOnLoaded = IsAddOnLoaded local IsAddOnLoaded = IsAddOnLoaded
local SecondsToTime = SecondsToTime local SecondsToTime = SecondsToTime
local europeDisplayFormat = join("", "%02d", ":|r%02d")
local instanceFormat = "%s |cffaaaaaa(%s)"
local timeDisplayFormat = "" local timeDisplayFormat = ""
local dateDisplayFormat = "" local dateDisplayFormat = ""
local europeDisplayFormat_nocolor = join("", "%02d", ":|r%02d") local enteredFrame = false
local lockoutInfoFormat = "|cffaaaaaa(%s)"
local lockoutColorExtended, lockoutColorNormal = {r = 0.3, g = 1, b = 0.3}, {r = .8, g = .8, b = .8} local lastPanel
local function OnClick() local function OnClick()
if IsAddOnLoaded("TimeManager") then -- https://github.com/gashole/TimeManager if IsAddOnLoaded("TimeManager") then -- https://github.com/gashole/TimeManager
@@ -33,48 +32,59 @@ end
local function OnLeave() local function OnLeave()
DT.tooltip:Hide() DT.tooltip:Hide()
enteredFrame = false
end end
local function OnEnter(self) local function OnEnter(self)
DT:SetupTooltip(self) DT:SetupTooltip(self)
if not enteredFrame then
RequestRaidInfo() RequestRaidInfo()
local lockedInstances = {raids = {}} enteredFrame = true
local _, name, reset end
local oneraid
local name, id, reset
for i = 1, GetNumSavedInstances() do for i = 1, GetNumSavedInstances() do
name, _, reset = GetSavedInstanceInfo(i) name, id, reset = GetSavedInstanceInfo(i)
if name then if name then
tinsert(lockedInstances["raids"], {name, reset}) if not oneraid then
end DT.tooltip:AddLine(L["Saved Instance(s)"])
oneraid = true
end end
if next(lockedInstances["raids"]) then DT.tooltip:AddDoubleLine(format(instanceFormat, name, id), SecondsToTime(reset, true), 1, 1, 1, 0.8, 0.8, 0.8)
DT.tooltip:AddLine(" ")
DT.tooltip:AddLine(L["Saved Raid(s)"])
for i = 1, getn(lockedInstances["raids"]) do
name, reset = unpack(lockedInstances["raids"][i])
lockoutColor = extended and lockoutColorExtended or lockoutColorNormal
DT.tooltip:AddDoubleLine(format(lockoutInfoFormat, name), SecondsToTime(abs(reset), 1, 1, false), 1, 1, 1, lockoutColor.r, lockoutColor.g, lockoutColor.b)
end end
DT.tooltip:Show() if DT.tooltip:NumLines() > 0 then
DT.tooltip:AddLine(" ") DT.tooltip:AddLine(" ")
end end
end
DT.tooltip:AddDoubleLine(L["Realm Time:"], format(europeDisplayFormat, GetGameTime()), 1, 1, 1, 0.8, 0.8, 0.8)
DT.tooltip:AddDoubleLine(L["Realm time:"], format(europeDisplayFormat_nocolor, GetGameTime()), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b)
DT.tooltip:Show() DT.tooltip:Show()
end end
local lastPanel local function OnEvent(self, event)
if event == "UPDATE_INSTANCE_INFO" and enteredFrame then
OnEnter(self)
end
end
local int = 5 local int = 5
local function OnUpdate(self, t) local function OnUpdate(self, t)
int = int - t int = int - t
if int > 0 then return end if int > 0 then return end
if enteredFrame then
OnEnter(self)
end
self.text:SetText(gsub(gsub(BetterDate(E.db.datatexts.timeFormat.." "..E.db.datatexts.dateFormat, time()), ":", timeDisplayFormat), "%s", dateDisplayFormat)) self.text:SetText(gsub(gsub(BetterDate(E.db.datatexts.timeFormat.." "..E.db.datatexts.dateFormat, time()), ":", timeDisplayFormat), "%s", dateDisplayFormat))
lastPanel = self lastPanel = self
@@ -91,4 +101,4 @@ local function ValueColorUpdate(hex)
end end
E.valueColorUpdateFuncs[ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Time", nil, nil, OnUpdate, OnClick, OnEnter, OnLeave) DT:RegisterDatatext("Time", {"UPDATE_INSTANCE_INFO"}, OnEvent, OnUpdate, OnClick, OnEnter, OnLeave)
+4 -4
View File
@@ -792,11 +792,11 @@ function UF:UpdateAllHeaders(event)
if ORD then if ORD then
ORD:ResetDebuffData() ORD:ResetDebuffData()
if instanceType == "party" or instanceType == "raid" then --[[if instanceType == "party" or instanceType == "raid" then
ORD:RegisterDebuffs(E.global.unitframe.aurafilters.RaidDebuffs.spells) ORD:RegisterDebuffs(E.global.unitframe.aurafilters.RaidDebuffs.spells)
-- else else
-- ORD:RegisterDebuffs(E.global.unitframe.aurafilters.CCDebuffs.spells) ORD:RegisterDebuffs(E.global.unitframe.aurafilters.CCDebuffs.spells)
end end--]]
end end
if E.private.unitframe.disabledBlizzardFrames.party then if E.private.unitframe.disabledBlizzardFrames.party then
+15 -19
View File
@@ -556,19 +556,17 @@ P["chat"] = {
P["datatexts"] = { P["datatexts"] = {
["font"] = "PT Sans Narrow", ["font"] = "PT Sans Narrow",
["fontSize"] = 12, ["fontSize"] = 12,
["fontOutline"] = "NONE", ["fontOutline"] = "OUTLINE",
["wordWrap"] = false,
["panels"] = { ["panels"] = {
["LeftChatDataPanel"] = { ["LeftChatDataPanel"] = {
["left"] = "Armor", ["left"] = "Armor",
["middle"] = "Durability", ["middle"] = "Durability",
["right"] = "Avoidance", ["right"] = "Avoidance"
}, },
["RightChatDataPanel"] = { ["RightChatDataPanel"] = {
["left"] = "System", ["left"] = "System",
["middle"] = "Time", ["middle"] = "Time",
["right"] = "Gold", ["right"] = "Gold"
}, },
["LeftMiniPanel"] = "Guild", ["LeftMiniPanel"] = "Guild",
["RightMiniPanel"] = "Friends", ["RightMiniPanel"] = "Friends",
@@ -577,22 +575,20 @@ P["datatexts"] = {
["BottomLeftMiniPanel"] = "", ["BottomLeftMiniPanel"] = "",
["BottomRightMiniPanel"] = "", ["BottomRightMiniPanel"] = "",
["TopRightMiniPanel"] = "", ["TopRightMiniPanel"] = "",
["TopLeftMiniPanel"] = "", ["TopLeftMiniPanel"] = ""
}, },
["battleground"] = true,
["panelBackdrop"] = true,
["panelTransparency"] = false,
--Datatext Options
--General
["goldFormat"] = "BLIZZARD",
["goldCoins"] = false,
--Time Datatext
["timeFormat"] = "%I:%M", ["timeFormat"] = "%I:%M",
["dateFormat"] = "", ["dateFormat"] = "",
["battleground"] = true,
--Enabled/Disabled Panels ["panelTransparency"] = false,
["panelBackdrop"] = true,
["goldFormat"] = "BLIZZARD",
["noCombatClick"] = false,
["noCombatHover"] = false,
["friends"] = {
["hideAFK"] = false,
["hideDND"] = false,
},
["minimapPanels"] = true, ["minimapPanels"] = true,
["leftChatPanel"] = true, ["leftChatPanel"] = true,
["rightChatPanel"] = true, ["rightChatPanel"] = true,
@@ -601,7 +597,7 @@ P["datatexts"] = {
["minimapTopRight"] = false, ["minimapTopRight"] = false,
["minimapBottom"] = false, ["minimapBottom"] = false,
["minimapBottomLeft"] = false, ["minimapBottomLeft"] = false,
["minimapBottomRight"] = false, ["minimapBottomRight"] = false
} }
--Tooltip --Tooltip
+102 -58
View File
@@ -3,10 +3,13 @@ local DT = E:GetModule("DataTexts");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local _G = _G
local pairs = pairs
local find, upper = string.find, string.upper local find, upper = string.find, string.upper
local getn = table.getn local getn = table.getn
--WoW API / Variables --WoW API / Variables
local GENERAL, NONE = GENERAL, NONE local HideLeftChat = HideLeftChat
local HideRightChat = HideRightChat
local datatexts = {} local datatexts = {}
@@ -14,7 +17,7 @@ function DT:PanelLayoutOptions()
for name, data in pairs(DT.RegisteredDataTexts) do for name, data in pairs(DT.RegisteredDataTexts) do
datatexts[name] = data.localizedName or L[name] datatexts[name] = data.localizedName or L[name]
end end
datatexts[""] = NONE datatexts[""] = L["None"]
local order local order
local table = E.Options.args.datatexts.args.panels.args local table = E.Options.args.datatexts.args.panels.args
@@ -23,9 +26,9 @@ function DT:PanelLayoutOptions()
if not _G[pointLoc] then table[pointLoc] = nil return end if not _G[pointLoc] then table[pointLoc] = nil return end
if type(tab) == "table" then if type(tab) == "table" then
if find(pointLoc, "Chat") then if find(pointLoc, "Chat") then
order = 15; order = 15
else else
order = 20; order = 20
end end
table[pointLoc] = { table[pointLoc] = {
order = order, order = order,
@@ -38,8 +41,8 @@ function DT:PanelLayoutOptions()
type = "select", type = "select",
name = L[option] or upper(option), name = L[option] or upper(option),
values = datatexts, values = datatexts,
get = function(info) return E.db.datatexts.panels[pointLoc][ info[getn(info)] ]; end, get = function(info) return E.db.datatexts.panels[pointLoc][ info[getn(info)] ] end,
set = function(info, value) E.db.datatexts.panels[pointLoc][ info[getn(info)] ] = value; DT:LoadDataTexts(); end set = function(info, value) E.db.datatexts.panels[pointLoc][ info[getn(info)] ] = value DT:LoadDataTexts() end
} }
end end
elseif type(tab) == "string" then elseif type(tab) == "string" then
@@ -47,8 +50,8 @@ function DT:PanelLayoutOptions()
type = "select", type = "select",
name = L[pointLoc] or pointLoc, name = L[pointLoc] or pointLoc,
values = datatexts, values = datatexts,
get = function(info) return E.db.datatexts.panels[pointLoc]; end, get = function(info) return E.db.datatexts.panels[pointLoc] end,
set = function(info, value) E.db.datatexts.panels[pointLoc] = value; DT:LoadDataTexts(); end set = function(info, value) E.db.datatexts.panels[pointLoc] = value DT:LoadDataTexts() end
} }
end end
end end
@@ -58,8 +61,8 @@ E.Options.args.datatexts = {
type = "group", type = "group",
name = L["DataTexts"], name = L["DataTexts"],
childGroups = "tab", childGroups = "tab",
get = function(info) return E.db.datatexts[ info[getn(info)] ]; end, get = function(info) return E.db.datatexts[ info[getn(info)] ] end,
set = function(info, value) E.db.datatexts[ info[getn(info)] ] = value; DT:LoadDataTexts(); end, set = function(info, value) E.db.datatexts[ info[getn(info)] ] = value DT:LoadDataTexts() end,
args = { args = {
intro = { intro = {
order = 1, order = 1,
@@ -74,18 +77,18 @@ E.Options.args.datatexts = {
general = { general = {
order = 3, order = 3,
type = "group", type = "group",
name = GENERAL, name = L["General"],
args = { args = {
header = { header = {
order = 1, order = 1,
type = "header", type = "header",
name = GENERAL name = L["General"]
}, },
generalGroup = { generalGroup = {
order = 2, order = 2,
type = "group", type = "group",
guiInline = true, guiInline = true,
name = GENERAL, name = L["General"],
args = { args = {
battleground = { battleground = {
order = 1, order = 1,
@@ -95,21 +98,21 @@ E.Options.args.datatexts = {
}, },
panelTransparency = { panelTransparency = {
order = 2, order = 2,
name = L["Panel Transparency"],
type = "toggle", type = "toggle",
name = L["Panel Transparency"],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
E:GetModule("Layout"):SetDataPanelStyle(); E:GetModule("Layout"):SetDataPanelStyle()
end end
}, },
panelBackdrop = { panelBackdrop = {
order = 3, order = 3,
name = L["Backdrop"],
type = "toggle", type = "toggle",
name = L["Backdrop"],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value E.db.datatexts[ info[getn(info)] ] = value
E:GetModule("Layout"):SetDataPanelStyle() E:GetModule("Layout"):SetDataPanelStyle()
end, end
}, },
noCombatClick = { noCombatClick = {
order = 4, order = 4,
@@ -154,7 +157,7 @@ E.Options.args.datatexts = {
fontSize = { fontSize = {
order = 2, order = 2,
type = "range", type = "range",
name = FONT_SIZE, name = L["Font Size"],
min = 4, max = 22, step = 1 min = 4, max = 22, step = 1
}, },
fontOutline = { fontOutline = {
@@ -163,7 +166,7 @@ E.Options.args.datatexts = {
name = L["Font Outline"], name = L["Font Outline"],
desc = L["Set the font outline."], desc = L["Set the font outline."],
values = { values = {
["NONE"] = NONE, ["NONE"] = L["None"],
["OUTLINE"] = "OUTLINE", ["OUTLINE"] = "OUTLINE",
["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE",
["THICKOUTLINE"] = "THICKOUTLINE" ["THICKOUTLINE"] = "THICKOUTLINE"
@@ -194,13 +197,13 @@ E.Options.args.datatexts = {
name = L["Datatext Panel (Left)"], name = L["Datatext Panel (Left)"],
desc = L["Display data panels below the chat, used for datatexts."], desc = L["Display data panels below the chat, used for datatexts."],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
if(E.db.LeftChatPanelFaded) then if E.db.LeftChatPanelFaded then
E.db.LeftChatPanelFaded = true; E.db.LeftChatPanelFaded = true
HideLeftChat(); HideLeftChat()
end end
E:GetModule("Chat"):UpdateAnchors(); E:GetModule("Chat"):UpdateAnchors()
E:GetModule("Layout"):ToggleChatPanels(); E:GetModule("Layout"):ToggleChatPanels()
end end
}, },
rightChatPanel = { rightChatPanel = {
@@ -209,13 +212,13 @@ E.Options.args.datatexts = {
name = L["Datatext Panel (Right)"], name = L["Datatext Panel (Right)"],
desc = L["Display data panels below the chat, used for datatexts."], desc = L["Display data panels below the chat, used for datatexts."],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
if(E.db.RightChatPanelFaded) then if E.db.RightChatPanelFaded then
E.db.RightChatPanelFaded = true; E.db.RightChatPanelFaded = true
HideRightChat(); HideRightChat()
end end
E:GetModule("Chat"):UpdateAnchors(); E:GetModule("Chat"):UpdateAnchors()
E:GetModule("Layout"):ToggleChatPanels(); E:GetModule("Layout"):ToggleChatPanels()
end end
}, },
minimapPanels = { minimapPanels = {
@@ -224,17 +227,17 @@ E.Options.args.datatexts = {
name = L["Minimap Panels"], name = L["Minimap Panels"],
desc = L["Display minimap panels below the minimap, used for datatexts."], desc = L["Display minimap panels below the minimap, used for datatexts."],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
E:GetModule("Minimap"):UpdateSettings(); E:GetModule("Minimap"):UpdateSettings()
end end
}, },
minimapTop = { minimapTop = {
order = 5, order = 5,
name = L["TopMiniPanel"],
type = "toggle", type = "toggle",
name = L["TopMiniPanel"],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
E:GetModule("Minimap"):UpdateSettings(); E:GetModule("Minimap"):UpdateSettings()
end end
}, },
minimapTopLeft = { minimapTopLeft = {
@@ -242,17 +245,17 @@ E.Options.args.datatexts = {
type = "toggle", type = "toggle",
name = L["TopLeftMiniPanel"], name = L["TopLeftMiniPanel"],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
E:GetModule("Minimap"):UpdateSettings(); E:GetModule("Minimap"):UpdateSettings()
end, end
}, },
minimapTopRight = { minimapTopRight = {
order = 7, order = 7,
type = "toggle", type = "toggle",
name = L["TopRightMiniPanel"], name = L["TopRightMiniPanel"],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
E:GetModule("Minimap"):UpdateSettings(); E:GetModule("Minimap"):UpdateSettings()
end end
}, },
minimapBottom = { minimapBottom = {
@@ -260,8 +263,8 @@ E.Options.args.datatexts = {
type = "toggle", type = "toggle",
name = L["BottomMiniPanel"], name = L["BottomMiniPanel"],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
E:GetModule("Minimap"):UpdateSettings(); E:GetModule("Minimap"):UpdateSettings()
end end
}, },
minimapBottomLeft = { minimapBottomLeft = {
@@ -269,17 +272,17 @@ E.Options.args.datatexts = {
type = "toggle", type = "toggle",
name = L["BottomLeftMiniPanel"], name = L["BottomLeftMiniPanel"],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
E:GetModule("Minimap"):UpdateSettings(); E:GetModule("Minimap"):UpdateSettings()
end end
}, },
minimapBottomRight = { minimapBottomRight = {
order = 10, order = 10,
name = L["BottomRightMiniPanel"],
type = "toggle", type = "toggle",
name = L["BottomRightMiniPanel"],
set = function(info, value) set = function(info, value)
E.db.datatexts[ info[getn(info)] ] = value; E.db.datatexts[ info[getn(info)] ] = value
E:GetModule("Minimap"):UpdateSettings(); E:GetModule("Minimap"):UpdateSettings()
end end
}, },
spacer = { spacer = {
@@ -303,14 +306,14 @@ E.Options.args.datatexts = {
header = { header = {
order = 1, order = 1,
type = "header", type = "header",
name = L["Time"], name = L["Time"]
}, },
timeFormat = { timeFormat = {
order = 2, order = 2,
type = "select", type = "select",
name = L["Time Format"], name = L["Time Format"],
values = { values = {
[""] = NONE, [""] = L["None"],
["%I:%M"] = "03:27", ["%I:%M"] = "03:27",
["%I:%M:%S"] = "03:27:32", ["%I:%M:%S"] = "03:27:32",
["%I:%M %p"] = "03:27 PM", ["%I:%M %p"] = "03:27 PM",
@@ -324,16 +327,57 @@ E.Options.args.datatexts = {
type = "select", type = "select",
name = L["Date Format"], name = L["Date Format"],
values = { values = {
[""] = NONE, [""] = L["None"],
["%d/%m/%y "] = "27/03/16", ["%d/%m/%y "] = "DD/MM/YY",
["%m/%d/%y "] = "03/27/16", ["%m/%d/%y "] = "MM/DD/YY",
["%y/%m/%d "] = "16/03/27", ["%y/%m/%d "] = "YY/MM/DD",
["%d.%m.%y "] = "27.03.16" ["%d.%m.%y "] = "DD.MM.YY",
["%m.%d.%y "] = "MM.DD.YY",
["%y.%m.%d "] = "YY.MM.DD"
}
}
}
},
friends = {
order = 6,
type = "group",
name = L["Friends"],
args = {
header = {
order = 1,
type = "header",
name = L["Friends"]
},
description = {
order = 2,
type = "description",
name = L["Hide specific sections in the datatext tooltip."]
},
hideGroup = {
order = 3,
type = "group",
guiInline = true,
name = L["Hide"],
args = {
hideAFK = {
order = 1,
type = "toggle",
name = L["Away"],
get = function(info) return E.db.datatexts.friends.hideAFK end,
set = function(info, value) E.db.datatexts.friends.hideAFK = value DT:LoadDataTexts() end
},
hideDND = {
order = 2,
type = "toggle",
name = L["Busy"],
get = function(info) return E.db.datatexts.friends.hideDND end,
set = function(info, value) E.db.datatexts.friends.hideDND = value DT:LoadDataTexts() end
} }
} }
} }
} }
} }
}; }
}
DT:PanelLayoutOptions(); DT:PanelLayoutOptions()