- Full rewrite on custom displays.

- Fixed the report bug on healing, energy and misc attributes.
- Fixed a bug where the player pet wasn't being tracked after logon in the game.

- NewAPI: instance:IsGroupMode() return if a instance is in group mode.
- NewAPI: instance:GetCustomObject() return the custom object current used by the isntance.
- NewAPI: _detalhes:GetEncounterActorsName (EJ_EncounterID) return a hash table with [bossname] -> {[model] [displayInfo]}
- NewAPI: actor:GetDisplayName() actor:Class() return the formated name; return the class.
- NewAPI: _detalhes:GetClassIcon (class) return the icon path and texcoords.
This commit is contained in:
tercio
2014-06-21 18:11:08 -03:00
parent 9d7b43fba6
commit b1cf458ca5
31 changed files with 4006 additions and 2031 deletions
+35
View File
@@ -31,6 +31,11 @@ do
end
end
--> return the EJ boss id
function _detalhes:GetEncounterIdFromBossIndex (mapid, index)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [index]
end
--> return the table which contain information about the start of a encounter
function _detalhes:GetEncounterStartInfo (mapid, encounterid)
local bossindex = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [encounterid]
@@ -83,6 +88,11 @@ do
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex]
end
--> return a table with all names of boss enemies
function _detalhes:GetEncounterActors (mapid, bossindex)
end
--> return a table with spells id of specified encounter
function _detalhes:GetEncounterSpells (mapid, bossindex)
local encounter = _detalhes:GetBossDetails (mapid, bossindex)
@@ -108,6 +118,13 @@ do
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].boss_ids
end
function _detalhes:InstanceIsRaid (mapid)
return _detalhes:InstanceisRaid (mapid)
end
function _detalhes:InstanceisRaid (mapid)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].is_raid
end
--> return a table with all encounter names present in raid instance
function _detalhes:GetBossNames (mapid)
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].boss_names
@@ -150,6 +167,24 @@ do
end
end
--> return a list with names of adds and bosses
function _detalhes:GetEncounterActorsName (EJ_EncounterID)
--code snippet from wowpedia
local actors = {}
local stack, encounter, _, _, curSectionID = {}, EJ_GetEncounterInfo (EJ_EncounterID)
repeat
local title, description, depth, abilityIcon, displayInfo, siblingID, nextSectionID, filteredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = EJ_GetSectionInfo (curSectionID)
if (displayInfo ~= 0 and abilityIcon == "") then
actors [title] = {model = displayInfo, info = description}
end
table.insert (stack, siblingID)
table.insert (stack, nextSectionID)
curSectionID = table.remove (stack)
until not curSectionID
return actors
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core
+7 -1
View File
@@ -104,7 +104,13 @@ do
return self.nome or actor.nome
end
function _detalhes:GetName (actor)
return actor.nome or self.nome
return self.nome or actor.nome
end
function _detalhes:GetDisplayName (actor)
return self.displayName or actor.displayName
end
function _detalhes:Class (actor)
return self.classe or actor.classe
end
end
+1
View File
@@ -288,6 +288,7 @@ function _detalhes:LoadConfig()
--> custom
_detalhes.custom = _detalhes_global.custom
_detalhes.refresh:r_atributo_custom()
--> initialize parser
_detalhes.capture_current = {}
+35 -3
View File
@@ -8,6 +8,7 @@ do
local _ipairs = ipairs
local _UnitClass = UnitClass
local _select = select
local _unpack = unpack
-- try get the class from actor name
function _detalhes:GetClass (name)
@@ -28,15 +29,46 @@ do
end
end
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
function _detalhes:GetClassIcon (class)
local c
if (self.classe) then
c = self.classe
elseif (type (class) == "table" and class.classe) then
c = class.classe
elseif (type (class) == "string") then
c = class
else
c = "UNKNOW"
end
if (c == "UNKNOW") then
return [[Interface\LFGFRAME\LFGROLE_BW]], 0.25, 0.5, 0, 1
elseif (c == "UNGROUPPLAYER") then
return [[Interface\ICONS\Achievement_Character_Orc_Male]], 0, 1, 0, 1
elseif (c == "PET") then
return [[Interface\AddOns\Details\images\classes_small]], 0.25, 0.49609375, 0.75, 1
else
return [[Interface\AddOns\Details\images\classes_small]], _unpack (CLASS_ICON_TCOORDS [c])
end
end
local default_color = {1, 1, 1, 1}
function _detalhes:GetClassColor (class)
if (self.classe) then
return _detalhes.class_colors [class.classe]
return unpack (_detalhes.class_colors [self.classe] or default_color)
elseif (type (class) == "table" and class.classe) then
return _detalhes.class_colors [class.classe]
return unpack (_detalhes.class_colors [class.classe] or default_color)
elseif (type (class) == "string") then
return unpack (_detalhes.class_colors [class] or default_color)
else
unpack (default_color)
end
return _detalhes.class_colors [class]
end
function _detalhes:GuessClass (t)
+3 -148
View File
@@ -12,154 +12,9 @@ function _detalhes:SaveData()
end
function _detalhes:SaveDataOnLogout()
if (true) then
return
end
if (_detalhes.wipe_full_config) then
_detalhes_global = nil
_detalhes_database = nil
return
end
--> cleanup tables
_detalhes:PrepareTablesForSave()
--> get data
-- On Character
--> nicktag cache
_detalhes_database.nick_tag_cache = _detalhes.nick_tag_cache
_detalhes_database.only_pvp_frags = _detalhes.only_pvp_frags
--> minimap
_detalhes_database.minimap = _detalhes.minimap
--> plugin data
_detalhes_database.plugin_database = _detalhes.plugin_database
--> save instances (windows)
_detalhes_database.tabela_instancias = _detalhes.tabela_instancias
_detalhes_database.class_icons_small = _detalhes.class_icons_small
_detalhes_database.class_coords = _detalhes.class_coords
_detalhes_database.class_colors = _detalhes.class_colors
--> character info
_detalhes_database.character_data = _detalhes.character_data
--> options data
--window size
_detalhes_database.max_window_size = _detalhes.max_window_size
_detalhes_database.new_window_size = _detalhes.new_window_size
_detalhes_database.window_clamp = _detalhes.window_clamp
--> text sizes
_detalhes_database.font_sizes = _detalhes.font_sizes
_detalhes_database.ps_abbreviation = _detalhes.ps_abbreviation
-- max segments
_detalhes_database.segments_amount = _detalhes.segments_amount
_detalhes_database.segments_amount_to_save = _detalhes.segments_amount_to_save
_detalhes_database.instances_amount = _detalhes.instances_amount
_detalhes_database.clear_ungrouped = _detalhes.clear_ungrouped
_detalhes_database.clear_graphic = _detalhes.clear_graphic
-- row animation
_detalhes_database.use_row_animations = _detalhes.use_row_animations
_detalhes_database.animate_scroll = _detalhes.animate_scroll
_detalhes_database.use_scroll = _detalhes.use_scroll
-- death log
_detalhes_database.deadlog_limit = _detalhes.deadlog_limit
-- report
_detalhes_database.report_lines = _detalhes.report_lines
_detalhes_database.report_to_who = _detalhes.report_to_who
-- colors
_detalhes_database.default_bg_color = _detalhes.default_bg_color
_detalhes_database.default_bg_alpha = _detalhes.default_bg_alpha
-- fades
_detalhes_database.row_fade_in = _detalhes.row_fade_in
_detalhes_database.windows_fade_in = _detalhes.windows_fade_in
_detalhes_database.row_fade_out = _detalhes.row_fade_out
_detalhes_database.windows_fade_out = _detalhes.windows_fade_out
-- modes
_detalhes_database.solo = _detalhes.solo
_detalhes_database.tank = _detalhes.raid
-- switch
_detalhes_database.switch = {}
_detalhes_database.switch.slots = _detalhes.switch.slots
_detalhes_database.switch.table = _detalhes.switch.table
-- capture
_detalhes_database.capture_real = _detalhes.capture_real
_detalhes_database.cloud_capture = _detalhes.cloud_capture
_detalhes_database.minimum_combat_time = _detalhes.minimum_combat_time
--> combat data
-- segments table
_detalhes_database.tabela_historico = _detalhes.tabela_historico
-- combat id
_detalhes_database.combat_id = _detalhes.combat_id
-- modes
_detalhes_database.SoloTables = {}
_detalhes_database.RaidTables = {}
--> precisa pegar o nome do plugin
if (_detalhes.SoloTables.Mode) then
_detalhes_database.SoloTables.Mode = _detalhes.SoloTables.Mode
if (_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode]) then
_detalhes_database.SoloTables.LastSelected = _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].real_name
end
end
if (_detalhes.RaidTables.Mode) then
_detalhes_database.RaidTables.Mode = _detalhes.RaidTables.Mode
if (_detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode]) then
_detalhes_database.RaidTables.LastSelected = _detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].real_name
end
end
--> buff data
_detalhes.Buffs:SaveBuffs()
--> customs
_detalhes_database.custom = _detalhes.custom
--> version
_detalhes_database.last_realversion = _detalhes.realversion --> core number
_detalhes_database.last_version = _detalhes.userversion --> version
-- On Account
_detalhes_global = _detalhes_global or {}
--> profiles
_detalhes_global.__profiiles = _detalhes.__profiiles
--> skins
_detalhes_global.savedStyles = _detalhes.savedStyles
_detalhes_global.standard_skin = _detalhes.standard_skin
_detalhes_global.got_first_run = true
--max segments
_detalhes_global.segments_amount = _detalhes.segments_amount
_detalhes_global.segments_amount_to_save = _detalhes.segments_amount_to_save
_detalhes_global.segments_panic_mode = _detalhes.segments_panic_mode
-- animations
_detalhes_global.use_row_animations = _detalhes.use_row_animations
_detalhes_global.animate_scroll = _detalhes.animate_scroll
-- scrollbar
_detalhes_global.use_scroll = _detalhes.use_scroll
-- core
_detalhes_global.clear_ungrouped = _detalhes.clear_ungrouped
_detalhes_global.update_speed = _detalhes.update_speed
_detalhes_global.time_type = _detalhes.time_type
_detalhes_global.memory_threshold = _detalhes.memory_threshold
_detalhes_global.memory_ram = _detalhes.memory_ram
_detalhes_global.remove_realm_from_name = _detalhes.remove_realm_from_name
_detalhes_global.trash_concatenate = _detalhes.trash_concatenate
_detalhes_global.trash_auto_remove = _detalhes.trash_auto_remove
_detalhes_global.SpellOverwriteUser = _detalhes.SpellOverwriteUser
--tutorial
_detalhes_global.tutorial = _detalhes.tutorial
--profiles
_detalhes_global.__profiiles = _detalhes.__profiiles
return true
if (true) then
return
end
end
local force_reset = function()
+49
View File
@@ -201,6 +201,55 @@ function SlashCmdList.DETAILS (msg, editbox)
--instance.baseframe:SetPoint ("CENTER", UIParent, "CENTER", 300, 100)
instance.baseframe:SetPoint ("left", DetailsWelcomeWindow, "right", 10, 0)
elseif (msg == "model") then
local frame = CreateFrame ("PlayerModel");
frame:SetPoint("center",UIParent,"center");
frame:SetHeight(600);
frame:SetWidth(300);
frame:SetDisplayInfo (49585);
elseif (msg == "ej2") then
--[[ get the EJ_ raid id
local wantRaids = true -- set false to get 5-man list
for i=1,1000 do
instanceID,name,description,bgImage,buttonImage,loreImage, dungeonAreaMapID, link = EJ_GetInstanceByIndex(i,wantRaids)
if not instanceID then break end
DEFAULT_CHAT_FRAME:AddMessage( instanceID.." "..name ,1,0.7,0.5)
end
--]]
local iid=362
for i=1, 100 do
local name, description, encounterID, rootSectionID, link = EJ_GetEncounterInfoByIndex (i, iid)
if not encounterID then break end
local msg = encounterID .. " , " .. name .. ", ".. rootSectionID.. ", "..link
DEFAULT_CHAT_FRAME:AddMessage(msg, 1,0.7,0.5)
end
elseif (msg == "ej") then
function PrintAllEncounterSections(encounterID, difficultyID)
EJ_SetDifficulty(difficultyID)
local stack, encounter, _, _, curSectionID = {}, EJ_GetEncounterInfo(encounterID)
print(stack, encounter, _, _, curSectionID)
repeat
local title, desc, depth, icon, model, siblingID, nextSectionID, filteredByDifficulty, link, _, f1, f2, f3, f4 = EJ_GetSectionInfo(curSectionID)
if not filteredByDifficulty then
--print((" "):rep(depth) .. link .. ": " .. desc)
--npcs nao tem icone e possuel modelo diferente de zero.
--spells tem icone e possuel modelo = zero
print (title, icon, model, siblingID)
end
table.insert(stack, siblingID)
table.insert(stack, nextSectionID)
curSectionID = table.remove(stack)
until not curSectionID
end
-- Print everything in 25-man Normal Madness of Deathwing:
PrintAllEncounterSections (869, 4)
elseif (msg == "time") then
print ("GetTime()", GetTime())