# HG changeset patch # User ovolkov # Date 1422951314 -10800 # Node ID 64c9517efa88b8a590f9944e90d0badec5bccb37 # Parent bd476e399376ec442d4ed0f03d613dd62759057f convert local boss name lookups to GetLFGDungeonEncounterInfo diff -r bd476e399376 -r 64c9517efa88 LFGFilter.lua --- a/LFGFilter.lua Tue Feb 03 10:26:29 2015 +0300 +++ b/LFGFilter.lua Tue Feb 03 11:15:14 2015 +0300 @@ -35,14 +35,14 @@ local token_to_encounter_id = { highmaul = { - ej_instance = 477, - [1128] = { "kargath", "bladefist", "kargath_bladefist" }, - [971] = { "butcher", "the_butcher" }, - [1195] = { "tectus" }, - [1196] = { "brackenspore", "bracken" }, - [1148] = { "twin_orgon", "twins" }, - [1153] = { "koragh", "breaker" }, - [1197] = { "imperator", "margok" }, + lfg_dungeon_id = 849, + { "kargath", "bladefist", "kargath_bladefist" }, + { "butcher", "the_butcher" }, + { "tectus" }, + { "brackenspore", "bracken" }, + { "twin_orgon", "twins" }, + { "koragh", "breaker" }, + { "imperator", "margok" }, } } @@ -64,35 +64,21 @@ LFGListSearchPanel_UpdateResults(self); end -local localized_encounter_name_to_id = {} +local localized_encounter_name_to_idx = {} local function InsertEncounterStateAliases(result_env, raid_token, completed_encounters) local encounter_aliases = token_to_encounter_id[raid_token] if not encounter_aliases then return end - local ej_instance = encounter_aliases.ej_instance - local encounter_names = localized_encounter_name_to_id[ej_instance] + local lfg_dungeon_id = encounter_aliases.lfg_dungeon_id + local encounter_names = localized_encounter_name_to_idx[lfg_dungeon_id] if not encounter_names then encounter_names = {} - EJ_SelectInstance(ej_instance) - local encounter_idx = 1 - local encounter_name, encounter_id, root_section_id, _ - repeat - encounter_name, _, encounter_id, root_section_id = EJ_GetEncounterInfoByIndex(encounter_idx) - if encounter_name then - encounter_names[encounter_name] = encounter_id - local next_section_id = root_section_id - repeat - local title, description, headerType, abilityIcon, displayInfo, siblingID, _, fileredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = EJ_GetSectionInfo(next_section_id) - if displayInfo ~= 0 then - if not encounter_names[title] then encounter_names[title] = encounter_id end - end - next_section_id = siblingID - until not next_section_id - encounter_idx = encounter_idx + 1 - end - until not encounter_name - localized_encounter_name_to_id[ej_instance] = encounter_names + for idx = 1, GetLFGDungeonNumEncounters(lfg_dungeon_id) do + local bossName, texture, isKilled = GetLFGDungeonEncounterInfo(lfg_dungeon_id, idx) + encounter_names[bossName] = idx + end + localized_encounter_name_to_idx[lfg_dungeon_id] = encounter_names end for idx = 1, #completed_encounters do @@ -242,5 +228,5 @@ encounter_idx = encounter_idx + 1 end until not encounter_name - localized_encounter_name_to_id[ej_instance] = encounter_names + localized_encounter_name_to_idx[ej_instance] = encounter_names end