- Less chat spam with debug mode '/de debug'.
- Check auto-hide when entering or leaving Pet Battles.
This commit is contained in:
+8
-20
@@ -730,9 +730,6 @@
|
||||
|
||||
function _detalhes:CheckMemoryAfterCombat()
|
||||
if (_detalhes.next_memory_check < time() and not InCombatLockdown() and not UnitAffectingCombat ("player")) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) checking memory after combat.")
|
||||
end
|
||||
_detalhes.next_memory_check = time()+_detalhes.intervalo_memoria
|
||||
UpdateAddOnMemoryUsage()
|
||||
local memory = GetAddOnMemoryUsage ("Details")
|
||||
@@ -747,12 +744,9 @@
|
||||
UpdateAddOnMemoryUsage()
|
||||
local memory = GetAddOnMemoryUsage ("Details")
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) checking memory periodically. Using: ",math.floor (memory), "of", _detalhes.memory_ram * 1000)
|
||||
_detalhes:Msg ("(debug) checking memory periodically. Using: ",math.floor (memory))
|
||||
end
|
||||
if (memory > _detalhes.memory_ram * 1000) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) Memory is too high, starting garbage collector")
|
||||
end
|
||||
_detalhes:IniciarColetaDeLixo (1, 60) --> sending 1 only check for combat and ignore garbage collect cooldown
|
||||
end
|
||||
end
|
||||
@@ -764,9 +758,6 @@
|
||||
if (_detalhes.ultima_coleta + _detalhes.intervalo_coleta > _detalhes._tempo + 1) then
|
||||
return
|
||||
elseif (_detalhes.in_combat or _InCombatLockdown() or _detalhes:IsInInstance()) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) garbage collect queued due combatlockdown (forced false)")
|
||||
end
|
||||
_detalhes:ScheduleTimer ("IniciarColetaDeLixo", 5)
|
||||
return
|
||||
end
|
||||
@@ -774,9 +765,6 @@
|
||||
if (type (forcar) ~= "boolean") then
|
||||
if (forcar == 1) then
|
||||
if (_detalhes.in_combat or _InCombatLockdown()) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) garbage collect queued due combatlockdown (forced 1)")
|
||||
end
|
||||
_detalhes:ScheduleTimer ("IniciarColetaDeLixo", 5, forcar)
|
||||
return
|
||||
end
|
||||
@@ -824,9 +812,9 @@
|
||||
_detalhes:ManutencaoTimeMachine()
|
||||
|
||||
--> print cache states
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) removed: damage "..damage.." heal "..heal.." energy "..energy.." misc "..misc)
|
||||
end
|
||||
--if (_detalhes.debug) then
|
||||
-- _detalhes:Msg ("(debug) removed: damage "..damage.." heal "..heal.." energy "..energy.." misc "..misc)
|
||||
--end
|
||||
|
||||
--> elimina pets antigos
|
||||
_detalhes:LimparPets()
|
||||
@@ -845,8 +833,8 @@
|
||||
if (_detalhes.debug) then
|
||||
collectgarbage()
|
||||
UpdateAddOnMemoryUsage()
|
||||
local memory2 = GetAddOnMemoryUsage ("Details")
|
||||
_detalhes:Msg ("(debug) memory before: "..memory.." memory after: "..memory2)
|
||||
--local memory2 = GetAddOnMemoryUsage ("Details")
|
||||
--_detalhes:Msg ("(debug) memory before: "..memory.." memory after: "..memory2)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -904,9 +892,9 @@
|
||||
|
||||
end
|
||||
|
||||
if (_detalhes.debug) then
|
||||
--if (_detalhes.debug) then
|
||||
-- _detalhes:Msg ("- garbage collect:", tipo, "actors removed:",_iter.cleaned)
|
||||
end
|
||||
--end
|
||||
|
||||
if (_iter.cleaned > 0) then
|
||||
ReconstroiMapa (_combate [tipo])
|
||||
|
||||
+16
-3
@@ -3308,7 +3308,7 @@
|
||||
end
|
||||
|
||||
for index, instancia in ipairs (_detalhes.tabela_instancias) do
|
||||
if (instancia.ativa) then
|
||||
if (instancia.ativa and instancia.hide_in_combat_type ~= 1) then --> 1 = none, we doesn't need to call
|
||||
instancia:SetCombatAlpha (nil, nil, true)
|
||||
end
|
||||
end
|
||||
@@ -3381,7 +3381,7 @@
|
||||
end
|
||||
|
||||
for index, instancia in ipairs (_detalhes.tabela_instancias) do
|
||||
if (instancia.ativa) then
|
||||
if (instancia.ativa and instancia.hide_in_combat_type ~= 1) then --> 1 = none, we doesn't need to call
|
||||
instancia:SetCombatAlpha (nil, nil, true)
|
||||
end
|
||||
end
|
||||
@@ -3541,6 +3541,9 @@
|
||||
_detalhes.pet_battle = true
|
||||
for index, instance in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (instance.ativa) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug 1) hidding windows for Pet Battle.")
|
||||
end
|
||||
instance:SetWindowAlphaForCombat (true, true)
|
||||
end
|
||||
end
|
||||
@@ -3550,7 +3553,17 @@
|
||||
_detalhes.pet_battle = false
|
||||
for index, instance in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (instance.ativa) then
|
||||
instance:SetCombatAlpha (nil, nil, true)
|
||||
if (instance.hide_in_combat_type == 1) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug 1) restoring windows after Pet Battle.")
|
||||
end
|
||||
instance:SetWindowAlphaForCombat()
|
||||
else
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug 2) restoring windows after Pet Battle.")
|
||||
end
|
||||
instance:SetCombatAlpha (nil, nil, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+1
-1
@@ -359,7 +359,7 @@ local _
|
||||
true, -- [4]
|
||||
true, -- [5]
|
||||
false, -- [6]
|
||||
["space"] = -3,
|
||||
["space"] = -2,
|
||||
["shadow"] = true,
|
||||
},
|
||||
["desaturated_menu"] = false,
|
||||
|
||||
@@ -4768,9 +4768,12 @@ function _detalhes:SetWindowAlphaForInteract (alpha)
|
||||
|
||||
self.baseframe:SetAlpha (alpha)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) setting window alpha for SetWindowAlphaForInteract() -> ", alpha)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function _detalhes:SetWindowAlphaForCombat (entering_in_combat, true_hide)
|
||||
@@ -4822,6 +4825,10 @@ function _detalhes:SetWindowAlphaForCombat (entering_in_combat, true_hide)
|
||||
gump:Fade (self.baseframe, _unpack (_detalhes.windows_fade_in))
|
||||
gump:Fade (self.rowframe, _unpack (_detalhes.windows_fade_in))
|
||||
self:SetIconAlpha (nil, true)
|
||||
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) hiding window SetWindowAlphaForCombat()", amount, rowsamount, menuamount)
|
||||
end
|
||||
else
|
||||
|
||||
self.baseframe:Show()
|
||||
@@ -4831,6 +4838,10 @@ function _detalhes:SetWindowAlphaForCombat (entering_in_combat, true_hide)
|
||||
gump:Fade (self.rowframe, "ALPHAANIM", rowsamount)
|
||||
gump:Fade (self.baseframe, "ALPHAANIM", rowsamount)
|
||||
self:SetIconAlpha (menuamount)
|
||||
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) showing window SetWindowAlphaForCombat()", amount, rowsamount, menuamount)
|
||||
end
|
||||
end
|
||||
|
||||
if (self.show_statusbar) then
|
||||
@@ -6473,7 +6484,6 @@ end
|
||||
function _detalhes:SetCombatAlpha (modify_type, alpha_amount, interacting)
|
||||
|
||||
if (interacting) then
|
||||
|
||||
if (self.hide_in_combat_type == 1) then --None
|
||||
return
|
||||
|
||||
|
||||
@@ -739,7 +739,7 @@ local window_openned_at = time()
|
||||
skin_label:SetPoint ("topleft", window, "topleft", 30, -140)
|
||||
|
||||
-- create second window button
|
||||
local new_window = function (_, _, self)
|
||||
local new_window = function (self)
|
||||
if (#_detalhes.tabela_instancias == 1) then
|
||||
local newwindow = _detalhes:CreateInstance (true)
|
||||
newwindow.baseframe:SetPoint ("topleft", _detalhes.tabela_instancias[1].baseframe, "topright", 50, 0)
|
||||
|
||||
Reference in New Issue
Block a user