- 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:
tercio
2014-12-19 22:47:02 -02:00
parent e70b25602e
commit 7c5a420349
12 changed files with 404 additions and 53 deletions
+6 -3
View File
File diff suppressed because one or more lines are too long
+7
View File
@@ -17,6 +17,7 @@
local _table_remove = table.remove -- lua local
local _rawget = rawget
local _math_max = math.max
local _math_floor = math.floor
local _GetTime = GetTime
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -106,6 +107,12 @@
end
--return the combat time in seconds
function combate:GetFormatedCombatTime()
local time = self:GetCombatTime()
local m, s = _math_floor (time/60), _math_floor (time%60)
return m, s
end
function combate:GetCombatTime()
if (self.end_time) then
return _math_max (self.end_time - self.start_time, 0.1)
+1
View File
@@ -1473,6 +1473,7 @@ end
if (not actor.powertype) then
--print ("actor without powertype", actor.nome, actor.powertype)
actor.powertype = 1
end
shadow.powertype = actor.powertype
+17 -1
View File
@@ -23,7 +23,7 @@
if (PluginAbsoluteName) then
local plugin = _detalhes.plugin_database [PluginAbsoluteName]
if (plugin) then
return plugin.__enabled
return plugin.enabled
end
else
return self.__enabled
@@ -37,6 +37,22 @@
return self.__description
end
function _detalhes:DisablePlugin (AbsoluteName)
local plugin = _detalhes:GetPlugin (AbsoluteName)
if (plugin) then
local saved_table = _detalhes:GetPluginSavedTable (AbsoluteName)
saved_table.enabled = false
plugin.__enabled = false
_detalhes:SendEvent ("PLUGIN_DISABLED", plugin)
_detalhes:DelayOptionsRefresh()
return true
end
end
function _detalhes:CheckDefaultTable (current, default)
for key, value in pairs (default) do
if (type (value) == "table") then
+137 -8
View File
@@ -9,11 +9,14 @@
local _math_floor = math.floor --lua local
local _cstr = string.format --lua local
local _UnitClass = UnitClass
local gump = _detalhes.gump --details local
local _GetSpellInfo = _detalhes.getspellinfo --details api
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> constants
@@ -273,8 +276,10 @@
-- add canal self pras mortes tbm?
if (who_name == _detalhes.playername) then -- and _detalhes.announce_interrupts.enabled
local channel = _detalhes.announce_interrupts.channel
local channel = _detalhes.announce_interrupts.channel
if (channel ~= "PRINT" and who_name == _detalhes.playername) then
local next = _detalhes.announce_interrupts.next
local custom = _detalhes.announce_interrupts.custom
@@ -314,18 +319,61 @@
_detalhes:SendMsgToChannel (msg, channel, _detalhes.announce_interrupts.whisper)
end
elseif (channel == "PRINT") then
local custom = _detalhes.announce_interrupts.custom
local spellname
if (spellid > 10) then
spellname = GetSpellLink (extraSpellID)
else
spellname = _GetSpellInfo (extraSpellID)
end
if (custom ~= "") then
custom = custom:gsub ("{spell}", spellname)
custom = custom:gsub ("{next}", who_name)
_detalhes:SendMsgToChannel (custom, "PRINT")
else
local minute, second = _detalhes:GetCombat():GetFormatedCombatTime()
local _, class = _UnitClass (who_name)
local class_color = "|cFFFF3333"
if (class) then
local coords = CLASS_ICON_TCOORDS [class]
class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
end
if (second < 10) then
second = "0" .. second
end
local msg = "|cFFFFFF00[|r".. minute .. ":" .. second .. "|cFFFFFF00]|r Interrupt: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName (who_name) .. "|r)"
_detalhes:SendMsgToChannel (msg, "PRINT")
end
end
end
local ignored_self_cooldowns = {
[119582] = true, -- Purifying Brew
[115308] = true, --Elusive Brew
[115203 ] = true, --Fortifying Brew
}
function _detalhes:cooldown_announcer (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname)
if (who_name == _detalhes.playername) then -- and _detalhes.announce_cooldowns.enabled
local channel = _detalhes.announce_cooldowns.channel
if (channel ~= "PRINT" and who_name == _detalhes.playername) then
local ignored = _detalhes.announce_cooldowns.ignored_cooldowns
if (ignored [spellid]) then
return
end
local channel = _detalhes.announce_cooldowns.channel
if (channel == "WHISPER") then
if (alvo_name == Loc ["STRING_RAID_WIDE"]) then
channel = "RAID"
@@ -373,11 +421,63 @@
_detalhes:SendMsgToChannel (msg, channel, _detalhes.announce_interrupts.whisper)
end
elseif (channel == "PRINT") then
local ignored = _detalhes.announce_cooldowns.ignored_cooldowns
if (ignored [spellid]) then
return
end
if (ignored_self_cooldowns [spellid]) then
return
end
if (who_name == alvo_name and who_name ~= _detalhes.playername) then
return
end
local msg
local minute, second = _detalhes:GetCombat():GetFormatedCombatTime()
local _, class = _UnitClass (who_name)
local class_color = "|cFFFFFFFF"
local _, class2 = _UnitClass (alvo_name)
local class_color2 = "|cFFFFFFFF"
if (class) then
local coords = CLASS_ICON_TCOORDS [class]
class_color = "|TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
end
if (class2) then
local coords = CLASS_ICON_TCOORDS [class2]
class_color2 = " -> |TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class2].colorStr
alvo_name = _detalhes:GetOnlyName (alvo_name)
else
alvo_name = ""
end
local spellname
if (spellid > 10) then
spellname = GetSpellLink (spellid)
else
spellname = _GetSpellInfo (spellid)
end
if (second < 10) then
second = "0" .. second
end
msg = "|cFF8F8FFF[|r".. minute .. ":" .. second .. "|cFF8F8FFF]|r Cooldown: " .. spellname .. " (" .. class_color .. _detalhes:GetOnlyName (who_name) .. "|r" .. class_color2 .. alvo_name .. "|r)"
_detalhes:SendMsgToChannel (msg, "PRINT")
end
end
function _detalhes:death_announcer (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, death_table, last_cooldown, death_at, max_health)
local where = _detalhes.announce_deaths.where
local zone = _detalhes:GetZoneType()
local channel = ""
@@ -413,6 +513,13 @@
if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then
channel = "INSTANCE_CHAT"
end
elseif (where == 4) then --> observer
if (zone ~= "raid" and zone ~= "party") then
return
end
channel = "PRINT"
end
local only_first = _detalhes.announce_deaths.only_first
@@ -426,7 +533,20 @@
alvo_name = _detalhes:GetOnlyName (alvo_name)
local msg = _cstr (Loc ["STRING_OPTIONS_RT_DEATH_MSG"], alvo_name) .. ":"
local msg
if (where == 4) then --> observer
local _, class = _UnitClass (alvo_name)
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:0:128:128:" .. coords[1]*128 .. ":" .. coords[2]*128 .. ":" .. coords[3]*128 .. ":" .. coords[4]*128 .. "|t |c" .. RAID_CLASS_COLORS [class].colorStr
end
msg = "Death: " .. class_color .. alvo_name .. "|r ->"
else
msg = _cstr (Loc ["STRING_OPTIONS_RT_DEATH_MSG"], alvo_name) .. ":"
end
local spells = ""
local last = #death_table
@@ -448,6 +568,15 @@
end
msg = msg .. " " .. spells
if (where == 4) then --> observer
local minute, second = _detalhes:GetCombat():GetFormatedCombatTime()
if (second < 10) then
second = "0" .. second
end
msg = "|cFFFF8800[|r".. minute .. ":" .. second .. "|cFFFF8800]|r " .. msg
end
_detalhes:SendMsgToChannel (msg, channel)
end
+1 -1
View File
@@ -513,7 +513,7 @@ local _
overlay = {1, 1, 1},
width = 256,
texcoord = {49/1024, 305/1024, 646/1024, 774/1024},
enabled = true,
enabled = false,
anchor = "all",
height = 128,
alpha = 0.8,
+18 -2
View File
@@ -7502,6 +7502,7 @@ function window:CreateFrame11()
end
local channel_list = {
{value = "PRINT", icon = [[Interface\LFGFRAME\BattlenetWorking2]], iconsize = {14, 14}, iconcolor = {1, 1, 1, 1}, texcoord = {12/64, 53/64, 11/64, 53/64}, label = Loc ["STRING_CHANNEL_PRINT"], onclick = on_select_channel},
{value = "SAY", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconsize = {14, 14}, texcoord = {0.0390625, 0.203125, 0.09375, 0.375}, label = Loc ["STRING_CHANNEL_SAY"], onclick = on_select_channel},
{value = "YELL", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconsize = {14, 14}, texcoord = {0.0390625, 0.203125, 0.09375, 0.375}, iconcolor = {1, 0.3, 0, 1}, label = Loc ["STRING_CHANNEL_YELL"], onclick = on_select_channel},
{value = "RAID", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 0}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_INSTANCE_CHAT"], onclick = on_select_channel},
@@ -7603,6 +7604,7 @@ function window:CreateFrame11()
end
local channel_list = {
{value = "PRINT", icon = [[Interface\LFGFRAME\BattlenetWorking2]], iconsize = {14, 14}, iconcolor = {1, 1, 1, 1}, texcoord = {12/64, 53/64, 11/64, 53/64}, label = Loc ["STRING_CHANNEL_PRINT"], onclick = on_select_channel},
{value = "SAY", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconsize = {14, 14}, texcoord = {0.0390625, 0.203125, 0.09375, 0.375}, label = Loc ["STRING_CHANNEL_SAY"], onclick = on_select_channel},
{value = "YELL", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconsize = {14, 14}, texcoord = {0.0390625, 0.203125, 0.09375, 0.375}, iconcolor = {1, 0.3, 0, 1}, label = Loc ["STRING_CHANNEL_YELL"], onclick = on_select_channel},
{value = "RAID", icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 0}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_INSTANCE_CHAT"], onclick = on_select_channel},
@@ -7811,20 +7813,21 @@ function window:CreateFrame11()
--dropdown para WHERE onde anunciar se só em raid e party
local on_select_channel = function (self, _, channel)
_detalhes.announce_deaths.channel = channel
_detalhes.announce_deaths.where = channel
end
local channel_list = {
{value = 1, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0, 1}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE1"], onclick = on_select_channel},
{value = 2, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {1, 0.49, 0}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE2"], onclick = on_select_channel},
{value = 3, icon = [[Interface\FriendsFrame\UI-Toast-ToastIcons]], iconcolor = {0.66, 0.65, 1}, iconsize = {14, 14}, texcoord = {0.53125, 0.7265625, 0.078125, 0.40625}, label = Loc ["STRING_OPTIONS_RT_DEATHS_WHERE3"], onclick = on_select_channel},
{value = 4, icon = [[Interface\LFGFRAME\BattlenetWorking2]], iconsize = {14, 14}, iconcolor = {1, 1, 1, 1}, texcoord = {12/64, 53/64, 11/64, 53/64}, label = Loc ["STRING_CHANNEL_PRINT"], onclick = on_select_channel},
}
local build_channel_menu = function()
return channel_list
end
g:NewLabel (frame11, _, "$parentDeathChannelLabel", "DeathChannelLabel", Loc ["STRING_OPTIONS_RT_DEATHS_WHERE"] , "GameFontHighlightLeft")
local d = g:NewDropDown (frame11, _, "$parentDeathChannelDropdown", "DeathChannelDropdown", DROPDOWN_WIDTH, 20, build_channel_menu, _detalhes.announce_deaths.channel)
local d = g:NewDropDown (frame11, _, "$parentDeathChannelDropdown", "DeathChannelDropdown", DROPDOWN_WIDTH, 20, build_channel_menu, _detalhes.announce_deaths.where)
d.onenter_backdrop = dropdown_backdrop_onenter
d.onleave_backdrop = dropdown_backdrop_onleave
d:SetBackdrop (dropdown_backdrop)
@@ -7910,6 +7913,7 @@ function window:CreateFrame12()
-------- plugins
local frame4 = window.options [12][1].gump
window.plugin_widgets = {}
local on_enter = function (self)
@@ -8005,6 +8009,8 @@ function window:CreateFrame12()
local plugin_stable = _detalhes:GetPluginSavedTable (absName)
local plugin = _detalhes:GetPlugin (absName)
g:NewSwitch (bframe, _, "$parentToolbarSlider"..i, "toolbarPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled)
bframe ["toolbarPluginsSlider"..i].PluginName = absName
tinsert (window.plugin_widgets, bframe ["toolbarPluginsSlider"..i])
bframe ["toolbarPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 400, y+1)
bframe ["toolbarPluginsSlider"..i].OnSwitch = function (self, _, value)
plugin_stable.enabled = value
@@ -8087,6 +8093,8 @@ function window:CreateFrame12()
local plugin_stable = _detalhes:GetPluginSavedTable (absName)
local plugin = _detalhes:GetPlugin (absName)
g:NewSwitch (bframe, _, "$parentRaidSlider"..i, "raidPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled)
tinsert (window.plugin_widgets, bframe ["raidPluginsSlider"..i])
bframe ["raidPluginsSlider"..i].PluginName = absName
bframe ["raidPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 400, y+1)
bframe ["raidPluginsSlider"..i].OnSwitch = function (self, _, value)
plugin_stable.enabled = value
@@ -8170,6 +8178,8 @@ function window:CreateFrame12()
local plugin_stable = _detalhes:GetPluginSavedTable (absName)
local plugin = _detalhes:GetPlugin (absName)
g:NewSwitch (bframe, _, "$parentSoloSlider"..i, "soloPluginsSlider"..i, 60, 20, _, _, plugin_stable.enabled)
tinsert (window.plugin_widgets, bframe ["soloPluginsSlider"..i])
bframe ["soloPluginsSlider"..i].PluginName = absName
bframe ["soloPluginsSlider"..i]:SetPoint ("topleft", frame4, "topleft", 400, y+1)
bframe ["soloPluginsSlider"..i].OnSwitch = function (self, _, value)
plugin_stable.enabled = value
@@ -8572,6 +8582,12 @@ end --> if not window
--> window 11
--> window 12
for _, slider in ipairs (window.plugin_widgets) do
local plugin_stable = _detalhes:GetPluginSavedTable (slider.PluginName)
slider:SetValue (plugin_stable.enabled)
end
--> window 13
_G.DetailsOptionsWindow13SelectProfileDropdown.MyObject:Select (_detalhes:GetCurrentProfileName())
+217 -38
View File
@@ -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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.