Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Returns the icon flags for a section, such as Magic Effect and Heroic Difficulty
iconFlags = C_EncounterJournal.GetSectionIconFlags(sectionID)
Arguments[]
- sectionID
- number : JournalEncounterSection.ID
Returns[]
- iconFlags
- number[]? - Flag IDs to display for this section.
- Refer to the ENCOUNTER_JOURNAL_SECTION_FLAG globals for the flag titles.
- For convenience there is EncounterJournal_SetFlagIcon() which sets the texture coords for interface/encounterjournal/ui-ej-icons.blp
Example[]
-- local copy since Blizzard_EncounterJournal is LoadOnDemand
local function EncounterJournal_SetFlagIcon(texture, index)
local iconSize = 32
local columns = 256/iconSize
local rows = 64/iconSize
local l = mod(index, columns) / columns
local r = l + (1/columns)
local t = floor(index/columns) / rows
local b = t + (1/rows)
texture:SetTexCoord(l, r, t, b)
end
local f = CreateFrame("Frame", nil, UIParent)
f:SetPoint("CENTER")
f:SetSize(32, 32)
local tex = f:CreateTexture()
tex:SetAllPoints(f)
tex:SetTexture("Interface/EncounterJournal/UI-EJ-Icons")
local function SetEncounterJournalIcon(sectionID)
local iconFlags = C_EncounterJournal.GetSectionIconFlags(sectionID)
if iconFlags then
for _, flag in pairs(iconFlags) do
print(flag, _G["ENCOUNTER_JOURNAL_SECTION_FLAG"..flag])
EncounterJournal_SetFlagIcon(tex, flag)
end
end
end
-- Vanessa VanCleef: sectionID 2065 [Powder Explosion]
SetEncounterJournalIcon(2065)
> 4, "Deadly"
Patch changes[]
Patch 7.3.5 (2018-01-16): Added, this functionality was separated from C_EncounterJournal.GetSectionInfo.