- Added Observer channel for Raid Tools, it only reports the cooldown/interrupt/death to you in your chat window.
- More updates on the new plugin Raid Check.
This commit is contained in:
@@ -3,6 +3,8 @@ local _UnitAura = UnitAura
|
||||
local _GetSpellInfo = GetSpellInfo
|
||||
local _UnitClass = UnitClass
|
||||
local _UnitName = UnitName
|
||||
local _UnitGroupRolesAssigned = UnitGroupRolesAssigned
|
||||
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
|
||||
|
||||
local flask_list = {
|
||||
[156064] = true, --Greater Draenic Agility Flask
|
||||
@@ -35,8 +37,6 @@ local food_list = {
|
||||
[175223] = true, --
|
||||
}
|
||||
|
||||
|
||||
|
||||
--> localization
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ("Details")
|
||||
--> create the plugin object
|
||||
@@ -44,8 +44,16 @@ local food_list = {
|
||||
tinsert (UISpecialFrames, "DetailsRaidCheck")
|
||||
DetailsRaidCheck:SetPluginDescription (Loc ["STRING_RAIDCHECK_PLUGIN_DESC"])
|
||||
|
||||
local version = "v0.3"
|
||||
|
||||
local debugmode = false
|
||||
|
||||
local CreatePluginFrames = function()
|
||||
|
||||
--> localize details functions (localize = it doesn't need to get this through indexed metatable any more)
|
||||
DetailsRaidCheck.GetOnlyName = DetailsRaidCheck.GetOnlyName
|
||||
|
||||
--> tables
|
||||
DetailsRaidCheck.usedprepot_table = {}
|
||||
DetailsRaidCheck.haveflask_table = {}
|
||||
DetailsRaidCheck.havefood_table = {}
|
||||
@@ -64,7 +72,6 @@ local food_list = {
|
||||
elseif (event == "COMBAT_PREPOTION_UPDATED") then
|
||||
|
||||
DetailsRaidCheck.usedprepot_table = select (1, ...)
|
||||
vardump (DetailsRaidCheck.usedprepot_table)
|
||||
|
||||
elseif (event == "COMBAT_PLAYER_LEAVE") then
|
||||
|
||||
@@ -75,9 +82,7 @@ local food_list = {
|
||||
elseif (event == "COMBAT_PLAYER_ENTER") then
|
||||
|
||||
if (DetailsRaidCheck.on_raid) then
|
||||
|
||||
DetailsRaidCheck:StopTrackBuffs()
|
||||
|
||||
end
|
||||
|
||||
elseif (event == "DETAILS_STARTED") then
|
||||
@@ -90,7 +95,8 @@ local food_list = {
|
||||
DetailsRaidCheck.tracking_buffs = false
|
||||
|
||||
DetailsRaidCheck:StopTrackBuffs()
|
||||
--> HIDE ICON
|
||||
|
||||
DetailsRaidCheck:HideToolbarIcon (DetailsRaidCheck.ToolbarButton)
|
||||
|
||||
elseif (event == "PLUGIN_ENABLED") then
|
||||
|
||||
@@ -102,9 +108,6 @@ local food_list = {
|
||||
|
||||
DetailsRaidCheck.ToolbarButton = _detalhes.ToolBar:NewPluginToolbarButton (DetailsRaidCheck.empty_function, [[Interface\AddOns\Details_RaidCheck\icon]], Loc ["STRING_RAIDCHECK_PLUGIN_NAME"], "", 16, 16, "RAIDCHECK_PLUGIN_BUTTON")
|
||||
DetailsRaidCheck.ToolbarButton.shadow = true --> loads icon_shadow.tga when the instance is showing icons with shadows
|
||||
DetailsRaidCheck:ShowToolbarIcon (DetailsRaidCheck.ToolbarButton, "star")
|
||||
|
||||
--DetailsRaidCheck:HideToolbarIcon (DetailsRaidCheck.ToolbarButton)
|
||||
|
||||
function DetailsRaidCheck:SetGreenIcon()
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
@@ -149,31 +152,161 @@ local food_list = {
|
||||
|
||||
local show_panel = CreateFrame ("frame", nil, UIParent)
|
||||
show_panel:SetSize (400, 300)
|
||||
show_panel:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
|
||||
--show_panel:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
|
||||
show_panel:SetPoint ("bottom", DetailsRaidCheck.ToolbarButton, "top", 0, 10)
|
||||
--show_panel:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 16, insets = {left = 4, right = 4, top = 2, bottom = 1}})
|
||||
show_panel:SetBackdrop ({bgFile = [[Interface\Garrison\GarrisonMissionUIInfoBoxBackgroundTile]], tileSize = 256, edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 16, insets = {left = 4, right = 4, top = 2, bottom = 1}})
|
||||
show_panel:SetBackdropColor (1, 1, 1, 0.9)
|
||||
|
||||
--
|
||||
|
||||
local bottom_gradient = show_panel:CreateTexture (nil, "artwork")
|
||||
bottom_gradient:SetPoint ("bottomleft", show_panel, "bottomleft", 4, 4)
|
||||
bottom_gradient:SetPoint ("bottomright", show_panel, "bottomright", -4, 4)
|
||||
bottom_gradient:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]])
|
||||
bottom_gradient:SetTexCoord (485/1024, 737/1024, 377/1024, 418/1024)
|
||||
bottom_gradient:SetHeight (45)
|
||||
|
||||
--
|
||||
|
||||
local report_string1 = show_panel:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
report_string1:SetPoint ("bottomleft", show_panel, "bottomleft", 10, 10)
|
||||
report_string1:SetText ("|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:12:12:0:1:512:512:8:70:225:307|t Report No Food/Flask |TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:12:12:0:1:512:512:8:70:328:409|t Report No Pre-Pot |TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:12:12:0:1:512:512:8:70:126:204|t Disable Plugin")
|
||||
DetailsRaidCheck:SetFontSize (report_string1, 10)
|
||||
DetailsRaidCheck:SetFontColor (report_string1, "white")
|
||||
report_string1:SetAlpha (0.6)
|
||||
--
|
||||
|
||||
local food_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
food_title:SetJustifyH ("center")
|
||||
food_title:SetPoint ("topleft", show_panel, "topleft", 17, -20)
|
||||
food_title:SetText ("No Food")
|
||||
food_title:SetTextColor (1, 0.8, 0.8)
|
||||
|
||||
local food_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
food_str:SetJustifyH ("left")
|
||||
food_str:SetPoint ("topleft", show_panel, "topleft", 15, -20)
|
||||
food_str:SetPoint ("topleft", food_title, "topleft", -9, -20)
|
||||
|
||||
local food_image = show_panel:CreateTexture (nil, "artwork")
|
||||
food_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]])
|
||||
food_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024)
|
||||
food_image:SetPoint ("topleft", food_title, "topleft", -11, 3)
|
||||
food_image:SetSize (food_title:GetStringWidth()+20, 19) --208, 48
|
||||
food_image:SetVertexColor (.65, .65, .65)
|
||||
|
||||
--
|
||||
|
||||
local flask_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
flask_title:SetJustifyH ("center")
|
||||
flask_title:SetPoint ("topleft", show_panel, "topleft", 110, -20)
|
||||
flask_title:SetText ("No Flask")
|
||||
flask_title:SetTextColor (1, 0.8, 0.8)
|
||||
|
||||
local flask_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
flask_str:SetJustifyH ("left")
|
||||
flask_str:SetPoint ("topleft", show_panel, "topleft", 150, -20)
|
||||
flask_str:SetPoint ("topleft", flask_title, "topleft", -9, -20)
|
||||
|
||||
local flask_image = show_panel:CreateTexture (nil, "artwork")
|
||||
flask_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]])
|
||||
flask_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024)
|
||||
flask_image:SetPoint ("topleft", flask_title, "topleft", -11, 3)
|
||||
flask_image:SetSize (flask_title:GetStringWidth()+20, 19) --208, 48
|
||||
flask_image:SetVertexColor (.65, .65, .65)
|
||||
|
||||
--
|
||||
|
||||
local prepot_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
prepot_title:SetJustifyH ("center")
|
||||
prepot_title:SetPoint ("topleft", show_panel, "topleft", 205, -20)
|
||||
prepot_title:SetText ("Used Pre Pot")
|
||||
prepot_title:SetTextColor (0.8, 1, 0.8)
|
||||
|
||||
local prepot_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
prepot_str:SetJustifyH ("left")
|
||||
prepot_str:SetPoint ("topleft", show_panel, "topleft", 285, -20)
|
||||
prepot_str:SetPoint ("topleft", prepot_title, "topleft", -11, -20)
|
||||
|
||||
local prepot_image = show_panel:CreateTexture (nil, "artwork")
|
||||
prepot_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]])
|
||||
prepot_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024)
|
||||
prepot_image:SetPoint ("topleft", prepot_title, "topleft", -11, 3)
|
||||
prepot_image:SetSize (prepot_title:GetStringWidth()+22, 19) --208, 48
|
||||
prepot_image:SetVertexColor (.65, .65, .65)
|
||||
|
||||
--
|
||||
|
||||
local prepot_title2 = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
prepot_title2:SetJustifyH ("center")
|
||||
prepot_title2:SetPoint ("topleft", show_panel, "topleft", 315, -20)
|
||||
prepot_title2:SetText ("No Pre Pot")
|
||||
prepot_title2:SetTextColor (1, 0.8, 0.8)
|
||||
|
||||
local prepot_str2 = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
prepot_str2:SetJustifyH ("left")
|
||||
prepot_str2:SetPoint ("topleft", prepot_title2, "topleft", -9, -20)
|
||||
|
||||
local prepot_image2 = show_panel:CreateTexture (nil, "artwork")
|
||||
prepot_image2:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]])
|
||||
prepot_image2:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024)
|
||||
prepot_image2:SetPoint ("topleft", prepot_title2, "topleft", -11, 3)
|
||||
prepot_image2:SetSize (prepot_title2:GetStringWidth()+22, 19) --208, 48
|
||||
prepot_image2:SetVertexColor (.65, .65, .65)
|
||||
|
||||
--
|
||||
|
||||
show_panel:Hide()
|
||||
|
||||
--> overwrite the default scripts
|
||||
DetailsRaidCheck.ToolbarButton:RegisterForClicks ("AnyUp")
|
||||
DetailsRaidCheck.ToolbarButton:SetScript ("OnClick", function (self, button)
|
||||
|
||||
if (button == "LeftButton") then
|
||||
--> link no food/flask
|
||||
local s, added = "No Flask or Food: ", {}
|
||||
|
||||
for i = 1, GetNumGroupMembers(), 1 do
|
||||
local name = UnitName ("raid" .. i)
|
||||
if (not DetailsRaidCheck.havefood_table [name]) then
|
||||
added [name] = true
|
||||
s = s .. DetailsRaidCheck:GetOnlyName (name) .. " "
|
||||
end
|
||||
|
||||
if (not DetailsRaidCheck.haveflask_table [name] and not added [name]) then
|
||||
s = s .. DetailsRaidCheck:GetOnlyName (name) .. " "
|
||||
end
|
||||
end
|
||||
|
||||
DetailsRaidCheck:SendMsgToChannel (s, "RAID")
|
||||
|
||||
elseif (button == "RightButton") then
|
||||
--> link no pre-pot latest segment
|
||||
|
||||
local s = "No Pre-Pot Last Try: "
|
||||
|
||||
for i = 1, GetNumGroupMembers(), 1 do
|
||||
local playerName, realmName = _UnitName ("raid" .. i)
|
||||
if (realmName and realmName ~= "") then
|
||||
playerName = playerName .. "-" .. realmName
|
||||
end
|
||||
|
||||
if (not DetailsRaidCheck.usedprepot_table [playerName]) then
|
||||
s = s .. DetailsRaidCheck:GetOnlyName (playerName) .. " "
|
||||
end
|
||||
end
|
||||
|
||||
DetailsRaidCheck:SendMsgToChannel (s, "RAID")
|
||||
|
||||
elseif (button == "MiddleButton") then
|
||||
|
||||
_detalhes:DisablePlugin ("DETAILS_PLUGIN_RAIDCHECK")
|
||||
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
local update_panel = function (self)
|
||||
|
||||
local s, f, p, n = "No Food:\n\n", "No Flask:\n\n", "Used Pre Pot:\n\n", "Not Used Pre Pot:\n\n"
|
||||
local amount1, amount2, amount3, amount4 = 0, 0, 0, 0
|
||||
local s, f, p, n = "", "", "", ""
|
||||
|
||||
for i = 1, GetNumGroupMembers(), 1 do
|
||||
|
||||
@@ -188,7 +321,9 @@ local food_list = {
|
||||
class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:-5:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
|
||||
end
|
||||
|
||||
s = s .. class_color .. name .. "|r\n"
|
||||
s = s .. class_color .. DetailsRaidCheck:GetOnlyName (name) .. "|r\n"
|
||||
|
||||
amount1 = amount1 + 1
|
||||
end
|
||||
|
||||
if (not DetailsRaidCheck.haveflask_table [name]) then
|
||||
@@ -199,7 +334,9 @@ local food_list = {
|
||||
local coords = CLASS_ICON_TCOORDS [class]
|
||||
class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:-5:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
|
||||
end
|
||||
f = f .. class_color .. name .. "|r\n"
|
||||
f = f .. class_color .. DetailsRaidCheck:GetOnlyName (name) .. "|r\n"
|
||||
|
||||
amount2 = amount2 + 1
|
||||
end
|
||||
|
||||
end
|
||||
@@ -207,6 +344,7 @@ local food_list = {
|
||||
food_str:SetText (s)
|
||||
flask_str:SetText (f)
|
||||
|
||||
--> used pre pot
|
||||
for player_name, potid in pairs (DetailsRaidCheck.usedprepot_table) do
|
||||
local name, _, icon = _GetSpellInfo (potid)
|
||||
local _, class = _UnitClass (player_name)
|
||||
@@ -216,29 +354,43 @@ local food_list = {
|
||||
class_color = RAID_CLASS_COLORS [class].colorStr
|
||||
end
|
||||
|
||||
p = p .. "|T" .. icon .. ":12:12:0:-5:64:64:0:64:0:64|t |c" .. class_color .. player_name .. "|r\n"
|
||||
p = p .. "|T" .. icon .. ":12:12:0:-5:64:64:0:64:0:64|t |c" .. class_color .. DetailsRaidCheck:GetOnlyName (player_name) .. "|r\n"
|
||||
|
||||
amount3 = amount3 + 1
|
||||
end
|
||||
|
||||
--> not used pre pot
|
||||
for i = 1, GetNumGroupMembers(), 1 do
|
||||
local playerName, realmName = _UnitName ("raid" .. i)
|
||||
if (realmName and realmName ~= "") then
|
||||
playerName = playerName .. "-" .. realmName
|
||||
end
|
||||
|
||||
if (not DetailsRaidCheck.usedprepot_table [playerName]) then
|
||||
local _, class = _UnitClass (playerName)
|
||||
local class_color = "FFFFFFFF"
|
||||
|
||||
if (class) then
|
||||
local coords = CLASS_ICON_TCOORDS [class]
|
||||
class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:-5:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
|
||||
local role = _UnitGroupRolesAssigned ("raid" .. i)
|
||||
|
||||
if (role == "DAMAGER" or (role == "HEALER" and DetailsRaidCheck.db.pre_pot_healers) or (role == "TANK" and DetailsRaidCheck.db.pre_pot_tanks)) then
|
||||
local playerName, realmName = _UnitName ("raid" .. i)
|
||||
if (realmName and realmName ~= "") then
|
||||
playerName = playerName .. "-" .. realmName
|
||||
end
|
||||
|
||||
if (not DetailsRaidCheck.usedprepot_table [playerName]) then
|
||||
local _, class = _UnitClass (playerName)
|
||||
local class_color = "|cFFFFFFFF"
|
||||
|
||||
if (class) then
|
||||
local coords = CLASS_ICON_TCOORDS [class]
|
||||
class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:-5:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
|
||||
end
|
||||
|
||||
n = n .. class_color .. DetailsRaidCheck:GetOnlyName (playerName) .. "|r\n"
|
||||
|
||||
amount4 = amount4 + 1
|
||||
end
|
||||
|
||||
n = n .. class_color .. playerName .. "|r\n"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
prepot_str:SetText (p .. "\n\n" .. n)
|
||||
prepot_str:SetText (p)
|
||||
prepot_str2:SetText (n)
|
||||
|
||||
local bigger = math.max (amount1, amount2, amount3, amount4)
|
||||
show_panel:SetHeight (100 + (bigger * 10))
|
||||
|
||||
end
|
||||
|
||||
@@ -253,6 +405,19 @@ local food_list = {
|
||||
end)
|
||||
|
||||
function DetailsRaidCheck:CheckZone (...)
|
||||
|
||||
if (debugmode) then
|
||||
DetailsRaidCheck:ShowToolbarIcon (DetailsRaidCheck.ToolbarButton, "star")
|
||||
|
||||
DetailsRaidCheck.on_raid = true
|
||||
|
||||
if (not DetailsRaidCheck.in_combat) then
|
||||
DetailsRaidCheck:StartTrackBuffs()
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
zone_type = select (1, ...)
|
||||
|
||||
if (not zone_type) then
|
||||
@@ -261,18 +426,21 @@ local food_list = {
|
||||
|
||||
if (zone_type == "raid") then
|
||||
|
||||
DetailsRaidCheck:ShowToolbarIcon (DetailsRaidCheck.ToolbarButton, "star")
|
||||
|
||||
DetailsRaidCheck.on_raid = true
|
||||
|
||||
if (not DetailsRaidCheck.in_combat) then
|
||||
DetailsRaidCheck:StartTrackBuffs()
|
||||
|
||||
end
|
||||
else
|
||||
|
||||
DetailsRaidCheck:HideToolbarIcon (DetailsRaidCheck.ToolbarButton)
|
||||
|
||||
DetailsRaidCheck.on_raid = false
|
||||
|
||||
if (DetailsRaidCheck.tracking_buffs) then
|
||||
DetailsRaidCheck:StopTrackBuffs()
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -286,21 +454,32 @@ local food_list = {
|
||||
DetailsRaidCheck.havefood_table [player_name] = nil
|
||||
end
|
||||
|
||||
for i = 1, GetNumGroupMembers(), 1 do
|
||||
local name = UnitName ("raid" .. i)
|
||||
local amt_players = GetNumGroupMembers()
|
||||
local with_flask, with_food = 0, 0
|
||||
|
||||
for i = 1, amt_players, 1 do
|
||||
local name = _UnitName ("raid" .. i)
|
||||
for buffIndex = 1, 41 do
|
||||
local bname, _, _, _, _, _, _, _, _, _, spellid = _UnitAura ("raid" .. i, buffIndex, nil, "HELPFUL")
|
||||
|
||||
if (bname and flask_list [spellid]) then
|
||||
DetailsRaidCheck.haveflask_table [name] = true
|
||||
with_flask = with_flask + 1
|
||||
end
|
||||
|
||||
if (bname and food_list [spellid]) then
|
||||
DetailsRaidCheck.havefood_table [name] = true
|
||||
with_food = with_food + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (with_food == amt_players and with_flask == amt_players) then
|
||||
DetailsRaidCheck:SetGreenIcon()
|
||||
else
|
||||
DetailsRaidCheck:SetRedIcon()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- DETAILS_PLUGIN_RAIDCHECK
|
||||
@@ -343,7 +522,7 @@ local food_list = {
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
function DetailsRaidCheck:OnEvent (_, event, ...)
|
||||
|
||||
if (event == "ADDON_LOADED") then
|
||||
@@ -365,7 +544,7 @@ local food_list = {
|
||||
}
|
||||
|
||||
--> install
|
||||
local install, saveddata, is_enabled = _G._detalhes:InstallPlugin ("TOOLBAR", Loc ["STRING_RAIDCHECK_PLUGIN_NAME"], [[Interface\AddOns\Details_RaidCheck\icon]], DetailsRaidCheck, "DETAILS_PLUGIN_RAIDCHECK", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.0", default_settings)
|
||||
local install, saveddata, is_enabled = _G._detalhes:InstallPlugin ("TOOLBAR", Loc ["STRING_RAIDCHECK_PLUGIN_NAME"], [[Interface\AddOns\Details_RaidCheck\icon]], DetailsRaidCheck, "DETAILS_PLUGIN_RAIDCHECK", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", version, default_settings)
|
||||
if (type (install) == "table" and install.error) then
|
||||
return print (install.error)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user