- Second pass on Patch 8.0.1

This commit is contained in:
Tercio
2018-07-17 13:31:22 -03:00
parent df9ce12b82
commit dba05908ec
96 changed files with 2018 additions and 2006 deletions
+49 -49
View File
@@ -99,16 +99,16 @@ function _detalhes:InstanceCall (funcao, ...)
end
end
--> chama a função para ser executada em todas as instâncias (internal)
--> chama a funo para ser executada em todas as instncias (internal)
function _detalhes:InstanciaCallFunction (funcao, ...)
for index, instancia in _ipairs (_detalhes.tabela_instancias) do
if (instancia:IsAtiva()) then --> só reabre se ela estiver ativa
if (instancia:IsAtiva()) then --> s reabre se ela estiver ativa
funcao (_, instancia, ...)
end
end
end
--> chama a função para ser executada em todas as instâncias (internal)
--> chama a funo para ser executada em todas as instncias (internal)
function _detalhes:InstanciaCallFunctionOffline (funcao, ...)
for index, instancia in _ipairs (_detalhes.tabela_instancias) do
funcao (_, instancia, ...)
@@ -277,7 +277,7 @@ end
------------------------------------------------------------------------------------------------------------------------
--> retorna se a instância esta ou não ativa
--> retorna se a instncia esta ou no ativa
function _detalhes:IsAtiva()
return self.ativa
end
@@ -341,7 +341,7 @@ end
end
--> desativando a instância ela fica em stand by e apenas hida a janela ~shutdown ~close ~fechar
--> desativando a instncia ela fica em stand by e apenas hida a janela ~shutdown ~close ~fechar
function _detalhes:DesativarInstancia()
local lower = _detalhes:GetLowerInstanceNumber()
@@ -351,7 +351,7 @@ end
if (lower == self.meu_id) then
--> os icones dos plugins estao hostiados nessa instancia.
_detalhes.ToolBar:ReorganizeIcons (true) --não precisa recarregar toda a skin
_detalhes.ToolBar:ReorganizeIcons (true) --no precisa recarregar toda a skin
end
if (_detalhes.switch.current_instancia and _detalhes.switch.current_instancia == self) then
@@ -551,7 +551,7 @@ end
if (lower == self.meu_id) then
--> os icones dos plugins precisam ser hostiados nessa instancia.
_detalhes.ToolBar:ReorganizeIcons (true) --> não precisa recarregar toda a skin
_detalhes.ToolBar:ReorganizeIcons (true) --> no precisa recarregar toda a skin
end
if (not self.iniciada) then
@@ -622,13 +622,13 @@ end
end
------------------------------------------------------------------------------------------------------------------------
--> apaga de vez um instância
--> apaga de vez um instncia
function _detalhes:ApagarInstancia (ID)
return _table_remove (_detalhes.tabela_instancias, ID)
end
------------------------------------------------------------------------------------------------------------------------
--> retorna quantas instância há no momento
--> retorna quantas instncia h no momento
function _detalhes:GetNumInstancesAmount()
return #_detalhes.tabela_instancias
end
@@ -684,7 +684,7 @@ end
------------------------------------------------------------------------------------------------------------------------
--> cria uma nova instância e a joga para o container de instâncias
--> cria uma nova instncia e a joga para o container de instncias
function _detalhes:CreateInstance (id)
return _detalhes:CriarInstancia (_, id)
@@ -722,7 +722,7 @@ end
new_instance:ChangeSkin()
else
--> se não tiver um padrão, criar de outra instância já aberta.
--> se no tiver um padro, criar de outra instncia j aberta.
local copy_from
for i = 1, next_id-1 do
local opened_instance = _detalhes:GetInstance (i)
@@ -757,7 +757,7 @@ end
end
end
--> antes de criar uma nova, ver se não há alguma para reativar
--> antes de criar uma nova, ver se no h alguma para reativar
for index, instancia in _ipairs (_detalhes.tabela_instancias) do
if (not instancia:IsAtiva()) then
instancia:AtivarInstancia()
@@ -769,7 +769,7 @@ end
return _detalhes:Msg (Loc ["STRING_INSTANCE_LIMIT"])
end
--> verifica se não tem uma janela na pool de janelas fechadas
--> verifica se no tem uma janela na pool de janelas fechadas
local next_id = #_detalhes.tabela_instancias+1
if (_detalhes.unused_instances [next_id]) then
@@ -796,7 +796,7 @@ end
end
------------------------------------------------------------------------------------------------------------------------
--> self é a instância que esta sendo movida.. instancia é a que esta parada
--> self a instncia que esta sendo movida.. instancia a que esta parada
function _detalhes:EstaAgrupada (esta_instancia, lado) --> lado //// 1 = encostou na esquerda // 2 = escostou emaixo // 3 = encostou na direita // 4 = encostou em cima
--local meu_snap = self.snap --> pegou a tabela com {side, side, side, side}
@@ -820,7 +820,7 @@ function _detalhes:EstaAgrupada (esta_instancia, lado) --> lado //// 1 = encosto
end
end
return false --> do contrário retorna false
return false --> do contrrio retorna false
end
function _detalhes:BaseFrameSnap()
@@ -870,7 +870,7 @@ function _detalhes:BaseFrameSnap()
--[
--> aqui precisa de um efeito reverso
local reverso = self.meu_id - 2 --> se existir
if (reverso > 0) then --> se tiver uma instância lá trás
if (reverso > 0) then --> se tiver uma instncia l trs
--> aqui faz o efeito reverso:
local inicio_retro = self.meu_id - 1
for meu_id = inicio_retro, 1, -1 do
@@ -878,7 +878,7 @@ function _detalhes:BaseFrameSnap()
for lado, snap_to in _pairs (instancia.snap) do
if (snap_to < instancia.meu_id and snap_to ~= self.meu_id) then --> se o lado que esta grudado for menor que o meu id... EX instnacia #2 grudada na #1
--> então tenho que pegar a instância do snap
--> ento tenho que pegar a instncia do snap
local instancia_alvo = _detalhes.tabela_instancias [snap_to]
local lado_reverso
@@ -1078,12 +1078,12 @@ function _detalhes:Desagrupar (instancia, lado, lado2)
lado = lado2
end
if (self.meu_id and not lado2) then --> significa que self é uma instancia
if (self.meu_id and not lado2) then --> significa que self uma instancia
lado = instancia
instancia = self
end
if (_type (instancia) == "number") then --> significa que passou o número da instância
if (_type (instancia) == "number") then --> significa que passou o nmero da instncia
instancia = _detalhes.tabela_instancias [instancia]
end
@@ -1093,7 +1093,7 @@ function _detalhes:Desagrupar (instancia, lado, lado2)
return
end
if (lado < 0) then --> clicou no botão para desagrupar tudo
if (lado < 0) then --> clicou no boto para desagrupar tudo
local ID = instancia.meu_id
for id, esta_instancia in _ipairs (_detalhes.tabela_instancias) do
@@ -1114,7 +1114,7 @@ function _detalhes:Desagrupar (instancia, lado, lado2)
end
end
if (index == 2) then -- index é o codigo do snap
if (index == 2) then -- index o codigo do snap
--esta_instancia.baseframe.rodape.StatusBarLeftAnchor:SetPoint ("left", esta_instancia.baseframe.rodape.top_bg, "left", 5, 58)
--esta_instancia.baseframe.rodape.StatusBarCenterAnchor:SetPoint ("center", esta_instancia.baseframe.rodape.top_bg, "center", 0, 58)
--esta_instancia.baseframe.rodape.esquerdo:SetTexture ("Interface\\AddOns\\Details\\images\\bar_down_left")
@@ -1178,7 +1178,7 @@ function _detalhes:SnapTextures (remove)
end
end
--> cria uma janela para uma nova instância
--> cria uma janela para uma nova instncia
--> search key: ~new ~nova
function _detalhes:CreateDisabledInstance (ID, skin_table)
@@ -1204,9 +1204,9 @@ end
--> instance id
meu_id = ID,
--> internal stuff
barras = {}, --container que irá armazenar todas as barras
barraS = {nil, nil}, --de x até x são as barras que estão sendo mostradas na tela
rolagem = false, --barra de rolagem não esta sendo mostrada
barras = {}, --container que ir armazenar todas as barras
barraS = {nil, nil}, --de x at x so as barras que esto sendo mostradas na tela
rolagem = false, --barra de rolagem no esta sendo mostrada
largura_scroll = 26,
bar_mod = 0,
bgdisplay_loc = 0,
@@ -1258,7 +1258,7 @@ end
--> setup default wallpaper
new_instance.wallpaper.texture = "Interface\\AddOns\\Details\\images\\background"
--[[ 7.1.5 isn't sending the background on the 5º return value ~cleanup
--[[ 7.1.5 isn't sending the background on the 5 return value ~cleanup
local spec = GetSpecialization()
if (spec) then
local id, name, description, icon, _background, role = GetSpecializationInfo (spec)
@@ -1289,7 +1289,7 @@ end
new_instance:ResetInstanceConfig()
--> setup default wallpaper
new_instance.wallpaper.texture = "Interface\\AddOns\\Details\\images\\background"
--[[ 7.1.5 isn't sending the background on the 5º return value ~cleanup
--[[ 7.1.5 isn't sending the background on the 5 return value ~cleanup
local spec = GetSpecialization()
if (spec) then
local id, name, description, icon, _background, role = GetSpecializationInfo (spec)
@@ -1303,9 +1303,9 @@ end
end
--]]
--> internal stuff
new_instance.barras = {} --container que irá armazenar todas as barras
new_instance.barraS = {nil, nil} --de x até x são as barras que estão sendo mostradas na tela
new_instance.rolagem = false --barra de rolagem não esta sendo mostrada
new_instance.barras = {} --container que ir armazenar todas as barras
new_instance.barraS = {nil, nil} --de x at x so as barras que esto sendo mostradas na tela
new_instance.rolagem = false --barra de rolagem no esta sendo mostrada
new_instance.largura_scroll = 26
new_instance.bar_mod = 0
new_instance.bgdisplay_loc = 0
@@ -1423,7 +1423,7 @@ end
--instance:ToolbarMenuButtons()
end
--> ao reiniciar o addon esta função é rodada para recriar a janela da instância
--> ao reiniciar o addon esta funo rodada para recriar a janela da instncia
--> search key: ~restaura ~inicio ~start
function _detalhes:RestauraJanela (index, temp, load_only)
@@ -1460,7 +1460,7 @@ function _detalhes:RestauraJanela (index, temp, load_only)
self.alturaAntiga = _baseframe:GetHeight()
--> change the attribute
_detalhes:TrocaTabela (self, self.segmento, self.atributo, self.sub_atributo, true) --> passando true no 5º valor para a função ignorar a checagem de valores iguais
_detalhes:TrocaTabela (self, self.segmento, self.atributo, self.sub_atributo, true) --> passando true no 5 valor para a funo ignorar a checagem de valores iguais
--> set wallpaper
if (self.wallpaper.enabled) then
@@ -1505,7 +1505,7 @@ function _detalhes:RestauraJanela (index, temp, load_only)
--> load mode
if (self.modo == modo_alone) then
if (_detalhes.solo and _detalhes.solo ~= self.meu_id) then --> proteção para ter apenas uma instância com a janela SOLO
if (_detalhes.solo and _detalhes.solo ~= self.meu_id) then --> proteo para ter apenas uma instncia com a janela SOLO
self.modo = modo_grupo
self.mostrando = "normal"
else
@@ -1979,7 +1979,7 @@ end
function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico)
if (instancia.freezed) then
return --> se esta congelada não tem o que fazer
return --> se esta congelada no tem o que fazer
end
local segmento = instancia.segmento
@@ -1987,7 +1987,7 @@ function _detalhes:AtualizaSegmentos_AfterCombat (instancia, historico)
local _fadeType, _fadeSpeed = _unpack (_detalhes.row_fade_in)
if (segmento == _detalhes.segments_amount) then --> significa que o index [5] passou a ser [6] com a entrada da nova tabela
instancia.showing = historico.tabelas [_detalhes.segments_amount] --> então ele volta a pegar o index [5] que antes era o index [4]
instancia.showing = historico.tabelas [_detalhes.segments_amount] --> ento ele volta a pegar o index [5] que antes era o index [4]
--print ("==> Changing the Segment now! - classe_instancia.lua 1942")
gump:Fade (instancia, _fadeType, _fadeSpeed, "barras")
instancia.showing[instancia.atributo].need_refresh = true
@@ -2046,7 +2046,7 @@ end
function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, iniciando_instancia, InstanceMode)
if (self and self.meu_id and not instancia) then --> self é uma instância
if (self and self.meu_id and not instancia) then --> self uma instncia
InstanceMode = iniciando_instancia
iniciando_instancia = sub_atributo
sub_atributo = atributo
@@ -2112,7 +2112,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
local atributo_changed = false
--> verifica se os valores passados são válidos
--> verifica se os valores passados so vlidos
if (not segmento) then
segmento = instancia.segmento
@@ -2136,7 +2136,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
sub_atributo = instancia.sub_atributo
end
--> já esta mostrando isso que esta pedindo
--> j esta mostrando isso que esta pedindo
if (not iniciando_instancia and segmento == current_segmento and atributo == current_atributo and sub_atributo == current_sub_atributo and not _detalhes.initializing) then
return
end
@@ -2147,7 +2147,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
_detalhes:Msg ("invalid attribute, switching to damage done.")
end
--> Muda o segmento caso necessário
--> Muda o segmento caso necessrio
if (segmento ~= current_segmento or _detalhes.initializing or iniciando_instancia) then
--> na troca de segmento, conferir se a instancia esta frozen
@@ -2166,7 +2166,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
elseif (segmento == 0) then --> combate atual
instancia.showing = _detalhes.tabela_vigente
--print ("==> Changing the Segment now! - classe_instancia.lua 2115")
else --> alguma tabela do histórico
else --> alguma tabela do histrico
instancia.showing = _detalhes.tabela_historico.tabelas [segmento]
end
@@ -2199,7 +2199,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
instance.showing = _detalhes.tabela_overall
elseif (segmento == 0) then --> combate atual
instance.showing = _detalhes.tabela_vigente; --print ("==> Changing the Segment now! - classe_instancia.lua 2148")
else --> alguma tabela do histórico
else --> alguma tabela do histrico
instance.showing = _detalhes.tabela_historico.tabelas [segmento]
end
@@ -2226,7 +2226,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
end
--> Muda o atributo caso necessário
--> Muda o atributo caso necessrio
if (atributo == 5) then
if (#_detalhes.custom < 1) then
atributo = 1
@@ -2247,7 +2247,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
return _detalhes.SoloTables.switch (nil, nil, -1)
elseif ( (instancia.modo == modo_raid) and not (_detalhes.initializing or iniciando_instancia) ) then --> raid
return --nao faz nada quando clicar no botão
return --nao faz nada quando clicar no boto
end
atributo_changed = true
@@ -2617,7 +2617,7 @@ function _detalhes:ChangeIcon (icon)
self.baseframe.cabecalho.atributo_icon:SetPoint ("TOPRIGHT", self.baseframe.cabecalho.ball_point, "TOPRIGHT", icon_anchor[1], icon_anchor[2])
elseif (self.modo == modo_alone) then --> solo
-- o icone é alterado pelo próprio plugin
-- o icone alterado pelo prprio plugin
elseif (self.modo == modo_grupo or self.modo == modo_all) then --> grupo
@@ -2669,7 +2669,7 @@ function _detalhes:ChangeIcon (icon)
end
elseif (self.modo == modo_raid) then --> raid
-- o icone é alterado pelo próprio plugin
-- o icone alterado pelo prprio plugin
end
end
@@ -2837,7 +2837,7 @@ local function GetDpsHps (_thisActor, key)
_thisActor [keyname] = dps --salva o dps dele
return dps
else
if (_thisActor [keyname] == 0) then --> não calculou o dps dele ainda mas entrou em standby
if (_thisActor [keyname] == 0) then --> no calculou o dps dele ainda mas entrou em standby
local dps = _thisActor.total/_thisActor:Tempo()
_thisActor [keyname] = dps
return dps
@@ -2947,13 +2947,13 @@ local report_build_line = function (i, v1, v2)
return v1 .. " " .. v2
end
--> Reportar o que esta na janela da instância
--> Reportar o que esta na janela da instncia
function _detalhes:monta_relatorio (este_relatorio, custom)
if (custom) then
--> shrink
local report_lines = {}
for i = 1, _detalhes.report_lines+1, 1 do --#este_relatorio -- o +1 é pq ele conta o cabeçalho como uma linha
for i = 1, _detalhes.report_lines+1, 1 do --#este_relatorio -- o +1 pq ele conta o cabealho como uma linha
report_lines [#report_lines+1] = este_relatorio[i]
end
@@ -3357,7 +3357,7 @@ function _detalhes:envia_relatorio (linhas, custom)
local editbox = _detalhes.janela_report.editbox
if (editbox.focus) then --> não precionou enter antes de clicar no okey
if (editbox.focus) then --> no precionou enter antes de clicar no okey
local texto = _detalhes:trim (editbox:GetText())
if (_string_len (texto) > 0) then
_detalhes.report_to_who = texto