474 lines
26 KiB
Lua
474 lines
26 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")
|
||
_detalhes.build_counter = 3057
|
||
_detalhes.userversion = "v7.0.3." .. _detalhes.build_counter
|
||
_detalhes.realversion = 114 --core version
|
||
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")"
|
||
Details = _detalhes
|
||
|
||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||
--> initialization stuff
|
||
|
||
do
|
||
|
||
local _detalhes = _G._detalhes
|
||
|
||
_detalhes.resize_debug = {}
|
||
|
||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||
|
||
--[[
|
||
|cFFFFFF00v7.0.3.3057 (|cFFFFCC00October 09th, 2016|r|cFFFFFF00)|r:\n\n
|
||
|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul.\n\n
|
||
|
||
--]]
|
||
--
|
||
|
||
Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v7.0.3.3057 (|cFFFFCC00October 09th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r attempt to make all Details! users on the party or raid to track rogue's akaari's soul.\n\n|cFFFFFF00v7.0.3.2994 (|cFFFFCC00September 25th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r |cFF0088EE[Devilsaur Shock-Baton]|r added to custom spells, its effect should be displayed: 'Devilsaur Shock Leash (trinket)'.\n\n|cFFFFFF00-|r More fixes for dungeon trash being tag as a dungeon boss.\n\n|cFFFFFF00-|r Fixed the item level calculation when the player is using a main hand and offhand artifact.\n\n|cFFFFFF00-|r Added option to auto erase world segments (outdoors, e.g. doing world quests).\n\n|cFFFFFF00-|r Fixed the avoidance tab on the player detail window for Demon Hunters.\n\n|cFFFFFF00-|r Added the tag {target} on custom text for the interrupt announcer.\n\n|cFFFFFF00-|r Merging Demon Hunter 'Fury of the Illidari' spell when the consolidade option is enabled under Spell Customization.\n\n|cFFFFFF00v7.0.3.2961 (|cFFFFCC00September 17th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for consolidade spells with the same name (isn't working with all spells yet).\nThe option is under Spell Customization on options panel.\n\n|cFFFFFF00v7.0.3.2955 (|cFFFFCC00September 14th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Built-in custom displays has been updated to Legion.\n\n|cFFFFFF00-|r Raid Check (plugin) now checks for Legion food, rune and flash.\n\n|cFFFFFF00-|r removed the config button from the Player Details Window.\n\n|cFFFFFF00-|r the alert for this news window won't popup for each characters after the player opened it once for the update.\n\n|cFFFFFF00-|r added tooltip information for the two new arenas added in Legion.\n\n|cFFFFFF00v7.0.3.2941 (|cFFFFCC00September 13th, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r fix for total bar where sometimes it desappears.\n\n|cFFFFFF00-|r fix for overall data reseting its elapsed time making dps and hps goes to millions.\n\n|cFFFFFF00-|r fix for overall not reseting when entering in a new dungeon.\n\n|cFFFFFF00-|r fix for trash cleanup on dungeons.\n\n|cFFFFFF00-|r fix for item level detection on dungeons.\n\n|cFFFFFF00-|r fix for artifact offhand always being counter as 750 item level.\n\n|cFFFFFF00-|r fix for segments menu sometimes not opening at all after a dungeon boss.\n\n|cFFFFFF00-|r fix for segments menu not showing the boss icon above the sub panel.\n\n|cFFFFFF00-|r fix for the top left corner of the window be ignoring the 'hide icon' setting at a /reload.\n\n|cFFFFFF00v7.0.3.2927 (|cFFFFCC00September 3rd, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Attempt to fix an issue with total bar hidding the latest bar shown.\n\n|cFFFFFF00v7.0.3.2899 (|cFFFFCC00August 26, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed a bug on tiny threat where it won't used the font set after a /reload.\n\n|cFFFFFF00-|r Bar spacing can now be set to -2 to 10 (from 0 to 10).\n\n|cFFFFFF00-|r Attempt to fix GBoM and Stormlash on dungeon boss fights.\n\n|cFFFFFF00v5.21 (|cFFFFCC00August 14, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for Monk's Soothing Mist on Streamer Plugin.\n\n|cFFFFFF00v5.20 (|cFFFFCC00August 13, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Warlock's Grimoire of Synergy buff uptime fix.\n\n|cFFFFFF00-|r Fix for the options panel background when using Classic panels.\n\n|cFFFFFF00-|r Tooltips are now slightly bigger.\n\n|cFFFFFF00-|r Fix for bookmark background where sometimes it has a light silver color.\n\n|cFFFFFF00-|r Fix for channel cast on Streamer Plugin.\n\n|cFFFFFF00-|r Legion followers fix.\n\n|cFFFFFF00-|r Boss detection for Legion dungeons.\n\n|cFFFFFF00-|r Priest spec detection review (thanks Yakumile-Azralon).\n\n|cFFFFFF00v5.15 (|cFFFFCC00August 5, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r fix for an error which happen sometimes during encounter start.\n\n|cFFFFFF00v5.14 (|cFFFFCC00August 2, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added outline option for bar's Left Text (experimental).\n\n|cFFFFFF00-|r 'Minimalistic' is once again the default skin for new windows, changed from the 'Safe Beta Skin'.\n\n|cFFFFFF00-|r Fixed some issues with spec detection and LibGroupInSpecT-1.1 has need enabled back again.\n\n|cFFFFFF00-|r Fixed an issue with micro displays not loading settings after a logon.\n\n|cFFFFFF00-|r Another wave of workarounds to prevent the client image cache bug.\n\n|cFFFFFF00-|r fixed the spam of 'segment not added to overall'.\n\n|cFFFFFF00-|r stormlash and blessing of might workarouds.\n\n|cFFFFFF00-|r warrior rampage fix.\n\n|cFFFFFF00-|r hunter throw axe fix.\n\n|cFFFFFF00v5.10c (|cFFFFCC00July 22, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Trying a workaround for the wow client's texture cache bug which causes FPS drops, please delete the file 'spec_icons_normal.TGA' from details/image folder.\n\n|cFFFFFF00v5.10b (|cFFFFCC00July 21, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed warlock's Soul Effigy.\n\n|cFFFFFF00v5.10a (|cFFFFCC00July 20, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed an issue with Calc Leech plugin.\n\n|cFFFFFF00v5.10 (|cFFFFCC00July 19, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Using .BLP format for images. If you have FPS drops caused by Details!, delete ALL .TGA files inside the folder Details/Images/\n\n|cFFFFFF00v5.8 (|cFFFFCC00July 11, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Big framework update. May have some bugs, please report to us if you find any.\n\n|cFFFFFF00v5.8 (|cFFFFCC00June 27, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Energy and Resources are working properly now.\n\n|cFFFFFF00-|r Added raid information for The Emerald Nightmare.\n\n|cFFFFFF00v5.7 (|cFFFFCC00June 16, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Most of the raid plugins got added on this version.\n\n|cFFFFFF00-|r Plugin 'Damage, The Game!' also got damage goals updated.\n\n|cFFFFFF00v5.5 (|cFFFFCC00June 03, 2016|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Default skin is now 'Safe Skin Legion Beta' which helps a little with the disabled texture issue.\n|cFFFFFF00-|r If you're using another skin, you may change at the options panel /details options > Skin Selection.\n|cFFFFFF00-|r You also can disable the class icons at Bars: General > Icon File."
|
||
|
||
Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r "
|
||
|
||
--> startup
|
||
_detalhes.initializing = true
|
||
_detalhes.enabled = true
|
||
_detalhes.__index = _detalhes
|
||
_detalhes._tempo = time()
|
||
_detalhes.debug = false
|
||
_detalhes.debug_chr = false
|
||
_detalhes.opened_windows = 0
|
||
_detalhes.last_combat_time = 0
|
||
|
||
--> containers
|
||
--> armazenas as fun<75><6E>es do parser - All parse functions
|
||
_detalhes.parser = {}
|
||
_detalhes.parser_functions = {}
|
||
_detalhes.parser_frame = CreateFrame ("Frame")
|
||
_detalhes.pvp_parser_frame = CreateFrame ("Frame")
|
||
_detalhes.parser_frame:Hide()
|
||
--> armazena os escudos - Shields information for absorbs
|
||
_detalhes.escudos = {}
|
||
--> armazena as fun<75><6E>es dos frames - Frames functions
|
||
_detalhes.gump = _G ["DetailsFramework"]
|
||
function _detalhes:GetFramework()
|
||
return self.gump
|
||
end
|
||
GameCooltip = GameCooltip2
|
||
--> anima<6D><61>es dos icones
|
||
_detalhes.icon_animations = {
|
||
load = {
|
||
in_use = {},
|
||
available = {},
|
||
},
|
||
}
|
||
--> armazena as fun<75><6E>es para inicializa<7A><61>o dos dados - Metatable functions
|
||
_detalhes.refresh = {}
|
||
--> armazena as fun<75><6E>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 = {}
|
||
_detalhes.cache_npc_ids = {}
|
||
--> cache de specs
|
||
_detalhes.cached_specs = {}
|
||
_detalhes.cached_talents = {}
|
||
--> ignored pets
|
||
_detalhes.pets_ignored = {}
|
||
_detalhes.pets_no_owner = {}
|
||
_detalhes.pets_players = {}
|
||
--> armazena as skins dispon<6F>veis para as janelas
|
||
_detalhes.skins = {}
|
||
--> armazena os hooks das fun<75><6E>es do parser
|
||
_detalhes.hooks = {}
|
||
--> informa<6D><61>es sobre a luta do boss atual
|
||
_detalhes.encounter_end_table = {}
|
||
_detalhes.encounter_table = {}
|
||
_detalhes.encounter_counter = {}
|
||
_detalhes.encounter_dungeons = {}
|
||
--> informa<6D><61>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
|
||
--> legion, thanks @pas06 on curse forge for the mapIds
|
||
[1552] = {file = "LoadingScreen_ArenaValSharah_wide", coords = {0, 1, 0.29296875, 0.857421875}}, -- Ashmane's Fall
|
||
[1504] = {file = "LoadingScreen_BlackrookHoldArena_wide", coords = {0, 1, 0.29296875, 0.857421875}}, --Black Rook Hold
|
||
|
||
--"LoadScreenOrgrimmarArena", --Ring of Valor
|
||
}
|
||
function _detalhes:GetArenaInfo (mapid)
|
||
local t = _detalhes.arena_info [mapid]
|
||
if (t) then
|
||
return t.file, t.coords
|
||
end
|
||
end
|
||
_detalhes.battleground_info = {
|
||
[489] = {file = "LoadScreenWarsongGulch", coords = {0, 1, 121/512, 484/512}}, --warsong gulch
|
||
[727] = {file = "LoadScreenSilvershardMines", coords = {0, 1, 251/1024, 840/1024}}, --silvershard mines
|
||
[529] = {file = "LoadscreenArathiBasin", coords = {0, 1, 126/512, 430/512}}, --arathi basin
|
||
[566] = {file = "LoadScreenNetherBattlegrounds", coords = {0, 1, 142/512, 466/512}}, --eye of the storm
|
||
[30] = {file = "LoadScreenPvpBattleground", coords = {0, 1, 127/512, 500/512}}, --alterac valley
|
||
[761] = {file = "LoadScreenGilneasBG2", coords = {0, 1, 281/1024, 878/1024}}, --the battle for gilneas
|
||
[726] = {file = "LoadScreenTwinPeaksBG", coords = {0, 1, 294/1024, 876/1024}}, --twin peaks
|
||
[998] = {file = "LoadScreenValleyofPower", coords = {0, 1, 257/1024, 839/1024}}, --temple of kotmogu
|
||
[1105] = {file = "LoadScreen_GoldRush", coords = {0, 1, 264/1024, 840/1024}}, --deepwind gorge
|
||
[607] = {file = "LoadScreenNorthrendBG", coords = {0, 1, 302/1024, 879/1024}}, --strand of the ancients
|
||
[628] = {file = "LOADSCREENISLEOFCONQUEST", coords = {0, 1, 297/1024, 878/1024}}, --isle of conquest
|
||
--[] = {file = "", coords = {0, 1, 0, 0}}, --
|
||
}
|
||
function _detalhes:GetBattlegroundInfo (mapid)
|
||
local t = _detalhes.battleground_info [mapid]
|
||
if (t) then
|
||
return t.file, t.coords
|
||
end
|
||
end
|
||
--> armazena instancias inativas
|
||
_detalhes.unused_instances = {}
|
||
--_detalhes.default_skin_to_use = "Minimalistic"
|
||
_detalhes.default_skin_to_use = "Minimalistic"
|
||
_detalhes.instance_title_text_timer = {}
|
||
--> player detail skin
|
||
_detalhes.playerdetailwindow_skins = {}
|
||
|
||
--> tooltip
|
||
_detalhes.tooltip_backdrop = {
|
||
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
|
||
edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
|
||
tile = true,
|
||
edgeSize = 16,
|
||
tileSize = 16,
|
||
insets = {left = 3, right = 3, top = 4, bottom = 4}
|
||
}
|
||
_detalhes.tooltip_border_color = {1, 1, 1, 1}
|
||
_detalhes.tooltip_spell_icon = {file = [[Interface\CHARACTERFRAME\UI-StateIcon]], coords = {36/64, 58/64, 7/64, 26/64}}
|
||
--_detalhes.tooltip_target_icon = {file = [[Interface\CHARACTERFRAME\UI-StateIcon]], coords = {36/64, 58/64, 7/64, 26/64}}
|
||
|
||
--> icons
|
||
_detalhes.attribute_icons = [[Interface\AddOns\Details\images\atributos_icones]]
|
||
function _detalhes:GetAttributeIcon (attribute)
|
||
return _detalhes.attribute_icons, 0.125 * (attribute - 1), 0.125 * attribute, 0, 1
|
||
end
|
||
--> Plugins
|
||
|
||
_detalhes.PluginsGlobalNames = {}
|
||
_detalhes.PluginsLocalizedNames = {}
|
||
|
||
--> 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
|
||
--[[global]] DETAILS_HEALTH_POTION_LIST = {
|
||
[188016] = true, --Ancient Healing Potion
|
||
[188018] = true, --Ancient Rejuvenation Potion
|
||
[6262] = true, --warlock's healthstone
|
||
}
|
||
--[[global]] DETAILS_HEALTH_POTION_ID = 188016
|
||
--[[global]] DETAILS_REJU_POTION_ID = 188018
|
||
|
||
_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,
|
||
["DEMONHUNTER"] = 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"]
|
||
}
|
||
|
||
--[[global]] DETAILS_MODE_SOLO = 1
|
||
--[[global]] DETAILS_MODE_RAID = 4
|
||
--[[global]] DETAILS_MODE_GROUP = 2
|
||
--[[global]] DETAILS_MODE_ALL = 3
|
||
|
||
_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", "DetailsPlayerDetailsWindow", _UIParent)
|
||
|
||
--> Event Frame
|
||
_detalhes.listener = _CreateFrame ("Frame", nil, _UIParent)
|
||
_detalhes.listener:RegisterEvent ("ADDON_LOADED")
|
||
_detalhes.listener:SetFrameStrata ("LOW")
|
||
_detalhes.listener:SetFrameLevel (9)
|
||
_detalhes.listener.FrameTime = 0
|
||
|
||
_detalhes.overlay_frame = _CreateFrame ("Frame", nil, _UIParent)
|
||
_detalhes.overlay_frame:SetFrameStrata ("TOOLTIP")
|
||
|
||
--> Pet Owner Finder
|
||
_CreateFrame ("GameTooltip", "DetailsPetOwnerFinder", nil, "GameTooltipTemplate")
|
||
|
||
|
||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||
--> functions
|
||
|
||
_detalhes.empty_function = function() end
|
||
_detalhes.empty_table = {}
|
||
|
||
--> register textures and fonts for shared media
|
||
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
|
||
--default bars
|
||
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]])
|
||
--flat bars
|
||
SharedMedia:Register ("statusbar", "Details Serenity", [[Interface\AddOns\Details\images\bar_serenity]])
|
||
SharedMedia:Register ("statusbar", "BantoBar", [[Interface\AddOns\Details\images\BantoBar]])
|
||
SharedMedia:Register ("statusbar", "Skyline", [[Interface\AddOns\Details\images\bar_skyline]])
|
||
SharedMedia:Register ("statusbar", "WorldState Score", [[Interface\WorldStateFrame\WORLDSTATEFINALSCORE-HIGHLIGHT]])
|
||
SharedMedia:Register ("statusbar", "DGround", [[Interface\AddOns\Details\images\bar_background]])
|
||
|
||
--window bg and bar border
|
||
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]])
|
||
SharedMedia:Register ("border", "Details BarBorder 3", [[Interface\AddOns\Details\images\border_3]])
|
||
SharedMedia:Register ("border", "1 Pixel", [[Interface\Buttons\WHITE8X8]])
|
||
--misc fonts
|
||
SharedMedia:Register ("font", "Oswald", [[Interface\Addons\Details\fonts\Oswald-Regular.otf]])
|
||
SharedMedia:Register ("font", "Nueva Std Cond", [[Interface\Addons\Details\fonts\NuevaStd-Cond.otf]])
|
||
SharedMedia:Register ("font", "Accidental Presidency", [[Interface\Addons\Details\fonts\Accidental Presidency.ttf]])
|
||
SharedMedia:Register ("font", "TrashHand", [[Interface\Addons\Details\fonts\TrashHand.TTF]])
|
||
SharedMedia:Register ("font", "Harry P", [[Interface\Addons\Details\fonts\HARRYP__.TTF]])
|
||
SharedMedia:Register ("font", "FORCED SQUARE", [[Interface\Addons\Details\fonts\FORCED SQUARE.ttf]])
|
||
|
||
SharedMedia:Register ("sound", "d_gun1", [[Interface\Addons\Details\sounds\sound_gun2.ogg]])
|
||
SharedMedia:Register ("sound", "d_gun2", [[Interface\Addons\Details\sounds\sound_gun3.ogg]])
|
||
SharedMedia:Register ("sound", "d_jedi1", [[Interface\Addons\Details\sounds\sound_jedi1.ogg]])
|
||
SharedMedia:Register ("sound", "d_whip1", [[Interface\Addons\Details\sounds\sound_whip1.ogg]])
|
||
|
||
--> 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 or ""), arg1 or "", arg2 or "", arg3 or "", arg4 or "")
|
||
else
|
||
print (Loc ["STRING_DETAILS1"] .. (_string or ""), arg1 or "", arg2 or "", arg3 or "", arg4 or "")
|
||
end
|
||
end
|
||
|
||
--> welcome
|
||
function _detalhes:WelcomeMsgLogon()
|
||
|
||
_detalhes:Msg ("you can always reset the addon running the command |cFFFFFF00'/details reinstall'|r if it does fail to load after being updated.")
|
||
|
||
function _detalhes:wipe_combat_after_failed_load()
|
||
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
|
||
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
|
||
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
|
||
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
|
||
_detalhes:UpdateContainerCombatentes()
|
||
|
||
_detalhes_database.tabela_overall = nil
|
||
_detalhes_database.tabela_historico = nil
|
||
|
||
_detalhes:Msg ("seems failed to load, please type /reload to try again.")
|
||
end
|
||
_detalhes:ScheduleTimer ("wipe_combat_after_failed_load", 5)
|
||
|
||
end
|
||
_detalhes.failed_to_load = _detalhes:ScheduleTimer ("WelcomeMsgLogon", 20)
|
||
|
||
--> key binds
|
||
--> header
|
||
_G ["BINDING_HEADER_Details"] = "Details!"
|
||
_G ["BINDING_HEADER_DETAILS_KEYBIND_SEGMENTCONTROL"] = Loc ["STRING_KEYBIND_SEGMENTCONTROL"]
|
||
_G ["BINDING_HEADER_DETAILS_KEYBIND_SCROLLING"] = Loc ["STRING_KEYBIND_SCROLLING"]
|
||
_G ["BINDING_HEADER_DETAILS_KEYBIND_WINDOW_CONTROL"] = Loc ["STRING_KEYBIND_WINDOW_CONTROL"]
|
||
_G ["BINDING_HEADER_DETAILS_KEYBIND_BOOKMARK"] = Loc ["STRING_KEYBIND_BOOKMARK"]
|
||
_G ["BINDING_HEADER_DETAILS_KEYBIND_REPORT"] = Loc ["STRING_KEYBIND_WINDOW_REPORT_HEADER"]
|
||
|
||
--> keys
|
||
|
||
_G ["BINDING_NAME_DETAILS_TOGGLE_ALL"] = Loc ["STRING_KEYBIND_TOGGLE_WINDOWS"]
|
||
|
||
_G ["BINDING_NAME_DETAILS_RESET_SEGMENTS"] = Loc ["STRING_KEYBIND_RESET_SEGMENTS"]
|
||
_G ["BINDING_NAME_DETAILS_SCROLL_UP"] = Loc ["STRING_KEYBIND_SCROLL_UP"]
|
||
_G ["BINDING_NAME_DETAILS_SCROLL_DOWN"] = Loc ["STRING_KEYBIND_SCROLL_DOWN"]
|
||
|
||
_G ["BINDING_NAME_DETAILS_REPORT_WINDOW1"] = format (Loc ["STRING_KEYBIND_WINDOW_REPORT"], 1)
|
||
_G ["BINDING_NAME_DETAILS_REPORT_WINDOW2"] = format (Loc ["STRING_KEYBIND_WINDOW_REPORT"], 2)
|
||
|
||
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW1"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 1)
|
||
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW2"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 2)
|
||
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW3"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 3)
|
||
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW4"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 4)
|
||
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW5"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 5)
|
||
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK1"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 1)
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK2"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 2)
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK3"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 3)
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK4"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 4)
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK5"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 5)
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK6"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 6)
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK7"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 7)
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK8"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 8)
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK9"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 9)
|
||
_G ["BINDING_NAME_DETAILS_BOOKMARK10"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 10)
|
||
|
||
end
|