Skip to content

Commit

Permalink
Packr Utility on Coach mode and Vanguard massive update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Jun 22, 2021
1 parent 8b25013 commit b596445
Show file tree
Hide file tree
Showing 18 changed files with 2,408 additions and 1,149 deletions.
7 changes: 5 additions & 2 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 256
local dversion = 257

local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
Expand All @@ -22,6 +22,9 @@ local tinsert = _G.tinsert
local abs = _G.abs
local tremove = _G.tremove

local IS_WOW_PROJECT_MAINLINE = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
local IS_WOW_PROJECT_NOT_MAINLINE = WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE

local UnitPlayerControlled = UnitPlayerControlled
local UnitIsTapDenied = UnitIsTapDenied

Expand Down Expand Up @@ -3678,7 +3681,7 @@ function DF:GetCharacterRaceList (fullList)
tinsert (DF.RaceCache, {Name = raceInfo.raceName, FileString = raceInfo.clientFileString})
end

if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
local alliedRaceInfo = C_AlliedRaces.GetRaceInfoByID (i)
if (alliedRaceInfo and DF.AlliedRaceList [alliedRaceInfo.raceID]) then
tinsert (DF.RaceCache, {Name = alliedRaceInfo.maleName, FileString = alliedRaceInfo.raceFileString})
Expand Down
57 changes: 30 additions & 27 deletions Libs/DF/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ local _type = type --> lua local
local _math_floor = math.floor --> lua local
local loadstring = loadstring --> lua local

local IS_WOW_PROJECT_MAINLINE = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
local IS_WOW_PROJECT_NOT_MAINLINE = WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE

local PixelUtil = PixelUtil or DFPixelUtil

local UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned
Expand Down Expand Up @@ -662,7 +665,7 @@ function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropc
["OnEnter"] = {0.3, 0.3, 0.3, 0.5},
["OnLeave"] = {0.9, 0.7, 0.7, 1}
}
PanelObject.frame:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = "Interface\DialogFrame\UI-DialogBox-Border", edgeSize = 10, tileSize = 64, tile = true})
PanelObject.frame:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 10, tileSize = 64, tile = true})

PanelObject.widget = PanelObject.frame

Expand Down Expand Up @@ -6006,13 +6009,13 @@ local default_load_conditions_frame_options = {
function DF:CreateLoadFilterParser (callback)
local f = CreateFrame ("frame")
f:RegisterEvent ("PLAYER_ENTERING_WORLD")
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
f:RegisterEvent ("PLAYER_SPECIALIZATION_CHANGED")
f:RegisterEvent ("PLAYER_TALENT_UPDATE")
end
f:RegisterEvent ("PLAYER_ROLES_ASSIGNED")
f:RegisterEvent ("ZONE_CHANGED_NEW_AREA")
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
f:RegisterEvent ("CHALLENGE_MODE_START")
end
f:RegisterEvent ("ENCOUNTER_START")
Expand Down Expand Up @@ -6075,7 +6078,7 @@ function DF:PassLoadFilters (loadTable, encounterID)
end

--spec
if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE and loadTable.spec.Enabled) then
if (IS_WOW_PROJECT_MAINLINE and loadTable.spec.Enabled) then
local canCheckTalents = true

if (passLoadClass) then
Expand Down Expand Up @@ -6116,7 +6119,7 @@ function DF:PassLoadFilters (loadTable, encounterID)
end

--talents
if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE and loadTable.talent.Enabled) then
if (IS_WOW_PROJECT_MAINLINE and loadTable.talent.Enabled) then
local talentsInUse = DF:GetCharacterTalents (false, true)
local hasTalent
for talentID, _ in pairs (talentsInUse) do
Expand All @@ -6131,7 +6134,7 @@ function DF:PassLoadFilters (loadTable, encounterID)
end

--pvptalent
if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE and loadTable.pvptalent.Enabled) then
if (IS_WOW_PROJECT_MAINLINE and loadTable.pvptalent.Enabled) then
local talentsInUse = DF:GetCharacterPvPTalents (false, true)
local hasTalent
for talentID, _ in pairs (talentsInUse) do
Expand Down Expand Up @@ -6168,7 +6171,7 @@ function DF:PassLoadFilters (loadTable, encounterID)
end

--affix
if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE and loadTable.affix.Enabled) then
if (IS_WOW_PROJECT_MAINLINE and loadTable.affix.Enabled) then
local isInMythicDungeon = C_ChallengeMode.IsChallengeModeActive()
if (not isInMythicDungeon) then
return false
Expand Down Expand Up @@ -6318,7 +6321,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
tinsert (f.AllRadioGroups, classGroup)

--create the radio group for character spec
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
local specs = {}
for _, specID in ipairs (DF:GetClassSpecIDs (select (2, UnitClass ("player")))) do
local specID, specName, specDescription, specIcon, specBackground, specRole, specClass = DetailsFramework.GetSpecializationInfoByID (specID)
Expand Down Expand Up @@ -6352,7 +6355,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
tinsert (f.AllRadioGroups, raceGroup)

--create radio group for talents
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
local talentList = {}
for _, talentTable in ipairs (DF:GetCharacterTalents()) do
tinsert (talentList, {
Expand Down Expand Up @@ -6452,7 +6455,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
end

--create radio group for pvp talents
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
local pvpTalentList = {}
for _, talentTable in ipairs (DF:GetCharacterPvPTalents()) do
tinsert (pvpTalentList, {
Expand Down Expand Up @@ -6582,7 +6585,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
tinsert (f.AllRadioGroups, roleTypesGroup)

--create radio group for mythic+ affixes
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
local affixes = {}
for i = 2, 1000 do
local affixName, desc, texture = C_ChallengeMode.GetAffixInfo (i)
Expand Down Expand Up @@ -6652,7 +6655,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
tinsert (f.AllTextEntries, mapIDEditbox)

function f.Refresh (self)
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
--update the talents (might have changed if the player changed its specialization)
local talentList = {}
for _, talentTable in ipairs (DF:GetCharacterTalents()) do
Expand All @@ -6667,7 +6670,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
DetailsFrameworkLoadConditionsPanel.TalentGroup:SetOptions (talentList)
end

if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
local pvpTalentList = {}
for _, talentTable in ipairs (DF:GetCharacterPvPTalents()) do
tinsert (pvpTalentList, {
Expand All @@ -6692,7 +6695,7 @@ function DF:OpenLoadConditionsPanel (optionsTable, callback, frameOptions)
textEntry:Refresh()
end

if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
DetailsFrameworkLoadConditionsPanel.CanShowTalentWarning()
DetailsFrameworkLoadConditionsPanel.CanShowPvPTalentWarning()
end
Expand Down Expand Up @@ -7210,10 +7213,10 @@ DF.StatusBarFunctions = {
{"PLAYER_ENTERING_WORLD"},
{"UNIT_HEALTH", true},
{"UNIT_MAXHEALTH", true},
{(WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE) and "UNIT_HEALTH_FREQUENT", true}, -- this one is classic-only...
{(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) and "UNIT_HEAL_PREDICTION", true},
{(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) and "UNIT_ABSORB_AMOUNT_CHANGED", true},
{(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) and "UNIT_HEAL_ABSORB_AMOUNT_CHANGED", true},
{(IS_WOW_PROJECT_NOT_MAINLINE) and "UNIT_HEALTH_FREQUENT", true}, -- this one is classic-only...
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_HEAL_PREDICTION", true},
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_ABSORB_AMOUNT_CHANGED", true},
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_HEAL_ABSORB_AMOUNT_CHANGED", true},
}

--> setup the castbar to be used by another unit
Expand Down Expand Up @@ -7242,15 +7245,15 @@ DF.StatusBarFunctions = {

--> check for settings and update some events
if (not self.Settings.ShowHealingPrediction) then
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
self:UnregisterEvent ("UNIT_HEAL_PREDICTION")
self:UnregisterEvent ("UNIT_HEAL_ABSORB_AMOUNT_CHANGED")
end
self.incomingHealIndicator:Hide()
self.healAbsorbIndicator:Hide()
end
if (not self.Settings.ShowShields) then
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
self:UnregisterEvent ("UNIT_ABSORB_AMOUNT_CHANGED")
end
self.shieldAbsorbIndicator:Hide()
Expand Down Expand Up @@ -7343,7 +7346,7 @@ DF.StatusBarFunctions = {

--health and absorbs prediction
healthBarMetaFunctions.UpdateHealPrediction = function (self)
if WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE then return end
if IS_WOW_PROJECT_NOT_MAINLINE then return end
local currentHealth = self.currentHealth
local currentHealthMax = self.currentHealthMax
local healthPercent = currentHealth / currentHealthMax
Expand Down Expand Up @@ -7657,7 +7660,7 @@ DF.PowerFrameFunctions = {

--> when a event different from unit_power_update is triggered, update which type of power the unit should show
UpdatePowerInfo = function (self)
if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE and self.Settings.ShowAlternatePower) then -- not available in classic
if (IS_WOW_PROJECT_MAINLINE and self.Settings.ShowAlternatePower) then -- not available in classic
local barID = UnitPowerBarID(self.displayedUnit)
local barInfo = GetUnitPowerBarInfoByID(barID)
--local name, tooltip, cost = GetUnitPowerBarStringsByID(barID);
Expand Down Expand Up @@ -7799,8 +7802,8 @@ DF.CastFrameFunctions = {
{"UNIT_SPELLCAST_CHANNEL_START"},
{"UNIT_SPELLCAST_CHANNEL_UPDATE"},
{"UNIT_SPELLCAST_CHANNEL_STOP"},
{(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) and "UNIT_SPELLCAST_INTERRUPTIBLE"},
{(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) and "UNIT_SPELLCAST_NOT_INTERRUPTIBLE"},
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_SPELLCAST_INTERRUPTIBLE"},
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_SPELLCAST_NOT_INTERRUPTIBLE"},
{"PLAYER_ENTERING_WORLD"},
{"UNIT_SPELLCAST_START", true},
{"UNIT_SPELLCAST_STOP", true},
Expand Down Expand Up @@ -8331,7 +8334,7 @@ DF.CastFrameFunctions = {
UNIT_SPELLCAST_START = function (self, unit)

local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellID = UnitCastingInfo (unit)
else
name, text, texture, startTime, endTime, isTradeSkill, castID, spellID = UnitCastingInfo (unit)
Expand Down Expand Up @@ -8393,7 +8396,7 @@ DF.CastFrameFunctions = {

UNIT_SPELLCAST_CHANNEL_START = function (self, unit, ...)
local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
if IS_WOW_PROJECT_MAINLINE then
name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo (unit)
else
name, text, texture, startTime, endTime, isTradeSkill, spellID = UnitChannelInfo (unit)
Expand Down Expand Up @@ -9004,7 +9007,7 @@ end
--> todo: see what 'UnitTargetsVehicleInRaidUI' is, there's a call for this in the CompactUnitFrame.lua but zero documentation
CheckVehiclePossession = function (self)
--> this unit is possessing a vehicle?
local unitPossessVehicle = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) and UnitHasVehicleUI (self.unit) or false
local unitPossessVehicle = (IS_WOW_PROJECT_MAINLINE) and UnitHasVehicleUI (self.unit) or false
if (unitPossessVehicle) then
if (not self.unitInVehicle) then
if (UnitIsUnit ("player", self.unit)) then
Expand Down
7 changes: 5 additions & 2 deletions Libs/DF/spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ if (not DF or not DetailsFrameworkCanLoad) then
return
end

local IS_WOW_PROJECT_MAINLINE = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
local IS_WOW_PROJECT_NOT_MAINLINE = WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE

DF_COOLDOWN_RAID = 4
DF_COOLDOWN_EXTERNAL = 3

Expand Down Expand Up @@ -486,7 +489,7 @@ DF.CooldownsBySpec = {
}

--additional CDs / modifications for classic
if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE) then
if (IS_WOW_PROJECT_NOT_MAINLINE) then
--WARRIOR
--Arms
DF.CooldownsBySpec[71][12292] = 1 --Death Wish (BCC)
Expand Down Expand Up @@ -1009,7 +1012,7 @@ DF.CrowdControlSpells = {
}

-- additionals for classic
if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE) then
if (IS_WOW_PROJECT_NOT_MAINLINE) then
DF.CrowdControlSpells[99] = nil --demoralizing roar disabled, no CC in tbc

--auto-generated
Expand Down
11 changes: 8 additions & 3 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

local version, build, date, tocversion = GetBuildInfo()

_detalhes.build_counter = 8516
_detalhes.alpha_build_counter = 8516 --if this is higher than the regular counter, use it instead
_detalhes.bcc_counter = 20
_detalhes.build_counter = 8637
_detalhes.alpha_build_counter = 8637 --if this is higher than the regular counter, use it instead
_detalhes.bcc_counter = 23
_detalhes.dont_open_news = true
_detalhes.game_version = version
_detalhes.userversion = version .. _detalhes.build_counter
Expand All @@ -33,6 +33,11 @@ do
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" )

local news = {
{"v9.0.5.8637.144", "June 22nd, 2021"},
"Major update on Vanguard plugin.",
"Added utility module to Coach, this module will send interrupt, dispel, cc breaks, cooldown usege and battle resses to the Coach.",
"Added plugins into the title bar display menu.",

{"v9.0.5.8502.144", "May 21th, 2021"},
"Added options to change the color of each team during an arena match.",
"Fixed One Segment Battleground.",
Expand Down
5 changes: 5 additions & 0 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3729,6 +3729,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
return
end

--do not register ress if not in combat
if (not Details.in_combat) then
return
end

_current_misc_container.need_refresh = true

------------------------------------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions core/plugins_raid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
_detalhes.RaidTables:EnableRaidMode (self, plugin_name)
end
end

--force hide wait for plugins
if (_G["DetailsWaitFrameBG"..self.meu_id] and _G["DetailsWaitForPluginFrame" .. self.meu_id]) then
_G["DetailsWaitForPluginFrame" .. self.meu_id]:Hide()
_G["DetailsWaitFrameBG"..self.meu_id]:Hide()
end
end

function _detalhes.RaidTables:EnableRaidMode (instance, plugin_name, from_cooltip, from_mode_menu)
Expand Down Expand Up @@ -215,6 +221,12 @@
GameCooltip:ExecFunc (instance.baseframe.cabecalho.atributo)
--instance _detalhes.popup:ExecFunc (DeleteButton)
end

--force hide wait for plugins
if (_G["DetailsWaitFrameBG"..instance.meu_id] and _G["DetailsWaitForPluginFrame" .. instance.meu_id]) then
_G["DetailsWaitForPluginFrame" .. instance.meu_id]:Hide()
_G["DetailsWaitFrameBG"..instance.meu_id]:Hide()
end
else
if (not instance.wait_for_plugin) then
instance:CreateWaitForPlugin()
Expand Down
Loading

0 comments on commit b596445

Please sign in to comment.