e5eff411c9
- Timeline plugin got some rework and now its window can be open while in combat. - Plugin You Are Not Prepared, got a options panel. - Added Data Broker for: Combat Time, Player Dps and Player Hps. - Fixed non formatted numbers where it shows its fractional part. - Texts on options panel now auto-resizes depending on the test's lengh. - Slash commands now are multi language, accepting both english and the localized language. - New API: framework:BuildMenu (parent, menu, x_offset, y_offset, height), auto build menu, similar to Ace3 GUI.
308 lines
18 KiB
Lua
308 lines
18 KiB
Lua
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
--> global name declaration
|
|
|
|
_ = nil
|
|
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0", "LibHotCorners")
|
|
|
|
_detalhes.build_counter = 14 --it's 14 for release
|
|
_detalhes.userversion = "v1.19.2"
|
|
_detalhes.realversion = 23
|
|
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")"
|
|
|
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
--> initialization stuff
|
|
|
|
do
|
|
|
|
local _detalhes = _G._detalhes
|
|
|
|
--[[
|
|
|cFFFFFF00-|r Details! it's now able to be translated by its community for all supported languages through Curse Forge Web Site:\n\nhttp://wow.curseforge.com/addons/details/localization/.\n\n
|
|
|
|
--]]
|
|
|
|
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
|
Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v1.19.0 - v1.19.1 - v1.19.2 (|cFFFFCC00Jul 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Trash segments won't be saved anymore.\n\n|cFFFFFF00-|r Added support for plugins options.\n\n|cFFFFFF00-|r Revamp on Deaths report lines, adding links for harmful spells and changing the text order |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Modified the percentage used on Comparison panel |cFF999999(thanks @Mystery2012-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the Dps/Hps data exported by Data Broker |cFF999999(thanks @Arieth-mmochampion forum)|r.\n\n|cFFFFFF00v1.18.4 - v1.18.5 - v1.18.6 (|cFFFFCC00Jul 13, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added option to customize the bar left text.\n\n|cFFFFFF00-|r Added option for show or hide bar placement number.\n\n|cFFFFFF00-|r Spell icon is shown in the bar when the enemy character is a environment spell type.\n\n|cFFFFFF00-|r Changed the non-player enemy icon (monsters).\n\n|cFFFFFF00-|r Fixed bug on flex performance profile |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Added new version tracker which should alert you when a newer Details! version is found.\n\n|cFFFFFF00-|r Added Enemy Damage Taken by clicking with middle mouse button over a enemy bar (enemies display).\n\n|cFFFFFF00-|r Added import/export for saved skins and custom displays created.\n\n|cFFFFFF00-|r Small changes on ElvUI Frame Style skin (need reaply).\n\n|cFFFFFF00-|r Fixed the death recognition for bosses, now it should show the correct color over segments menu.\n\n|cFFFFFF00-|r Fixed Dps inacuracy when plyaing solo (no party or raid group).\n\n|cFFFFFF00-|r Fixed the duration time of buffs applied before the pull, like pre-potions.\n\n|cFFFFFF00v1.17.5 (|cFFFFCC00Jun 30, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Shortcut panel is now known as Bookmarks and a revamp has done on its panel.\n\n|cFFFFFF00-|r NickTag now doesnt check anymore if a received nickname from other guild member is invalid.\n\n|cFFFFFF00-|r Healthstone now is considered a cooldown.\n\n|cFFFFFF00-|r Few improvements on Default Skin, Minimalistic Skin and ElvUI Frame Style Skin.\n\n|cFFFFFF00-|r Revamp on Image Editor, many bugs solves and now it is usable.\n\n|cFFFFFF00-|r 'Hide' slash command now hides all opened windows; 'Show', open all closed windows and 'New' create a new window.\n\n|cFFFFFF00-|r Added Devotion Aura, Rallying Cry as cooldowns.\n\n|cFFFFFF00-|r Added options for lock, unlock, break snap, close, reopen and create new window.\n\n|cFFFFFF00-|r Added a options panel for HotCorners, access it through options button or slash hotcorner command.\n\n|cFFFFFF00-|r Added 'Logos' and 'Raid & Dungeons' sections for Wallpapers. \n\n|cFFFFFF00-|r Added a option to load a image from the computer to use as wallpaper.\n\n|cFFFFFF00-|r Fixed the percent issue with Healing Done and HPS while in combat.\n\n|cFFFFFF00-|r Fixed non-combat switch by role where changing role wasnt changing the shown attribute.\n\n|cFFFFFF00-|r Fixed 'While in Combat' hiding schema |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed several bugs on Interact Auto Transparency.\n\n|cFFFFFF00-|r Fixed the report window alert when opening the report window and it already is opened |cFF999999(thanks @Rasstapp-mmochampion forum)|r.\n\n|cFFFFFF00-|r Fixed the gap between last row created and the end of the window.\n\n|cFFFFFF00-|r Fixed all tooltips bugs on Wallpaper Section on Options Panel.\n\n|cFFFFFF00a1.17.0 (|cFFFFCC00Jun 21, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Support for Custom Displays has been rewrited, to access the new panel go to Sword Menu -> Custom -> Create New Display.\n\n|cFFFFFF00-|r Added a custom display for show potion usage.\n\n|cFFFFFF00-|r Fixed a bug where the player pet wasnt being tracked after logon in the game. This bug was affecting directly classes with pets playing out of a raid group.\n\n|cFFFFFF00-|r Fixed the report bug on healing, energy and misc attributes |cFF999999(thanks @skmzarn-mmochampion forum)|r.\n\n|cFFFFFF00a1.16.0 - a1.16.1 - a1.16.3b (|cFFFFCC00Jun 14, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed row creation while resizing where sometimes it was broking the last row in the window.\n\n|cFFFFFF00-|r Fixed small involuntary resizes after resizing a window. |cFF999999(thanks @Morimvudu-Nemesis)|r\n\n|cFFFFFF00-|r Fixed frame strata after stretching the window where was setting its strata to Medium.\n\n|cFFFFFF00-|r Fixed Vanguard strata where it wasnt following the strata from its host window.\n\n|cFFFFFF00-|r Mode menu now have a sub menu for raid plugins.\n\n|cFFFFFF00-|r Red and Green colors under comparison frame has been inverted. |cFF999999(thanks @skmzarn-mmochampion forum)|r\n\n|cFFFFFF00-|r Fixed some report issues with dps and hps, also almost all reports now have guide lines. |cFF999999(thanks @sosleapy-mmochampion forum)|r\n\n|cFFFFFF00-|r Pet dispell and interrupt count also for its owner as well. |cFF999999(thanks @skmzarn-mmochampion forum)|r\n\n|cFFFFFF00-|r Few fixes on comparison panel over Player Details Window.\n\n|cFFFFFF00-|r Added option to be able to save the windows size and position within the profile. |cFF999999(thanks @Torchler-mmochampion forum)|r\n\n|cFFFFFF00-|r Added performance profile settings. |cFF999999(thanks @SlippyCheeze-mmochampion forum)|r\n\n|cFFFFFF00-|r Added auto switch based on group roles also a switch for wipe. |cFF999999(thanks @SlippyCheeze-mmochampion forum)|r\n\n|cFFFFFF00-|r Fixed a bug where sometimes all non boss segments was considered boss encounters.\n\n|cFFFFFF00v1.15.4 (|cFFFFCC00Jun 06, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a compare tab under Player Details Window:\nThis new tab showns up when there is too characters with the same class and spec.\nIts useful to compare skills used, uptimes and targets.\n\n|cFFFFFF00-|r Few improvements on Default and ElvUI skins.\n\n|cFFFFFF00-|r Added a button for auto align two windows within right chat window when ElvUI skin is active.\n\n|cFFFFFF00-|r Fixed problem with Damage -> Enemies display.\n\n|cFFFFFF00-|r Fixed report Player Detail Window report buttons.\n\n|cFFFFFF00-|r Fixed some report lines where the numbers wasnt properly formatted.\n\n|cFFFFFF00-|r Fixed a rare bug where the owner of some pets wasnt detected.\n\n|cFFFFFF00-|r Fixed issue in dungeons where capture data get paused after a boss kill.\n\n|cFFFFFF00-|r Fixed issue with Encounter Details showing its icon for dungeons bosses.\n\n|cFFFFFF00-|r Fixed a rare bug where the capture of damage stops after erasing a trash segment.\n\n|cFFFFFF00v1.15.0 - v1.15.3 - v1.15.3b (|cFFFFCC00Jun 03, 2014|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Emergencial fix for death logs which sometimes was breaking the addon data capture.\n\n|cFFFFFF00-|r Fixed window alerts which was showing behind the bars.\n\n|cFFFFFF00-|r Fixed death log issue with friendly fire hits.\n\n|cFFFFFF00-|r Fixed a issue where Details! windows wasn't hidden when a pet battle starts.\n\n|cFFFFFF00-|r Fixed a issue with segments menu when a window is placed on the right side of the screen.\n\n|cFFFFFF00-|r Damage -> Enemies now also show neutral creatures.\n\n|cFFFFFF00-|r Added support to dungeons, bosses and trash mobs are now recognized."
|
|
Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r "
|
|
|
|
--> startup
|
|
_detalhes.initializing = true
|
|
_detalhes.enabled = true
|
|
_detalhes.__index = _detalhes
|
|
_detalhes._tempo = time()
|
|
_detalhes.debug = false
|
|
_detalhes.opened_windows = 0
|
|
|
|
--> containers
|
|
--> armazenas as funções do parser - All parse functions
|
|
_detalhes.parser = {}
|
|
_detalhes.parser_functions = {}
|
|
_detalhes.parser_frame = CreateFrame ("Frame", nil, _UIParent)
|
|
_detalhes.parser_frame:Hide()
|
|
--> armazena os escudos - Shields information for absorbs
|
|
_detalhes.escudos = {}
|
|
--> armazena as funções dos frames - Frames functions
|
|
_detalhes.gump = {}
|
|
--> armazena as funções para inicialização dos dados - Metatable functions
|
|
_detalhes.refresh = {}
|
|
--> armazena as funções para limpar e guardas os dados - Metatable functions
|
|
_detalhes.clear = {}
|
|
--> armazena a config do painel de fast switch
|
|
_detalhes.switch = {}
|
|
--> armazena os estilos salvos
|
|
_detalhes.savedStyles = {}
|
|
--> armazena quais atributos possue janela de atributos - contain attributes and sub attributos wich have a detailed window (left click on a row)
|
|
_detalhes.row_singleclick_overwrite = {}
|
|
--> report
|
|
_detalhes.ReportOptions = {}
|
|
--> armazena os buffs registrados - store buffs ids and functions
|
|
_detalhes.Buffs = {} --> initialize buff table
|
|
--> cache de grupo
|
|
_detalhes.cache_damage_group = {}
|
|
_detalhes.cache_healing_group = {}
|
|
--> ignored pets
|
|
_detalhes.pets_ignored = {}
|
|
_detalhes.pets_no_owner = {}
|
|
--> armazena as skins disponíveis para as janelas
|
|
_detalhes.skins = {}
|
|
--> armazena os hooks das funções do parser
|
|
_detalhes.hooks = {}
|
|
--> informações sobre a luta do boss atual
|
|
_detalhes.encounter_end_table = {}
|
|
_detalhes.encounter_table = {}
|
|
--> informações sobre a arena atual
|
|
_detalhes.arena_table = {}
|
|
_detalhes.arena_info = {
|
|
[562] = {file = "LoadScreenBladesEdgeArena", coords = {0, 1, 0.29296875, 0.9375}}, -- Circle of Blood Arena
|
|
[617] = {file = "LoadScreenDalaranSewersArena", coords = {0, 1, 0.29296875, 0.857421875}}, --Dalaran Arena
|
|
[559] = {file = "LoadScreenNagrandArenaBattlegrounds", coords = {0, 1, 0.341796875, 1}}, --Ring of Trials
|
|
[980] = {file = "LoadScreenTolvirArena", coords = {0, 1, 0.29296875, 0.857421875}}, --Tol'Viron Arena
|
|
[572] = {file = "LoadScreenRuinsofLordaeronBattlegrounds", coords = {0, 1, 0.341796875, 1}}, --Ruins of Lordaeron
|
|
[1134] = {file = "LoadingScreen_Shadowpan_bg", coords = {0, 1, 0.29296875, 0.857421875}}, -- Tiger's Peak
|
|
--"LoadScreenOrgrimmarArena", --Ring of Valor
|
|
}
|
|
|
|
function _detalhes:GetArenaInfo (mapid)
|
|
local t = _detalhes.arena_info [mapid]
|
|
if (t) then
|
|
return t.file, t.coords
|
|
end
|
|
end
|
|
|
|
--> Plugins
|
|
--> raid -------------------------------------------------------------------
|
|
--> general function for raid mode plugins
|
|
_detalhes.RaidTables = {}
|
|
--> menu for raid modes
|
|
_detalhes.RaidTables.Menu = {}
|
|
--> plugin objects for raid mode
|
|
_detalhes.RaidTables.Plugins = {}
|
|
--> name to plugin object
|
|
_detalhes.RaidTables.NameTable = {}
|
|
--> using by
|
|
_detalhes.RaidTables.InstancesInUse = {}
|
|
_detalhes.RaidTables.PluginsInUse = {}
|
|
|
|
--> solo -------------------------------------------------------------------
|
|
--> general functions for solo mode plugins
|
|
_detalhes.SoloTables = {}
|
|
--> maintain plugin menu
|
|
_detalhes.SoloTables.Menu = {}
|
|
--> plugins objects for solo mode
|
|
_detalhes.SoloTables.Plugins = {}
|
|
--> name to plugin object
|
|
_detalhes.SoloTables.NameTable = {}
|
|
|
|
--> toolbar -------------------------------------------------------------------
|
|
--> plugins container
|
|
_detalhes.ToolBar = {}
|
|
--> current showing icons
|
|
_detalhes.ToolBar.Shown = {}
|
|
_detalhes.ToolBar.AllButtons = {}
|
|
--> plugin objects
|
|
_detalhes.ToolBar.Plugins = {}
|
|
--> name to plugin object
|
|
_detalhes.ToolBar.NameTable = {}
|
|
_detalhes.ToolBar.Menu = {}
|
|
|
|
--> statusbar -------------------------------------------------------------------
|
|
--> plugins container
|
|
_detalhes.StatusBar = {}
|
|
--> maintain plugin menu
|
|
_detalhes.StatusBar.Menu = {}
|
|
--> plugins object
|
|
_detalhes.StatusBar.Plugins = {}
|
|
--> name to plugin object
|
|
_detalhes.StatusBar.NameTable = {}
|
|
|
|
--> constants
|
|
_detalhes._detalhes_props = {
|
|
DATA_TYPE_START = 1, --> Something on start
|
|
DATA_TYPE_END = 2, --> Something on end
|
|
|
|
MODO_ALONE = 1, --> Solo
|
|
MODO_GROUP = 2, --> Group
|
|
MODO_ALL = 3, --> Everything
|
|
MODO_RAID = 4, --> Raid
|
|
}
|
|
_detalhes.modos = {
|
|
alone = 1, --> Solo
|
|
group = 2, --> Group
|
|
all = 3, --> Everything
|
|
raid = 4 --> Raid
|
|
}
|
|
|
|
_detalhes.divisores = {
|
|
abre = "(", --> open
|
|
fecha = ")", --> close
|
|
colocacao = ". " --> dot
|
|
}
|
|
|
|
_detalhes.role_texcoord = {
|
|
DAMAGER = "72:130:69:127",
|
|
HEALER = "72:130:2:60",
|
|
TANK = "5:63:69:127",
|
|
NONE = "139:196:69:127",
|
|
}
|
|
|
|
_detalhes.player_class = {
|
|
["HUNTER"] = true,
|
|
["WARRIOR"] = true,
|
|
["PALADIN"] = true,
|
|
["SHAMAN"] = true,
|
|
["MAGE"] = true,
|
|
["ROGUE"] = true,
|
|
["PRIEST"] = true,
|
|
["WARLOCK"] = true,
|
|
["DRUID"] = true,
|
|
["MONK"] = true,
|
|
["DEATHKNIGHT"] = true,
|
|
}
|
|
|
|
local Loc = LibStub ("AceLocale-3.0"):GetLocale ("Details")
|
|
|
|
_detalhes.segmentos = {
|
|
label = Loc ["STRING_SEGMENT"]..": ",
|
|
overall = Loc ["STRING_TOTAL"],
|
|
overall_standard = Loc ["STRING_OVERALL"],
|
|
current = Loc ["STRING_CURRENT"],
|
|
current_standard = Loc ["STRING_CURRENTFIGHT"],
|
|
past = Loc ["STRING_FIGHTNUMBER"]
|
|
}
|
|
|
|
_detalhes._detalhes_props["modo_nome"] = {
|
|
[_detalhes._detalhes_props["MODO_ALONE"]] = Loc ["STRING_MODE_SELF"],
|
|
[_detalhes._detalhes_props["MODO_GROUP"]] = Loc ["STRING_MODE_GROUP"],
|
|
[_detalhes._detalhes_props["MODO_ALL"]] = Loc ["STRING_MODE_ALL"],
|
|
[_detalhes._detalhes_props["MODO_RAID"]] = Loc ["STRING_MODE_RAID"]
|
|
}
|
|
|
|
_detalhes.icones = {
|
|
--> report window
|
|
report = {
|
|
up = "Interface\\FriendsFrame\\UI-Toast-FriendOnlineIcon",
|
|
down = "Interface\\ItemAnimations\\MINIMAP\\TRACKING\\Profession",
|
|
disabled = "Interface\\ItemAnimations\\MINIMAP\\TRACKING\\Profession",
|
|
highlight = nil
|
|
}
|
|
}
|
|
|
|
_detalhes.missTypes = {"ABSORB", "BLOCK", "DEFLECT", "DODGE", "EVADE", "IMMUNE", "MISS", "PARRY", "REFLECT", "RESIST"} --> do not localize-me
|
|
|
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
--> frames
|
|
|
|
local _CreateFrame = CreateFrame --api locals
|
|
local _UIParent = UIParent --api locals
|
|
|
|
--> Info Window
|
|
_detalhes.janela_info = _CreateFrame ("Frame", "Details_JanelaInfo", _UIParent)
|
|
|
|
--> Event Frame
|
|
_detalhes.listener = _CreateFrame ("Frame", nil, _UIParent)
|
|
_detalhes.listener:RegisterEvent ("ADDON_LOADED")
|
|
_detalhes.listener:RegisterEvent ("PLAYER_LOGOUT")
|
|
_detalhes.listener:SetFrameStrata ("LOW")
|
|
_detalhes.listener:SetFrameLevel (9)
|
|
_detalhes.listener.FrameTime = 0
|
|
|
|
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
--> functions
|
|
|
|
_detalhes.empty_function = function() end
|
|
|
|
--> register textures and fonts for shared media
|
|
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
|
|
SharedMedia:Register ("statusbar", "Details D'ictum", [[Interface\AddOns\Details\images\bar4]])
|
|
SharedMedia:Register ("statusbar", "Details Vidro", [[Interface\AddOns\Details\images\bar4_vidro]])
|
|
SharedMedia:Register ("statusbar", "Details D'ictum (reverse)", [[Interface\AddOns\Details\images\bar4_reverse]])
|
|
SharedMedia:Register ("statusbar", "Details Serenity", [[Interface\AddOns\Details\images\bar_serenity]])
|
|
SharedMedia:Register ("background", "Details Ground", [[Interface\AddOns\Details\images\background]])
|
|
SharedMedia:Register ("border", "Details BarBorder 1", [[Interface\AddOns\Details\images\border_1]])
|
|
SharedMedia:Register ("border", "Details BarBorder 2", [[Interface\AddOns\Details\images\border_2]])
|
|
|
|
--> global 'vardump' for dump table contents over chat panel
|
|
function vardump (t)
|
|
if (type (t) ~= "table") then
|
|
return
|
|
end
|
|
for a,b in pairs (t) do
|
|
print (a,b)
|
|
end
|
|
end
|
|
|
|
--> global 'table_deepcopy' copies a full table
|
|
function table_deepcopy (orig)
|
|
local orig_type = type(orig)
|
|
local copy
|
|
if orig_type == 'table' then
|
|
copy = {}
|
|
for orig_key, orig_value in next, orig, nil do
|
|
copy [table_deepcopy (orig_key)] = table_deepcopy (orig_value)
|
|
end
|
|
else
|
|
copy = orig
|
|
end
|
|
return copy
|
|
end
|
|
|
|
--> delay messages
|
|
function _detalhes:DelayMsg (msg)
|
|
_detalhes.delaymsgs = _detalhes.delaymsgs or {}
|
|
_detalhes.delaymsgs [#_detalhes.delaymsgs+1] = msg
|
|
end
|
|
function _detalhes:ShowDelayMsg()
|
|
if (_detalhes.delaymsgs and #_detalhes.delaymsgs > 0) then
|
|
for _, msg in ipairs (_detalhes.delaymsgs) do
|
|
print (msg)
|
|
end
|
|
end
|
|
_detalhes.delaymsgs = {}
|
|
end
|
|
|
|
--> print messages
|
|
function _detalhes:Msg (_string, arg1, arg2, arg3, arg4)
|
|
if (self.__name) then
|
|
--> yes, we have a name!
|
|
print ("|cffffaeae" .. self.__name .. "|r |cffcc7c7c(plugin)|r: " .. _string, arg1 or "", arg2 or "", arg3 or "", arg4 or "")
|
|
else
|
|
print (Loc ["STRING_DETAILS1"] .. _string, arg1 or "", arg2 or "", arg3 or "", arg4 or "")
|
|
end
|
|
end
|
|
|
|
--> welcome
|
|
function _detalhes:WelcomeMsgLogon()
|
|
_detalhes:Msg ("|cffb0b0b0you can always reset the addon running the command '/details reinstall' if it does fail to load after being updated.|r")
|
|
end
|
|
_detalhes:ScheduleTimer ("WelcomeMsgLogon", 8)
|
|
|
|
--> key binds
|
|
--> header
|
|
_G ["BINDING_HEADER_Details"] = "Details!"
|
|
--> keys
|
|
_G ["BINDING_NAME_DETAILS_RESET_SEGMENTS"] = "Reset Segments"
|
|
_G ["BINDING_NAME_DETAILS_SCROLL_UP"] = "Scroll Up All Windows"
|
|
_G ["BINDING_NAME_DETAILS_SCROLL_DOWN"] = "Scroll Down All Windows"
|
|
|
|
end
|