Skip to content

Commit a5742c4

Browse files
committed
Add state to ENCOUNTER_TIMELINE_EVENT_ADDED entries
1 parent bbb867d commit a5742c4

File tree

1 file changed

+53
-48
lines changed

1 file changed

+53
-48
lines changed

Transcriptor.lua

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,70 +1354,75 @@ sh.CHAT_MSG_MONSTER_SAY = sh.CHAT_MSG_MONSTER_YELL
13541354
sh.CHAT_MSG_MONSTER_WHISPER = sh.CHAT_MSG_MONSTER_YELL
13551355

13561356
do
1357-
local entriesInTable = {
1358-
"id",
1359-
"source",
1360-
"spellName",
1361-
"spellID",
1362-
"iconFileID",
1363-
"duration",
1364-
"maxQueueDuration",
1365-
"icons",
1366-
"severity",
1367-
"isApproximate",
1368-
}
1369-
local entriesToBlock = {
1370-
color = true,
1357+
local codes = {
1358+
[0] = "Active",
1359+
[1] = "Paused",
1360+
[2] = "Finished",
1361+
[3] = "Canceled",
13711362
}
1372-
function sh.ENCOUNTER_TIMELINE_EVENT_ADDED(eventInfo)
1373-
local msgTable = {}
1374-
for i = 1, #entriesInTable do
1375-
local entry = entriesInTable[i]
1376-
local value = eventInfo[entry]
1377-
if not issecretvalue(value) then
1378-
if value then
1363+
1364+
do
1365+
local entriesInTable = {
1366+
"id",
1367+
"source",
1368+
"spellName",
1369+
"spellID",
1370+
"iconFileID",
1371+
"duration",
1372+
"maxQueueDuration",
1373+
"icons",
1374+
"severity",
1375+
"isApproximate",
1376+
}
1377+
local entriesToBlock = {
1378+
color = true,
1379+
}
1380+
function sh.ENCOUNTER_TIMELINE_EVENT_ADDED(eventInfo)
1381+
local msgTable = {}
1382+
1383+
local state = C_EncounterTimeline.GetEventState(eventInfo.id)
1384+
msgTable[1] = ("State: %d (%s)"):format(state, codes[state])
1385+
1386+
for i = 1, #entriesInTable do
1387+
local entry = entriesInTable[i]
1388+
local value = eventInfo[entry]
1389+
if not issecretvalue(value) then
1390+
if value then
1391+
msgTable[#msgTable+1] = entry
1392+
msgTable[#msgTable+1] = tostring(value)
1393+
end
1394+
else
13791395
msgTable[#msgTable+1] = entry
1380-
msgTable[#msgTable+1] = tostring(value)
1396+
msgTable[#msgTable+1] = "<secret>"
13811397
end
1382-
else
1383-
msgTable[#msgTable+1] = entry
1384-
msgTable[#msgTable+1] = "<secret>"
13851398
end
1386-
end
1387-
for k,v in next, eventInfo do
1388-
if not tContains(entriesInTable, k) and not entriesToBlock[k] then
1389-
if not issecretvalue(v) then
1390-
msgTable[#msgTable+1] = k
1391-
msgTable[#msgTable+1] = tostring(v)
1392-
else
1393-
msgTable[#msgTable+1] = k
1394-
msgTable[#msgTable+1] = "<secret>"
1399+
for k,v in next, eventInfo do
1400+
if not tContains(entriesInTable, k) and not entriesToBlock[k] then
1401+
if not issecretvalue(v) then
1402+
msgTable[#msgTable+1] = k
1403+
msgTable[#msgTable+1] = tostring(v)
1404+
else
1405+
msgTable[#msgTable+1] = k
1406+
msgTable[#msgTable+1] = "<secret>"
1407+
end
13951408
end
13961409
end
1410+
local msg = tconcat(msgTable, "#")
1411+
return msg
13971412
end
1398-
local msg = tconcat(msgTable, "#")
1399-
return msg
14001413
end
1401-
end
14021414

1403-
function sh.ENCOUNTER_TIMELINE_EVENT_REMOVED(eventID)
1404-
return strjoin("#", eventID)
1405-
end
1406-
1407-
do
1408-
local codes = {
1409-
[0] = "Active",
1410-
[1] = "Paused",
1411-
[2] = "Finished",
1412-
[3] = "Canceled",
1413-
}
14141415
function sh.ENCOUNTER_TIMELINE_EVENT_STATE_CHANGED(eventID)
14151416
local newState = C_EncounterTimeline.GetEventState(eventID)
14161417
local text = ("State: %d (%s)"):format(newState, codes[newState])
14171418
return strjoin("#", eventID, text)
14181419
end
14191420
end
14201421

1422+
function sh.ENCOUNTER_TIMELINE_EVENT_REMOVED(eventID)
1423+
return strjoin("#", eventID)
1424+
end
1425+
14211426
do
14221427
local entriesInTable = {
14231428
"text",

0 commit comments

Comments
 (0)