Packr Utility on Coach mode and Vanguard massive update

This commit is contained in:
Tercio Jose
2021-06-22 17:00:09 -03:00
parent 8b2501309f
commit b596445ace
18 changed files with 2386 additions and 1127 deletions
+5 -2
View File
@@ -1,6 +1,6 @@
local dversion = 256
local dversion = 257
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -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
@@ -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})
+30 -27
View File
@@ -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
@@ -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
@@ -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")
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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)
@@ -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, {
@@ -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, {
@@ -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)
@@ -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
@@ -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, {
@@ -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
@@ -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
@@ -7242,7 +7245,7 @@ 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
@@ -7250,7 +7253,7 @@ DF.StatusBarFunctions = {
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()
@@ -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
@@ -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);
@@ -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},
@@ -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)
@@ -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)
@@ -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
+5 -2
View File
@@ -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
@@ -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)
@@ -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
+8 -3
View File
@@ -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
@@ -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.",
+5
View File
@@ -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
------------------------------------------------------------------------------------------------
+12
View File
@@ -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)
@@ -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()
+28 -19
View File
@@ -966,44 +966,53 @@
local WaitForPluginFrame = CreateFrame ("frame", "DetailsWaitForPluginFrame" .. self.meu_id, UIParent,"BackdropTemplate")
local WaitTexture = WaitForPluginFrame:CreateTexture (nil, "overlay")
WaitTexture:SetTexture ("Interface\\UNITPOWERBARALT\\Mechanical_Circular_Frame")
WaitTexture:SetPoint ("center", WaitForPluginFrame)
WaitTexture:SetWidth (180)
WaitTexture:SetHeight (180)
WaitTexture:SetTexture ("Interface\\CHARACTERFRAME\\Disconnect-Icon")
WaitTexture:SetWidth(64/2)
WaitTexture:SetHeight(64/2)
--WaitTexture:SetDesaturated(true)
--WaitTexture:SetVertexColor(1, 1, 1, 0.3)
WaitForPluginFrame.wheel = WaitTexture
local RotateAnimGroup = WaitForPluginFrame:CreateAnimationGroup()
local rotate = RotateAnimGroup:CreateAnimation ("Rotation")
rotate:SetDegrees (360)
rotate:SetDuration (60)
RotateAnimGroup:SetLooping ("repeat")
local rotate = RotateAnimGroup:CreateAnimation ("Alpha")
--rotate:SetDegrees (360)
--rotate:SetDuration (5)
rotate:SetFromAlpha(0.8)
rotate:SetToAlpha(1)
--RotateAnimGroup:SetLooping ("repeat")
rotate:SetTarget(WaitTexture)
local bgpanel = gump:NewPanel (UIParent, UIParent, "DetailsWaitFrameBG"..self.meu_id, nil, 120, 30, false, false, false)
local bgpanel = gump:NewPanel (WaitForPluginFrame, WaitForPluginFrame, "DetailsWaitFrameBG"..self.meu_id, nil, 120, 30, false, false, false)
bgpanel:SetPoint ("center", WaitForPluginFrame, "center")
bgpanel:SetBackdrop ({bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"})
bgpanel:SetBackdropColor (.2, .2, .2, 1)
local label = gump:NewLabel (UIParent, UIParent, nil, nil, Loc ["STRING_WAITPLUGIN"]) --> localize-me
label.color = "silver"
local label = gump:NewLabel (bgpanel, bgpanel, nil, nil, Loc ["STRING_WAITPLUGIN"])
label.color = "white"
label:SetPoint ("center", WaitForPluginFrame, "center")
label:SetJustifyH ("center")
label:SetJustifyH ("left")
label:Hide()
WaitTexture:SetPoint("right", label.widget, "topleft", 12, -7)
WaitForPluginFrame:Hide()
WaitForPluginFrame:Hide()
self.wait_for_plugin_created = true
function self:WaitForPlugin()
self:ChangeIcon ([[Interface\GossipFrame\ActiveQuestIcon]])
if (WaitForPluginFrame:IsShown() and WaitForPluginFrame:GetParent() == self.baseframe) then
self.waiting_pid = self:ScheduleTimer ("ExecDelayedPlugin1", 5, self)
end
--if (WaitForPluginFrame:IsShown() and WaitForPluginFrame:GetParent() == self.baseframe) then
-- self.waiting_pid = self:ScheduleTimer ("ExecDelayedPlugin1", 5, self)
--end
WaitForPluginFrame:SetParent (self.baseframe)
WaitForPluginFrame:SetAllPoints (self.baseframe)
local size = math.max (self.baseframe:GetHeight()* 0.35, 100)
WaitForPluginFrame.wheel:SetWidth (size)
WaitForPluginFrame.wheel:SetHeight (size)
bgpanel:ClearAllPoints()
bgpanel:SetPoint("topleft", self.baseframe, 0, 0)
bgpanel:SetPoint("bottomright", self.baseframe, 0, 0)
--local size = math.max (self.baseframe:GetHeight()* 0.35, 100)
--WaitForPluginFrame.wheel:SetWidth (size)
--WaitForPluginFrame.wheel:SetHeight (size)
WaitForPluginFrame:Show()
label:Show()
bgpanel:Show()
+84
View File
@@ -0,0 +1,84 @@
local Details = _G._detalhes
local DF = _G.DetailsFramework
local _
--local AceComm = LibStub ("AceComm-3.0")
--local AceSerializer = LibStub ("AceSerializer-3.0")
local Loc = LibStub("AceLocale-3.0"):GetLocale("Details")
local CONST_MENU_X_POSITION = 10
local CONST_MENU_Y_POSITION = -40
local CONST_MENU_WIDTH = 160
local CONST_MENU_HEIGHT = 20
local CONST_INFOBOX_X_POSITION = 220
local CONST_EDITBUTTONS_X_POSITION = 560
local CONST_EDITBOX_Y_POSITION = -200
local CONST_EDITBOX_WIDTH = 900
local CONST_EDITBOX_HEIGHT = 370
local CONST_EDITBOX_BUTTON_WIDTH = 80
local CONST_EDITBOX_BUTTON_HEIGHT = 20
local CONST_BUTTON_TEMPLATE = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
local CONST_TEXTENTRY_TEMPLATE = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
DF:InstallTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BUTTONS",
{
icon = {texture = [[Interface\BUTTONS\UI-GuildButton-PublicNote-Up]]},
width = 160,
},
"DETAILS_PLUGIN_BUTTON_TEMPLATE"
)
DF:InstallTemplate ("button", "DETAILS_CUSTOMDISPLAY_REGULAR_BUTTON",
{
width = 130,
},
"DETAILS_PLUGIN_BUTTON_TEMPLATE"
)
DF:InstallTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX", {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.2, .2, .2, 0.6},
backdropbordercolor = {0, 0, 0, 1},
})
DF:InstallTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_EXPANDED", {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.2, .2, .2, 1},
backdropbordercolor = {0, 0, 0, 1},
})
DF:InstallTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_BUTTON", {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {.2, .2, .2, 1},
backdropbordercolor = {0, 0, 0, 1},
})
DF:NewColor ("DETAILS_CUSTOMDISPLAY_ICON", .7, .6, .5, 1)
local CONST_CODETEXTENTRY_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX")
local CONST_CODETEXTENTRYEXPANDED_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_EXPANDED")
local CONST_CODETEXTENTRYBUTTON_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX_BUTTON")
local CONST_CODETEXTENTRY_OPENCODEBUTTONS_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BUTTONS")
local CONST_REGULAR_BUTTON_TEMPLATE = DF:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_REGULAR_BUTTON")
--new script button
--search script box
--control buttons like import, export, delete, restore
--build the left menu, this menu has all scripts to edit
--build the script properties panel with name, icon, etc
--
+66 -15
View File
@@ -217,6 +217,20 @@ do
local sub_attribute = self.sub_attribute
local instance = all_switch.instance
--check if is a plugin button
if (self.isPlugin) then
if (_detalhes.RaidTables.NameTable[self.pluginName]) then
_detalhes.RaidTables:EnableRaidMode (instance, self.pluginName)
elseif (_detalhes.SoloTables.NameTable [self.pluginName]) then
_detalhes.SoloTables:EnableSoloMode (instance, self.pluginName)
else
_detalhes:Msg ("Plugin not found.")
end
all_switch:Hide()
return
end
if (instance.modo == _detalhes._detalhes_props["MODO_ALONE"] or instance.modo == _detalhes._detalhes_props["MODO_RAID"]) then
instance:AlteraModo (instance, 2)
end
@@ -415,11 +429,15 @@ do
end
--> update plugins
local script_index = 6
local script_index = _detalhes.atributos[0]+2
local button_index = 1
all_switch.x = all_switch.x + 130
all_switch.y = -28
for _, button in ipairs (all_switch.buttons[script_index]) do
button:Hide()
end
--build raid plugins list
local raidPlugins = _detalhes.RaidTables:GetAvailablePlugins()
if (#raidPlugins >= 0) then
@@ -427,8 +445,6 @@ do
--if a plugin has the member 'NoMenu', it won't be shown on menus to select plugins
if (ptable[3].__enabled and not ptable[3].NoMenu) then
--PluginName, PluginIcon, PluginObject, PluginAbsoluteName
--CoolTip:AddMenu (2, _detalhes.RaidTables.EnableRaidMode, instancia, ptable[4], true, ptable[1], ptable[2], true)
local button = all_switch.buttons [script_index] [button_index]
if (not button) then
button = create_all_switch_button(script_index, button_index, all_switch.x, all_switch.y)
@@ -436,6 +452,10 @@ do
all_switch.y = all_switch.y - 17
end
--set the button to select the plugin
button.isPlugin = true
button.pluginName = ptable[4]
button.text:SetText(ptable[1])
all_switch.check_text_size(button.text)
button.texture:SetTexture (ptable[2])
@@ -1055,9 +1075,27 @@ function _detalhes:FastSwitch (button, bookmark, bookmark_number, select_new)
end
if (bookmark.atributo == "plugin") then
--> is a plugin, check if is a raid or solo plugin
if (_detalhes.RaidTables.NameTable [bookmark.sub_atributo]) then
_detalhes.RaidTables:EnableRaidMode (_detalhes.switch.current_instancia, bookmark.sub_atributo)
local raidPlugins = _detalhes.RaidTables:GetAvailablePlugins()
local isAvailable = false
if (#raidPlugins >= 0) then
for i, ptable in ipairs (raidPlugins) do
--check if the plugin is available
if (ptable[4] == bookmark.sub_atributo) then
isAvailable = true
end
end
end
if (isAvailable) then
_detalhes.RaidTables:EnableRaidMode (_detalhes.switch.current_instancia, bookmark.sub_atributo)
else
Details:Msg("plugin already in use in another window. If you are wondering where, check the Orange Gear > Window Control.") --localize-me
end
elseif (_detalhes.SoloTables.NameTable [bookmark.sub_atributo]) then
_detalhes.SoloTables:EnableSoloMode (_detalhes.switch.current_instancia, bookmark.sub_atributo)
else
@@ -1145,6 +1183,7 @@ function _detalhes.switch:Update()
local name
local vcolor
local add
local textColor = "white"
if (options and options.sub_atributo) then
if (options.atributo == 5) then --> custom
@@ -1163,12 +1202,31 @@ function _detalhes.switch:Update()
end
elseif (options.atributo == "plugin") then --> plugin
local plugin = _detalhes:GetPlugin (options.sub_atributo)
if (plugin) then
local raidPlugins = _detalhes.RaidTables:GetAvailablePlugins()
local isAvailable = false
if (#raidPlugins >= 0) then
for i, ptable in ipairs (raidPlugins) do
--check if the plugin is available
if (ptable[4] == plugin.real_name) then
isAvailable = true
end
end
end
if (isAvailable) then
vcolor = vertex_color_default
else
vcolor = {.35, .35, .35, .35}
textColor = "gray"
end
icone = plugin.__icon
coords = default_coords
name = plugin.__name
vcolor = vertex_color_default
else
icone = [[Interface\AddOns\Details\images\icons]]
coords = add_coords
@@ -1208,6 +1266,7 @@ function _detalhes.switch:Update()
end
button.button2.texto:SetSize (width, height)
DetailsFramework:SetFontColor(button.button2.texto, textColor)
button.textureNormal:SetTexture (icone, true)
button.textureNormal:SetTexCoord (_unpack (coords))
@@ -1453,7 +1512,7 @@ end
local left_box_on_click = function (self, button)
if (button == "RightButton") then
--select another bookmark
_detalhes:FastSwitch (self, bookmark, self.bookmark_number, true)
_detalhes:FastSwitch (self, nil, self.bookmark_number, true)
else
--change the display
local bookmark = _detalhes.switch.table [self.bookmark_number]
@@ -1490,14 +1549,6 @@ local change_icon = function (self, icon1, icon2, icon3, icon4)
end
function _detalhes.switch:NewSwitchButton (frame, index, x, y, rightButton)
local paramTable = {
["instancia"] = _detalhes.switch.current_instancia,
["button"] = index,
["atributo"] = nil,
["sub_atributo"] = nil
}
--botao dentro da caixa
local button = CreateFrame ("button", "DetailsSwitchPanelButton_1_"..index, frame, "BackdropTemplate") --botao com o icone
button:SetSize (15, 24)
@@ -1577,4 +1628,4 @@ function _detalhes.switch:NewSwitchButton (frame, index, x, y, rightButton)
return button
end
--doa
+17 -1
View File
@@ -82,7 +82,14 @@ function Details.Coach.Client.SendDataToRL()
print("Details Coach sending data to RL.")
end
local data = Details.packFunctions.GetAllData()
--local data = Details.packFunctions.GetAllData()
local okay, data = pcall(Details.packFunctions.GetAllData)
if (not okay) then
Details:Msg("Error on GetAllData():", data)
Details.Coach.Client.UpdateTicker:Cancel()
return
end
if (data and Details.Coach.Client.coachName) then
Details:SendCommMessage(_G.DETAILS_PREFIX_NETWORK, Details:Serialize(_G.DETAILS_PREFIX_COACH, UnitName("player"), GetRealmName(), Details.realversion, "CDT", data), "WHISPER", Details.Coach.Client.coachName)
end
@@ -134,6 +141,15 @@ function Details.Coach.StartUp()
end
function eventListener.OnEnterCombat()
--[=[ --debug solo
Details.Coach.SendRLCombatStartNotify("Ditador")
--start a timer to send data to the coach
if (Details.Coach.Client.UpdateTicker) then
Details.Coach.Client.UpdateTicker:Cancel()
end
Details.Coach.Client.UpdateTicker = Details.Schedules.NewTicker(1.5, Details.Coach.Client.SendDataToRL)
--]=]
--send a notify to coach telling a new combat has started
if (Details.Coach.Client.IsEnabled()) then
if (IsInRaid() and isInRaidZone()) then
+779 -2
View File
@@ -27,6 +27,7 @@ local actorInformation = {}
local actorInformationIndexes = {}
local actorDamageInfo = {}
local actorHealInfo = {}
local actorUtilityInfo = {}
--flags
local REACTION_HOSTILE = 0x00000040
@@ -55,7 +56,8 @@ local isDebugging = false
function Details.packFunctions.GetAllData()
local combat = Details:GetCurrentCombat()
local packedData = Details.packFunctions.PackCombatData(combat, 0x13)
local packedData = Details.packFunctions.PackCombatData(combat, 0x1B)
--local packedData = Details.packFunctions.PackCombatData(combat, 0x13)
return packedData
end
@@ -81,6 +83,7 @@ function Details.packFunctions.PackCombatData(combatObject, flags)
table.wipe(actorInformationIndexes)
table.wipe(actorDamageInfo)
table.wipe(actorHealInfo)
table.wipe(actorUtilityInfo)
--reset the serial counter
entitySerialCounter = 0
@@ -104,13 +107,20 @@ function Details.packFunctions.PackCombatData(combatObject, flags)
end
if (bit.band(flags, 0x1) ~= 0) then
print("pack damage")
Details.packFunctions.PackDamage(combatObject)
end
if (bit.band(flags, 0x2) ~= 0) then
print("pack heal")
Details.packFunctions.PackHeal(combatObject)
end
if (bit.band(flags, 0x8) ~= 0) then
print("pack utility")
Details.packFunctions.PackUtility(combatObject)
end
--> prepare data to send over network
local exportedString = flags .. ","
@@ -142,6 +152,14 @@ function Details.packFunctions.PackCombatData(combatObject, flags)
end
end
--add the utility actors data
if (bit.band(flags, 0x8) ~= 0) then
exportedString = exportedString .. "!U" .. ","
for index, data in ipairs(actorUtilityInfo) do
exportedString = exportedString .. data .. ","
end
end
--main stuff
--print("finished export (debug):", exportedString) --debug
--print("uncompressed (debug):", format("%.2f", #exportedString/1024), "KBytes")
@@ -154,13 +172,15 @@ function Details.packFunctions.PackCombatData(combatObject, flags)
--Details:Dump({exportedString})
print("EXPORTING STRING FINAL:", exportedString)
--compress
local LibDeflate = _G.LibStub:GetLibrary("LibDeflate")
local dataCompressed = LibDeflate:CompressDeflate(exportedString, {level = 9})
local dataEncoded = LibDeflate:EncodeForWoWAddonChannel(dataCompressed)
--print("encoded for WowAddonChannel (debug):", format("%.2f", #dataEncoded/1024), "KBytes")
return dataEncoded
end
@@ -895,6 +915,746 @@ function Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePositi
return tablePosition
end
--------------------------------------------------------------------------------------------------
--> pack utility data
--pack utility passes the player utility info + pets the player own
--each player will also send an enemy, the enemy will be in order of raidIndex of the player
function Details.packFunctions.PackUtility(combatObject)
if (isDebugging) then
print("PackUtility(): start.")
end
--store actorObjects to pack
local actorsToPack = {}
--get the player object from the combat > utility container
local playerName = UnitName("player")
local playerObject = combatObject:GetActor(DETAILS_ATTRIBUTE_MISC, playerName)
if (not playerObject) then
if (isDebugging) then
print("PackUtility(): return | no player object.")
end
return
end
tinsert(actorsToPack, playerObject)
--get the list of pets the player own
local playerPets = playerObject.pets
for _, petName in ipairs(playerPets) do
local petObject = combatObject:GetActor(DETAILS_ATTRIBUTE_MISC, petName)
if (petObject) then
tinsert(actorsToPack, petObject)
end
end
local playerIndex = _G.UnitInRaid("player")
if (not playerIndex) then --no player index
if (isDebugging) then
print("PackUtility(): return | no player index found.")
end
return
end
--get all npc enemies and sort them by their respaw id
local allActors = combatObject[DETAILS_ATTRIBUTE_MISC]._ActorTable
local allEnemies = {} --this have subtables, format: {actorObject, spawnId}
for i = 1, #allActors do
--get the actor object
local actor = allActors[i]
--check if is an enemy or neutral
if (actor:IsNeutralOrEnemy()) then
--get the spawnId
local spawnId = select(7, strsplit("-", actor.serial))
if (spawnId) then
--convert hex to number
spawnId = tonumber(spawnId:sub(1, 10), 16)
if (spawnId) then
--first index is the actorObject, the second index is the spawnId to sort enemies
tinsert(allEnemies, {actor, spawnId})
end
end
end
end
--sort enemies by their spawnId
table.sort(allEnemies, Details.Sort2)
local allPlayerNames = {}
for i = 1, 20 do
local name, _, subgroup = GetRaidRosterInfo(i)
if (name) then --maybe the group has less than 20 players
name = _G.Ambiguate(name, "none")
if (name and subgroup <= 4) then
tinsert(allPlayerNames, name)
end
end
end
table.sort(allPlayerNames, function(t1, t2) return t1 < t2 end)
local playerName = UnitName("player")
for i = 1, #allPlayerNames do
if (playerName == allPlayerNames[i]) then
playerIndex = i
break
end
end
--this is the enemy that this player has to send
local enemyObjectToSend = allEnemies[playerIndex] and allEnemies[playerIndex][1]
if (enemyObjectToSend) then
tinsert(actorsToPack, enemyObjectToSend)
end
--add the actors to actor information table
for _, actorObject in ipairs(actorsToPack) do
--check if already has the actor information
local indexToActorInfo = actorInformationIndexes[actorObject.nome] --actor name
if (not indexToActorInfo) then
--need to add the actor general information into the actor information table
indexToActorInfo = Details.packFunctions.AddActorInformation(actorObject)
end
end
for i = 1, #actorsToPack do
--get the actor object
local actor = actorsToPack[i]
local indexToActorInfo = actorInformationIndexes[actor.nome]
--where the information of this actor starts
local currentIndex = #actorUtilityInfo + 1
--[1] index where is stored the actor info like name, class, spec, etc
actorUtilityInfo[currentIndex] = indexToActorInfo --[1]
--[=[
interrupt_spells._ActorTable [spellId] = {
[2139] = {
["id"] = 2139,
["interrompeu_oque"] = {
[337110] = 1,
},
["targets"] = {
["Baroness Frieda"] = 1,
},
["counter"] = 1,
},
}
cooldowns_defensive
cooldowns_defensive_targets
["cooldowns_defensive_spells"] = {
["_ActorTable"] = {
[45438] = {
["id"] = 45438,
["targets"] = {
["Relune-Tichondrius"] = 1,
},
["counter"] = 1,
},
},
["tipo"] = 9,
},
cc_break
cc_break_oque
cc_break_targets
["cc_break_spells"] = {
["_ActorTable"] = {
[42223] = {
["cc_break_oque"] = {
[197214] = 2,
},
["id"] = 42223,
["targets"] = {
["Castellan Niklaus"] = 1,
["Baroness Frieda"] = 1,
},
["cc_break"] = 2,
["counter"] = 0,
},
},
},
["cc_done_spells"] = {
["_ActorTable"] = {
[127797] = {
["id"] = 127797,
["targets"] = {
["Castellan Niklaus"] = 1,
["Lord Stavros"] = 1,
["Baroness Frieda"] = 1,
},
["counter"] = 3,
},
},
["tipo"] = 9,
},
["dispell_spells"] = {
["_ActorTable"] = {
[77130] = {
["targets"] = {
["Magicgreenie-BleedingHollow"] = 1,
},
["id"] = 77130,
["dispell_oque"] = {
[337110] = 1,
},
["dispell"] = 1,
["counter"] = 0,
},
},
["tipo"] = 9,
},
ress
ress_targets
["ress_spells"] = {
["_ActorTable"] = {
[212048] = {
["id"] = 212048,
["ress"] = 7,
["targets"] = {
["Freezerbeef-Illidan"] = 1,
["Jilkari-ThoriumBrotherhood"] = 1,
["Ditador"] = 1,
["Caller-Thrall"] = 1,
["Thebappo-Tichondrius"] = 1,
["Superskourge-Area52"] = 1,
["Rorschak-Area52"] = 1,
},
["counter"] = 0,
},
},
["tipo"] = 9,
},
--]=]
--> cooldowns, pack player cooldowns used
actorUtilityInfo [#actorUtilityInfo + 1] = "C"
local cooldownContainer = actor.cooldowns_defensive_spells and actor.cooldowns_defensive_spells._ActorTable
local totalSpellIndexes = 0
if (cooldownContainer) then
--reserve an index to tell the length of spells
actorUtilityInfo [#actorUtilityInfo + 1] = 0
local reservedSpellSizeIndex = #actorUtilityInfo
for spellId, spellInfo in pairs(cooldownContainer) do
local spellCounter = spellInfo.counter
local spellTargets = spellInfo.targets
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellId)
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellCounter)
totalSpellIndexes = totalSpellIndexes + 2
--build targets
local targetsSize = Details.packFunctions.CountTableEntriesValid(spellTargets) * 2
actorUtilityInfo [#actorUtilityInfo + 1] = targetsSize
totalSpellIndexes = totalSpellIndexes + 1
for actorName, totalDone in pairs(spellTargets) do
actorUtilityInfo [#actorUtilityInfo + 1] = actorName
actorUtilityInfo [#actorUtilityInfo + 1] = floor(totalDone)
totalSpellIndexes = totalSpellIndexes + 2
end
end
--amount of indexes spells are using
actorUtilityInfo[reservedSpellSizeIndex] = totalSpellIndexes
else
actorUtilityInfo [#actorUtilityInfo + 1] = 0
end
--> interrupts, pack player interrupts
actorUtilityInfo [#actorUtilityInfo + 1] = "I"
local interruptsContainer = actor.interrupt_spells and actor.interrupt_spells._ActorTable
local totalSpellIndexes = 0
if (interruptsContainer) then
--reserve an index to tell the length of spells
actorUtilityInfo [#actorUtilityInfo + 1] = 0
local reservedSpellSizeIndex = #actorUtilityInfo
for spellId, spellInfo in pairs(interruptsContainer) do
local spellCounter = spellInfo.counter
local spellTargets = spellInfo.targets
local whatGotInterrupted = spellInfo.interrompeu_oque
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellId)
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellCounter) --spellCounter is nil
totalSpellIndexes = totalSpellIndexes + 2
--build targets
local targetsSize = Details.packFunctions.CountTableEntriesValid(spellTargets) * 2
actorUtilityInfo [#actorUtilityInfo + 1] = targetsSize
totalSpellIndexes = totalSpellIndexes + 1
for actorName, totalDone in pairs(spellTargets) do
actorUtilityInfo [#actorUtilityInfo + 1] = actorName
actorUtilityInfo [#actorUtilityInfo + 1] = floor(totalDone)
totalSpellIndexes = totalSpellIndexes + 2
end
--build what was interrupted by the spell
local interruptedSize = Details.packFunctions.CountTableEntriesValid(whatGotInterrupted) * 2
actorUtilityInfo [#actorUtilityInfo + 1] = interruptedSize
totalSpellIndexes = totalSpellIndexes + 1
for spellId, totalDone in pairs(whatGotInterrupted) do
actorUtilityInfo [#actorUtilityInfo + 1] = spellId
actorUtilityInfo [#actorUtilityInfo + 1] = floor(totalDone)
totalSpellIndexes = totalSpellIndexes + 2
end
end
--amount of indexes spells are using
actorUtilityInfo[reservedSpellSizeIndex] = totalSpellIndexes
else
actorUtilityInfo [#actorUtilityInfo + 1] = 0
end
--> cc break, pack player crowd control breaks
actorUtilityInfo [#actorUtilityInfo + 1] = "B"
local ccBreakContainer = actor.cc_break_spells and actor.cc_break_spells._ActorTable
local totalSpellIndexes = 0
if (ccBreakContainer) then
--reserve an index to tell the length of spells
actorUtilityInfo [#actorUtilityInfo + 1] = 0
local reservedSpellSizeIndex = #actorUtilityInfo
for spellId, spellInfo in pairs(ccBreakContainer) do
local spellCounter = spellInfo.cc_break
local spellTargets = spellInfo.targets
local whatGotCCBroken = spellInfo.cc_break_oque
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellId)
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellCounter)
totalSpellIndexes = totalSpellIndexes + 2
--build targets
local targetsSize = Details.packFunctions.CountTableEntriesValid(spellTargets) * 2
actorUtilityInfo [#actorUtilityInfo + 1] = targetsSize
totalSpellIndexes = totalSpellIndexes + 1
for actorName, totalDone in pairs(spellTargets) do
actorUtilityInfo [#actorUtilityInfo + 1] = actorName
actorUtilityInfo [#actorUtilityInfo + 1] = floor(totalDone)
totalSpellIndexes = totalSpellIndexes + 2
end
--build what was interrupted by the spell
local ccBrokenSize = Details.packFunctions.CountTableEntriesValid(whatGotCCBroken) * 2
actorUtilityInfo [#actorUtilityInfo + 1] = ccBrokenSize
totalSpellIndexes = totalSpellIndexes + 1
for spellId, totalDone in pairs(whatGotCCBroken) do
actorUtilityInfo [#actorUtilityInfo + 1] = spellId
actorUtilityInfo [#actorUtilityInfo + 1] = floor(totalDone)
totalSpellIndexes = totalSpellIndexes + 2
end
end
--amount of indexes spells are using
actorUtilityInfo[reservedSpellSizeIndex] = totalSpellIndexes
else
actorUtilityInfo [#actorUtilityInfo + 1] = 0
end
--> dispel, pack player dispels done
actorUtilityInfo [#actorUtilityInfo + 1] = "D"
local dispelsContainer = actor.dispell_spells and actor.dispell_spells._ActorTable
local totalSpellIndexes = 0
if (dispelsContainer) then
--reserve an index to tell the length of spells
actorUtilityInfo [#actorUtilityInfo + 1] = 0
local reservedSpellSizeIndex = #actorUtilityInfo
for spellId, spellInfo in pairs(dispelsContainer) do
local spellTotal = spellInfo.dispell
local spellTargets = spellInfo.targets
local whatGotDispelled = spellInfo.dispell_oque
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellId)
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellTotal)
totalSpellIndexes = totalSpellIndexes + 2
--build targets
local targetsSize = Details.packFunctions.CountTableEntriesValid(spellTargets) * 2
actorUtilityInfo [#actorUtilityInfo + 1] = targetsSize
totalSpellIndexes = totalSpellIndexes + 1
for actorName, totalDone in pairs(spellTargets) do
actorUtilityInfo [#actorUtilityInfo + 1] = actorName
actorUtilityInfo [#actorUtilityInfo + 1] = floor(totalDone)
totalSpellIndexes = totalSpellIndexes + 2
end
--build what was dispelled by the spell
local dispelsSize = Details.packFunctions.CountTableEntriesValid(whatGotDispelled) * 2
actorUtilityInfo [#actorUtilityInfo + 1] = dispelsSize
totalSpellIndexes = totalSpellIndexes + 1
for spellId, totalDone in pairs(whatGotDispelled) do
actorUtilityInfo [#actorUtilityInfo + 1] = spellId
actorUtilityInfo [#actorUtilityInfo + 1] = floor(totalDone)
totalSpellIndexes = totalSpellIndexes + 2
end
end
--amount of indexes spells are using
actorUtilityInfo[reservedSpellSizeIndex] = totalSpellIndexes
else
actorUtilityInfo [#actorUtilityInfo + 1] = 0
end
--> ress, pack player ress performed
actorUtilityInfo [#actorUtilityInfo + 1] = "R"
local ressContainer = actor.ress_spells and actor.ress_spells._ActorTable
local totalSpellIndexes = 0
if (ressContainer) then
--reserve an index to tell the length of spells
actorUtilityInfo [#actorUtilityInfo + 1] = 0
local reservedSpellSizeIndex = #actorUtilityInfo
for spellId, spellInfo in pairs(ressContainer) do
local spellTotal = spellInfo.ress
local spellTargets = spellInfo.targets
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellId)
actorUtilityInfo [#actorUtilityInfo + 1] = floor(spellTotal)
totalSpellIndexes = totalSpellIndexes + 2
--build targets
local targetsSize = Details.packFunctions.CountTableEntriesValid(spellTargets) * 2
actorUtilityInfo [#actorUtilityInfo + 1] = targetsSize
totalSpellIndexes = totalSpellIndexes + 1
for actorName, totalDone in pairs(spellTargets) do
actorUtilityInfo [#actorUtilityInfo + 1] = actorName
actorUtilityInfo [#actorUtilityInfo + 1] = floor(totalDone)
totalSpellIndexes = totalSpellIndexes + 2
end
end
--amount of indexes spells are using
actorUtilityInfo[reservedSpellSizeIndex] = totalSpellIndexes
else
actorUtilityInfo [#actorUtilityInfo + 1] = 0
end
end
if (isDebugging) then
print("PackUtility(): done.")
end
end
function Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePosition)
if (isDebugging) then
print("UnPackUtility(): start.")
end
--get the utility container
local utilityContainer = currentCombat[DETAILS_ATTRIBUTE_MISC]
--loop from 1 to 199, the amount of actors store is unknown
--todo: it's only unpacking the first actor from the table, e.g. theres izimode and eye of corruption, after export it only shows the eye of corruption
--table position does not move forward
for i = 1, 199 do
--actor information index in the combatData table
--this index gives the position where the actor name, class, spec are stored
local actorReference = tonumber(combatData[tablePosition]) --[1]
local actorName, actorFlag, serialNumber, class, spec = Details.packFunctions.RetriveActorInformation(combatData, actorReference)
if (isDebugging) then
print("UnPackUtility(): Retrivied Data From " .. (actorReference or "nil") .. ":", actorName, actorFlag, serialNumber, class, spec)
end
--check if all utility actors has been processed
--if there's no actor name it means it reached the end
if (not actorName) then
if (isDebugging) then
print("UnPackUtiliyu(): break | Utility loop has been stopped", "index:", i, "tablePosition:", tablePosition, "value:", combatData[tablePosition])
end
break
end
--get or create the actor object
local actorObject = utilityContainer:GetOrCreateActor(serialNumber, actorName, actorFlag, true)
--set the actor class, spec and group
actorObject.classe = class
actorObject.spec = spec
actorObject.grupo = isActorInGroup(class, actorFlag)
actorObject.flag_original = actorFlag
--finished utility actor setup
--C - cooldowns
--I - interrupts
--B - cc break
--D - dispels
--R - ress
--> copy back the actor cooldowns spells
tablePosition = tablePosition + 1
tablePosition = tablePosition + 1
--amount of indexes used to store cooldowns spells for this actor
local spellsSize = tonumber(combatData[tablePosition]) --[7]
if (isDebugging) then
print("cooldowns size unpack:", spellsSize)
end
tablePosition = tablePosition + 1
--check if there's cooldown data
if (spellsSize > 0) then
local newTotal = 0
local newTargetsTable = {}
local spellIndex = tablePosition
while(spellIndex < tablePosition + spellsSize) do
local spellId = tonumber(combatData[spellIndex]) --[1]
local spellTotal = tonumber(combatData[spellIndex+1]) --[2]
local targetsSize = tonumber(combatData[spellIndex+2]) --[3]
local targetTable = Details.packFunctions.UnpackTable(combatData, spellIndex+2, true)
local spellObject = actorObject.cooldowns_defensive_spells:GetOrCreateSpell(spellId, true)
spellObject.counter = spellTotal
spellObject.targets = targetTable
for targetName, amount in pairs (spellObject.targets) do
newTargetsTable[targetName] = (newTargetsTable[targetName] or 0) + amount
newTotal = newTotal + amount
end
spellIndex = spellIndex + targetsSize + 3
end
actorObject.cooldowns_defensive = newTotal
actorObject.cooldowns_defensive_targets = newTargetsTable
tablePosition = tablePosition + spellsSize --increase table position
end
--> copy back the actor interrupts spells
--tablePosition = tablePosition + 1
local startInterrupt = combatData[tablePosition]
tablePosition = tablePosition + 1
--amount of indexes used to store interrupt spells for this actor
local spellsSize = tonumber(combatData[tablePosition]) --[7]
if (isDebugging) then
print("interrupt size unpack:", spellsSize)
end
tablePosition = tablePosition + 1
if (spellsSize > 0) then
local newTotal = 0
local newTargetsTable = {}
local newTargetWhatTable = {}
local spellIndex = tablePosition
while(spellIndex < tablePosition + spellsSize) do
local spellId = tonumber(combatData[spellIndex]) --[1]
local spellTotal = tonumber(combatData[spellIndex+1]) --[2]
local targetsSize = tonumber(combatData[spellIndex+2]) --[3]
local targetTable = Details.packFunctions.UnpackTable(combatData, spellIndex+2, true)
local spellObject = actorObject.interrupt_spells:GetOrCreateSpell(spellId, true)
spellObject.counter = spellTotal
spellObject.targets = targetTable
for targetName, amount in pairs (spellObject.targets) do
newTargetsTable[targetName] = (newTargetsTable[targetName] or 0) + amount
newTotal = newTotal + amount
end
--interrupt what
spellIndex = spellIndex + targetsSize + 3
local interruptWhatTableSize = combatData[spellIndex]
local interruptWhatTable = Details.packFunctions.UnpackTable(combatData, spellIndex, true) --table[index] is nil
spellObject.interrompeu_oque = interruptWhatTable
for targetName, amount in pairs (spellObject.targets) do
newTargetWhatTable[targetName] = (newTargetWhatTable[targetName] or 0) + amount
end
spellIndex = spellIndex + interruptWhatTableSize + 1
end
actorObject.interrupt = newTotal
actorObject.interrupt_targets = newTargetsTable
actorObject.interrompeu_oque = newTargetWhatTable
tablePosition = tablePosition + spellsSize --increase table position
end
--> copy back the actor cc break spells
--tablePosition = tablePosition + 1
local startCCBreak = combatData[tablePosition]
tablePosition = tablePosition + 1
--amount of indexes used to store cc break spells for this actor
local spellsSize = tonumber(combatData[tablePosition]) --[7]
if (isDebugging) then
print("cc break size unpack:", spellsSize)
end
tablePosition = tablePosition + 1
if (spellsSize > 0) then
local newTotal = 0
local newTargetsTable = {}
local newTargetWhatTable = {}
local spellIndex = tablePosition
while(spellIndex < tablePosition + spellsSize) do
local spellId = tonumber(combatData[spellIndex]) --[1]
local spellTotal = tonumber(combatData[spellIndex+1]) --[2]
local targetsSize = tonumber(combatData[spellIndex+2]) --[3]
local targetTable = Details.packFunctions.UnpackTable(combatData, spellIndex+2, true)
local spellObject = actorObject.cc_break_spells:GetOrCreateSpell(spellId, true)
spellObject.cc_break = spellTotal
spellObject.targets = targetTable
for targetName, amount in pairs (spellObject.targets) do
newTargetsTable[targetName] = (newTargetsTable[targetName] or 0) + amount
newTotal = newTotal + amount
end
--cc broke what
spellIndex = spellIndex + targetsSize + 3
local ccBrokeWhatTableSize = combatData[spellIndex]
local ccBrokeWhatTable = Details.packFunctions.UnpackTable(combatData, spellIndex, true)
spellObject.cc_break_oque = ccBrokeWhatTable
for targetName, amount in pairs (spellObject.cc_break_oque) do
newTargetWhatTable[targetName] = (newTargetWhatTable[targetName] or 0) + amount
end
spellIndex = spellIndex + ccBrokeWhatTableSize + 1
end
actorObject.cc_break = newTotal
actorObject.cc_break_targets = newTargetsTable
actorObject.cc_break_oque = newTargetWhatTable
tablePosition = tablePosition + spellsSize --increase table position
end
--> copy back the actor dispel spells
--tablePosition = tablePosition + 1
tablePosition = tablePosition + 1
--amount of indexes used to store dispel spells for this actor
local spellsSize = tonumber(combatData[tablePosition]) --[7]
if (isDebugging) then
print("dispel size unpack:", spellsSize)
end
tablePosition = tablePosition + 1
if (spellsSize > 0) then
local newTotal = 0
local newTargetsTable = {}
local newTargetWhatTable = {}
local spellIndex = tablePosition
while(spellIndex < tablePosition + spellsSize) do
local spellId = tonumber(combatData[spellIndex]) --[1]
local spellTotal = tonumber(combatData[spellIndex+1]) --[2]
local targetsSize = tonumber(combatData[spellIndex+2]) --[3]
local targetTable = Details.packFunctions.UnpackTable(combatData, spellIndex+2, true)
local spellObject = actorObject.dispell_spells:GetOrCreateSpell(spellId, true)
spellObject.dispell = spellTotal
spellObject.targets = targetTable
for targetName, amount in pairs (spellObject.targets) do
newTargetsTable[targetName] = (newTargetsTable[targetName] or 0) + amount
newTotal = newTotal + amount
end
spellIndex = spellIndex + targetsSize + 3
--dispel what
local dispelWhatTableSize = combatData[spellIndex]
local dispelWhatTable = Details.packFunctions.UnpackTable(combatData, spellIndex, true)
spellObject.dispell_oque = dispelWhatTable
for spellId, amount in pairs (spellObject.dispell_oque) do
newTargetWhatTable[spellId] = (newTargetWhatTable[spellId] or 0) + amount
end
spellIndex = spellIndex + dispelWhatTableSize + 1
end
actorObject.dispell = newTotal
actorObject.dispell_targets = newTargetsTable
actorObject.dispell_oque = newTargetWhatTable
tablePosition = tablePosition + spellsSize --increase table position
end
--ress
--ress_targets
--ress_spells
--> copy back the actor ress spells
--tablePosition = tablePosition + 1
tablePosition = tablePosition + 1
--amount of indexes used to store ress spells for this actor
local spellsSize = tonumber(combatData[tablePosition]) --[7]
if (isDebugging) then
print("ress size unpack:", spellsSize)
end
tablePosition = tablePosition + 1
if (spellsSize > 0) then
local newTotal = 0
local newTargetsTable = {}
local spellIndex = tablePosition
while(spellIndex < tablePosition + spellsSize) do
local spellId = tonumber(combatData[spellIndex]) --[1]
local spellTotal = tonumber(combatData[spellIndex+1]) --[2]
local targetsSize = tonumber(combatData[spellIndex+2]) --[3]
local targetTable = Details.packFunctions.UnpackTable(combatData, spellIndex+2, true)
local spellObject = actorObject.ress_spells:GetOrCreateSpell(spellId, true)
spellObject.ress = spellTotal
spellObject.targets = targetTable
for targetName, amount in pairs (spellObject.targets) do
newTargetsTable[targetName] = (newTargetsTable[targetName] or 0) + amount
newTotal = newTotal + amount
end
spellIndex = spellIndex + targetsSize + 3
end
actorObject.ress = newTotal
actorObject.ress_targets = newTargetsTable
tablePosition = tablePosition + spellsSize --increase table position
end
end
if (isDebugging) then
print("UnPackUtility(): done.")
end
return tablePosition
end
--this function does the same as the function above but does not create a new combat, it just add new information
function Details.packFunctions.DeployPackedCombatData(packedCombatData)
if (isDebugging) then
@@ -982,6 +1742,23 @@ function Details.packFunctions.DeployPackedCombatData(packedCombatData)
Details.packFunctions.UnPackHeal(currentCombat, combatData, tablePosition)
end
if (bit.band(flags, 0x8) ~= 0) then
--find the index where the utility information start
for i = tablePosition, #combatData do
if (combatData[i] == "!U") then
tablePosition = i + 1
break
end
end
if (isDebugging) then
print("DeployPackedCombatData(): data has utility info, Utility Index:", tablePosition)
end
--unpack utility
Details.packFunctions.UnPackUtility(currentCombat, combatData, tablePosition)
end
if (bit.band(flags, 0x10) == 0) then
--set the start and end of combat time and date
currentCombat:SetStartTime(combatData[INDEX_COMBAT_START_TIME])
+12 -2
View File
@@ -1540,10 +1540,18 @@ function SlashCmdList.DETAILS (msg, editbox)
end
--BFA BETA
elseif (msg == "update") then
_detalhes:CopyPaste ([[https://www.wowinterface.com/downloads/info23056-DetailsDamageMeter8.07.3.5.html]])
--elseif (msg == "update") then
-- _detalhes:CopyPaste ([[https://www.wowinterface.com/downloads/info23056-DetailsDamageMeter8.07.3.5.html]])
elseif (msg == "ec") then
if (rest and tonumber(rest)) then
local combatToErase = tonumber(rest)
tremove(_detalhes.tabela_historico.tabelas, combatToErase)
Details:Msg("combat erased.")
end
return
elseif (msg == "share") then
local f = {}
@@ -1659,6 +1667,8 @@ function SlashCmdList.DETAILS (msg, editbox)
end
end
print("|", msg)
print (" ")
--local v = _detalhes.game_version .. "." .. (_detalhes.build_counter >= _detalhes.alpha_build_counter and _detalhes.build_counter or _detalhes.alpha_build_counter)
+1214 -1024
View File
File diff suppressed because it is too large Load Diff
@@ -2168,7 +2168,7 @@ function EncounterDetails:OnEvent (_, event, ...)
if (_G._detalhes and _G._detalhes:InstallOkey()) then
if (DetailsFramework.IsTimewalkWoW()) then
if (DetailsFramework.IsClassicWow()) then
return
end
@@ -2180,7 +2180,7 @@ function EncounterDetails:OnEvent (_, event, ...)
local PLUGIN_LOCALIZED_NAME = Loc ["STRING_PLUGIN_NAME"]
local PLUGIN_REAL_NAME = "DETAILS_PLUGIN_ENCOUNTER_DETAILS"
local PLUGIN_ICON = [[Interface\Scenarios\ScenarioIcon-Boss]]
local PLUGIN_AUTHOR = "Details! Team"
local PLUGIN_AUTHOR = "Terciob"
local PLUGIN_VERSION = "v1.06"
local default_settings = {
@@ -948,7 +948,7 @@ end
if (_G._detalhes) then
if (DetailsFramework.IsTimewalkWoW()) then
if (DetailsFramework.IsClassicWow()) then
return
end
@@ -974,7 +974,7 @@ end
--make it load after the other plugins
C_Timer.After(1, function()
--> install
local install, saveddata, is_enabled = _G._detalhes:InstallPlugin ("TOOLBAR", Loc ["STRING_RAIDCHECK_PLUGIN_NAME"], [[Interface\Buttons\UI-CheckBox-Check]], DetailsRaidCheck, "DETAILS_PLUGIN_RAIDCHECK", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", version, default_settings)
local install, saveddata, is_enabled = _G._detalhes:InstallPlugin ("TOOLBAR", Loc ["STRING_RAIDCHECK_PLUGIN_NAME"], [[Interface\Buttons\UI-CheckBox-Check]], DetailsRaidCheck, "DETAILS_PLUGIN_RAIDCHECK", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", version, default_settings)
if (type (install) == "table" and install.error) then
return print (install.error)
end
@@ -2286,7 +2286,7 @@ function StreamOverlay:OnEvent (_, event, ...)
StreamOverlay.DefaultConfigTable = default_options_table
--> Install
local install, saveddata = _G._detalhes:InstallPlugin ("TOOLBAR", "Action Tracker", [[Interface\MINIMAP\MOVIERECORDINGICON]], StreamOverlay, "DETAILS_PLUGIN_STREAM_OVERLAY", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", StreamOverlay.CurrentVersion, default_options_table)
local install, saveddata = _G._detalhes:InstallPlugin ("TOOLBAR", "Action Tracker", [[Interface\MINIMAP\MOVIERECORDINGICON]], StreamOverlay, "DETAILS_PLUGIN_STREAM_OVERLAY", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", StreamOverlay.CurrentVersion, default_options_table)
if (type (install) == "table" and install.error) then
print (install.error)
end
@@ -689,7 +689,7 @@ function ThreatMeter:OnEvent (_, event, ...)
local MINIMAL_DETAILS_VERSION_REQUIRED = 1
--> Install
local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Druid_Cower", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.07")
local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Druid_Cower", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", "v2.01")
if (type (install) == "table" and install.error) then
print (install.error)
end
+115 -24
View File
@@ -138,7 +138,7 @@ local function CreatePluginFrames (data)
Vanguard:CombatEnd()
Vanguard:ResetBars()
Vanguard:ResetBlocks()
--Vanguard:ResetBlocks()
elseif (event == "GROUP_ONLEAVE") then
@@ -157,11 +157,13 @@ local function CreatePluginFrames (data)
elseif (event == "DETAILS_INSTANCE_ENDRESIZE" or event == "DETAILS_INSTANCE_SIZECHANGED") then
--Vanguard:OnResize()
elseif (event == "PLUGIN_DISABLED") then
elseif (event == "PLUGIN_ENABLED") then
elseif (event == "DETAILS_OPTIONS_MODIFIED") then
Vanguard.RefreshWidgets()
end
end
@@ -338,6 +340,8 @@ local function CreatePluginFrames (data)
local width = Vanguard.db.tank_block_size
self:SetWidth (width)
self:SetBackdropColor (unpack (Vanguard.db.tank_block_color))
self.unitFrame.healthBar.background:SetColorTexture(unpack (Vanguard.db.tank_block_color))
self.unitFrame.healthBar.Settings.BackgroundColor = Vanguard.db.tank_block_color
--texture
self.unitFrame.healthBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
@@ -347,14 +351,14 @@ local function CreatePluginFrames (data)
local debuff_on_enter = function (self)
if (self.spellid) then
self.texture:SetBlendMode ("ADD")
--self.texture:SetBlendMode ("ADD")
GameTooltip:SetOwner (self, "ANCHOR_TOPLEFT")
GameTooltip:SetSpellByID (self.spellid)
GameTooltip:Show()
end
end
local debuff_on_leave = function (self)
self.texture:SetBlendMode ("BLEND")
--self.texture:SetBlendMode ("BLEND")
if (self.spellid) then
GameTooltip:Hide()
end
@@ -456,51 +460,57 @@ local function CreatePluginFrames (data)
f.debuffs_next_index = 1
for i = 1, CONST_DEBUFF_AMOUNT do
local support_frame = CreateFrame ("frame", nil, f.unitFrame, "BackdropTemplate")
local support_frame = CreateFrame ("frame", "VanguardSupportFrame_"..index.."_"..i, f.unitFrame, "BackdropTemplate")
support_frame:SetFrameLevel (f.unitFrame:GetFrameLevel()+10)
support_frame:SetSize (24, 24)
support_frame:SetScript ("OnMouseUp", on_click)
--icon texture
local texture = support_frame:CreateTexture (nil, "overlay")
local texture = support_frame:CreateTexture (support_frame:GetName() .. "_Texture", "overlay")
texture:SetSize (24, 24)
texture:SetPoint("center", support_frame, "center", 0, 0)
local y = 3
local xOffSet = (i-1) * (texture:GetWidth() + 1)
support_frame.offset = xOffSet
support_frame:SetPoint ("left", f, "left", 5 + xOffSet, -8)
local dblock = CreateFrame ("cooldown", "VanguardTankBlock" .. index.. "Cooldown" .. i, support_frame, "CooldownFrameTemplate, BackdropTemplate")
local dblock = CreateFrame ("cooldown", "VanguardTankDebuffCooldown" .. index.. "_" .. i, support_frame, "CooldownFrameTemplate, BackdropTemplate")
dblock:SetAlpha (0.7)
dblock:SetPoint ("topleft", texture, "topleft")
dblock:SetPoint ("bottomright", texture, "bottomright")
dblock:SetScript ("OnMouseUp", on_click)
dblock.texture = texture
dblock:SetHideCountdownNumbers(true)
--scripts
dblock:SetScript ("OnMouseUp", on_click)
dblock:SetScript ("OnEnter", debuff_on_enter)
dblock:SetScript ("OnLeave", debuff_on_leave)
local elevateStringsFrame = CreateFrame("frame", nil, support_frame)
dblock.texture = texture
dblock:SetHideCountdownNumbers(true)
local elevateStringsFrame = CreateFrame("frame", support_frame:GetName() .. "_ElevateFrame", support_frame)
elevateStringsFrame:SetAllPoints()
elevateStringsFrame:SetFrameLevel(dblock:GetFrameLevel()+10)
elevateStringsFrame:EnableMouse(false)
local stack = elevateStringsFrame:CreateFontString (nil, "overlay", "GameFontNormal")
local stack = elevateStringsFrame:CreateFontString (elevateStringsFrame:GetName() .. "_StackText", "overlay", "GameFontNormal")
stack:SetPoint ("bottomright", dblock, "bottomright", 0, 0)
DetailsFramework:SetFontColor(stack, "yellow")
local stack_bg = elevateStringsFrame:CreateTexture (nil, "artwork")
local stack_bg = elevateStringsFrame:CreateTexture (elevateStringsFrame:GetName() .. "_StackBG", "artwork")
stack_bg:SetColorTexture(0, 0, 0, 1)
stack_bg:SetPoint ("center", stack, "center", 0, 0)
stack_bg:SetSize(10, 10)
stack_bg:Hide()
dblock.Timer = dblock:CreateFontString(nil, "overlay", "NumberFontNormal")
dblock.Timer = dblock:CreateFontString(dblock:GetName() .. "_Timer", "overlay", "NumberFontNormal")
dblock.Timer:SetPoint("center")
dblock.stack = stack
dblock.stack_bg = stack_bg
dblock.support = support_frame
dblock.elevate_frame = elevateStringsFrame
f.debuffs_blocks [i] = dblock
end
@@ -532,10 +542,76 @@ local function CreatePluginFrames (data)
end
function Vanguard.RefreshWidgets()
local hostInstance = Vanguard:GetInstance(Vanguard.instance_id)
local isClickThrough = hostInstance.clickthrough_window
local isClickThrough_InCombat = hostInstance.clickthrough_incombatonly
for i, f in pairs(Vanguard.TankBlocks) do
for debuffBlockId = 1, CONST_DEBUFF_AMOUNT do
local debuffBlock = f.debuffs_blocks[debuffBlockId]
DetailsFramework:SetFontSize(debuffBlock.Timer, Vanguard.db.aura_timer_text_size)
debuffBlock.support:SetPoint ("left", f, "left", 5 + debuffBlock.support.offset, -8 + Vanguard.db.aura_offset_y)
end
if (isClickThrough) then
if (isClickThrough_InCombat) then
if (InCombatLockdown()) then
f:EnableMouse(false)
f.unitFrame:EnableMouse(false)
f.unitFrame.healthBar:EnableMouse(false)
f.unitFrame.powerBar:EnableMouse(false)
f.unitFrame.castBar:EnableMouse(false)
for debuffBlockId = 1, CONST_DEBUFF_AMOUNT do
local debuffBlock = f.debuffs_blocks[debuffBlockId]
debuffBlock:EnableMouse(false)
debuffBlock.support:EnableMouse(false)
--debuffBlock.elevate_frame:EnableMouse(false)
end
f.heal_inc:EnableMouse(false)
else
f:EnableMouse(true)
f.unitFrame:EnableMouse(true)
f.unitFrame.healthBar:EnableMouse(true)
f.unitFrame.powerBar:EnableMouse(true)
f.unitFrame.castBar:EnableMouse(true)
for debuffBlockId = 1, CONST_DEBUFF_AMOUNT do
local debuffBlock = f.debuffs_blocks[debuffBlockId]
debuffBlock:EnableMouse(true)
debuffBlock.support:EnableMouse(true)
--debuffBlock.elevate_frame:EnableMouse(true)
debuffBlock:SetScript("OnMouseUp", on_click)
end
f.heal_inc:EnableMouse(true)
end
else
f:EnableMouse(false)
f.unitFrame:EnableMouse(false)
f.unitFrame.healthBar:EnableMouse(false)
f.unitFrame.powerBar:EnableMouse(false)
f.unitFrame.castBar:EnableMouse(false)
for debuffBlockId = 1, CONST_DEBUFF_AMOUNT do
local debuffBlock = f.debuffs_blocks[debuffBlockId]
debuffBlock:EnableMouse(false)
debuffBlock.support:EnableMouse(false)
--debuffBlock.elevate_frame:EnableMouse(false)
end
f.heal_inc:EnableMouse(false)
end
else
f:EnableMouse(true)
f.unitFrame:EnableMouse(true)
f.unitFrame.healthBar:EnableMouse(true)
f.unitFrame.powerBar:EnableMouse(true)
f.unitFrame.castBar:EnableMouse(true)
for debuffBlockId = 1, CONST_DEBUFF_AMOUNT do
local debuffBlock = f.debuffs_blocks[debuffBlockId]
debuffBlock:EnableMouse(true)
debuffBlock.support:EnableMouse(true)
--debuffBlock.elevate_frame:EnableMouse(true)
debuffBlock:SetScript("OnMouseUp", on_click)
end
f.heal_inc:EnableMouse(true)
end
--texture
@@ -580,10 +656,10 @@ local function CreatePluginFrames (data)
f.unitFrame.castBar:SetPoint("topleft", f, "topleft", 0, 0)
f.unitFrame.castBar:SetPoint("topright", f, "topright", 0, 0)
end
else
f.unitFrame.castBar:Hide()
end
f.unitFrame.castBar:Hide()
if (Vanguard.db.show_power_bar) then
f.unitFrame.powerBar:Show()
f.unitFrame.powerBar:SetHeight(Vanguard.db.tank_block_powerbar_size_height)
@@ -746,6 +822,8 @@ local function CreatePluginFrames (data)
Vanguard.track_incoming = Vanguard:ScheduleRepeatingTimer ("TrackIncoming", 0.1)
onUpdateFrame:SetScript("OnUpdate", onUpdateFrame.onUpdate)
Vanguard.RefreshWidgets()
end
function Vanguard:CombatEnd()
@@ -760,6 +838,8 @@ local function CreatePluginFrames (data)
end
onUpdateFrame:SetScript("OnUpdate", nil)
Vanguard.RefreshWidgets()
end
local formatTime = function(time)
@@ -793,6 +873,7 @@ local function CreatePluginFrames (data)
dblock.debuffName = name
dblock.texture:SetTexture(icon)
dblock.texture:SetTexCoord(.1, .9, .1, .9)
dblock.spellid = spellId
if (count and count > 1) then
dblock.stack:SetText(count)
@@ -937,7 +1018,7 @@ local build_options_panel = function()
get = function() return Vanguard.db.tank_block_size_height end,
set = function (self, fixedparam, value) Vanguard.db.tank_block_size_height = value; Vanguard:RefreshTanks() end,
min = 10,
max = 60,
max = 100,
step = 1,
name = "Health Bar Height",
},
@@ -965,14 +1046,22 @@ local build_options_panel = function()
set = function (self, r, g, b, a)
local current = Vanguard.db.tank_block_color;
current[1], current[2], current[3], current[4] = r, g, b, a;
Vanguard:RefreshTanks();
Vanguard:RefreshTanks()
end,
--desc = "Select the color of the tank block background.",
name = "Health Bar Background Color"
},
{type = "blank"},
{
type = "range",
get = function() return Vanguard.db.aura_offset_y end,
set = function (self, fixedparam, value) Vanguard.db.aura_offset_y = value; Vanguard.RefreshWidgets() end,
min = -20,
max = 20,
step = 1,
name = "Debuff Y Offset",
},
{
type = "range",
get = function() return Vanguard.db.aura_timer_text_size end,
@@ -1016,11 +1105,12 @@ function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, wh
show_inc_bars = true,
tank_block_size = 150,
tank_block_height = 40,
tank_block_color = {0.24705882, 0.0039215, 0, 0.8},
tank_block_color = {0.074509, 0.035294, 0.035294, 0.832845},
tank_block_texture = "Details Serenity",
first_run = false,
bar_height = 24,
aura_timer_text_size = 14,
aura_offset_y = 0,
show_health_bar = true,
show_power_bar = false,
show_cast_bar = false,
@@ -1032,7 +1122,7 @@ function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, wh
--> Install
function Vanguard:OnDetailsEvent() end --> dummy func to stop warnings.
local install, saveddata = _G._detalhes:InstallPlugin ("TANK", "Vanguard", "Interface\\Icons\\INV_Shield_04", Vanguard, "DETAILS_PLUGIN_VANGUARD", MINIMAL_DETAILS_VERSION_REQUIRED, "Tercio", "v2.1", default_saved_table)
local install, saveddata = _G._detalhes:InstallPlugin ("TANK", "Vanguard", "Interface\\Icons\\INV_Shield_04", Vanguard, "DETAILS_PLUGIN_VANGUARD", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", "v3.0", default_saved_table)
if (type (install) == "table" and install.error) then
print (install.error)
end
@@ -1048,6 +1138,7 @@ function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, wh
_G._detalhes:RegisterEvent (Vanguard, "DETAILS_INSTANCE_ENDRESIZE")
_G._detalhes:RegisterEvent (Vanguard, "DETAILS_INSTANCE_SIZECHANGED")
_G._detalhes:RegisterEvent (Vanguard, "GROUP_ONLEAVE")
_G._detalhes:RegisterEvent (Vanguard, "DETAILS_OPTIONS_MODIFIED")
VanguardFrame:RegisterEvent ("ZONE_CHANGED_NEW_AREA")
VanguardFrame:RegisterEvent ("PLAYER_ENTERING_WORLD")