- Added slash command '/details api'.

- Major update on our .txt about the API, these files are on the root folder of details! at WoW/Interface/AddOns/Details.
This commit is contained in:
Tercio
2015-10-04 13:46:29 -03:00
parent 0104adf583
commit 9f5d387938
14 changed files with 1265 additions and 95 deletions
+12
View File
@@ -62,6 +62,10 @@
return self [attribute]
end
function combate:GetRoster()
return self.raid_roster
end
function combate:InstanceType()
return _rawget (self, "instance_type")
end
@@ -118,6 +122,14 @@
return self [container]._ActorTable
end
function combate:GetActor (container, name)
local index = self [container] and self [container]._NameIndexTable [name]
if (index) then
return self [container]._ActorTable [index]
end
return nil
end
--return the combat time in seconds
function combate:GetFormatedCombatTime()
local time = self:GetCombatTime()
+5
View File
@@ -789,7 +789,9 @@
spellname = ""
end
actor.nome = spellname
actor.name = spellname
actor.classe = actor.spellschool
actor.class = actor.spellschool
class = actor.spellschool
local index = self._NameIndexTable [actor.nome]
@@ -799,6 +801,9 @@
else
class = actor.classe or actor.class
if (not class or class == "UNKNOWN") then
class = "UNKNOW"
end
if (class == "UNKNOW") then
--> try once again
class = _detalhes:GetClass (actor.nome or actor.name)
+31 -1
View File
@@ -60,6 +60,23 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> api functions
function container_combatentes:GetActor (actorName)
local index = self._NameIndexTable [actorName]
if (index) then
return self._ActorTable [index]
end
end
function container_combatentes:GetSpellSource (spellid)
local t = self._ActorTable
print ("getting the source", spellid, #t)
for i = 1, #t do
if (t[i].spells._ActorTable [spellid]) then
return t[i].nome
end
end
end
function container_combatentes:GetAmount (actorName, key)
key = key or "total"
local index = self._NameIndexTable [actorName]
@@ -514,6 +531,18 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core
--_detalhes:AddToNpcIdCache (novo_objeto)
function _detalhes:AddToNpcIdCache (actor)
if (flag and serial) then
if (_bit_band (flag, REACTION_HOSTILE) ~= 0 and _bit_band (flag, OBJECT_TYPE_NPC) ~= 0 and _bit_band (flag, OBJECT_TYPE_PETGUARDIAN) == 0) then
local npc_id = _detalhes:GetNpcIdFromGuid (serial)
if (npc_id) then
_detalhes.cache_npc_ids [npc_id] = nome
end
end
end
end
function _detalhes:UpdateContainerCombatentes()
container_pets = _detalhes.tabela_pets.pets
@@ -563,10 +592,11 @@
local bykey
local sort = function (t1, t2)
return t1 [bykey] > t2 [bykey]
return (t1 [bykey] or 0) > (t2 [bykey] or 0)
end
function container_combatentes:SortByKey (key)
assert (type (key) == "string", "Container:SortByKey() expects a keyname on parameter 1.")
bykey = key
_table_sort (self._ActorTable, sort)
self:remapear()
+11
View File
@@ -47,6 +47,17 @@ local _
function container_habilidades:GetSpell (id)
return self._ActorTable [id]
end
function container_habilidades:GetAmount (id, key)
local spell = self._ActorTable [id]
if (spell) then
return spell [key]
end
end
function container_habilidades:ListActors()
return _pairs (self._ActorTable)
end
function container_habilidades:PegaHabilidade (id, criar, token, cria_shadow)