Updated LibOpenRaid and DetailsFramework

This commit is contained in:
Tercio Jose
2022-10-09 19:47:56 -03:00
parent 9974a87119
commit 944178f76f
126 changed files with 15502 additions and 15495 deletions
@@ -13,18 +13,18 @@ function _detalhes:CreateStorageDB()
return DetailsDataStorage
end
local f = CreateFrame ("frame", nil, UIParent)
local f = CreateFrame("frame", nil, UIParent)
f:Hide()
f:RegisterEvent ("ADDON_LOADED")
f:SetScript ("OnEvent", function(self, event, addonName)
f:SetScript("OnEvent", function(self, event, addonName)
if (addonName == "Details_DataStorage") then
DetailsDataStorage = DetailsDataStorage or _detalhes:CreateStorageDB()
if (DetailsDataStorage.VERSION < DETAILS_STORAGE_VERSION) then
--> do revisions
--do revisions
if (DetailsDataStorage.VERSION < 5) then
table.wipe (DetailsDataStorage)
DetailsDataStorage = _detalhes:CreateStorageDB()
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -48,7 +48,7 @@ Loc ["STRING_INTERRIPT_HELP"] = " |cFFFFFF00Click|r on a bar:\nopen report windo
Loc ["STRING_DISPELL_HELP"] = " \n|cFFFFFF00Click|r on a bar:\nopen report window."
Loc ["STRING_DEATHS_HELP"] = " \n|cFFFFFF00Click|r on a bar:\nopen report window."
--> mechanic types
--mechanic types
Loc ["STRING_HEAL"] = "heal"
Loc ["STRING_LOWDPS"] = "lowdps"
Loc ["STRING_LOWHEAL"] = "lowheal"
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -41,7 +41,7 @@ Loc ["STRING_INTERRIPT_HELP"] = "\n\n|cFFFFFF00Clique|r na barra: abre a janela
Loc ["STRING_DISPELL_HELP"] = "\n\n|cFFFFFF00Clique|r na barra: abre a janela de enviar relatorio."
Loc ["STRING_DEATHS_HELP"] = "\n\n|cFFFFFF00Clique|r na barra: abre a janela de enviar relatorio."
--> mechanic types
--mechanic types
Loc ["STRING_HEAL"] = "cura"
Loc ["STRING_LOWDPS"] = "dpsbaixo"
Loc ["STRING_LOWHEAL"] = "curabaixa"
@@ -1003,7 +1003,7 @@ function DetailsRaidCheck:OnEvent(_, event, ...)
C_Timer.After(1, function()
--install
local install, savedData, isEnabled = _G.Details:InstallPlugin("TOOLBAR", Loc["STRING_RAIDCHECK_PLUGIN_NAME"], [[Interface\Buttons\UI-CheckBox-Check]], DetailsRaidCheck, "DETAILS_PLUGIN_RAIDCHECK", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", version, defaultSettings)
if (type (install) == "table" and install.error) then
if (type(install) == "table" and install.error) then
return print(install.error)
end
File diff suppressed because it is too large Load Diff
@@ -1,18 +1,18 @@
local AceLocale = LibStub ("AceLocale-3.0")
local Loc = AceLocale:GetLocale ("Details_Threat")
local _GetNumSubgroupMembers = GetNumSubgroupMembers --> wow api
local _GetNumGroupMembers = GetNumGroupMembers --> wow api
local _UnitIsFriend = UnitIsFriend --> wow api
local _UnitName = UnitName --> wow api
local _IsInRaid = IsInRaid --> wow api
local _IsInGroup = IsInGroup --> wow api
local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned --> wow api
local _GetNumSubgroupMembers = GetNumSubgroupMembers --wow api
local _GetNumGroupMembers = GetNumGroupMembers --wow api
local _UnitIsFriend = UnitIsFriend --wow api
local _UnitName = UnitName --wow api
local _IsInRaid = IsInRaid --wow api
local _IsInGroup = IsInGroup --wow api
local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned --wow api
local GetUnitName = GetUnitName
local _ipairs = ipairs --> lua api
local _table_sort = table.sort --> lua api
local _cstr = string.format --> lua api
local _ipairs = ipairs --lua api
local _table_sort = table.sort --lua api
local _cstr = string.format --lua api
local _unpack = unpack
local _math_floor = math.floor
local _math_abs = math.abs
@@ -20,10 +20,10 @@ local RAID_CLASS_COLORS = RAID_CLASS_COLORS
--> Create the plugin Object
--Create the plugin Object
local ThreatMeter = _detalhes:NewPluginObject ("Details_TinyThreat")
--> Main Frame
--Main Frame
local ThreatMeterFrame = ThreatMeter.Frame
ThreatMeter:SetPluginDescription ("Small tool for track the threat you and other raid members have in your current target.")
@@ -49,41 +49,41 @@ end
local function CreatePluginFrames (data)
--> catch Details! main object
--catch Details! main object
local _detalhes = _G._detalhes
local DetailsFrameWork = _detalhes.gump
--> data
--data
ThreatMeter.data = data or {}
--> defaults
--defaults
ThreatMeter.RowWidth = 294
ThreatMeter.RowHeight = 14
--> amount of row wich can be displayed
--amount of row wich can be displayed
ThreatMeter.CanShow = 0
--> all rows already created
--all rows already created
ThreatMeter.Rows = {}
--> current shown rows
--current shown rows
ThreatMeter.ShownRows = {}
-->
ThreatMeter.Actived = false
--> localize functions
--localize functions
ThreatMeter.percent_color = ThreatMeter.percent_color
ThreatMeter.GetOnlyName = ThreatMeter.GetOnlyName
--> window reference
--window reference
local instance
local player
--> OnEvent Table
--OnEvent Table
function ThreatMeter:OnDetailsEvent (event, ...)
if (event == "DETAILS_STARTED") then
ThreatMeter:RefreshRows()
elseif (event == "HIDE") then --> plugin hidded, disabled
elseif (event == "HIDE") then --plugin hidded, disabled
ThreatMeter.Actived = false
ThreatMeter:Cancel()
@@ -149,23 +149,23 @@ local function CreatePluginFrames (data)
end
end
ThreatMeterFrame:SetWidth (300)
ThreatMeterFrame:SetHeight (100)
ThreatMeterFrame:SetWidth(300)
ThreatMeterFrame:SetHeight(100)
function ThreatMeter:UpdateContainers()
for _, row in _ipairs (ThreatMeter.Rows) do
for _, row in _ipairs(ThreatMeter.Rows) do
row:SetContainer (instance.baseframe)
end
end
function ThreatMeter:UpdateRows()
for _, row in _ipairs (ThreatMeter.Rows) do
for _, row in _ipairs(ThreatMeter.Rows) do
row.width = ThreatMeter.RowWidth
end
end
function ThreatMeter:HideBars()
for _, row in _ipairs (ThreatMeter.Rows) do
for _, row in _ipairs(ThreatMeter.Rows) do
row:Hide()
end
end
@@ -186,8 +186,8 @@ local function CreatePluginFrames (data)
local instance = ThreatMeter:GetPluginInstance()
local w, h = instance:GetSize()
ThreatMeterFrame:SetWidth (w)
ThreatMeterFrame:SetHeight (h)
ThreatMeterFrame:SetWidth(w)
ThreatMeterFrame:SetHeight(h)
ThreatMeter.RowHeight = instance.row_info.height
ThreatMeter.CanShow = math.floor ( h / (instance.row_info.height+1))
@@ -229,8 +229,8 @@ local function CreatePluginFrames (data)
row.height = instance.row_info.height
local rowHeight = - ( (row.rowId -1) * (instance.row_info.height + 1) )
row:ClearAllPoints()
row:SetPoint ("topleft", ThreatMeterFrame, "topleft", 1, rowHeight)
row:SetPoint ("topright", ThreatMeterFrame, "topright", -1, rowHeight)
row:SetPoint("topleft", ThreatMeterFrame, "topleft", 1, rowHeight)
row:SetPoint("topright", ThreatMeterFrame, "topright", -1, rowHeight)
end
end
@@ -243,7 +243,7 @@ local function CreatePluginFrames (data)
function ThreatMeter:NewRow (i)
local newrow = DetailsFrameWork:NewBar (ThreatMeterFrame, nil, "DetailsThreatRow"..i, nil, 300, ThreatMeter.RowHeight)
newrow:SetPoint (3, -((i-1)*(ThreatMeter.RowHeight+1)))
newrow:SetPoint(3, -((i-1)*(ThreatMeter.RowHeight+1)))
newrow.lefttext = "bar " .. i
newrow.color = "skyblue"
newrow.fontsize = 9.9
@@ -322,7 +322,7 @@ local function CreatePluginFrames (data)
if (ThreatMeter.Actived and UnitExists(unitId) and not _UnitIsFriend("player", unitId)) then
--> get the threat of all players
--get the threat of all players
if (_IsInRaid()) then
for i = 1, _GetNumGroupMembers(), 1 do
@@ -331,7 +331,7 @@ local function CreatePluginFrames (data)
local threat_table = ThreatMeter.player_list_indexes [threat_table_index]
if (not threat_table) then
--> some one joined the group while the player are in combat
--some one joined the group while the player are in combat
ThreatMeter:Start()
return
end
@@ -347,7 +347,7 @@ local function CreatePluginFrames (data)
local threat_table = ThreatMeter.player_list_indexes [threat_table_index]
if (not threat_table) then
--> some one joined the group while the player are in combat
--some one joined the group while the player are in combat
ThreatMeter:Start()
return
end
@@ -364,14 +364,14 @@ local function CreatePluginFrames (data)
else
--> player
--player
local thisplayer_name = GetUnitName ("player", true)
local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name]
local threat_table = ThreatMeter.player_list_indexes [threat_table_index]
UpdateTableFromThreatSituation(threat_table, "player", unitId)
--> pet
--pet
if (UnitExists ("pet")) then
local thisplayer_name = GetUnitName ("pet", true) .. " *PET*"
local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name]
@@ -387,23 +387,23 @@ local function CreatePluginFrames (data)
local gougeSpellId = (not disableGougeMode) and FindGougeSpellForUnit(unitId)
local useAbsoluteMode = gougeSpellId or ThreatMeter.saveddata.absolute_mode
--> sort
--sort
_table_sort (ThreatMeter.player_list_indexes, useAbsoluteMode and absoluteSort or relativeSort)
local needMainTankDummyBar = true
for index, t in _ipairs (ThreatMeter.player_list_indexes) do
for index, t in _ipairs(ThreatMeter.player_list_indexes) do
ThreatMeter.player_list_hash [t[1]] = index
if t[3] then
needMainTankDummyBar = false
end
end
--> no threat on this enemy
--no threat on this enemy
if (ThreatMeter.player_list_indexes [1][7] < 1) then
ThreatMeter:HideBars()
return
end
--> find main tank threat, even if they are not in group
--find main tank threat, even if they are not in group
local mainTankAbsoluteThreat = ThreatMeter.player_list_indexes[1][6]/(ThreatMeter.player_list_indexes[1][7]/100)
local lastIndex = 0
@@ -415,7 +415,7 @@ local function CreatePluginFrames (data)
local needMeleePullBar = (not hidePullBar) and useAbsoluteMode
local needRelativePullBar = (not hidePullBar) and (not useAbsoluteMode) and me and (me[2] > 0) and (not me[3])
--> find out scaling factor for bars
--find out scaling factor for bars
local barValueUnit
if useAbsoluteMode then
barValueUnit = max(ThreatMeter.player_list_indexes[1][7]/100, needRangedPullBar and 1.3 or needMeleePullBar and 1.1 or 1.0)
@@ -423,10 +423,10 @@ local function CreatePluginFrames (data)
barValueUnit = 1.0
end
--> find out gouge threshold (highest offtank threat, divided by 110%; this prevents the offtank from taking the boss back)
--find out gouge threshold (highest offtank threat, divided by 110%; this prevents the offtank from taking the boss back)
local gougeThreshold = nil
if gougeSpellId then
for _, t in _ipairs (ThreatMeter.player_list_indexes) do
for _, t in _ipairs(ThreatMeter.player_list_indexes) do
if not t[3] then
gougeThreshold = t[6] / 1.1
break
@@ -442,7 +442,7 @@ local function CreatePluginFrames (data)
local threatActor = ThreatMeter.player_list_indexes[index-dummyBarCount]
if needRelativePullBar then
thisRow._icon:SetTexture ([[Interface\PVPFrame\Icon-Combat]])
thisRow._icon:SetTexture([[Interface\PVPFrame\Icon-Combat]])
thisRow._icon:SetTexCoord (0, 1, 0, 1)
local myPullThreat = me[6]*(100/me[2])
@@ -464,7 +464,7 @@ local function CreatePluginFrames (data)
if needRangedPullBar and ((not threatActor) or (threatActor[7] < 130)) then
thisRow._icon:SetTexture ([[Interface\PaperDoll\UI-PaperDoll-Slot-Ranged]])
thisRow._icon:SetTexture([[Interface\PaperDoll\UI-PaperDoll-Slot-Ranged]])
thisRow._icon:SetTexCoord (0, 1, 0, 1)
thisRow:SetLeftText ("Ranged pull at")
@@ -482,7 +482,7 @@ local function CreatePluginFrames (data)
end
if needMeleePullBar and ((not threatActor) or (threatActor[7] < 110)) then
thisRow._icon:SetTexture ([[Interface\PaperDoll\UI-PaperDoll-Slot-MainHand]])
thisRow._icon:SetTexture([[Interface\PaperDoll\UI-PaperDoll-Slot-MainHand]])
thisRow._icon:SetTexCoord (0, 1, 0, 1)
thisRow:SetLeftText ("Melee pull at")
@@ -500,7 +500,7 @@ local function CreatePluginFrames (data)
end
if needMainTankDummyBar and ((not threatActor) or (not useAbsoluteMode) or (threatActor[6] < mainTankAbsoluteThreat)) then
thisRow._icon:SetTexture ([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord ["TANK"]))
thisRow:SetLeftText ("Current Tank")
@@ -509,7 +509,7 @@ local function CreatePluginFrames (data)
-- color main tank based on highest non-tank threat
local r,g = 0,1
for _, t in _ipairs (ThreatMeter.player_list_indexes) do
for _, t in _ipairs(ThreatMeter.player_list_indexes) do
if not t[3] then
local otherPct = t[useAbsoluteMode and 7 or 2]
r,g = (otherPct*0.01), (_math_abs(otherPct-100)*0.01)
@@ -529,7 +529,7 @@ local function CreatePluginFrames (data)
if gougeThreshold and ((not threatActor) or (threatActor[6] < gougeThreshold)) then
local spellName, _, spellTexture = GetSpellInfo(gougeSpellId)
thisRow._icon:SetTexture (spellTexture)
thisRow._icon:SetTexture(spellTexture)
thisRow._icon:SetTexCoord (0, 1, 0, 1)
local pct = gougeThreshold * 100 / mainTankAbsoluteThreat
@@ -550,7 +550,7 @@ local function CreatePluginFrames (data)
if (threatActor) then
local role = threatActor[4]
thisRow._icon:SetTexture ([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role]))
thisRow:SetLeftText (ThreatMeter:GetOnlyName (threatActor [1]))
@@ -558,7 +558,7 @@ local function CreatePluginFrames (data)
local pct = threatActor [useAbsoluteMode and 7 or 2]
thisRow:SetRightText (ThreatMeter:ToK2 (threatActor [6]) .. " (" .. _cstr ("%.1f", pct) .. "%)")
thisRow:SetValue (pct/barValueUnit)
thisRow:SetValue(pct/barValueUnit)
if (options.useplayercolor and threatActor [1] == player) then
thisRow:SetColor (_unpack (options.playercolor))
@@ -574,7 +574,7 @@ local function CreatePluginFrames (data)
if threatActor[3] then
-- color main tank based on highest non-tank threat
local r,g = 0,1
for _, t in _ipairs (ThreatMeter.player_list_indexes) do
for _, t in _ipairs(ThreatMeter.player_list_indexes) do
if not t[3] then
local otherPct = t[useAbsoluteMode and 7 or 2]
r,g = (otherPct*0.01), (_math_abs(otherPct-100)*0.01)
@@ -602,7 +602,7 @@ local function CreatePluginFrames (data)
end
if (not shownMe) then
--> show my self into last bar
--show my self into last bar
local threat_actor = ThreatMeter.player_list_indexes [ ThreatMeter.player_list_hash [player] ]
if (threat_actor) then
if (threat_actor [2] and threat_actor [2] > 0.1) then
@@ -610,10 +610,10 @@ local function CreatePluginFrames (data)
thisRow:SetLeftText (player)
--thisRow.textleft:SetTextColor (unpack (RAID_CLASS_COLORS [threat_actor [5]]))
local role = threat_actor [4]
thisRow._icon:SetTexture ([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role]))
thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", threat_actor [2]) .. "%)")
thisRow:SetValue (threat_actor [2])
thisRow:SetValue(threat_actor [2])
if (options.useplayercolor) then
thisRow:SetColor (_unpack (options.playercolor))
@@ -660,7 +660,7 @@ local function CreatePluginFrames (data)
ThreatMeter.player_list_indexes = {}
ThreatMeter.player_list_hash = {}
--> pre build player list
--pre build player list
if (_IsInRaid()) then
for i = 1, _GetNumGroupMembers(), 1 do
local thisplayer_name = GetUnitName ("raid"..i, true)
@@ -851,18 +851,18 @@ function ThreatMeter:OnEvent (_, event, ...)
--return
end
--> create widgets
--create widgets
CreatePluginFrames (data)
local MINIMAL_DETAILS_VERSION_REQUIRED = 1
--> Install
--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, "Terciob", "v2.01")
if (type (install) == "table" and install.error) then
if (type(install) == "table" and install.error) then
print (install.error)
end
--> Register needed events
--Register needed events
_G._detalhes:RegisterEvent (ThreatMeter, "COMBAT_PLAYER_ENTER")
_G._detalhes:RegisterEvent (ThreatMeter, "COMBAT_PLAYER_LEAVE")
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_ENDRESIZE")
@@ -875,7 +875,7 @@ function ThreatMeter:OnEvent (_, event, ...)
ThreatMeterFrame:RegisterEvent ("PLAYER_REGEN_DISABLED")
ThreatMeterFrame:RegisterEvent ("PLAYER_REGEN_ENABLED")
--> Saved data
--Saved data
ThreatMeter.saveddata = saveddata or {}
ThreatMeter.saveddata.updatespeed = ThreatMeter.saveddata.updatespeed or 1
@@ -894,7 +894,7 @@ function ThreatMeter:OnEvent (_, event, ...)
ThreatMeter.options = ThreatMeter.saveddata
--> Register slash commands
--Register slash commands
SLASH_DETAILS_TINYTHREAT1, SLASH_DETAILS_TINYTHREAT2 = "/tinythreat", "/tt"
function SlashCmdList.DETAILS_TINYTHREAT (msg, editbox)
+104 -104
View File
@@ -15,17 +15,17 @@ local DF = _G.DetailsFramework
--ignorar bloodlust, shield d priest
--reler os tanks ao sair de um grupo
local _GetTime = GetTime --> wow api local
local _UFC = UnitAffectingCombat --> wow api local
local _IsInRaid = IsInRaid --> wow api local
local _IsInGroup = IsInGroup --> wow api local
local _UnitName = UnitName --> wow api local
local _GetTime = GetTime --wow api local
local _UFC = UnitAffectingCombat --wow api local
local _IsInRaid = IsInRaid --wow api local
local _IsInGroup = IsInGroup --wow api local
local _UnitName = UnitName --wow api local
local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned
local _UnitHealth = UnitHealth --> wow api local
local _UnitHealthMax = UnitHealthMax --> wow api local
local _UnitIsPlayer = UnitIsPlayer --> wow api local
local _UnitClass = UnitClass --> wow api local
local _UnitDebuff = UnitDebuff --> wow api local
local _UnitHealth = UnitHealth --wow api local
local _UnitHealthMax = UnitHealthMax --wow api local
local _UnitIsPlayer = UnitIsPlayer --wow api local
local _UnitClass = UnitClass --wow api local
local _UnitDebuff = UnitDebuff --wow api local
local UnitGetIncomingHeals = UnitGetIncomingHeals
local _unpack = unpack
local UnitGetTotalAbsorbs = UnitGetTotalAbsorbs
@@ -35,14 +35,14 @@ local DB_ANIMATION_TIME_DILATATION = 0.515321
local CONST_DEBUFF_AMOUNT = 5
local CONST_MAX_TANKS = 2
local _cstr = string.format --> lua library local
local _table_insert = table.insert --> lua library local
local _table_remove = table.remove --> lua library local
local _ipairs = ipairs --> lua library local
local _pairs = pairs --> lua library local
local _math_floor = math.floor --> lua library local
local _math_abs = math.abs --> lua library local
local _math_min = math.min --> lua library local
local _cstr = string.format --lua library local
local _table_insert = table.insert --lua library local
local _table_remove = table.remove --lua library local
local _ipairs = ipairs --lua library local
local _pairs = pairs --lua library local
local _math_floor = math.floor --lua library local
local _math_abs = math.abs --lua library local
local _math_min = math.min --lua library local
local _table_sort = table.sort
local ignored_debuffs = {
@@ -55,9 +55,9 @@ local ignored_debuffs = {
---------------------------------------------------------------------------------------------
--> Create plugin Object
--Create plugin Object
local Vanguard = _detalhes:NewPluginObject ("Details_Vanguard")
--> Main Frame
--Main Frame
local VanguardFrame = Vanguard.Frame
local onUpdateFrame = CreateFrame("frame")
@@ -72,40 +72,40 @@ end
local function CreatePluginFrames (data)
--> localize details functions
--localize details functions
Vanguard.GetSpec = Vanguard.GetSpec
Vanguard.class_specs_coords = Vanguard.class_specs_coords
local framework = Vanguard:GetFramework()
--> OnDetailsEvent Parser
--OnDetailsEvent Parser
function Vanguard:OnDetailsEvent (event, ...)
if (event == "HIDE") then --> plugin hidded, disabled
if (event == "HIDE") then --plugin hidded, disabled
VanguardFrame:UnregisterEvent ("ROLE_CHANGED_INFORM")
VanguardFrame:UnregisterEvent ("GROUP_ROSTER_UPDATE")
VanguardFrame:UnregisterEvent ("PLAYER_TARGET_CHANGED")
Vanguard:CombatEnd()
elseif (event == "SHOW") then --> plugin shown, enabled
elseif (event == "SHOW") then --plugin shown, enabled
if (not Vanguard.db.first_run) then
Vanguard.db.first_run = true
local welcome = CreateFrame ("frame", nil, UIParent, "BackdropTemplate")
local welcome = CreateFrame("frame", nil, UIParent, "BackdropTemplate")
welcome:SetFrameStrata ("TOOLTIP")
welcome:SetPoint ("center", UIParent, "center")
welcome:SetSize (400, 200)
welcome:SetPoint("center", UIParent, "center")
welcome:SetSize(400, 200)
DF:ApplyStandardBackdrop(welcome)
local str = _detalhes.gump:CreateLabel (welcome, "Welcome to Vanguard!\n\n\n- The green-left bar represents the incoming healing plus absorbs on the tank.\n\n- The red-right show the incoming damage.\n\n- Tanks health bar and debuffs on them are shown in the bottom side.\n\n- Click anywhere to show options.", nil, nil, "GameFontNormal")
str:SetPoint (15, -15)
str:SetWidth (375)
local str = _detalhes.gump:CreateLabel(welcome, "Welcome to Vanguard!\n\n\n- The green-left bar represents the incoming healing plus absorbs on the tank.\n\n- The red-right show the incoming damage.\n\n- Tanks health bar and debuffs on them are shown in the bottom side.\n\n- Click anywhere to show options.", nil, nil, "GameFontNormal")
str:SetPoint(15, -15)
str:SetWidth(375)
local close_button = _detalhes.gump:CreateButton (welcome, function() welcome:Hide() end, 120, 20, "Close")
close_button:SetTemplate(_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE"))
close_button:SetPoint ("center", welcome, "center")
close_button:SetPoint ("bottom", welcome, "bottom", 0, 10)
close_button:SetPoint("center", welcome, "center")
close_button:SetPoint("bottom", welcome, "bottom", 0, 10)
end
@@ -127,10 +127,10 @@ local function CreatePluginFrames (data)
Vanguard:CombatStart()
end
VanguardFrame:SetPoint ("topleft", Vanguard.CurrentInstance.baseframe, "topleft")
VanguardFrame:SetPoint ("bottomright", Vanguard.CurrentInstance.baseframe, "bottomright")
VanguardFrame:SetPoint("topleft", Vanguard.CurrentInstance.baseframe, "topleft")
VanguardFrame:SetPoint("bottomright", Vanguard.CurrentInstance.baseframe, "bottomright")
elseif (event == "COMBAT_PLAYER_ENTER") then --> a new combat has been started
elseif (event == "COMBAT_PLAYER_ENTER") then --a new combat has been started
Vanguard.CurrentInstance = Vanguard:GetInstance (Vanguard.instance_id)
Vanguard.CurrentCombat = select (1, ...)
@@ -138,7 +138,7 @@ local function CreatePluginFrames (data)
Vanguard:CombatStart()
elseif (event == "COMBAT_PLAYER_LEAVE") then --> current combat has finished
elseif (event == "COMBAT_PLAYER_LEAVE") then --current combat has finished
Vanguard.CurrentCombat = select (1, ...)
@@ -173,14 +173,14 @@ local function CreatePluginFrames (data)
end
end
--> list with tank names
Vanguard.TankList = {} --> tanks
Vanguard.TankHashNames = {} --> tanks
Vanguard.TankBlocks = {} --> tank frames
Vanguard.TankIncDamage = {} --> tank damage taken from last 5 seconds
--list with tank names
Vanguard.TankList = {} --tanks
Vanguard.TankHashNames = {} --tanks
Vanguard.TankBlocks = {} --tank frames
Vanguard.TankIncDamage = {} --tank damage taken from last 5 seconds
Vanguard.UnitIdCache = {}
--> search for tanks in the raid or party group
--search for tanks in the raid or party group
function Vanguard:IdentifyTanks()
table.wipe (Vanguard.TankList)
@@ -271,7 +271,7 @@ local function CreatePluginFrames (data)
function Vanguard:ResetBars()
if (Vanguard.db.show_inc_bars) then
for i, tankblock in ipairs (Vanguard.TankBlocks) do
for i, tankblock in ipairs(Vanguard.TankBlocks) do
local bar = tankblock.heal_inc
bar:SetSplit (50)
bar:SetLeftText (tankblock.tankname_string)
@@ -284,7 +284,7 @@ local function CreatePluginFrames (data)
bar:Show()
end
else
for i, tankblock in ipairs (Vanguard.TankBlocks) do
for i, tankblock in ipairs(Vanguard.TankBlocks) do
local bar = tankblock.heal_inc
bar:Hide()
end
@@ -292,7 +292,7 @@ local function CreatePluginFrames (data)
end
function Vanguard:ResetBlocks()
for i, tblock in ipairs (Vanguard.TankBlocks) do
for i, tblock in ipairs(Vanguard.TankBlocks) do
local _, maxValue = tblock.unitFrame.healthBar:GetMinMaxValues()
tblock.unitFrame.healthBar:SetValue(maxValue)
@@ -301,8 +301,8 @@ local function CreatePluginFrames (data)
for i = 1, CONST_DEBUFF_AMOUNT do
local dblock = tblock.debuffs_blocks [i]
dblock.texture:SetTexture (nil)
dblock.stack:SetText ("")
dblock.texture:SetTexture(nil)
dblock.stack:SetText("")
dblock.stack_bg:Hide()
dblock:SetCooldown (0, 0, 0, 0)
dblock.in_use = nil
@@ -313,7 +313,7 @@ local function CreatePluginFrames (data)
local SetTank = function(self, index)
local name = Vanguard.TankList [index]
self.tankname:SetText (Vanguard:GetOnlyName (name))
self.tankname:SetText(Vanguard:GetOnlyName (name))
self.tankname_string = name
local bar = self.heal_inc
@@ -324,10 +324,10 @@ local function CreatePluginFrames (data)
local spec = Vanguard:GetSpec (name)
if (spec) then
self.specicon:SetTexture (Vanguard.CurrentInstance.row_info.spec_file)
self.specicon:SetTexture(Vanguard.CurrentInstance.row_info.spec_file)
self.specicon:SetTexCoord (_unpack (Vanguard.class_specs_coords [spec]))
else
self.specicon:SetTexture (Vanguard.CurrentInstance.row_info.icon_file)
self.specicon:SetTexture(Vanguard.CurrentInstance.row_info.icon_file)
self.specicon:SetTexCoord (left, right, top, bottom)
end
@@ -343,27 +343,27 @@ local function CreatePluginFrames (data)
bar:SetLeftText (name)
local width = Vanguard.db.tank_block_size
self:SetWidth (width)
self:SetBackdropColor (unpack (Vanguard.db.tank_block_color))
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))
self.unitFrame.powerBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
self.unitFrame.castBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
self.unitFrame.healthBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
self.unitFrame.powerBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
self.unitFrame.castBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
end
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
@@ -384,21 +384,21 @@ local function CreatePluginFrames (data)
function Vanguard:CreateTankBlock (index)
--frame
local f = CreateFrame ("button", "VanguardTankBlock" .. index, VanguardFrame, "BackdropTemplate")
local f = CreateFrame("button", "VanguardTankBlock" .. index, VanguardFrame, "BackdropTemplate")
f.SetTank = SetTank
f:SetSize (Vanguard.db.tank_block_size, Vanguard.db.tank_block_size_height)
f:SetSize(Vanguard.db.tank_block_size, Vanguard.db.tank_block_size_height)
f:SetScript ("OnMouseUp", on_click)
f:SetScript("OnMouseUp", on_click)
if (index == 1) then
f:SetPoint ("bottomleft", VanguardFrame, "bottomleft", 0 + ((index-1) * 155), 0)
f:SetPoint("bottomleft", VanguardFrame, "bottomleft", 0 + ((index-1) * 155), 0)
else
f:SetPoint ("left", Vanguard.TankBlocks [index-1], "right", 5, 0)
f:SetPoint("left", Vanguard.TankBlocks [index-1], "right", 5, 0)
end
f:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
f:SetBackdropColor (unpack (Vanguard.db.tank_block_color))
f:SetBackdropBorderColor (0, 0, 0, 1)
f:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
f:SetBackdropColor(unpack (Vanguard.db.tank_block_color))
f:SetBackdropBorderColor(0, 0, 0, 1)
--debuff icons
f.debufficons = {}
@@ -431,19 +431,19 @@ local function CreatePluginFrames (data)
}
f.unitFrame = DetailsFramework:CreateUnitFrame(f, "VanguardTankUnitFrame" .. index, unitFrameSettingsOverride, healthBarSettingsOverride, castBarSettingsOverride, powerBarSettingsOverride)
f.unitFrame:SetPoint ("topleft", f, "topleft", 1, -1)
f.unitFrame:SetPoint ("bottomright", f, "bottomright", -1, 1)
f.unitFrame:SetPoint("topleft", f, "topleft", 1, -1)
f.unitFrame:SetPoint("bottomright", f, "bottomright", -1, 1)
--spec icon
f.specicon = f.unitFrame.healthBar:CreateTexture(nil, "overlay")
f.specicon:SetPoint ("topleft", f.unitFrame.healthBar, "topleft", 5, -5)
f.specicon:SetSize (14, 14)
f.specicon:SetPoint("topleft", f.unitFrame.healthBar, "topleft", 5, -5)
f.specicon:SetSize(14, 14)
--tank name
f.tankname = f.unitFrame.healthBar:CreateFontString(nil, "overlay", "GameFontNormal")
f.tankname:SetPoint ("left", f.specicon, "right", 2, 1)
f.tankname:SetPoint("left", f.specicon, "right", 2, 1)
f.unitFrame.castBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
f.unitFrame.healthBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
f.unitFrame.powerBar:SetTexture (SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
f.unitFrame.castBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
f.unitFrame.healthBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
f.unitFrame.powerBar:SetTexture(SharedMedia:Fetch("statusbar", Vanguard.db.tank_block_texture))
f.unitFrame.powerBar.background:SetColorTexture(0, 0, 0, 1)
f.unitFrame.powerBar.background:SetVertexColor(0, 0, 0, 1)
@@ -451,13 +451,13 @@ local function CreatePluginFrames (data)
--inc heals inc damage
f.heal_inc = DF:CreateSplitBar(f, 294, Vanguard.db.bar_height)
f.heal_inc:SetSize(294, Vanguard.db.bar_height)
f.heal_inc:SetPoint ("topleft", VanguardFrame, "topleft", 0, ((index - 1) * -Vanguard.db.bar_height))
f.heal_inc:SetPoint ("topright", VanguardFrame, "topright", 0, ((index - 1) * -Vanguard.db.bar_height))
f.heal_inc:SetPoint("topleft", VanguardFrame, "topleft", 0, ((index - 1) * -Vanguard.db.bar_height))
f.heal_inc:SetPoint("topright", VanguardFrame, "topright", 0, ((index - 1) * -Vanguard.db.bar_height))
f.heal_inc.fontsize = 10
f.heal_inc:SetTexture(SharedMedia:Fetch ("statusbar", Vanguard.db.tank_block_texture))
f.heal_inc:EnableAnimations()
f.heal_inc:SetScript ("OnMouseUp", on_click)
f.heal_inc:SetScript("OnMouseUp", on_click)
--debuffs blocks
f.debuffs_blocks = {}
@@ -465,30 +465,30 @@ local function CreatePluginFrames (data)
f.debuffs_next_index = 1
for i = 1, CONST_DEBUFF_AMOUNT do
local support_frame = CreateFrame ("frame", "VanguardSupportFrame_"..index.."_"..i, 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)
support_frame:SetSize(24, 24)
support_frame:SetScript("OnMouseUp", on_click)
--icon texture
local texture = support_frame:CreateTexture (support_frame:GetName() .. "_Texture", "overlay")
texture:SetSize (24, 24)
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)
support_frame:SetPoint("left", f, "left", 5 + xOffSet, -8)
local dblock = CreateFrame ("cooldown", "VanguardTankDebuffCooldown" .. index.. "_" .. 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:SetPoint("topleft", texture, "topleft")
dblock:SetPoint("bottomright", texture, "bottomright")
--scripts
dblock:SetScript ("OnMouseUp", on_click)
dblock:SetScript ("OnEnter", debuff_on_enter)
dblock:SetScript ("OnLeave", debuff_on_leave)
dblock:SetScript("OnMouseUp", on_click)
dblock:SetScript("OnEnter", debuff_on_enter)
dblock:SetScript("OnLeave", debuff_on_leave)
dblock.texture = texture
@@ -500,12 +500,12 @@ local function CreatePluginFrames (data)
elevateStringsFrame:EnableMouse(false)
local stack = elevateStringsFrame:CreateFontString (elevateStringsFrame:GetName() .. "_StackText", "overlay", "GameFontNormal")
stack:SetPoint ("bottomright", dblock, "bottomright", 0, 0)
stack:SetPoint("bottomright", dblock, "bottomright", 0, 0)
DetailsFramework:SetFontColor(stack, "yellow")
local stack_bg = elevateStringsFrame:CreateTexture (elevateStringsFrame:GetName() .. "_StackBG", "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:SetPoint("center", stack, "center", 0, 0)
stack_bg:SetSize(10, 10)
stack_bg:Hide()
@@ -556,7 +556,7 @@ local function CreatePluginFrames (data)
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)
debuffBlock.support:SetPoint("left", f, "left", 5 + debuffBlock.support.offset, -8 + Vanguard.db.aura_offset_y)
end
if (isClickThrough) then
@@ -631,14 +631,14 @@ local function CreatePluginFrames (data)
if (not Vanguard.db.show_health_bar and not Vanguard.db.show_cast_bar and not Vanguard.db.show_power_bar) then
f.unitFrame:Hide()
f.Center:Hide()
f:SetBackdropBorderColor (0, 0, 0, 0)
f:SetBackdropBorderColor(0, 0, 0, 0)
return
end
f.unitFrame:Show()
f.unitFrame.healthBar:Show()
f.Center:Show()
f:SetBackdropBorderColor (0, 0, 0, 1)
f:SetBackdropBorderColor(0, 0, 0, 1)
f.unitFrame.healthBar:SetPoint("topleft", f, "topleft", 0, 0)
f.unitFrame.healthBar:SetPoint("topright", f, "topright", 0, 0)
@@ -688,7 +688,7 @@ local function CreatePluginFrames (data)
self.CurrentHealth = self.AnimationStart
if (self.Spark) then
self.Spark:SetPoint ("center", self, "left", self.AnimationStart / self.CurrentHealthMax * self:GetWidth(), 0)
self.Spark:SetPoint("center", self, "left", self.AnimationStart / self.CurrentHealthMax * self:GetWidth(), 0)
self.Spark:Show()
end
@@ -742,7 +742,7 @@ local function CreatePluginFrames (data)
local timeNow = time()
if (events_table) then
for _, event in ipairs (events_table) do
for _, event in ipairs(events_table) do
if (event[1] and event[4]+5 > timeNow) then --damage event
taken = taken + event [3]
end
@@ -758,7 +758,7 @@ local function CreatePluginFrames (data)
--split animation
tframe.heal_inc:SetLeftText (Vanguard:ToK (shields + heals) .. " [|cFFFFFF55" .. Vanguard:ToK (shields) .. "|r]")
tframe.heal_inc:SetRightText (Vanguard:ToK ( _math_floor (taken)))
tframe.heal_inc:SetRightText (Vanguard:ToK ( _math_floor(taken)))
heals = heals + shields
@@ -1124,20 +1124,20 @@ function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, wh
tank_block_powerbar_size_height = 10,
}
--> Install
function Vanguard:OnDetailsEvent() end --> dummy func to stop warnings.
--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, "Terciob", "v3.0", default_saved_table)
if (type (install) == "table" and install.error) then
if (type(install) == "table" and install.error) then
print (install.error)
end
--Vanguard.db.first_run = false --debug
--> create widgets
--create widgets
CreatePluginFrames()
--> Register needed events
--Register needed events
_G._detalhes:RegisterEvent (Vanguard, "COMBAT_PLAYER_ENTER")
_G._detalhes:RegisterEvent (Vanguard, "COMBAT_PLAYER_LEAVE")
_G._detalhes:RegisterEvent (Vanguard, "DETAILS_INSTANCE_ENDRESIZE")
@@ -1150,12 +1150,12 @@ function Vanguard:OnEvent (_, event, arg1, token, time, who_serial, who_name, wh
end
end
elseif (event == "ROLE_CHANGED_INFORM" or event == "GROUP_ROSTER_UPDATE") then --> raid changes
elseif (event == "ROLE_CHANGED_INFORM" or event == "GROUP_ROSTER_UPDATE") then --raid changes
if (Vanguard.CurrentInstance) then
Vanguard:IdentifyTanks()
end
elseif (event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_ENTERING_WORLD") then --> logon or map changes
elseif (event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_ENTERING_WORLD") then --logon or map changes
if (Vanguard.CurrentInstance) then
Vanguard:IdentifyTanks()
end