/keys now only show the player name, before was showing the player name and the realm name
This commit is contained in:
@@ -11,56 +11,58 @@ local addonName, Details222 = ...
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--constants
|
||||
|
||||
local container_playernpc = _detalhes.container_type.CONTAINER_PLAYERNPC
|
||||
|
||||
local container_damage = _detalhes.container_type.CONTAINER_DAMAGE_CLASS
|
||||
local container_heal = _detalhes.container_type.CONTAINER_HEAL_CLASS
|
||||
local container_heal_target = _detalhes.container_type.CONTAINER_HEALTARGET_CLASS
|
||||
local container_friendlyfire = _detalhes.container_type.CONTAINER_FRIENDLYFIRE
|
||||
local container_damage_target = _detalhes.container_type.CONTAINER_DAMAGETARGET_CLASS
|
||||
local container_energy = _detalhes.container_type.CONTAINER_ENERGY_CLASS
|
||||
local container_energy_target = _detalhes.container_type.CONTAINER_ENERGYTARGET_CLASS
|
||||
local container_misc = _detalhes.container_type.CONTAINER_MISC_CLASS
|
||||
local container_misc_target = _detalhes.container_type.CONTAINER_MISCTARGET_CLASS
|
||||
|
||||
local habilidade_dano = _detalhes.habilidade_dano
|
||||
local habilidade_cura = _detalhes.habilidade_cura
|
||||
local habilidade_e_energy = _detalhes.habilidade_e_energy
|
||||
local habilidade_misc = _detalhes.habilidade_misc
|
||||
|
||||
local container_habilidades = _detalhes.container_habilidades
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--internals
|
||||
|
||||
|
||||
function container_habilidades:NovoContainer (tipo_do_container)
|
||||
local _newContainer = {
|
||||
funcao_de_criacao = container_habilidades:FuncaoDeCriacao (tipo_do_container),
|
||||
tipo = tipo_do_container,
|
||||
_ActorTable = {}
|
||||
}
|
||||
|
||||
|
||||
setmetatable(_newContainer, container_habilidades)
|
||||
|
||||
|
||||
return _newContainer
|
||||
end
|
||||
|
||||
function container_habilidades:GetSpell (id)
|
||||
return self._ActorTable [id]
|
||||
---get the spellTable for the passed spellId
|
||||
---@param spellId number
|
||||
---@return table
|
||||
function container_habilidades:GetSpell (spellId)
|
||||
return self._ActorTable[spellId]
|
||||
end
|
||||
|
||||
function container_habilidades:GetAmount (id, key)
|
||||
local spell = self._ActorTable [id]
|
||||
|
||||
---return the value of the spellTable[key] for the passed spellId
|
||||
---@param spellId number
|
||||
---@param key string
|
||||
---@return any
|
||||
function container_habilidades:GetAmount(spellId, key)
|
||||
local spell = self._ActorTable[spellId]
|
||||
if (spell) then
|
||||
return spell [key]
|
||||
return spell[key]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
---return an iterator for all spellTables in this container
|
||||
---@return fun(table: table<<K>, <V>>, index?: <K>):<K>, <V>
|
||||
function container_habilidades:ListActors()
|
||||
return pairs(self._ActorTable)
|
||||
end
|
||||
|
||||
function container_habilidades:ListActors()
|
||||
--same as the function above, just an alias
|
||||
function container_habilidades:ListSpells()
|
||||
return pairs(self._ActorTable)
|
||||
end
|
||||
|
||||
@@ -69,18 +71,18 @@ local addonName, Details222 = ...
|
||||
end
|
||||
|
||||
function container_habilidades:PegaHabilidade (id, criar, token)
|
||||
|
||||
|
||||
local esta_habilidade = self._ActorTable [id]
|
||||
|
||||
|
||||
if (esta_habilidade) then
|
||||
return esta_habilidade
|
||||
else
|
||||
if (criar) then
|
||||
|
||||
|
||||
local novo_objeto = self.funcao_de_criacao (nil, id, nil, token)
|
||||
|
||||
|
||||
self._ActorTable [id] = novo_objeto
|
||||
|
||||
|
||||
return novo_objeto
|
||||
else
|
||||
return nil
|
||||
@@ -91,16 +93,16 @@ local addonName, Details222 = ...
|
||||
function container_habilidades:FuncaoDeCriacao (tipo)
|
||||
if (tipo == container_damage) then
|
||||
return habilidade_dano.NovaTabela
|
||||
|
||||
|
||||
elseif (tipo == container_heal) then
|
||||
return habilidade_cura.NovaTabela
|
||||
|
||||
elseif (tipo == container_energy) then
|
||||
return habilidade_e_energy.NovaTabela
|
||||
|
||||
|
||||
elseif (tipo == container_misc) then
|
||||
return habilidade_misc.NovaTabela
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user