Files
coa-details/boot.lua
T
tercio 6ac6d7fd71 Added support to Profiles, now you can share the same config between two or more characters
Added support for BattleTag friends over report window.
Added pet threat to Tiny Threat plugin when out of a party or raid group.
Fixed a issue with close button where it disappear without close the window when toolbar is in bottom side.
Also fixed a issue where swapping toolbar positioning was sometimes making close button disappear.
Fixed a problem opening options panel through minimap when there is no window opened.
2014-04-09 18:44:12 -03:00

258 lines
9.0 KiB
Lua

--File Revision: 1
--Last Modification: 27/07/2013
-- Change Log:
-- 27/07/2013: Finished alpha version.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> global name declaration
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
_detalhes.userversion = "v1.12.00"
_detalhes.version = "Alpha 016"
_detalhes.realversion = 16
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> initialization stuff
do
local _detalhes = _G._detalhes
--> 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_frame = CreateFrame ("Frame", nil, _UIParent)
_detalhes.parser_frame:Hide()
--> armazena os escudos - Shields information for absorbs
_detalhes.escudos = {}
--> armazena os overwirtes de spells pelo usuario
_detalhes.SpellOverwriteUser = {}
--> 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 as fontstring usadas no addon - Store labels (fontstrings)
_detalhes.font_pool = {}
--> 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_table = {}
--> 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 = {}
--> 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.flags = {
--> Player and Pet
player = 0x00000001,--> player character
pet = 0x00000002, --> pet mobile
--> Group
in_group = 0x00000100,--> in group
player_in_group = 0x00000101, --> player in group
--> Friendship
friend = 0x00000010,--> friend (same faction)
friend_in_group = 0x00000110, --> friend in group
--> Enemies
neutral = 0x00000020,--> neutral
enemy = 0x00000040--> enemy
}
_detalhes.divisores = {
abre = "(", --> open
fecha = ")", --> close
colocacao = ". " --> dot
}
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 D'ictum (reverse)", [[Interface\AddOns\Details\images\bar4_reverse]])
SharedMedia:Register ("statusbar", "Details Serenity", [[Interface\AddOns\Details\images\bar_serenity]])
--> 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
end