Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Advertisement

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
ID Flag ID Flag
0 Tank icon Tank Alert 7 Magic icon Magic Effect
1 Dps icon Damage Dealer Alert 8 Curse icon Curse Effect
2 Healer icon Healer Alert 9 Poison icon Poison Effect
3 Heroic icon Heroic Difficulty 10 Disease icon Disease Effect
4 Deadly icon Deadly 11 Enrage icon Enrage
5 Important icon Important 12 Mythic icon Mythic Difficulty
6 Interruptable icon Interruptible

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"
API C EncounterJournal

Patch changes[]

Legion Patch 7.3.5 (2018-01-16): Added, this functionality was separated from C_EncounterJournal.GetSectionInfo.

Advertisement