Wowpedia
Advertisement
Wowpedia
240,451
pages
Game Flavors
Links
Patch
Added in 7.3.5

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

Patch changes

Advertisement