Verified Commit 33064c1e authored by Merathilis's avatar Merathilis
Browse files

Add some Torghast Info to the Time DataText. Thx Siweia for the idea <3

parent adcb85ca
......@@ -2,7 +2,7 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local DT = E:GetModule('DataTexts')
local _G = _G
local next, unpack = next, unpack
local next, pairs, unpack = next, pairs, unpack
local format, strjoin = format, strjoin
local sort, tinsert = sort, tinsert
local date, utf8sub = date, string.utf8sub
......@@ -31,6 +31,10 @@ local TIMEMANAGER_TOOLTIP_REALMTIME = TIMEMANAGER_TOOLTIP_REALMTIME
local VOICE_CHAT_BATTLEGROUND = VOICE_CHAT_BATTLEGROUND
local WINTERGRASP_IN_PROGRESS = WINTERGRASP_IN_PROGRESS
local WORLD_BOSSES_TEXT = RAID_INFO_WORLD_BOSS
local C_AreaPoiInfo_GetAreaPOIInfo = C_AreaPoiInfo.GetAreaPOIInfo
local C_QuestLog_IsQuestFlaggedCompleted = C_QuestLog.IsQuestFlaggedCompleted
local C_UIWidgetManager_GetTextWithStateWidgetVisualizationInfo = C_UIWidgetManager.GetTextWithStateWidgetVisualizationInfo
local UNKNOWN = UNKNOWN
local APM = { _G.TIMEMANAGER_PM, _G.TIMEMANAGER_AM }
local ukDisplayFormat, europeDisplayFormat = '', ''
......@@ -44,6 +48,20 @@ local enteredFrame = false
local OnUpdate, lastPanel
-- Torghast
local TorghastWidgets, TorghastInfo = {
{nameID = 2925, levelID = 2930}, -- Fracture Chambers
{nameID = 2926, levelID = 2932}, -- Skoldus Hall
{nameID = 2924, levelID = 2934}, -- Soulforges
{nameID = 2927, levelID = 2936}, -- Coldheart Interstitia
{nameID = 2928, levelID = 2938}, -- Mort'regar
{nameID = 2929, levelID = 2940}, -- The Upper Reaches
}
local function CleanupLevelName(text)
return gsub(text, "|n", "")
end
local function ValueColorUpdate(hex)
europeDisplayFormat = strjoin('', '%02d', hex, ':|r%02d')
ukDisplayFormat = strjoin('', '', '%d', hex, ':|r%02d', hex, ' %s|r')
......@@ -278,6 +296,25 @@ local function OnEnter()
end
end
-- Torghast
if not TorghastInfo then
TorghastInfo = C_AreaPoiInfo_GetAreaPOIInfo(1543, 6640)
end
if TorghastInfo and C_QuestLog_IsQuestFlaggedCompleted(60136) then
for _, value in pairs(TorghastWidgets) do
local nameInfo = C_UIWidgetManager_GetTextWithStateWidgetVisualizationInfo(value.nameID)
if nameInfo and nameInfo.shownState == 1 then
DT.tooltip:AddLine(' ')
DT.tooltip:AddLine(TorghastInfo.name)
local nameText = CleanupLevelName(nameInfo.text)
local levelInfo = C_UIWidgetManager_GetTextWithStateWidgetVisualizationInfo(value.levelID)
local levelText = levelInfo and CleanupLevelName(levelInfo.text) or UNKNOWN
DT.tooltip:AddDoubleLine(nameText, levelText)
end
end
end
local Hr, Min, AmPm = CalculateTimeValues(true)
if DT.tooltip:NumLines() > 0 then
DT.tooltip:AddLine(' ')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment