Initial WoW Classic Support
First pass of changes to make Details! compatible with WoW Classic.
This commit is contained in:
+7
-8
@@ -33,6 +33,8 @@
|
||||
local atributo_custom = _detalhes.atributo_custom --details local
|
||||
local info = _detalhes.janela_info --details local
|
||||
|
||||
local UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> constants
|
||||
|
||||
@@ -115,7 +117,7 @@
|
||||
local mapID = C_Map.GetBestMapForUnit ("player")
|
||||
local ejid
|
||||
if (mapID) then
|
||||
ejid = EJ_GetInstanceForMap (mapID)
|
||||
ejid = DetailsFramework.EncounterJournal.EJ_GetInstanceForMap (mapID)
|
||||
end
|
||||
|
||||
if (not mapID) then
|
||||
@@ -123,7 +125,6 @@
|
||||
return
|
||||
end
|
||||
|
||||
--local ejid = EJ_GetCurrentInstance()
|
||||
if (ejid == 0) then
|
||||
ejid = _detalhes:GetInstanceEJID()
|
||||
end
|
||||
@@ -551,9 +552,7 @@
|
||||
mapID = 0
|
||||
end
|
||||
|
||||
local ejid = EJ_GetInstanceForMap (mapID)
|
||||
|
||||
--local ejid = EJ_GetCurrentInstance()
|
||||
local ejid = DetailsFramework.EncounterJournal.EJ_GetInstanceForMap (mapID)
|
||||
|
||||
if (ejid == 0) then
|
||||
ejid = _detalhes:GetInstanceEJID()
|
||||
@@ -575,7 +574,7 @@
|
||||
end
|
||||
|
||||
--> tag as a mythic dungeon segment, can be any type of segment, this tag also avoid the segment to be tagged as trash
|
||||
local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo()
|
||||
local mythicLevel = C_ChallengeMode and C_ChallengeMode.GetActiveKeystoneInfo()
|
||||
if (mythicLevel and mythicLevel >= 2) then
|
||||
_detalhes.tabela_vigente.is_mythic_dungeon_segment = true
|
||||
_detalhes.tabela_vigente.is_mythic_dungeon_run_id = _detalhes.mythic_dungeon_id
|
||||
@@ -1070,10 +1069,10 @@
|
||||
return
|
||||
end
|
||||
local _, playerClass = UnitClass ("player")
|
||||
local specIndex = GetSpecialization()
|
||||
local specIndex = DetailsFramework.GetSpecialization()
|
||||
local playerSpecID
|
||||
if (specIndex) then
|
||||
playerSpecID = GetSpecializationInfo (specIndex)
|
||||
playerSpecID = DetailsFramework.GetSpecializationInfo (specIndex)
|
||||
end
|
||||
|
||||
if (playerSpecID and playerClass) then
|
||||
|
||||
+33
-22
@@ -3,14 +3,21 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
|
||||
local UnitName = UnitName
|
||||
local UnitGUID = UnitGUID
|
||||
local UnitGroupRolesAssigned = UnitGroupRolesAssigned
|
||||
local UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned
|
||||
local select = select
|
||||
local floor = floor
|
||||
|
||||
local GetNumGroupMembers = GetNumGroupMembers
|
||||
|
||||
local ItemUpgradeInfo = LibStub ("LibItemUpgradeInfo-1.0")
|
||||
local LibGroupInSpecT = LibStub ("LibGroupInSpecT-1.1")
|
||||
--local LibGroupInSpecT = false
|
||||
--local LibGroupInSpecT = LibStub ("LibGroupInSpecT-1.1") --disabled due to classic wow
|
||||
local ItemUpgradeInfo
|
||||
local LibGroupInSpecT
|
||||
|
||||
if (DetailsFramework.IsClassicWow()) then
|
||||
ItemUpgradeInfo = false
|
||||
LibGroupInSpecT = false
|
||||
end
|
||||
|
||||
local storageDebug = false
|
||||
local store_instances = _detalhes.InstancesToStoreData
|
||||
@@ -423,9 +430,9 @@ function _detalhes:ResetSpecCache (forced)
|
||||
table.wipe (_detalhes.cached_specs)
|
||||
|
||||
if (_detalhes.track_specs) then
|
||||
local my_spec = GetSpecialization()
|
||||
local my_spec = DetailsFramework.GetSpecialization()
|
||||
if (type (my_spec) == "number") then
|
||||
local spec_number = GetSpecializationInfo (my_spec)
|
||||
local spec_number = DetailsFramework.GetSpecializationInfo (my_spec)
|
||||
if (type (spec_number) == "number") then
|
||||
local pguid = UnitGUID (_detalhes.playername)
|
||||
if (pguid) then
|
||||
@@ -1793,29 +1800,33 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
end
|
||||
end
|
||||
|
||||
local spec = GetInspectSpecialization (unitid)
|
||||
if (spec and spec ~= 0) then
|
||||
_detalhes.cached_specs [guid] = spec
|
||||
end
|
||||
local spec
|
||||
local talents = {}
|
||||
|
||||
if (not DetailsFramework.IsClassicWow()) then
|
||||
spec = GetInspectSpecialization (unitid)
|
||||
if (spec and spec ~= 0) then
|
||||
_detalhes.cached_specs [guid] = spec
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------
|
||||
|
||||
local talents = {}
|
||||
for i = 1, 7 do
|
||||
for o = 1, 3 do
|
||||
local talentID, name, texture, selected, available = GetTalentInfo (i, o, 1, true, unitid)
|
||||
if (selected) then
|
||||
tinsert (talents, talentID)
|
||||
break
|
||||
|
||||
for i = 1, 7 do
|
||||
for o = 1, 3 do
|
||||
--need to review this in classic
|
||||
local talentID, name, texture, selected, available = GetTalentInfo (i, o, 1, true, unitid)
|
||||
if (selected) then
|
||||
tinsert (talents, talentID)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (talents [1]) then
|
||||
_detalhes.cached_talents [guid] = talents
|
||||
--print (UnitName (unitid), "talents:", unpack (talents))
|
||||
if (talents [1]) then
|
||||
_detalhes.cached_talents [guid] = talents
|
||||
--print (UnitName (unitid), "talents:", unpack (talents))
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------
|
||||
|
||||
if (ilvl_core.forced_inspects [guid]) then
|
||||
|
||||
+8
-2
@@ -86,6 +86,12 @@
|
||||
return
|
||||
end
|
||||
|
||||
if (DetailsFramework.IsClassicWow()) then
|
||||
--average item level doesn't exists
|
||||
--talent information is very different
|
||||
return
|
||||
end
|
||||
|
||||
--> check the player level
|
||||
local playerLevel = UnitLevel ("player")
|
||||
if (not playerLevel) then
|
||||
@@ -116,10 +122,10 @@
|
||||
end
|
||||
|
||||
--> get the spec ID
|
||||
local spec = GetSpecialization()
|
||||
local spec = DetailsFramework.GetSpecialization()
|
||||
local currentSpec
|
||||
if (spec) then
|
||||
local specID = GetSpecializationInfo (spec)
|
||||
local specID = DetailsFramework.GetSpecializationInfo (spec)
|
||||
if (specID and specID ~= 0) then
|
||||
currentSpec = specID
|
||||
end
|
||||
|
||||
+12
-6
@@ -18,7 +18,7 @@
|
||||
local _IsInRaid = IsInRaid --wow api local
|
||||
local _IsInGroup = IsInGroup --wow api local
|
||||
local _GetNumGroupMembers = GetNumGroupMembers --wow api local
|
||||
local _UnitGroupRolesAssigned = UnitGroupRolesAssigned --wow api local
|
||||
local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned
|
||||
local _GetTime = GetTime
|
||||
local _select = select
|
||||
local _UnitBuff = UnitBuff
|
||||
@@ -361,7 +361,7 @@
|
||||
else
|
||||
local db = _detalhes.GetStorage()
|
||||
|
||||
local role = UnitGroupRolesAssigned ("player")
|
||||
local role = _UnitGroupRolesAssigned ("player")
|
||||
local isDamage = (role == "DAMAGER") or (role == "TANK") --or true
|
||||
local bestRank, encounterTable = _detalhes.storage:GetBestFromPlayer (diff, encounterID, isDamage and "damage" or "healing", _detalhes.playername, true)
|
||||
|
||||
@@ -4641,9 +4641,15 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
end
|
||||
|
||||
function _detalhes.parser_functions:PLAYER_SPECIALIZATION_CHANGED()
|
||||
local specIndex = GetSpecialization()
|
||||
|
||||
--some parts of details! does call this function, check first for past expansions
|
||||
if (DetailsFramework.IsClassicWow()) then
|
||||
return
|
||||
end
|
||||
|
||||
local specIndex = DetailsFramework.GetSpecialization()
|
||||
if (specIndex) then
|
||||
local specID = GetSpecializationInfo (specIndex)
|
||||
local specID = DetailsFramework.GetSpecializationInfo (specIndex)
|
||||
if (specID and specID ~= 0) then
|
||||
local guid = UnitGUID ("player")
|
||||
if (guid) then
|
||||
@@ -5191,9 +5197,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
if (role == "TANK") then
|
||||
tanks_members_cache [_UnitGUID ("player")] = true
|
||||
else
|
||||
local spec = GetSpecialization()
|
||||
local spec = DetailsFramework.GetSpecialization()
|
||||
if (spec and spec ~= 0) then
|
||||
if (GetSpecializationRole (spec) == "TANK") then
|
||||
if (DetailsFramework.GetSpecializationRole (spec) == "TANK") then
|
||||
tanks_members_cache [_UnitGUID ("player")] = true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
local _math_floor = math.floor --> api local
|
||||
local _ipairs = ipairs --> api local
|
||||
|
||||
|
||||
local UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> status bar core functions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user