- Fixed few bugs when using the key bind to toggle windows.
- Added item level on Raid Check plugin panel.
This commit is contained in:
@@ -417,6 +417,40 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:CheckCoupleWindows (instance1, instance2)
|
||||
instance1 = instance1 or _detalhes:GetInstance (1)
|
||||
instance2 = instance2 or _detalhes:GetInstance (2)
|
||||
|
||||
if (instance1 and instance2 and not instance1.ignore_mass_showhide and not instance1.ignore_mass_showhide) then
|
||||
|
||||
instance1.baseframe:ClearAllPoints()
|
||||
instance2.baseframe:ClearAllPoints()
|
||||
|
||||
instance1:RestoreMainWindowPosition()
|
||||
instance2:RestoreMainWindowPosition()
|
||||
|
||||
instance1:AtualizaPontos()
|
||||
instance2:AtualizaPontos()
|
||||
|
||||
local _R, _T, _L, _B = _detalhes.VPL (instance2, instance1), _detalhes.VPB (instance2, instance1), _detalhes.VPR (instance2, instance1), _detalhes.VPT (instance2, instance1)
|
||||
|
||||
if (_R) then
|
||||
--print ("R")
|
||||
instance2:MakeInstanceGroup ({false, false, 1, false})
|
||||
elseif (_T) then
|
||||
--print ("T")
|
||||
instance2:MakeInstanceGroup ({false, false, false, 1})
|
||||
elseif (_L) then
|
||||
--print ("L")
|
||||
instance2:MakeInstanceGroup ({1, false, false, false})
|
||||
elseif (_B) then
|
||||
--print ("B")
|
||||
instance2:MakeInstanceGroup ({false, 1, false, false})
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function _detalhes:ToggleWindows()
|
||||
|
||||
local instance
|
||||
@@ -435,11 +469,10 @@ end
|
||||
else
|
||||
_detalhes:ReabrirTodasInstancias()
|
||||
|
||||
local instance2 = _detalhes:GetInstance(2)
|
||||
if (instance2) then
|
||||
_detalhes.move_janela_func (instance2.baseframe, true, instance2, true)
|
||||
_detalhes.move_janela_func (instance2.baseframe, false, instance2, true)
|
||||
end
|
||||
local instance1 = _detalhes:GetInstance (1)
|
||||
local instance2 = _detalhes:GetInstance (2)
|
||||
|
||||
_detalhes:CheckCoupleWindows (instance1, instance2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+1
-1
@@ -706,7 +706,7 @@ function _detalhes.ilevel:GetInOrder()
|
||||
local order = {}
|
||||
|
||||
for guid, t in pairs (_detalhes.item_level_pool) do
|
||||
order [#order+1] = {t.name, t.ilvl, t.time}
|
||||
order [#order+1] = {t.name, t.ilvl or 0, t.time}
|
||||
end
|
||||
|
||||
table.sort (order, _detalhes.Sort2)
|
||||
|
||||
+1
-1
@@ -462,7 +462,7 @@
|
||||
--> item level
|
||||
function _detalhes:SentMyItemLevel()
|
||||
local overall, equipped = GetAverageItemLevel()
|
||||
_detalhes:SendRaidData (CONST_ITEMLEVEL_DATA, overall)
|
||||
_detalhes:SendRaidData (CONST_ITEMLEVEL_DATA, equipped)
|
||||
end
|
||||
|
||||
function _detalhes.network.ItemLevel_Received (player, realm, core_version, itemlevel)
|
||||
|
||||
@@ -389,7 +389,7 @@ _detalhes.OnEnterMainWindow = OnEnterMainWindow
|
||||
|
||||
local function VPL (instancia, esta_instancia)
|
||||
--> conferir esquerda
|
||||
if (instancia.ponto4.x < esta_instancia.ponto1.x) then --> a janela esta a esquerda
|
||||
if (instancia.ponto4.x-0.5 < esta_instancia.ponto1.x) then --> a janela esta a esquerda
|
||||
if (instancia.ponto4.x+20 > esta_instancia.ponto1.x) then --> a janela esta a menos de 20 pixels de distância
|
||||
if (instancia.ponto4.y < esta_instancia.ponto1.y + 100 and instancia.ponto4.y > esta_instancia.ponto1.y - 100) then --> a janela esta a +20 ou -20 pixels de distância na vertical
|
||||
return 1
|
||||
@@ -413,7 +413,7 @@ end
|
||||
|
||||
local function VPR (instancia, esta_instancia)
|
||||
--> conferir lateral direita
|
||||
if (instancia.ponto2.x > esta_instancia.ponto3.x) then --> a janela esta a direita
|
||||
if (instancia.ponto2.x+0.5 > esta_instancia.ponto3.x) then --> a janela esta a direita
|
||||
if (instancia.ponto2.x-20 < esta_instancia.ponto3.x) then --> a janela esta a menos de 20 pixels de distância
|
||||
if (instancia.ponto2.y < esta_instancia.ponto3.y + 100 and instancia.ponto2.y > esta_instancia.ponto3.y - 100) then --> a janela esta a +20 ou -20 pixels de distância na vertical
|
||||
return 3
|
||||
@@ -435,6 +435,8 @@ local function VPT (instancia, esta_instancia)
|
||||
return nil
|
||||
end
|
||||
|
||||
_detalhes.VPT, _detalhes.VPR, _detalhes.VPB, _detalhes.VPL = VPT, VPR, VPB, VPL
|
||||
|
||||
local color_red = {1, 0.2, 0.2}
|
||||
local color_green = {0.2, 1, 0.2}
|
||||
|
||||
|
||||
@@ -36,19 +36,29 @@ local food_list = {
|
||||
[175222] = true, --
|
||||
[175223] = true, --
|
||||
|
||||
[180745] = true, --
|
||||
[180746] = true, --
|
||||
[180747] = true, --
|
||||
[180748] = true, --
|
||||
[180749] = true, --
|
||||
[180750] = true, --
|
||||
[180745] = true, --125 crit
|
||||
[180746] = true, --125 versa
|
||||
[180747] = true, --187 stam
|
||||
[180748] = true, --125 haste
|
||||
[180749] = true, --125 multi
|
||||
[180750] = true, --125 mastery
|
||||
|
||||
[180757] = true, --
|
||||
[180758] = true, --
|
||||
[180761] = true, --
|
||||
[180759] = true, --
|
||||
[180762] = true, --
|
||||
[180760] = true, --
|
||||
--the food it self inside the player backback
|
||||
[180757] = true, --125 multi
|
||||
[180758] = true, --125 crit
|
||||
[180761] = true, --125 haste
|
||||
[180759] = true, --125 versa
|
||||
[180762] = true, --125 mastery
|
||||
[180760] = true, --187 stam
|
||||
}
|
||||
|
||||
local best_food = {
|
||||
[180745] = true, --125 crit
|
||||
[180746] = true, --125 versa
|
||||
[180747] = true, --187 stam
|
||||
[180748] = true, --125 haste
|
||||
[180749] = true, --125 multi
|
||||
[180750] = true, --125 mastery
|
||||
}
|
||||
|
||||
local focus_augmentation = 175457
|
||||
@@ -68,7 +78,7 @@ local runes_id = {
|
||||
tinsert (UISpecialFrames, "DetailsRaidCheck")
|
||||
DetailsRaidCheck:SetPluginDescription (Loc ["STRING_RAIDCHECK_PLUGIN_DESC"])
|
||||
|
||||
local version = "v0.4.1"
|
||||
local version = "v0.5"
|
||||
|
||||
local debugmode = false
|
||||
|
||||
@@ -176,7 +186,7 @@ local runes_id = {
|
||||
end
|
||||
|
||||
local show_panel = CreateFrame ("frame", nil, UIParent)
|
||||
show_panel:SetSize (400, 300)
|
||||
show_panel:SetSize (500, 300)
|
||||
show_panel:SetPoint ("bottom", DetailsRaidCheck.ToolbarButton, "top", 0, 10)
|
||||
show_panel:SetBackdrop ({bgFile = [[Interface\Garrison\GarrisonMissionUIInfoBoxBackgroundTile]], tileSize = 256, edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 16, insets = {left = 1, right = 1, top = 1, bottom = 1}})
|
||||
show_panel:SetBackdropColor (1, 1, 1, 0.9)
|
||||
@@ -262,7 +272,7 @@ local runes_id = {
|
||||
|
||||
local prepot_title2 = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
prepot_title2:SetJustifyH ("center")
|
||||
prepot_title2:SetPoint ("topleft", show_panel, "topleft", 315, -20)
|
||||
prepot_title2:SetPoint ("topleft", show_panel, "topleft", 300, -20)
|
||||
prepot_title2:SetText ("No Pre Pot")
|
||||
prepot_title2:SetTextColor (1, 0.8, 0.8)
|
||||
|
||||
@@ -276,12 +286,52 @@ local runes_id = {
|
||||
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)
|
||||
|
||||
--
|
||||
local ilvl_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
ilvl_title:SetJustifyH ("center")
|
||||
ilvl_title:SetPoint ("topleft", show_panel, "topleft", 400, -20)
|
||||
ilvl_title:SetText ("Item LvL")
|
||||
ilvl_title:SetTextColor (0.8, 1, 0.8)
|
||||
|
||||
local ilvl_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
ilvl_str:SetJustifyH ("left")
|
||||
ilvl_str:SetPoint ("topleft", ilvl_title, "topleft", -11, -20)
|
||||
|
||||
local ilvl_image = show_panel:CreateTexture (nil, "artwork")
|
||||
ilvl_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]])
|
||||
ilvl_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024)
|
||||
ilvl_image:SetPoint ("topleft", ilvl_title, "topleft", -11, 3)
|
||||
ilvl_image:SetSize (ilvl_title:GetStringWidth()+22, 19) --208, 48
|
||||
ilvl_image:SetVertexColor (.65, .65, .65)
|
||||
|
||||
--DISABLED
|
||||
local bestfood_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
bestfood_title:SetJustifyH ("center")
|
||||
bestfood_title:SetPoint ("topleft", show_panel, "topleft", 400, -20)
|
||||
bestfood_title:SetText ("125 Food")
|
||||
bestfood_title:SetTextColor (0.8, 1, 0.8)
|
||||
|
||||
local bestfood_str = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
bestfood_str:SetJustifyH ("left")
|
||||
bestfood_str:SetPoint ("topleft", bestfood_title, "topleft", -11, -20)
|
||||
|
||||
local bestfood_image = show_panel:CreateTexture (nil, "artwork")
|
||||
bestfood_image:SetTexture ([[Interface\Garrison\GarrisonMissionUI2]])
|
||||
bestfood_image:SetTexCoord (680/1024, 888/1024, 429/1024, 477/1024)
|
||||
bestfood_image:SetPoint ("topleft", bestfood_title, "topleft", -11, 3)
|
||||
bestfood_image:SetSize (bestfood_title:GetStringWidth()+22, 19) --208, 48
|
||||
bestfood_image:SetVertexColor (.65, .65, .65)
|
||||
|
||||
bestfood_title:Hide()
|
||||
bestfood_str:Hide()
|
||||
bestfood_image:Hide()
|
||||
|
||||
--
|
||||
|
||||
--DISABLED
|
||||
local prepot_title = show_panel:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
|
||||
prepot_title:SetJustifyH ("center")
|
||||
prepot_title:SetPoint ("topleft", show_panel, "topleft", 415, -20)
|
||||
prepot_title:SetPoint ("topleft", show_panel, "topleft", 410, -20)
|
||||
prepot_title:SetText ("Used Pre Pot")
|
||||
prepot_title:SetTextColor (0.8, 1, 0.8)
|
||||
|
||||
@@ -298,7 +348,7 @@ local runes_id = {
|
||||
|
||||
prepot_title:Hide()
|
||||
prepot_str:Hide()
|
||||
prepot_image:Hide()
|
||||
prepot_image:Hide()
|
||||
|
||||
--
|
||||
|
||||
@@ -409,13 +459,59 @@ local runes_id = {
|
||||
|
||||
end)
|
||||
|
||||
local update_panel = function (self)
|
||||
local update_panel = function (self, elapsed)
|
||||
|
||||
if (not IsInRaid()) then
|
||||
return
|
||||
end
|
||||
|
||||
local amount1, amount2, amount3, amount4, amount5 = 0, 0, 0, 0, 0
|
||||
local amount1, amount2, amount3, amount4, amount5, amount6, amount7 = 0, 0, 0, 0, 0, 0, 0
|
||||
|
||||
--item lvl
|
||||
self.one_second = self.one_second + elapsed
|
||||
if (self.one_second > 5) then
|
||||
self.one_second = 0
|
||||
local ilvl = ""
|
||||
for _, ilvl_char in ipairs (_detalhes.ilevel:GetInOrder()) do
|
||||
local _, class = _UnitClass (ilvl_char [1])
|
||||
|
||||
if (class) then
|
||||
local coords = CLASS_ICON_TCOORDS [class]
|
||||
local 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
|
||||
|
||||
ilvl = ilvl .. class_color .. DetailsRaidCheck:GetOnlyName (ilvl_char [1]) .. "|r: " .. floor (ilvl_char[2]) .. "\n"
|
||||
amount7 = amount7 + 1
|
||||
end
|
||||
end
|
||||
|
||||
self.last_ilvl_amount = amount7
|
||||
ilvl_str:SetText (ilvl)
|
||||
else
|
||||
amount7 = self.last_ilvl_amount or 0
|
||||
end
|
||||
--t.name, t.ilvl, t.time
|
||||
|
||||
--best food
|
||||
local b = ""
|
||||
for name, foodid in pairs (DetailsRaidCheck.havefood_table) do
|
||||
if (best_food [foodid]) then
|
||||
--print (name, foodid, best_food [foodid], type (foodid))
|
||||
local _, class = _UnitClass (name)
|
||||
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
|
||||
end
|
||||
|
||||
b = b .. class_color .. DetailsRaidCheck:GetOnlyName (name) .. "|r\n"
|
||||
|
||||
amount6 = amount6 + 1
|
||||
end
|
||||
end
|
||||
bestfood_str:SetText (b)
|
||||
|
||||
--food
|
||||
local s, f, p, n = "", "", "", ""
|
||||
|
||||
local amt = GetNumGroupMembers()
|
||||
@@ -543,13 +639,14 @@ local runes_id = {
|
||||
|
||||
focus_aug2:SetText (n)
|
||||
|
||||
local bigger = math.max (amount1, amount2, amount3, amount4, amount5)
|
||||
local bigger = math.max (amount1, amount2, amount3, amount4, amount5, amount6)
|
||||
show_panel:SetHeight (100 + (bigger * 10))
|
||||
|
||||
end
|
||||
|
||||
DetailsRaidCheck.ToolbarButton:SetScript ("OnEnter", function (self)
|
||||
show_panel:Show()
|
||||
show_panel.one_second = 6
|
||||
show_panel:SetScript ("OnUpdate", update_panel)
|
||||
end)
|
||||
|
||||
@@ -620,17 +717,17 @@ local runes_id = {
|
||||
local bname, _, _, _, _, _, _, _, _, _, spellid = _UnitAura ("raid" .. i, buffIndex, nil, "HELPFUL")
|
||||
|
||||
if (bname and flask_list [spellid]) then
|
||||
DetailsRaidCheck.haveflask_table [name] = true
|
||||
DetailsRaidCheck.haveflask_table [name] = spellid
|
||||
with_flask = with_flask + 1
|
||||
end
|
||||
|
||||
if (bname and food_list [spellid]) then
|
||||
DetailsRaidCheck.havefood_table [name] = true
|
||||
DetailsRaidCheck.havefood_table [name] = spellid
|
||||
with_food = with_food + 1
|
||||
end
|
||||
|
||||
if (bname and runes_id [spellid]) then
|
||||
DetailsRaidCheck.havefocusaug_table [name] = true
|
||||
DetailsRaidCheck.havefocusaug_table [name] = spellid
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -491,6 +491,13 @@ function _G._detalhes:Start()
|
||||
--boss mobs callbacks
|
||||
_detalhes:ScheduleTimer ("BossModsLink", 5)
|
||||
|
||||
local now = time()
|
||||
for guid, t in pairs (_detalhes.item_level_pool) do
|
||||
if (t.time+3600 < now) then
|
||||
_detalhes.item_level_pool [guid] = nil
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
function _detalhes:TestResize()
|
||||
_detalhes:OpenNewsWindow ("TESTE, |TInterface\\AddOns\\Details\\images\\key_shift:20:40:0:0:64:64:0:64:0:40|t")
|
||||
|
||||
Reference in New Issue
Block a user