Mercurial > wow > wowdb-profiler
comparison Main.lua @ 583:4a51fdc1e2e4
Began the process of updating for Midnight's changes.
author | MMOSimca |
---|---|
date | Sun, 05 Oct 2025 22:48:07 -0400 |
parents | 78e9cbbf3d58 |
children | be7931f9225c |
comparison
equal
deleted
inserted
replaced
582:b15d966bf6ae | 583:4a51fdc1e2e4 |
---|---|
16 local unpack = _G.unpack | 16 local unpack = _G.unpack |
17 | 17 |
18 local C_Timer = _G.C_Timer | 18 local C_Timer = _G.C_Timer |
19 local C_Spell = _G.C_Spell | 19 local C_Spell = _G.C_Spell |
20 local GetCurrencyInfo = _G.GetCurrencyInfo | 20 local GetCurrencyInfo = _G.GetCurrencyInfo |
21 | |
22 local ICL = InCombatLockdown | |
23 local III = IsInInstance | |
21 | 24 |
22 | 25 |
23 -- ADDON NAMESPACE ---------------------------------------------------- | 26 -- ADDON NAMESPACE ---------------------------------------------------- |
24 | 27 |
25 local ADDON_NAME, private = ... | 28 local ADDON_NAME, private = ... |
1217 | 1220 |
1218 if not level_data then | 1221 if not level_data then |
1219 level_data = {} | 1222 level_data = {} |
1220 encounter_data[npc_level] = level_data | 1223 encounter_data[npc_level] = level_data |
1221 end | 1224 end |
1222 level_data.max_health = level_data.max_health or _G.UnitHealthMax("target") | 1225 |
1223 | 1226 -- Can't do this in instances now |
1224 -- May not capture as much data as it could, since the API changed in Legion to report multiple types of power | 1227 if not III() then |
1225 if not level_data.power then | 1228 level_data.max_health = level_data.max_health or _G.UnitHealthMax("target") |
1226 local max_power = _G.UnitPowerMax("target") | 1229 |
1227 | 1230 -- May not capture as much data as it could, since the API changed in Legion to report multiple types of power |
1228 if max_power > 0 then | 1231 if not level_data.power then |
1229 local power_type = _G.UnitPowerType("target") | 1232 local max_power = _G.UnitPowerMax("target") |
1230 level_data.power = ("%s:%d"):format(private.POWER_TYPE_NAMES[tostring(power_type)] or power_type, max_power) | 1233 |
1234 if max_power > 0 then | |
1235 local power_type = _G.UnitPowerType("target") | |
1236 level_data.power = ("%s:%d"):format(private.POWER_TYPE_NAMES[tostring(power_type)] or power_type, max_power) | |
1237 end | |
1231 end | 1238 end |
1232 end | 1239 end |
1233 name_to_id_map[_G.UnitName("target")] = unit_idnum | 1240 name_to_id_map[_G.UnitName("target")] = unit_idnum |
1234 return npc, unit_idnum | 1241 return npc, unit_idnum |
1235 end | 1242 end |