From 51030c5ef8e8a5436e050ce555649d6c71c4498d Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Wed, 4 May 2022 19:28:12 -0300 Subject: [PATCH] TBC issues with lib open raid --- Libs/LibOpenRaid/LibOpenRaid.lua | 12 ++++++++++-- boot.lua | 2 +- core/parser.lua | 2 +- frames/window_cdtracker.lua | 2 +- frames/window_main.lua | 22 ++++++++++++---------- frames/window_options2_sections.lua | 4 ++-- functions/playerclass.lua | 10 ++++++---- 7 files changed, 33 insertions(+), 21 deletions(-) diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index 0b22689c..4a834866 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -39,9 +39,13 @@ BUGS: --]=] +--don't load if it's not retail, emergencial patch due to classic and bcc stuff not transposed yet +if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE) then + return +end local major = "LibOpenRaid-1.0" -local CONST_LIB_VERSION = 33 +local CONST_LIB_VERSION = 34 LIB_OPEN_RAID_CAN_LOAD = false --declae the library within the LibStub @@ -52,7 +56,7 @@ LIB_OPEN_RAID_CAN_LOAD = false end LIB_OPEN_RAID_CAN_LOAD = true - + --default values openRaidLib.inGroup = false openRaidLib.UnitIDCache = {} @@ -843,6 +847,10 @@ LIB_OPEN_RAID_CAN_LOAD = false end function openRaidLib.UnitInfoManager.SetUnitInfo(unitName, unitInfo, specId, renown, covenantId, talentsTableUnpacked, conduitsTableUnpacked, pvpTalentsTableUnpacked) + if (not GetSpecializationInfoByID) then --tbc hot fix + return + end + local specId, specName, specDescription, specIcon, role = GetSpecializationInfoByID(specId or 0) local className, classString, classId = UnitClass(unitName) diff --git a/boot.lua b/boot.lua index d1ce6825..c7afdf84 100644 --- a/boot.lua +++ b/boot.lua @@ -8,7 +8,7 @@ _detalhes.build_counter = 9780 _detalhes.alpha_build_counter = 9780 --if this is higher than the regular counter, use it instead - _detalhes.bcc_counter = 33 + _detalhes.bcc_counter = 37 _detalhes.dont_open_news = true _detalhes.game_version = version _detalhes.userversion = version .. _detalhes.build_counter diff --git a/core/parser.lua b/core/parser.lua index 8eddea1a..b2323593 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -2457,7 +2457,7 @@ ------------------------------------------------------------------------------------------------ --> buff uptime - if (LIB_OPEN_RAID_BLOODLUST[spellid]) then + if (LIB_OPEN_RAID_BLOODLUST and LIB_OPEN_RAID_BLOODLUST[spellid]) then if (_detalhes.playername == alvo_name) then _current_combat.bloodlust = _current_combat.bloodlust or {} _current_combat.bloodlust[#_current_combat.bloodlust+1] = _current_combat:GetCombatTime() diff --git a/frames/window_cdtracker.lua b/frames/window_cdtracker.lua index 6e602125..b3613ef4 100644 --- a/frames/window_cdtracker.lua +++ b/frames/window_cdtracker.lua @@ -2,7 +2,7 @@ local Details = _G.Details local DF = _G.DetailsFramework -local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0") +local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", true) --namespace Details.CooldownTracking = {} diff --git a/frames/window_main.lua b/frames/window_main.lua index a8468c06..680b77da 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -2284,16 +2284,18 @@ local icon_frame_on_enter = function (self) end else - local dungeonPlayerInfo = C_PlayerInfo.GetPlayerMythicPlusRatingSummary(actorName) - if (dungeonPlayerInfo) then - local currentScore = dungeonPlayerInfo.currentSeasonScore or 0 - if (currentScore > 0) then - GameCooltip:AddLine("M+ Score:", currentScore, 1, "white") - GameCooltip:AddIcon ([[]], 1, 1, 1, 20) - _detalhes:AddTooltipBackgroundStatusbar() - height = height + 19 --frame height - end - end + if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE and C_PlayerInfo) then --is retail? + local dungeonPlayerInfo = C_PlayerInfo.GetPlayerMythicPlusRatingSummary(actorName) + if (dungeonPlayerInfo) then + local currentScore = dungeonPlayerInfo.currentSeasonScore or 0 + if (currentScore > 0) then + GameCooltip:AddLine("M+ Score:", currentScore, 1, "white") + GameCooltip:AddIcon ([[]], 1, 1, 1, 20) + _detalhes:AddTooltipBackgroundStatusbar() + height = height + 19 --frame height + end + end + end end --dps diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index ede57f24..5732112c 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -1625,10 +1625,10 @@ do desc = Loc["STRING_OPTIONS_ALIGNED_TEXT_COLUMNS_OFFSET_DESC"], }, - {type = "blank"}, + {type = "breakline"}, {type = "label", get = function() return Loc ["STRING_OPTIONS_TOTALBAR_ANCHOR"] end, text_template = subSectionTitleTextTemplate}, - {--enabled + {--total bar enabled type = "toggle", get = function() return currentInstance.total_bar.enabled end, set = function (self, fixedparam, value) diff --git a/functions/playerclass.lua b/functions/playerclass.lua index 808cce02..fbfcb16c 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -10,7 +10,7 @@ do local _select = select local _unpack = unpack - local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0") + local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", true) local unknown_class_coords = {0.75, 1, 0.75, 1} @@ -260,9 +260,11 @@ do function Details:GetUnitId(unitName) unitName = unitName or self.nome - local unitId = openRaidLib.GetUnitID(unitName) - if (unitId) then - return unitId + if (openRaidLib) then + local unitId = openRaidLib.GetUnitID(unitName) + if (unitId) then + return unitId + end end if (IsInRaid()) then