Updated LibOpenRaid and DetailsFramework
This commit is contained in:
+183
-183
File diff suppressed because it is too large
Load Diff
+114
-114
@@ -27,7 +27,7 @@ function _detalhes:GetCoreVersion()
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> chat hooks
|
||||
--chat hooks
|
||||
|
||||
_detalhes.chat_embed = _detalhes:CreateEventListener()
|
||||
_detalhes.chat_embed.startup = true
|
||||
@@ -74,7 +74,7 @@ end
|
||||
_detalhes.chat_tab_embed.single_window = is_single
|
||||
|
||||
if (current_name ~= tab_name) then
|
||||
--> rename the tab on chat frame
|
||||
--rename the tab on chat frame
|
||||
local ChatFrame = _detalhes.chat_embed:GetTab (current_name)
|
||||
if (ChatFrame) then
|
||||
FCF_SetWindowName (ChatFrame, tab_name, false)
|
||||
@@ -82,7 +82,7 @@ end
|
||||
end
|
||||
|
||||
if (is_enabled) then
|
||||
--> was disabled, so we need to save the current window positions.
|
||||
--was disabled, so we need to save the current window positions.
|
||||
if (not current_enabled_state) then
|
||||
local window1 = _detalhes:GetInstance (1)
|
||||
if (window1) then
|
||||
@@ -102,10 +102,10 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
--> need to make the embed
|
||||
--need to make the embed
|
||||
_detalhes.chat_embed:DoEmbed()
|
||||
else
|
||||
--> need to release the frame
|
||||
--need to release the frame
|
||||
if (current_enabled_state) then
|
||||
_detalhes.chat_embed:ReleaseEmbed()
|
||||
end
|
||||
@@ -158,27 +158,27 @@ end
|
||||
_detalhes.chat_tab_embed_onframe = ChatFrame
|
||||
|
||||
if (_detalhes.chat_tab_embed.single_window) then
|
||||
--> only one window
|
||||
--only one window
|
||||
local window1 = _detalhes:GetInstance (1)
|
||||
|
||||
window1:UngroupInstance()
|
||||
window1.baseframe:ClearAllPoints()
|
||||
|
||||
window1.baseframe:SetParent (ChatFrame)
|
||||
window1.baseframe:SetParent(ChatFrame)
|
||||
|
||||
window1.rowframe:SetParent (window1.baseframe)
|
||||
window1.rowframe:SetParent(window1.baseframe)
|
||||
window1.rowframe:ClearAllPoints()
|
||||
window1.rowframe:SetAllPoints()
|
||||
|
||||
window1.windowSwitchButton:SetParent (window1.baseframe)
|
||||
window1.windowSwitchButton:SetParent(window1.baseframe)
|
||||
window1.windowSwitchButton:ClearAllPoints()
|
||||
window1.windowSwitchButton:SetAllPoints()
|
||||
|
||||
local y_up = window1.toolbar_side == 1 and -20 or 0
|
||||
local y_down = (window1.show_statusbar and 14 or 0) + (window1.toolbar_side == 2 and 20 or 0)
|
||||
|
||||
window1.baseframe:SetPoint ("topleft", ChatFrameBackground, "topleft", 0, y_up + _detalhes.chat_tab_embed.y_offset)
|
||||
window1.baseframe:SetPoint ("bottomright", ChatFrameBackground, "bottomright", _detalhes.chat_tab_embed.x_offset, y_down)
|
||||
window1.baseframe:SetPoint("topleft", ChatFrameBackground, "topleft", 0, y_up + _detalhes.chat_tab_embed.y_offset)
|
||||
window1.baseframe:SetPoint("bottomright", ChatFrameBackground, "bottomright", _detalhes.chat_tab_embed.x_offset, y_down)
|
||||
|
||||
window1:LockInstance (true)
|
||||
window1:SaveMainWindowPosition()
|
||||
@@ -186,13 +186,13 @@ end
|
||||
local window2 = _detalhes:GetInstance (2)
|
||||
if (window2 and window2.baseframe) then
|
||||
if (window2.baseframe:GetParent() == ChatFrame) then
|
||||
--> need to detach
|
||||
--need to detach
|
||||
_detalhes.chat_embed:ReleaseEmbed (true)
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
--> window #1 and #2
|
||||
--window #1 and #2
|
||||
local window1 = _detalhes:GetInstance (1)
|
||||
local window2 = _detalhes:GetInstance (2)
|
||||
if (not window2) then
|
||||
@@ -204,15 +204,15 @@ end
|
||||
window1.baseframe:ClearAllPoints()
|
||||
window2.baseframe:ClearAllPoints()
|
||||
|
||||
window1.baseframe:SetParent (ChatFrame)
|
||||
window2.baseframe:SetParent (ChatFrame)
|
||||
window1.rowframe:SetParent (window1.baseframe)
|
||||
window2.rowframe:SetParent (window2.baseframe)
|
||||
window1.baseframe:SetParent(ChatFrame)
|
||||
window2.baseframe:SetParent(ChatFrame)
|
||||
window1.rowframe:SetParent(window1.baseframe)
|
||||
window2.rowframe:SetParent(window2.baseframe)
|
||||
|
||||
window1.windowSwitchButton:SetParent (window1.baseframe)
|
||||
window1.windowSwitchButton:SetParent(window1.baseframe)
|
||||
window1.windowSwitchButton:ClearAllPoints()
|
||||
window1.windowSwitchButton:SetAllPoints()
|
||||
window2.windowSwitchButton:SetParent (window2.baseframe)
|
||||
window2.windowSwitchButton:SetParent(window2.baseframe)
|
||||
window2.windowSwitchButton:ClearAllPoints()
|
||||
window2.windowSwitchButton:SetAllPoints()
|
||||
|
||||
@@ -232,11 +232,11 @@ end
|
||||
local width = ChatFrameBackground:GetWidth() / 2
|
||||
local height = ChatFrameBackground:GetHeight() - y_down + y_up
|
||||
|
||||
window1.baseframe:SetSize (width + (_detalhes.chat_tab_embed.x_offset/2), height + _detalhes.chat_tab_embed.y_offset)
|
||||
window2.baseframe:SetSize (width + (_detalhes.chat_tab_embed.x_offset/2), height + _detalhes.chat_tab_embed.y_offset)
|
||||
window1.baseframe:SetSize(width + (_detalhes.chat_tab_embed.x_offset/2), height + _detalhes.chat_tab_embed.y_offset)
|
||||
window2.baseframe:SetSize(width + (_detalhes.chat_tab_embed.x_offset/2), height + _detalhes.chat_tab_embed.y_offset)
|
||||
|
||||
window1.baseframe:SetPoint ("topleft", ChatFrameBackground, "topleft", 0, y_up + _detalhes.chat_tab_embed.y_offset)
|
||||
window2.baseframe:SetPoint ("topright", ChatFrameBackground, "topright", _detalhes.chat_tab_embed.x_offset, y_up + _detalhes.chat_tab_embed.y_offset)
|
||||
window1.baseframe:SetPoint("topleft", ChatFrameBackground, "topleft", 0, y_up + _detalhes.chat_tab_embed.y_offset)
|
||||
window2.baseframe:SetPoint("topright", ChatFrameBackground, "topright", _detalhes.chat_tab_embed.x_offset, y_up + _detalhes.chat_tab_embed.y_offset)
|
||||
|
||||
window1:SaveMainWindowPosition()
|
||||
window2:SaveMainWindowPosition()
|
||||
@@ -248,16 +248,16 @@ end
|
||||
end
|
||||
|
||||
function _detalhes.chat_embed:ReleaseEmbed (second_window)
|
||||
--> release
|
||||
--release
|
||||
local window1 = _detalhes:GetInstance (1)
|
||||
local window2 = _detalhes:GetInstance (2)
|
||||
|
||||
if (second_window) then
|
||||
window2.baseframe:ClearAllPoints()
|
||||
window2.baseframe:SetParent (UIParent)
|
||||
window2.rowframe:SetParent (UIParent)
|
||||
window2.baseframe:SetPoint ("center", UIParent, "center", 200, 0)
|
||||
window2.rowframe:SetPoint ("center", UIParent, "center", 200, 0)
|
||||
window2.baseframe:SetParent(UIParent)
|
||||
window2.rowframe:SetParent(UIParent)
|
||||
window2.baseframe:SetPoint("center", UIParent, "center", 200, 0)
|
||||
window2.rowframe:SetPoint("center", UIParent, "center", 200, 0)
|
||||
window2:LockInstance (false)
|
||||
window2:SaveMainWindowPosition()
|
||||
|
||||
@@ -269,10 +269,10 @@ end
|
||||
end
|
||||
|
||||
window1.baseframe:ClearAllPoints()
|
||||
window1.baseframe:SetParent (UIParent)
|
||||
window1.rowframe:SetParent (UIParent)
|
||||
window1.baseframe:SetPoint ("center", UIParent, "center")
|
||||
window1.rowframe:SetPoint ("center", UIParent, "center")
|
||||
window1.baseframe:SetParent(UIParent)
|
||||
window1.rowframe:SetParent(UIParent)
|
||||
window1.baseframe:SetPoint("center", UIParent, "center")
|
||||
window1.rowframe:SetPoint("center", UIParent, "center")
|
||||
window1:LockInstance (false)
|
||||
window1:SaveMainWindowPosition()
|
||||
|
||||
@@ -283,10 +283,10 @@ end
|
||||
|
||||
if (not _detalhes.chat_tab_embed.single_window and window2) then
|
||||
window2.baseframe:ClearAllPoints()
|
||||
window2.baseframe:SetParent (UIParent)
|
||||
window2.rowframe:SetParent (UIParent)
|
||||
window2.baseframe:SetPoint ("center", UIParent, "center", 200, 0)
|
||||
window2.rowframe:SetPoint ("center", UIParent, "center", 200, 0)
|
||||
window2.baseframe:SetParent(UIParent)
|
||||
window2.rowframe:SetParent(UIParent)
|
||||
window2.baseframe:SetPoint("center", UIParent, "center", 200, 0)
|
||||
window2.rowframe:SetPoint("center", UIParent, "center", 200, 0)
|
||||
window2:LockInstance (false)
|
||||
window2:SaveMainWindowPosition()
|
||||
|
||||
@@ -343,7 +343,7 @@ function _detalhes:SetDeathLogLimit (limit)
|
||||
end
|
||||
else
|
||||
event_table.n = 1
|
||||
for _, t in ipairs (event_table) do
|
||||
for _, t in ipairs(event_table) do
|
||||
wipe (t)
|
||||
end
|
||||
end
|
||||
@@ -385,13 +385,13 @@ function _detalhes:TrackSpecsNow (track_everything)
|
||||
end
|
||||
else
|
||||
local combatlist = {}
|
||||
for _, combat in ipairs (_detalhes.tabela_historico.tabelas) do
|
||||
for _, combat in ipairs(_detalhes.tabela_historico.tabelas) do
|
||||
tinsert (combatlist, combat)
|
||||
end
|
||||
tinsert (combatlist, _detalhes.tabela_vigente)
|
||||
tinsert (combatlist, _detalhes.tabela_overall)
|
||||
|
||||
for _, combat in ipairs (combatlist) do
|
||||
for _, combat in ipairs(combatlist) do
|
||||
for _, actor in combat[1]:ListActors() do
|
||||
if (actor:IsPlayer()) then
|
||||
for spellid, spell in pairs (actor:GetSpellList()) do
|
||||
@@ -429,9 +429,9 @@ function _detalhes:ResetSpecCache (forced)
|
||||
|
||||
if (_detalhes.track_specs) then
|
||||
local my_spec = DetailsFramework.GetSpecialization()
|
||||
if (type (my_spec) == "number") then
|
||||
if (type(my_spec) == "number") then
|
||||
local spec_number = DetailsFramework.GetSpecializationInfo (my_spec)
|
||||
if (type (spec_number) == "number") then
|
||||
if (type(spec_number) == "number") then
|
||||
local pguid = UnitGUID (_detalhes.playername)
|
||||
if (pguid) then
|
||||
_detalhes.cached_specs [pguid] = spec_number
|
||||
@@ -475,7 +475,7 @@ function _detalhes:RefreshUpdater(suggested_interval)
|
||||
local updateInterval = suggested_interval or _detalhes.update_speed
|
||||
|
||||
if (_detalhes.streamer_config.faster_updates) then
|
||||
--> force 60 updates per second
|
||||
--force 60 updates per second
|
||||
updateInterval = 0.016
|
||||
end
|
||||
|
||||
@@ -623,7 +623,7 @@ end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> background tasks
|
||||
--background tasks
|
||||
|
||||
|
||||
local background_tasks = {}
|
||||
@@ -635,12 +635,12 @@ local task_timers = {
|
||||
|
||||
function _detalhes:RegisterBackgroundTask (name, func, priority, ...)
|
||||
|
||||
assert (type (self) == "table", "RegisterBackgroundTask 'self' must be a table.")
|
||||
assert (type (name) == "string", "RegisterBackgroundTask param #1 must be a string.")
|
||||
if (type (func) == "string") then
|
||||
assert (type (self [func]) == "function", "RegisterBackgroundTask param #2 function not found on main object.")
|
||||
assert (type(self) == "table", "RegisterBackgroundTask 'self' must be a table.")
|
||||
assert (type(name) == "string", "RegisterBackgroundTask param #1 must be a string.")
|
||||
if (type(func) == "string") then
|
||||
assert (type(self [func]) == "function", "RegisterBackgroundTask param #2 function not found on main object.")
|
||||
else
|
||||
assert (type (func) == "function", "RegisterBackgroundTask param #2 expect a function or function name.")
|
||||
assert (type(func) == "function", "RegisterBackgroundTask param #2 expect a function or function name.")
|
||||
end
|
||||
|
||||
priority = priority or "LOW"
|
||||
@@ -674,7 +674,7 @@ function _detalhes:DoBackgroundTasks()
|
||||
|
||||
for taskName, taskTable in pairs (background_tasks) do
|
||||
if (t > taskTable.nextexec) then
|
||||
if (type (taskTable.func) == "string") then
|
||||
if (type(taskTable.func) == "string") then
|
||||
taskTable.object [taskTable.func] (taskTable.object, unpack (taskTable.args, 1, taskTable.args_amt))
|
||||
else
|
||||
taskTable.func (unpack (taskTable.args, 1, taskTable.args_amt))
|
||||
@@ -689,13 +689,13 @@ _detalhes.background_tasks_loop = _detalhes:ScheduleRepeatingTimer ("DoBackgroun
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> storage stuff ~storage
|
||||
--storage stuff ~storage
|
||||
|
||||
--global database
|
||||
_detalhes.storage = {}
|
||||
|
||||
function _detalhes.storage:OpenRaidStorage()
|
||||
--> check if the storage is already loaded
|
||||
--check if the storage is already loaded
|
||||
if (not IsAddOnLoaded ("Details_DataStorage")) then
|
||||
local loaded, reason = LoadAddOn ("Details_DataStorage")
|
||||
if (not loaded) then
|
||||
@@ -703,7 +703,7 @@ function _detalhes.storage:OpenRaidStorage()
|
||||
end
|
||||
end
|
||||
|
||||
--> get the storage table
|
||||
--get the storage table
|
||||
local db = DetailsDataStorage
|
||||
|
||||
if (not db and _detalhes.CreateStorageDB) then
|
||||
@@ -733,13 +733,13 @@ function _detalhes.storage:HaveDataForEncounter (diff, encounter_id, guild_name)
|
||||
if (table) then
|
||||
local encounters = table [encounter_id]
|
||||
if (encounters) then
|
||||
--> didn't requested a guild name, so just return 'we have data for this encounter'
|
||||
--didn't requested a guild name, so just return 'we have data for this encounter'
|
||||
if (not guild_name) then
|
||||
return true
|
||||
end
|
||||
|
||||
--> data for a specific guild is requested, check if there is data for the guild
|
||||
for index, encounter in ipairs (encounters) do
|
||||
--data for a specific guild is requested, check if there is data for the guild
|
||||
for index, encounter in ipairs(encounters) do
|
||||
if (encounter.guild == guild_name) then
|
||||
return true
|
||||
end
|
||||
@@ -786,7 +786,7 @@ function _detalhes.storage:GetBestFromGuild (diff, encounter_id, role, dps, guil
|
||||
if (table) then
|
||||
local encounters = table [encounter_id]
|
||||
if (encounters) then
|
||||
for index, encounter in ipairs (encounters) do
|
||||
for index, encounter in ipairs(encounters) do
|
||||
if (encounter.guild == guild_name) then
|
||||
local players = encounter [role]
|
||||
if (players) then
|
||||
@@ -852,7 +852,7 @@ function _detalhes.storage:GetPlayerGuildRank (diff, encounter_id, role, playern
|
||||
if (_table) then
|
||||
local encounters = _table [encounter_id]
|
||||
if (encounters) then
|
||||
for index, encounter in ipairs (encounters) do
|
||||
for index, encounter in ipairs(encounters) do
|
||||
if (encounter.guild == guild_name) then
|
||||
local roleTable = encounter [role]
|
||||
for playerName, playerTable in pairs (roleTable) do
|
||||
@@ -931,7 +931,7 @@ function _detalhes.storage:GetBestFromPlayer (diff, encounter_id, role, playerna
|
||||
if (table) then
|
||||
local encounters = table [encounter_id]
|
||||
if (encounters) then
|
||||
for index, encounter in ipairs (encounters) do
|
||||
for index, encounter in ipairs(encounters) do
|
||||
local player = encounter [role] and encounter [role] [playername]
|
||||
if (player) then
|
||||
if (best) then
|
||||
@@ -971,7 +971,7 @@ local encounter_is_current_tier = function(encounterID)
|
||||
if (OnlyFromCurrentRaidTier) then
|
||||
local mapID = _detalhes:GetInstanceIdFromEncounterId (encounterID)
|
||||
if (mapID) then
|
||||
--> if isn'y the mapID in the table to save data
|
||||
--if isn'y the mapID in the table to save data
|
||||
if (not _detalhes.InstancesToStoreData [mapID]) then
|
||||
return false
|
||||
end
|
||||
@@ -987,9 +987,9 @@ local have_encounter = function(db, ID)
|
||||
local maxTime = ID + 120
|
||||
|
||||
for diff, diffTable in pairs (db or {}) do
|
||||
if (type (diffTable) == "table") then
|
||||
if (type(diffTable) == "table") then
|
||||
for encounterID, encounterTable in pairs (diffTable) do
|
||||
for index, encounter in ipairs (encounterTable) do
|
||||
for index, encounter in ipairs(encounterTable) do
|
||||
--check if the encounter fits in the timespam window
|
||||
if (encounter.time >= minTime and encounter.time <= maxTime) then
|
||||
return true
|
||||
@@ -1030,10 +1030,10 @@ function _detalhes.storage:GetIDsToGuildSync()
|
||||
|
||||
--build the encounter ID list
|
||||
for diff, diffTable in pairs (db or {}) do
|
||||
if (type (diffTable) == "table") then
|
||||
if (type(diffTable) == "table") then
|
||||
for encounterID, encounterTable in pairs (diffTable) do
|
||||
if (encounter_is_current_tier (encounterID)) then
|
||||
for index, encounter in ipairs (encounterTable) do
|
||||
for index, encounter in ipairs(encounterTable) do
|
||||
if (encounter.servertime) then
|
||||
if (myGuildName == encounter.guild) then
|
||||
tinsert (IDs, encounter.servertime)
|
||||
@@ -1061,7 +1061,7 @@ function _detalhes.storage:CheckMissingIDsToGuildSync (IDsList)
|
||||
return
|
||||
end
|
||||
|
||||
if (type (IDsList) ~= "table") then
|
||||
if (type(IDsList) ~= "table") then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) [RoS-EncounterSync] RoC IDsList isn't a table.")
|
||||
end
|
||||
@@ -1075,7 +1075,7 @@ function _detalhes.storage:CheckMissingIDsToGuildSync (IDsList)
|
||||
local RequestIDs = {}
|
||||
|
||||
--check missing IDs
|
||||
for index, ID in ipairs (IDsList) do
|
||||
for index, ID in ipairs(IDsList) do
|
||||
if (not have_encounter (db, ID)) then
|
||||
if (not have_recent_requested_encounter (ID)) then
|
||||
tinsert (RequestIDs, ID)
|
||||
@@ -1099,7 +1099,7 @@ function _detalhes.storage:BuildEncounterDataToGuildSync (IDsList)
|
||||
return
|
||||
end
|
||||
|
||||
if (type (IDsList) ~= "table") then
|
||||
if (type(IDsList) ~= "table") then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) [RoS-EncounterSync] IDsList isn't a table.")
|
||||
end
|
||||
@@ -1117,14 +1117,14 @@ function _detalhes.storage:BuildEncounterDataToGuildSync (IDsList)
|
||||
_detalhes:Msg ("(debug) [RoS-EncounterSync] the client requested " .. #IDsList .. " encounters.")
|
||||
end
|
||||
|
||||
for index, ID in ipairs (IDsList) do
|
||||
for index, ID in ipairs(IDsList) do
|
||||
|
||||
for diff, diffTable in pairs (db or {}) do
|
||||
if (type (diffTable) == "table") then
|
||||
if (type(diffTable) == "table") then
|
||||
for encounterID, encounterTable in pairs (diffTable) do
|
||||
for index, encounter in ipairs (encounterTable) do
|
||||
for index, encounter in ipairs(encounterTable) do
|
||||
|
||||
if (ID == encounter.time or ID == encounter.servertime) then --> the time here is always exactly
|
||||
if (ID == encounter.time or ID == encounter.servertime) then --the time here is always exactly
|
||||
--send this encounter
|
||||
CurrentTable [diff] = CurrentTable [diff] or {}
|
||||
CurrentTable [diff] [encounterID] = CurrentTable [diff] [encounterID] or {}
|
||||
@@ -1167,12 +1167,12 @@ function _detalhes.storage:AddGuildSyncData (data, source)
|
||||
_detalhes.LastGuildSyncReceived = GetTime()
|
||||
|
||||
for diff, diffTable in pairs (data) do
|
||||
if (type (diff) == "number" and type (diffTable) == "table") then
|
||||
if (type(diff) == "number" and type (diffTable) == "table") then
|
||||
for encounterID, encounterTable in pairs (diffTable) do
|
||||
if (type (encounterID) == "number" and type (encounterTable) == "table") then
|
||||
for index, encounter in ipairs (encounterTable) do
|
||||
if (type(encounterID) == "number" and type (encounterTable) == "table") then
|
||||
for index, encounter in ipairs(encounterTable) do
|
||||
--validate the encounter
|
||||
if (type (encounter.servertime) == "number" and type (encounter.time) == "number" and type (encounter.guild) == "string" and type (encounter.date) == "string" and type (encounter.healing) == "table" and type (encounter.elapsed) == "number" and type (encounter.damage) == "table") then
|
||||
if (type(encounter.servertime) == "number" and type (encounter.time) == "number" and type (encounter.guild) == "string" and type (encounter.date) == "string" and type (encounter.healing) == "table" and type (encounter.elapsed) == "number" and type (encounter.damage) == "table") then
|
||||
--check if the encounter is from the current raiding tier
|
||||
if (encounter_is_current_tier (encounterID)) then
|
||||
--check if this encounter already has been added from another sync
|
||||
@@ -1266,7 +1266,7 @@ function _detalhes.storage:GetPlayerData (diff, encounter_id, playername)
|
||||
end
|
||||
|
||||
local t = {}
|
||||
assert (type (playername) == "string", "PlayerName must be a string.")
|
||||
assert (type(playername) == "string", "PlayerName must be a string.")
|
||||
|
||||
|
||||
if (not diff) then
|
||||
@@ -1335,7 +1335,7 @@ function _detalhes.storage:GetEncounterData (diff, encounter_id, guild)
|
||||
local data = db [diff]
|
||||
|
||||
assert (data, "Difficulty not found. Use: 14, 15 or 16.")
|
||||
assert (type (encounter_id) == "number", "EncounterId must be a number.")
|
||||
assert (type(encounter_id) == "number", "EncounterId must be a number.")
|
||||
|
||||
data = data [encounter_id]
|
||||
|
||||
@@ -1361,7 +1361,7 @@ function _detalhes.storage:GetEncounterData (diff, encounter_id, guild)
|
||||
end
|
||||
|
||||
local create_storage_tables = function()
|
||||
--> get the storage table
|
||||
--get the storage table
|
||||
local db = DetailsDataStorage
|
||||
|
||||
if (not db and _detalhes.CreateStorageDB) then
|
||||
@@ -1418,9 +1418,9 @@ end
|
||||
function _detalhes.OpenStorage()
|
||||
--if the player is in combat, this function return false, if failed to load by other reason it returns nil
|
||||
|
||||
--> check if the storage is already loaded
|
||||
--check if the storage is already loaded
|
||||
if (not IsAddOnLoaded ("Details_DataStorage")) then
|
||||
--> can't open it during combat
|
||||
--can't open it during combat
|
||||
if (InCombatLockdown() or UnitAffectingCombat ("player")) then
|
||||
if (_detalhes.debug) then
|
||||
print ("|cFFFFFF00Details! Storage|r: can't load storage due to combat.")
|
||||
@@ -1462,7 +1462,7 @@ function Details.Database.LoadDB()
|
||||
end
|
||||
end
|
||||
|
||||
--> get the storage table
|
||||
--get the storage table
|
||||
local db = _G.DetailsDataStorage
|
||||
|
||||
if (not db and _detalhes.CreateStorageDB) then
|
||||
@@ -1621,7 +1621,7 @@ function Details.Database.StoreEncounter(combat)
|
||||
--total kills in a boss on raid or dungeon
|
||||
local totalkills_database = Details.Database.GetBossKillsDB(db)
|
||||
|
||||
--> store total kills on this boss
|
||||
--store total kills on this boss
|
||||
--if the player is facing a raid boss
|
||||
if (IsInRaid()) then
|
||||
totalkills_database[encounter_id] = totalkills_database[encounter_id] or {}
|
||||
@@ -1663,10 +1663,10 @@ function Details.Database.StoreEncounter(combat)
|
||||
end
|
||||
|
||||
|
||||
--> check for heroic and mythic
|
||||
--check for heroic and mythic
|
||||
if (storageDebug or (diff == 15 or diff == 16 or diff == 14)) then --test on raid finder: ' or diff == 17' -- normal mode: diff == 14 or
|
||||
|
||||
--> check the guild name
|
||||
--check the guild name
|
||||
local match = 0
|
||||
local guildName = GetGuildInfo ("player")
|
||||
local raidSize = GetNumGroupMembers() or 0
|
||||
@@ -1747,14 +1747,14 @@ function Details.Database.StoreEncounter(combat)
|
||||
end
|
||||
end
|
||||
|
||||
--> add the encounter data
|
||||
--add the encounter data
|
||||
tinsert (encounter_database, this_combat_data)
|
||||
if (_detalhes.debug) then
|
||||
print ("|cFFFFFF00Details! Storage|r: combat data added to encounter database.")
|
||||
end
|
||||
|
||||
local myrole = UnitGroupRolesAssigned ("player")
|
||||
local mybest, onencounter = _detalhes.storage:GetBestFromPlayer (diff, encounter_id, myrole, _detalhes.playername, true) --> get dps or hps
|
||||
local mybest, onencounter = _detalhes.storage:GetBestFromPlayer (diff, encounter_id, myrole, _detalhes.playername, true) --get dps or hps
|
||||
local mybest2 = mybest and mybest[1] or 0
|
||||
|
||||
if (mybest and onencounter) then
|
||||
@@ -1804,7 +1804,7 @@ function Details.Database.StoreEncounter(combat)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> inspect stuff
|
||||
--inspect stuff
|
||||
|
||||
_detalhes.ilevel = {}
|
||||
local ilvl_core = _detalhes:CreateEventListener()
|
||||
@@ -1827,7 +1827,7 @@ function ilvl_core:HasQueuedInspec (unitName)
|
||||
end
|
||||
end
|
||||
|
||||
local inspect_frame = CreateFrame ("frame")
|
||||
local inspect_frame = CreateFrame("frame")
|
||||
inspect_frame:RegisterEvent ("INSPECT_READY")
|
||||
|
||||
local two_hand = {
|
||||
@@ -1843,7 +1843,7 @@ local LOOP_TIME = 7
|
||||
function _detalhes:IlvlFromNetwork (player, realm, core, serialNumber, itemLevel, talentsSelected, currentSpec)
|
||||
if (_detalhes.debug) then
|
||||
local talents = "Invalid Talents"
|
||||
if (type (talentsSelected) == "table") then
|
||||
if (type(talentsSelected) == "table") then
|
||||
talents = ""
|
||||
for i = 1, #talentsSelected do
|
||||
talents = talents .. talentsSelected [i] .. ","
|
||||
@@ -1856,44 +1856,44 @@ function _detalhes:IlvlFromNetwork (player, realm, core, serialNumber, itemLevel
|
||||
return
|
||||
end
|
||||
|
||||
--> older versions of details wont send serial nor talents nor spec
|
||||
--older versions of details wont send serial nor talents nor spec
|
||||
if (not serialNumber or not itemLevel or not talentsSelected or not currentSpec) then
|
||||
--if any data is invalid, abort
|
||||
return
|
||||
end
|
||||
|
||||
--> won't inspect this actor
|
||||
--won't inspect this actor
|
||||
_detalhes.trusted_characters [serialNumber] = true
|
||||
|
||||
if (type (serialNumber) ~= "string") then
|
||||
if (type(serialNumber) ~= "string") then
|
||||
return
|
||||
end
|
||||
|
||||
--store the item level
|
||||
if (type (itemLevel) == "number") then
|
||||
if (type(itemLevel) == "number") then
|
||||
_detalhes.item_level_pool [serialNumber] = {name = player, ilvl = itemLevel, time = time()}
|
||||
end
|
||||
|
||||
--store talents
|
||||
if (type (talentsSelected) == "table") then
|
||||
if (type(talentsSelected) == "table") then
|
||||
if (talentsSelected [1]) then
|
||||
_detalhes.cached_talents [serialNumber] = talentsSelected
|
||||
end
|
||||
end
|
||||
|
||||
--store the spec the player is playing
|
||||
if (type (currentSpec) == "number") then
|
||||
if (type(currentSpec) == "number") then
|
||||
_detalhes.cached_specs [serialNumber] = currentSpec
|
||||
end
|
||||
end
|
||||
|
||||
--> test
|
||||
--test
|
||||
--/run _detalhes.ilevel:CalcItemLevel ("player", UnitGUID("player"), true)
|
||||
--/run wipe (_detalhes.item_level_pool)
|
||||
|
||||
function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
|
||||
if (type (unitid) == "table") then
|
||||
if (type(unitid) == "table") then
|
||||
shout = unitid [3]
|
||||
guid = unitid [2]
|
||||
unitid = unitid [1]
|
||||
@@ -1901,7 +1901,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
|
||||
if (unitid and CanInspect(unitid) and UnitPlayerControlled(unitid) and CheckInteractDistance(unitid, CONST_INSPECT_ACHIEVEMENT_DISTANCE)) then
|
||||
|
||||
--> 16 = all itens including main and off hand
|
||||
--16 = all itens including main and off hand
|
||||
local item_amount = 16
|
||||
local item_level = 0
|
||||
local failed = 0
|
||||
@@ -1914,8 +1914,8 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
if (iLevel) then
|
||||
item_level = item_level + iLevel
|
||||
|
||||
--> 16 = main hand 17 = off hand
|
||||
--> if using a two-hand, ignore the off hand slot
|
||||
--16 = main hand 17 = off hand
|
||||
-- if using a two-hand, ignore the off hand slot
|
||||
if (equip_id == 16 and two_hand [equipSlot]) then
|
||||
item_amount = 15
|
||||
break
|
||||
@@ -1933,7 +1933,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
local average = item_level / item_amount
|
||||
--print (UnitName (unitid), "ILVL:", average, unitid, "items:", item_amount)
|
||||
|
||||
--> register
|
||||
--register
|
||||
if (average > 0) then
|
||||
if (shout) then
|
||||
_detalhes:Msg (UnitName(unitid) .. " item level: " .. average)
|
||||
@@ -1977,7 +1977,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
--------------------------------------------------------------------------------------------------------
|
||||
|
||||
if (ilvl_core.forced_inspects [guid]) then
|
||||
if (type (ilvl_core.forced_inspects [guid].callback) == "function") then
|
||||
if (type(ilvl_core.forced_inspects [guid].callback) == "function") then
|
||||
local okey, errortext = pcall (ilvl_core.forced_inspects[guid].callback, guid, unitid, ilvl_core.forced_inspects[guid].param1, ilvl_core.forced_inspects[guid].param2)
|
||||
if (not okey) then
|
||||
_detalhes:Msg ("Error on QueryInspect callback: " .. errortext)
|
||||
@@ -1992,7 +1992,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
end
|
||||
_detalhes.ilevel.CalcItemLevel = ilvl_core.CalcItemLevel
|
||||
|
||||
inspect_frame:SetScript ("OnEvent", function(self, event, ...)
|
||||
inspect_frame:SetScript("OnEvent", function(self, event, ...)
|
||||
local guid = select (1, ...)
|
||||
|
||||
if (inspecting [guid]) then
|
||||
@@ -2002,7 +2002,7 @@ inspect_frame:SetScript ("OnEvent", function(self, event, ...)
|
||||
|
||||
ilvl_core:CancelTimer (cancel_tread)
|
||||
|
||||
--> do inspect stuff
|
||||
--do inspect stuff
|
||||
if (unitid) then
|
||||
local t = {unitid, guid}
|
||||
--ilvl_core:ScheduleTimer ("CalcItemLevel", 0.5, t)
|
||||
@@ -2044,7 +2044,7 @@ function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number)
|
||||
return
|
||||
end
|
||||
|
||||
--> ddouble check
|
||||
--ddouble check
|
||||
if (not is_forced and (UnitAffectingCombat ("player") or InCombatLockdown())) then
|
||||
return
|
||||
end
|
||||
@@ -2186,7 +2186,7 @@ function ilvl_core:Loop()
|
||||
return
|
||||
end
|
||||
|
||||
--> if already inspecting or the actor is in the list of trusted actors
|
||||
--if already inspecting or the actor is in the list of trusted actors
|
||||
if (inspecting [guid] or _detalhes.trusted_characters [guid]) then
|
||||
return
|
||||
end
|
||||
@@ -2252,12 +2252,12 @@ function ilvl_core:OnLeave()
|
||||
end
|
||||
end
|
||||
|
||||
--> ilvl API
|
||||
--ilvl API
|
||||
function _detalhes.ilevel:IsTrackerEnabled()
|
||||
return _detalhes.track_item_level
|
||||
end
|
||||
function _detalhes.ilevel:TrackItemLevel (bool)
|
||||
if (type (bool) == "boolean") then
|
||||
if (type(bool) == "boolean") then
|
||||
if (bool) then
|
||||
_detalhes.track_item_level = true
|
||||
if (can_start_loop()) then
|
||||
@@ -2349,27 +2349,27 @@ function Details:DecompressData (data, dataType)
|
||||
|
||||
dataCompressed = LibDeflate:DecodeForPrint (data)
|
||||
if (not dataCompressed) then
|
||||
Details:Msg ("couldn't decode the data.")
|
||||
Details:Msg("couldn't decode the data.")
|
||||
return false
|
||||
end
|
||||
|
||||
elseif (dataType == "comm") then
|
||||
dataCompressed = LibDeflate:DecodeForWoWAddonChannel (data)
|
||||
if (not dataCompressed) then
|
||||
Details:Msg ("couldn't decode the data.")
|
||||
Details:Msg("couldn't decode the data.")
|
||||
return false
|
||||
end
|
||||
end
|
||||
local dataSerialized = LibDeflate:DecompressDeflate (dataCompressed)
|
||||
|
||||
if (not dataSerialized) then
|
||||
Details:Msg ("couldn't uncompress the data.")
|
||||
Details:Msg("couldn't uncompress the data.")
|
||||
return false
|
||||
end
|
||||
|
||||
local okay, data = LibAceSerializer:Deserialize (dataSerialized)
|
||||
if (not okay) then
|
||||
Details:Msg ("couldn't unserialize the data.")
|
||||
Details:Msg("couldn't unserialize the data.")
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -2379,7 +2379,7 @@ end
|
||||
|
||||
--oldschool talent tree
|
||||
if (DetailsFramework.IsWotLKWow()) then
|
||||
local talentWatchClassic = CreateFrame ("frame")
|
||||
local talentWatchClassic = CreateFrame("frame")
|
||||
talentWatchClassic:RegisterEvent("CHARACTER_POINTS_CHANGED")
|
||||
talentWatchClassic:RegisterEvent("SPELLS_CHANGED")
|
||||
talentWatchClassic:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
@@ -2488,8 +2488,8 @@ if (DetailsFramework.IsWotLKWow()) then
|
||||
if (iLevel) then
|
||||
item_level = item_level + iLevel
|
||||
|
||||
--> 16 = main hand 17 = off hand
|
||||
--> if using a two-hand, ignore the off hand slot
|
||||
--16 = main hand 17 = off hand
|
||||
-- if using a two-hand, ignore the off hand slot
|
||||
if (equip_id == 16 and two_hand [equipSlot]) then
|
||||
item_amount = 15
|
||||
break
|
||||
|
||||
+105
-105
@@ -4,7 +4,7 @@
|
||||
local _tempo = time()
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> local pointers
|
||||
--local pointers
|
||||
local _
|
||||
local _pairs = pairs --lua local
|
||||
local _ipairs = ipairs --lua local
|
||||
@@ -30,7 +30,7 @@
|
||||
local container_damage_target = _detalhes.container_type.CONTAINER_DAMAGETARGET_CLASS
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> constants
|
||||
--constants
|
||||
|
||||
local class_type_dano = _detalhes.atributos.dano
|
||||
local class_type_cura = _detalhes.atributos.cura
|
||||
@@ -38,9 +38,9 @@
|
||||
local class_type_misc = _detalhes.atributos.misc
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> core
|
||||
--core
|
||||
|
||||
--> reconstr�i o mapa do container
|
||||
--reconstr�i o mapa do container
|
||||
local function ReconstroiMapa (tabela)
|
||||
local mapa = {}
|
||||
for i = 1, #tabela._ActorTable do
|
||||
@@ -49,7 +49,7 @@
|
||||
tabela._NameIndexTable = mapa
|
||||
end
|
||||
|
||||
--> reaplica as tabelas no overall
|
||||
--reaplica as tabelas no overall
|
||||
function _detalhes:RestauraOverallMetaTables()
|
||||
|
||||
local is_in_instance = select (1, IsInInstance())
|
||||
@@ -71,8 +71,8 @@
|
||||
|
||||
local todos_atributos = {combate [class_type_dano]._ActorTable, combate [class_type_cura]._ActorTable, combate [class_type_e_energy]._ActorTable, combate [class_type_misc]._ActorTable}
|
||||
|
||||
for class_type, atributo in _ipairs (todos_atributos) do
|
||||
for _, esta_classe in _ipairs (atributo) do
|
||||
for class_type, atributo in _ipairs(todos_atributos) do
|
||||
for _, esta_classe in _ipairs(atributo) do
|
||||
|
||||
local nome = esta_classe.nome
|
||||
|
||||
@@ -101,9 +101,9 @@
|
||||
end
|
||||
end
|
||||
|
||||
for class_type, atributo in _ipairs (todos_atributos) do
|
||||
for _, esta_classe in _ipairs (atributo) do
|
||||
if (esta_classe.ownerName) then --> nome do owner
|
||||
for class_type, atributo in _ipairs(todos_atributos) do
|
||||
for _, esta_classe in _ipairs(atributo) do
|
||||
if (esta_classe.ownerName) then --nome do owner
|
||||
esta_classe.owner = combate (class_type, esta_classe.ownerName)
|
||||
end
|
||||
end
|
||||
@@ -111,26 +111,26 @@
|
||||
|
||||
end
|
||||
|
||||
--> reaplica indexes e metatables
|
||||
--reaplica indexes e metatables
|
||||
function _detalhes:RestauraMetaTables()
|
||||
|
||||
_detalhes.refresh:r_atributo_custom()
|
||||
|
||||
--> container de pets e hist�rico
|
||||
--container de pets e hist�rico
|
||||
_detalhes.refresh:r_container_pets (_detalhes.tabela_pets)
|
||||
_detalhes.refresh:r_historico (_detalhes.tabela_historico)
|
||||
|
||||
--> tabelas dos combates
|
||||
--tabelas dos combates
|
||||
local combate_overall = _detalhes.tabela_overall
|
||||
local overall_dano = combate_overall [class_type_dano] --> damage atalho
|
||||
local overall_cura = combate_overall [class_type_cura] --> heal atalho
|
||||
local overall_energy = combate_overall [class_type_e_energy] --> energy atalho
|
||||
local overall_misc = combate_overall [class_type_misc] --> misc atalho
|
||||
local overall_dano = combate_overall [class_type_dano] --damage atalho
|
||||
local overall_cura = combate_overall [class_type_cura] --heal atalho
|
||||
local overall_energy = combate_overall [class_type_e_energy] --energy atalho
|
||||
local overall_misc = combate_overall [class_type_misc] --misc atalho
|
||||
|
||||
local tabelas_do_historico = _detalhes.tabela_historico.tabelas --> atalho
|
||||
local tabelas_do_historico = _detalhes.tabela_historico.tabelas --atalho
|
||||
|
||||
--> recupera meta function
|
||||
for _, combat_table in _ipairs (tabelas_do_historico) do
|
||||
--recupera meta function
|
||||
for _, combat_table in _ipairs(tabelas_do_historico) do
|
||||
combat_table.__call = _detalhes.call_combate
|
||||
end
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
combat.previous_combat = tabelas_do_historico [i+1]
|
||||
end
|
||||
|
||||
--> tempo padrao do overall
|
||||
--tempo padrao do overall
|
||||
|
||||
local overall_saved = combate_overall.overall_refreshed
|
||||
|
||||
@@ -150,16 +150,16 @@
|
||||
|
||||
local is_in_instance = select (1, IsInInstance())
|
||||
|
||||
--> inicia a recupera��o das tabelas e montagem do overall
|
||||
--inicia a recupera��o das tabelas e montagem do overall
|
||||
if (#tabelas_do_historico > 0) then
|
||||
for index, combate in _ipairs (tabelas_do_historico) do
|
||||
for index, combate in _ipairs(tabelas_do_historico) do
|
||||
|
||||
combate.hasSaved = true
|
||||
|
||||
--> recupera a meta e indexes da tabela do combate
|
||||
--recupera a meta e indexes da tabela do combate
|
||||
_detalhes.refresh:r_combate (combate, combate_overall)
|
||||
|
||||
--> aumenta o tempo do combate do overall, seta as datas e os combates armazenados
|
||||
--aumenta o tempo do combate do overall, seta as datas e os combates armazenados
|
||||
if (not overall_saved and combate.overall_added) then
|
||||
|
||||
if (combate.end_time and combate.start_time) then
|
||||
@@ -185,22 +185,22 @@
|
||||
|
||||
end
|
||||
|
||||
--> recupera a meta e indexes dos 4 container
|
||||
--recupera a meta e indexes dos 4 container
|
||||
_detalhes.refresh:r_container_combatentes (combate [class_type_dano], overall_dano)
|
||||
_detalhes.refresh:r_container_combatentes (combate [class_type_cura], overall_cura)
|
||||
_detalhes.refresh:r_container_combatentes (combate [class_type_e_energy], overall_energy)
|
||||
_detalhes.refresh:r_container_combatentes (combate [class_type_misc], overall_misc)
|
||||
|
||||
--> ghost container
|
||||
--ghost container
|
||||
if (combate[5]) then
|
||||
_detalhes.refresh:r_container_combatentes (combate [5], combate_overall [5])
|
||||
end
|
||||
|
||||
--> tabela com os 4 tabelas de jogadores
|
||||
--tabela com os 4 tabelas de jogadores
|
||||
local todos_atributos = {combate [class_type_dano]._ActorTable, combate [class_type_cura]._ActorTable, combate [class_type_e_energy]._ActorTable, combate [class_type_misc]._ActorTable}
|
||||
|
||||
for class_type, atributo in _ipairs (todos_atributos) do
|
||||
for _, esta_classe in _ipairs (atributo) do
|
||||
for class_type, atributo in _ipairs(todos_atributos) do
|
||||
for _, esta_classe in _ipairs(atributo) do
|
||||
|
||||
local nome = esta_classe.nome
|
||||
|
||||
@@ -246,10 +246,10 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> reconstr�i a tabela dos pets
|
||||
for class_type, atributo in _ipairs (todos_atributos) do
|
||||
for _, esta_classe in _ipairs (atributo) do
|
||||
if (esta_classe.ownerName) then --> nome do owner
|
||||
--reconstr�i a tabela dos pets
|
||||
for class_type, atributo in _ipairs(todos_atributos) do
|
||||
for _, esta_classe in _ipairs(atributo) do
|
||||
if (esta_classe.ownerName) then --nome do owner
|
||||
esta_classe.owner = combate (class_type, esta_classe.ownerName)
|
||||
end
|
||||
end
|
||||
@@ -259,14 +259,14 @@
|
||||
--fim
|
||||
end
|
||||
|
||||
--> restaura last_events_table
|
||||
local primeiro_combate = tabelas_do_historico [1] --> primeiro combate
|
||||
--restaura last_events_table
|
||||
local primeiro_combate = tabelas_do_historico [1] --primeiro combate
|
||||
if (primeiro_combate) then
|
||||
primeiro_combate [1]:ActorCallFunction (atributo_damage.r_last_events_table)
|
||||
primeiro_combate [2]:ActorCallFunction (atributo_heal.r_last_events_table)
|
||||
end
|
||||
|
||||
local segundo_combate = tabelas_do_historico [2] --> segundo combate
|
||||
local segundo_combate = tabelas_do_historico [2] --segundo combate
|
||||
if (segundo_combate) then
|
||||
segundo_combate [1]:ActorCallFunction (atributo_damage.r_last_events_table)
|
||||
segundo_combate [2]:ActorCallFunction (atributo_heal.r_last_events_table)
|
||||
@@ -276,8 +276,8 @@
|
||||
|
||||
function _detalhes:DoInstanceCleanup()
|
||||
|
||||
--> normal instances
|
||||
for _, esta_instancia in _ipairs (_detalhes.tabela_instancias) do
|
||||
--normal instances
|
||||
for _, esta_instancia in _ipairs(_detalhes.tabela_instancias) do
|
||||
|
||||
if (esta_instancia.StatusBar.left) then
|
||||
esta_instancia.StatusBarSaved = {
|
||||
@@ -292,7 +292,7 @@
|
||||
}
|
||||
end
|
||||
|
||||
--> erase all widgets frames
|
||||
--erase all widgets frames
|
||||
|
||||
esta_instancia.scroll = nil
|
||||
esta_instancia.baseframe = nil
|
||||
@@ -329,8 +329,8 @@
|
||||
|
||||
end
|
||||
|
||||
--> unused instances
|
||||
for _, esta_instancia in _ipairs (_detalhes.unused_instances) do
|
||||
--unused instances
|
||||
for _, esta_instancia in _ipairs(_detalhes.unused_instances) do
|
||||
|
||||
if (esta_instancia.StatusBar.left) then
|
||||
esta_instancia.StatusBarSaved = {
|
||||
@@ -345,7 +345,7 @@
|
||||
}
|
||||
end
|
||||
|
||||
--> erase all widgets frames
|
||||
--erase all widgets frames
|
||||
esta_instancia.scroll = nil
|
||||
esta_instancia.baseframe = nil
|
||||
esta_instancia.bgframe = nil
|
||||
@@ -389,9 +389,9 @@
|
||||
overall_added = true
|
||||
end
|
||||
|
||||
for index, combat in _ipairs (combats) do
|
||||
for index, container in _ipairs (combat) do
|
||||
for index, esta_classe in _ipairs (container._ActorTable) do
|
||||
for index, combat in _ipairs(combats) do
|
||||
for index, container in _ipairs(combat) do
|
||||
for index, esta_classe in _ipairs(container._ActorTable) do
|
||||
esta_classe.owner = nil
|
||||
end
|
||||
end
|
||||
@@ -410,9 +410,9 @@
|
||||
overall_added = true
|
||||
end
|
||||
|
||||
for index, combat in _ipairs (combats) do
|
||||
for class_type, container in _ipairs (combat) do
|
||||
for index, esta_classe in _ipairs (container._ActorTable) do
|
||||
for index, combat in _ipairs(combats) do
|
||||
for class_type, container in _ipairs(combat) do
|
||||
for index, esta_classe in _ipairs(container._ActorTable) do
|
||||
|
||||
esta_classe.displayName = nil
|
||||
esta_classe.minha_barra = nil
|
||||
@@ -444,9 +444,9 @@
|
||||
overall_added = true
|
||||
end
|
||||
|
||||
for index, combat in _ipairs (combats) do
|
||||
for index, combat in _ipairs(combats) do
|
||||
_detalhes.clear:c_combate (combat)
|
||||
for index, container in _ipairs (combat) do
|
||||
for index, container in _ipairs(combat) do
|
||||
_detalhes.clear:c_container_combatentes (container)
|
||||
end
|
||||
end
|
||||
@@ -464,8 +464,8 @@
|
||||
overall_added = true
|
||||
end
|
||||
|
||||
for index, combat in _ipairs (combats) do
|
||||
for index, container in _ipairs (combat) do
|
||||
for index, combat in _ipairs(combats) do
|
||||
for index, container in _ipairs(combat) do
|
||||
_detalhes.clear:c_container_combatentes_index (container)
|
||||
end
|
||||
end
|
||||
@@ -475,21 +475,21 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> limpa indexes, metatables e shadows
|
||||
--limpa indexes, metatables e shadows
|
||||
function _detalhes:PrepareTablesForSave()
|
||||
|
||||
_detalhes.clear_ungrouped = true
|
||||
|
||||
--> clear instances
|
||||
--clear instances
|
||||
_detalhes:DoInstanceCleanup()
|
||||
_detalhes:DoClassesCleanup() --aumentou 1 combat
|
||||
_detalhes:DoContainerCleanup() --aumentou 1 combat
|
||||
|
||||
--> clear combats
|
||||
--clear combats
|
||||
local tabelas_de_combate = {}
|
||||
local historico_tabelas = _detalhes.tabela_historico.tabelas or {}
|
||||
|
||||
--> remove os segmentos de trash
|
||||
--remove os segmentos de trash
|
||||
for i = #historico_tabelas, 1, -1 do
|
||||
local combate = historico_tabelas [i]
|
||||
if (combate:IsTrash()) then
|
||||
@@ -497,7 +497,7 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> remove os segmentos > que o limite permitido para salvar
|
||||
--remove os segmentos > que o limite permitido para salvar
|
||||
if (_detalhes.segments_amount_to_save and _detalhes.segments_amount_to_save < _detalhes.segments_amount) then
|
||||
for i = _detalhes.segments_amount, _detalhes.segments_amount_to_save+1, -1 do
|
||||
if (_detalhes.tabela_historico.tabelas [i]) then
|
||||
@@ -506,10 +506,10 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> tabela do combate atual
|
||||
--tabela do combate atual
|
||||
local tabela_atual = _detalhes.tabela_vigente or _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
|
||||
|
||||
--> limpa a tabela overall
|
||||
--limpa a tabela overall
|
||||
if (_detalhes.overall_clear_logout) then
|
||||
_detalhes.tabela_overall = nil
|
||||
_detalhes_database.tabela_overall = nil
|
||||
@@ -519,14 +519,14 @@
|
||||
_combate.previous_combat = nil
|
||||
local todos_atributos = {_combate [class_type_dano] or {}, _combate [class_type_cura] or {}, _combate [class_type_e_energy] or {}, _combate [class_type_misc] or {}}
|
||||
|
||||
for class_type, _tabela in _ipairs (todos_atributos) do
|
||||
for class_type, _tabela in _ipairs(todos_atributos) do
|
||||
local conteudo = _tabela._ActorTable
|
||||
|
||||
--> Limpa tabelas que n�o estejam em grupo
|
||||
--Limpa tabelas que n�o estejam em grupo
|
||||
if (conteudo) then
|
||||
if (_detalhes.clear_ungrouped) then
|
||||
--if (not _detalhes.clear_ungrouped) then
|
||||
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index
|
||||
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --._ActorTable[1] para pegar o primeiro index
|
||||
|
||||
while (_iter.data) do --search key: ~deletar ~apagar
|
||||
local can_erase = true
|
||||
@@ -567,18 +567,18 @@
|
||||
end
|
||||
end
|
||||
|
||||
for _, _tabela in _ipairs (historico_tabelas) do
|
||||
for _, _tabela in _ipairs(historico_tabelas) do
|
||||
tabelas_de_combate [#tabelas_de_combate+1] = _tabela
|
||||
end
|
||||
|
||||
for tabela_index, _combate in _ipairs (tabelas_de_combate) do
|
||||
for tabela_index, _combate in _ipairs(tabelas_de_combate) do
|
||||
|
||||
--> limpa a tabela do grafico
|
||||
--limpa a tabela do grafico
|
||||
if (_detalhes.clear_graphic) then
|
||||
_combate.TimeData = {}
|
||||
end
|
||||
|
||||
--> limpa a referencia do ultimo combate
|
||||
--limpa a referencia do ultimo combate
|
||||
_combate.previous_combat = nil
|
||||
|
||||
local container_dano = _combate [class_type_dano] or {}
|
||||
@@ -596,18 +596,18 @@
|
||||
end
|
||||
|
||||
if (not _combate.is_mythic_dungeon_segment) then
|
||||
for class_type, _tabela in _ipairs (todos_atributos) do
|
||||
for class_type, _tabela in _ipairs(todos_atributos) do
|
||||
|
||||
local conteudo = _tabela._ActorTable
|
||||
|
||||
--> Limpa tabelas que n�o estejam em grupo
|
||||
--Limpa tabelas que n�o estejam em grupo
|
||||
if (conteudo) then
|
||||
|
||||
if (_detalhes.clear_ungrouped) then
|
||||
--n�o deleta dummies e actors de fora do grupo
|
||||
--if (not _detalhes.clear_ungrouped) then
|
||||
|
||||
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index
|
||||
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --._ActorTable[1] para pegar o primeiro index
|
||||
|
||||
while (_iter.data) do --search key: ~deletar ~apagar
|
||||
local can_erase = true
|
||||
@@ -631,7 +631,7 @@
|
||||
|
||||
if (can_erase) then
|
||||
|
||||
if (not _iter.data.owner) then --> pet
|
||||
if (not _iter.data.owner) then --pet
|
||||
local myself = _iter.data
|
||||
|
||||
if (myself.tipo == class_type_dano or myself.tipo == class_type_cura) then
|
||||
@@ -659,7 +659,7 @@
|
||||
_combate.totals_grupo [myself.tipo] ["ress"] = _combate.totals_grupo [myself.tipo] ["ress"] - myself.ress
|
||||
end
|
||||
end
|
||||
--> n�o precisa diminuir o total dos buffs e debuffs
|
||||
--n�o precisa diminuir o total dos buffs e debuffs
|
||||
if (myself.cooldowns_defensive) then
|
||||
_combate.totals [myself.tipo] ["cooldowns_defensive"] = _combate.totals [myself.tipo] ["cooldowns_defensive"] - myself.cooldowns_defensive
|
||||
if (myself.grupo) then
|
||||
@@ -708,27 +708,27 @@
|
||||
end --end is mythic dungeon segment
|
||||
end
|
||||
|
||||
--> panic mode
|
||||
--panic mode
|
||||
if (_detalhes.segments_panic_mode and _detalhes.can_panic_mode) then
|
||||
if (_detalhes.tabela_vigente.is_boss) then
|
||||
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
|
||||
end
|
||||
end
|
||||
|
||||
--> clear all segments on logoff
|
||||
--clear all segments on logoff
|
||||
if (_detalhes.data_cleanup_logout) then
|
||||
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
|
||||
_detalhes.tabela_overall = nil
|
||||
_detalhes_database.tabela_overall = nil
|
||||
end
|
||||
|
||||
--> clear customs
|
||||
--clear customs
|
||||
_detalhes.clear:c_atributo_custom()
|
||||
|
||||
--> clear owners
|
||||
--clear owners
|
||||
_detalhes:DoOwnerCleanup()
|
||||
|
||||
--> cleaer container indexes
|
||||
--cleaer container indexes
|
||||
_detalhes:DoContainerIndexCleanup()
|
||||
end
|
||||
|
||||
@@ -737,7 +737,7 @@
|
||||
instancia.showing[instancia.atributo].need_refresh = true
|
||||
instancia.v_barras = true
|
||||
instancia:ResetaGump()
|
||||
instancia:RefreshMainWindow (true)
|
||||
instancia:RefreshMainWindow(true)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -748,7 +748,7 @@
|
||||
UpdateAddOnMemoryUsage()
|
||||
local memory = GetAddOnMemoryUsage ("Details")
|
||||
if (memory > _detalhes.memory_ram) then
|
||||
_detalhes:IniciarColetaDeLixo (true, 60) --> sending true doesn't check anythink
|
||||
_detalhes:IniciarColetaDeLixo (true, 60) --sending true doesn't check anythink
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -762,7 +762,7 @@
|
||||
_detalhes:Msg ("(debug) checking memory periodically. Using: ",math.floor (memory))
|
||||
end
|
||||
if (memory > _detalhes.memory_ram * 1000) then
|
||||
_detalhes:IniciarColetaDeLixo (1, 60) --> sending 1 only check for combat and ignore garbage collect cooldown
|
||||
_detalhes:IniciarColetaDeLixo (1, 60) --sending 1 only check for combat and ignore garbage collect cooldown
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -777,7 +777,7 @@
|
||||
return
|
||||
end
|
||||
else
|
||||
if (type (forcar) ~= "boolean") then
|
||||
if (type(forcar) ~= "boolean") then
|
||||
if (forcar == 1) then
|
||||
if (_detalhes.in_combat or _InCombatLockdown()) then
|
||||
_detalhes:ScheduleTimer ("IniciarColetaDeLixo", 5, forcar)
|
||||
@@ -797,13 +797,13 @@
|
||||
|
||||
local memory = GetAddOnMemoryUsage ("Details")
|
||||
|
||||
--> reseta o cache do parser
|
||||
--reseta o cache do parser
|
||||
_detalhes:ClearParserCache()
|
||||
|
||||
--> limpa barras que n�o est�o sendo usadas nas inst�ncias.
|
||||
for index, instancia in _ipairs (_detalhes.tabela_instancias) do
|
||||
--limpa barras que n�o est�o sendo usadas nas inst�ncias.
|
||||
for index, instancia in _ipairs(_detalhes.tabela_instancias) do
|
||||
if (instancia.barras and instancia.barras [1]) then
|
||||
for i, barra in _ipairs (instancia.barras) do
|
||||
for i, barra in _ipairs(instancia.barras) do
|
||||
if (not barra:IsShown()) then
|
||||
barra.minha_tabela = nil
|
||||
end
|
||||
@@ -811,7 +811,7 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> faz a coleta nos 4 atributos
|
||||
--faz a coleta nos 4 atributos
|
||||
local damage = atributo_damage:ColetarLixo (lastevent)
|
||||
local heal = atributo_heal:ColetarLixo (lastevent)
|
||||
local energy = atributo_energy:ColetarLixo (lastevent)
|
||||
@@ -819,28 +819,28 @@
|
||||
|
||||
local limpados = damage + heal + energy + misc
|
||||
|
||||
--> refresh nas janelas
|
||||
--refresh nas janelas
|
||||
if (limpados > 0) then
|
||||
_detalhes:InstanciaCallFunction (_detalhes.reset_window)
|
||||
end
|
||||
|
||||
_detalhes:ManutencaoTimeMachine()
|
||||
|
||||
--> print cache states
|
||||
--print cache states
|
||||
--if (_detalhes.debug) then
|
||||
-- _detalhes:Msg ("(debug) removed: damage "..damage.." heal "..heal.." energy "..energy.." misc "..misc)
|
||||
--end
|
||||
|
||||
--> elimina pets antigos
|
||||
--elimina pets antigos
|
||||
_detalhes:LimparPets()
|
||||
if (not _detalhes.in_combat) then
|
||||
_detalhes:ClearCCPetsBlackList()
|
||||
end
|
||||
|
||||
--> reseta cache de specs
|
||||
--reseta cache de specs
|
||||
_detalhes:ResetSpecCache()
|
||||
|
||||
--> wipa container de escudos
|
||||
--wipa container de escudos
|
||||
_table_wipe (_detalhes.escudos)
|
||||
|
||||
_detalhes.ultima_coleta = _detalhes._tempo
|
||||
@@ -854,7 +854,7 @@
|
||||
|
||||
end
|
||||
|
||||
--> combates Normais
|
||||
--combates Normais
|
||||
local function FazColeta (_combate, tipo, intervalo_overwrite)
|
||||
|
||||
local conteudo = _combate [tipo]._ActorTable
|
||||
@@ -893,7 +893,7 @@
|
||||
end
|
||||
|
||||
if (can_garbage) then
|
||||
if (not _actor.owner) then --> pet
|
||||
if (not _actor.owner) then --pet
|
||||
_actor:subtract_total (_combate)
|
||||
end
|
||||
|
||||
@@ -924,7 +924,7 @@
|
||||
return _iter.cleaned
|
||||
end
|
||||
|
||||
--> Combate overall
|
||||
--Combate overall
|
||||
function _detalhes:ColetarLixo (tipo, lastevent)
|
||||
|
||||
--print ("fazendo coleta...")
|
||||
@@ -932,24 +932,24 @@
|
||||
local _tempo = _time()
|
||||
local limpados = 0
|
||||
|
||||
--> monta a lista de combates
|
||||
--monta a lista de combates
|
||||
local tabelas_de_combate = {}
|
||||
for _, _tabela in _ipairs (_detalhes.tabela_historico.tabelas) do
|
||||
for _, _tabela in _ipairs(_detalhes.tabela_historico.tabelas) do
|
||||
if (_tabela ~= _detalhes.tabela_vigente) then
|
||||
tabelas_de_combate [#tabelas_de_combate+1] = _tabela
|
||||
end
|
||||
end
|
||||
tabelas_de_combate [#tabelas_de_combate+1] = _detalhes.tabela_vigente
|
||||
|
||||
--> faz a coleta em todos os combates para este atributo
|
||||
for _, _combate in _ipairs (tabelas_de_combate) do
|
||||
--faz a coleta em todos os combates para este atributo
|
||||
for _, _combate in _ipairs(tabelas_de_combate) do
|
||||
limpados = limpados + FazColeta (_combate, tipo, lastevent)
|
||||
end
|
||||
|
||||
--> limpa a tabela overall para o atributo atual (limpa para os 4, um de cada vez atrav�s do ipairs)
|
||||
--limpa a tabela overall para o atributo atual (limpa para os 4, um de cada vez atrav�s do ipairs)
|
||||
local _overall_combat = _detalhes.tabela_overall
|
||||
local conteudo = _overall_combat [tipo]._ActorTable
|
||||
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --> ._ActorTable[1] para pegar o primeiro index
|
||||
local _iter = {index = 1, data = conteudo[1], cleaned = 0} --._ActorTable[1] para pegar o primeiro index
|
||||
|
||||
while (_iter.data) do
|
||||
|
||||
@@ -960,13 +960,13 @@
|
||||
can_garbage = true
|
||||
end
|
||||
|
||||
if (can_garbage) then --> n�o h� refer�ncias a este objeto
|
||||
if (can_garbage) then --n�o h� refer�ncias a este objeto
|
||||
|
||||
if (not _actor.owner) then --> pet
|
||||
if (not _actor.owner) then --pet
|
||||
_actor:subtract_total (_overall_combat)
|
||||
end
|
||||
|
||||
--> apaga a refer�ncia deste jogador na tabela overall
|
||||
--apaga a refer�ncia deste jogador na tabela overall
|
||||
_iter.cleaned = _iter.cleaned+1
|
||||
|
||||
_table_remove (conteudo, _iter.index)
|
||||
@@ -979,7 +979,7 @@
|
||||
|
||||
end
|
||||
|
||||
--> termina o coletor de lixo
|
||||
--termina o coletor de lixo
|
||||
if (_iter.cleaned > 0) then
|
||||
_overall_combat[tipo].need_refresh = true
|
||||
ReconstroiMapa (_overall_combat [tipo])
|
||||
@@ -988,7 +988,7 @@
|
||||
|
||||
if (limpados > 0) then
|
||||
_detalhes:InstanciaCallFunction (_detalhes.ScheduleUpdate)
|
||||
_detalhes:RefreshMainWindow (-1)
|
||||
_detalhes:RefreshMainWindow(-1)
|
||||
end
|
||||
|
||||
return limpados
|
||||
|
||||
+10
-10
@@ -7,14 +7,14 @@
|
||||
Details.network = {}
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> local pointers
|
||||
--local pointers
|
||||
|
||||
local UnitName = UnitName
|
||||
local GetRealmName = GetRealmName
|
||||
local select = select
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> constants
|
||||
--constants
|
||||
|
||||
_G.DETAILS_PREFIX_NETWORK = "DTLS"
|
||||
|
||||
@@ -73,10 +73,10 @@
|
||||
local registredPlugins = {}
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> comm functions
|
||||
--comm functions
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> item level
|
||||
--item level
|
||||
function Details:SendCharacterData()
|
||||
--only send if in group
|
||||
if (not IsInGroup() and not IsInRaid()) then
|
||||
@@ -162,7 +162,7 @@
|
||||
|
||||
function Details.network.Update_VersionReceived(player, realm, coreVersion, buildNumber)
|
||||
if (Details.debugnet) then
|
||||
Details:Msg ("(debug) received version alert ", buildNumber)
|
||||
Details:Msg("(debug) received version alert ", buildNumber)
|
||||
end
|
||||
|
||||
if (Details.streamer_config.no_alerts) then
|
||||
@@ -432,7 +432,7 @@
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> register comm
|
||||
--register comm
|
||||
|
||||
function Details:CommReceived(commPrefix, data, channel, source)
|
||||
|
||||
@@ -518,7 +518,7 @@
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> send functions
|
||||
--send functions
|
||||
|
||||
function Details:GetChannelId(channel)
|
||||
--deprecated
|
||||
@@ -587,12 +587,12 @@
|
||||
end
|
||||
|
||||
function Details:SendGuildData(type, ...)
|
||||
if not IsInGuild() then return end --> fix from Tim@WoWInterface
|
||||
if not IsInGuild() then return end --fix from Tim@WoWInterface
|
||||
Details:SendCommMessage(DETAILS_PREFIX_NETWORK, Details:Serialize(type, UnitName("player"), GetRealmName(), Details.realversion, ...), "GUILD")
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> cloud
|
||||
--cloud
|
||||
|
||||
function Details:SendCloudRequest()
|
||||
--deprecated
|
||||
@@ -607,7 +607,7 @@
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> update
|
||||
--update
|
||||
|
||||
function Details:CheckVersion(sendToGuild)
|
||||
if (IsInRaid()) then
|
||||
|
||||
+692
-692
File diff suppressed because it is too large
Load Diff
+130
-130
@@ -7,7 +7,7 @@
|
||||
|
||||
DETAILSPLUGIN_ALWAYSENABLED = 0x1
|
||||
|
||||
--> consts
|
||||
--consts
|
||||
local CONST_PLUGINWINDOW_MENU_WIDTH = 150
|
||||
local CONST_PLUGINWINDOW_MENU_HEIGHT = 22
|
||||
local CONST_PLUGINWINDOW_MENU_X = -5
|
||||
@@ -16,7 +16,7 @@
|
||||
local CONST_PLUGINWINDOW_HEIGHT = 600
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> details api functions
|
||||
--details api functions
|
||||
function _detalhes:GetPlugin (PAN) --plugin absolute name
|
||||
return _detalhes.SoloTables.NameTable [PAN] or _detalhes.RaidTables.NameTable [PAN] or _detalhes.ToolBar.NameTable [PAN] or _detalhes.StatusBar.NameTable [PAN] or _detalhes.PluginsLocalizedNames [PAN] or _detalhes.PluginsGlobalNames [PAN]
|
||||
end
|
||||
@@ -40,7 +40,7 @@
|
||||
local instance = self:GetPluginInstance()
|
||||
if (instance) then
|
||||
local w, h = instance:GetSize()
|
||||
self.Frame:SetSize (w, h)
|
||||
self.Frame:SetSize(w, h)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
saved_table.enabled = false
|
||||
plugin.__enabled = false
|
||||
|
||||
_detalhes:SendEvent ("PLUGIN_DISABLED", plugin)
|
||||
_detalhes:SendEvent("PLUGIN_DISABLED", plugin)
|
||||
|
||||
_detalhes:DelayOptionsRefresh()
|
||||
return true
|
||||
@@ -92,8 +92,8 @@
|
||||
|
||||
function _detalhes:CheckDefaultTable (current, default)
|
||||
for key, value in pairs (default) do
|
||||
if (type (value) == "table") then
|
||||
if (type (current [key]) ~= "table") then
|
||||
if (type(value) == "table") then
|
||||
if (type(current [key]) ~= "table") then
|
||||
current [key] = Details.CopyTable (value)
|
||||
else
|
||||
_detalhes:CheckDefaultTable (current [key], value)
|
||||
@@ -101,7 +101,7 @@
|
||||
else
|
||||
if (current [key] == nil) then
|
||||
current [key] = value
|
||||
--elseif (type (current [key]) ~= type (value)) then
|
||||
--elseif (type(current [key]) ~= type (value)) then
|
||||
-- current [key] = value
|
||||
end
|
||||
end
|
||||
@@ -174,21 +174,21 @@
|
||||
return _detalhes:NewError ("plugin doesn't have a Frame, please check case-sensitive member name: Frame")
|
||||
end
|
||||
|
||||
--> Install Plugin
|
||||
--Install Plugin
|
||||
_detalhes.SoloTables.Plugins [#_detalhes.SoloTables.Plugins+1] = PluginObject
|
||||
_detalhes.SoloTables.Menu [#_detalhes.SoloTables.Menu+1] = {PluginName, PluginIcon, PluginObject, PluginAbsoluteName}
|
||||
_detalhes.SoloTables.NameTable [PluginAbsoluteName] = PluginObject
|
||||
_detalhes:SendEvent ("INSTALL_OKEY", PluginObject)
|
||||
_detalhes:SendEvent("INSTALL_OKEY", PluginObject)
|
||||
|
||||
_detalhes.PluginCount.SOLO = _detalhes.PluginCount.SOLO + 1
|
||||
|
||||
elseif (PluginType == "RAID") then
|
||||
|
||||
--> Install Plugin
|
||||
--Install Plugin
|
||||
_detalhes.RaidTables.Plugins [#_detalhes.RaidTables.Plugins+1] = PluginObject
|
||||
_detalhes.RaidTables.Menu [#_detalhes.RaidTables.Menu+1] = {PluginName, PluginIcon, PluginObject, PluginAbsoluteName}
|
||||
_detalhes.RaidTables.NameTable [PluginAbsoluteName] = PluginObject
|
||||
_detalhes:SendEvent ("INSTALL_OKEY", PluginObject)
|
||||
_detalhes:SendEvent("INSTALL_OKEY", PluginObject)
|
||||
|
||||
_detalhes.PluginCount.RAID = _detalhes.PluginCount.RAID + 1
|
||||
|
||||
@@ -196,21 +196,21 @@
|
||||
|
||||
elseif (PluginType == "TOOLBAR") then
|
||||
|
||||
--> Install Plugin
|
||||
--Install Plugin
|
||||
_detalhes.ToolBar.Plugins [#_detalhes.ToolBar.Plugins+1] = PluginObject
|
||||
_detalhes.ToolBar.Menu [#_detalhes.ToolBar.Menu+1] = {PluginName, PluginIcon, PluginObject, PluginAbsoluteName}
|
||||
_detalhes.ToolBar.NameTable [PluginAbsoluteName] = PluginObject
|
||||
_detalhes:SendEvent ("INSTALL_OKEY", PluginObject)
|
||||
_detalhes:SendEvent("INSTALL_OKEY", PluginObject)
|
||||
|
||||
_detalhes.PluginCount.TOOLBAR = _detalhes.PluginCount.TOOLBAR + 1
|
||||
|
||||
elseif (PluginType == "STATUSBAR") then
|
||||
|
||||
--> Install Plugin
|
||||
--Install Plugin
|
||||
_detalhes.StatusBar.Plugins [#_detalhes.StatusBar.Plugins+1] = PluginObject
|
||||
_detalhes.StatusBar.Menu [#_detalhes.StatusBar.Menu+1] = {PluginName, PluginIcon}
|
||||
_detalhes.StatusBar.NameTable [PluginAbsoluteName] = PluginObject
|
||||
_detalhes:SendEvent ("INSTALL_OKEY", PluginObject)
|
||||
_detalhes:SendEvent("INSTALL_OKEY", PluginObject)
|
||||
|
||||
_detalhes.PluginCount.STATUSBAR = _detalhes.PluginCount.STATUSBAR + 1
|
||||
end
|
||||
@@ -228,7 +228,7 @@
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> internal functions
|
||||
--internal functions
|
||||
|
||||
_detalhes.PluginCount = {
|
||||
["SOLO"] = 0,
|
||||
@@ -242,13 +242,13 @@
|
||||
--self = frame __parent = plugin object
|
||||
local instance = _detalhes:GetInstance (self.__parent.instance_id)
|
||||
if (instance) then
|
||||
self:SetParent (instance.baseframe)
|
||||
self:SetParent(instance.baseframe)
|
||||
end
|
||||
_detalhes:SendEvent ("SHOW", self.__parent)
|
||||
_detalhes:SendEvent("SHOW", self.__parent)
|
||||
end
|
||||
|
||||
local OnDisableFunction = function(self)
|
||||
_detalhes:SendEvent ("HIDE", self.__parent)
|
||||
_detalhes:SendEvent("HIDE", self.__parent)
|
||||
if (bit.band (self.__parent.__options, DETAILSPLUGIN_ALWAYSENABLED) == 0) then
|
||||
self.__parent.Enabled = false
|
||||
end
|
||||
@@ -284,11 +284,11 @@
|
||||
PluginOptions = PluginOptions or 0x0
|
||||
local NewPlugin = {__options = PluginOptions, __enabled = true, RegisterEvent = register_event_func, UnregisterEvent = unregister_event_func}
|
||||
|
||||
local Frame = CreateFrame ("Frame", FrameName, UIParent,"BackdropTemplate")
|
||||
local Frame = CreateFrame("Frame", FrameName, UIParent,"BackdropTemplate")
|
||||
Frame:RegisterEvent ("PLAYER_LOGIN")
|
||||
Frame:RegisterEvent ("PLAYER_LOGOUT")
|
||||
|
||||
Frame:SetScript ("OnEvent", function(self, event, ...)
|
||||
Frame:SetScript("OnEvent", function(self, event, ...)
|
||||
if (NewPlugin.OnEvent) then
|
||||
if (event == "PLAYER_LOGIN") then
|
||||
NewPlugin:OnEvent (self, "ADDON_LOADED", NewPlugin.Frame:GetName())
|
||||
@@ -311,17 +311,17 @@
|
||||
NewPlugin.Enabled = false
|
||||
end
|
||||
|
||||
--> default members
|
||||
--default members
|
||||
if (PluginType == "STATUSBAR") then
|
||||
BuildDefaultStatusBarMembers (NewPlugin)
|
||||
end
|
||||
|
||||
NewPlugin.Frame = Frame
|
||||
|
||||
Frame:SetScript ("OnShow", OnEnableFunction)
|
||||
Frame:SetScript ("OnHide", OnDisableFunction)
|
||||
Frame:SetScript("OnShow", OnEnableFunction)
|
||||
Frame:SetScript("OnHide", OnDisableFunction)
|
||||
|
||||
--> temporary details event function
|
||||
--temporary details event function
|
||||
NewPlugin.OnDetailsEvent = temp_event_function
|
||||
|
||||
setmetatable (NewPlugin, _detalhes)
|
||||
@@ -334,11 +334,11 @@
|
||||
template = template or 1
|
||||
|
||||
if (template == 2) then
|
||||
local options_frame = CreateFrame ("frame", name, UIParent, "ButtonFrameTemplate,BackdropTemplate")
|
||||
local options_frame = CreateFrame("frame", name, UIParent, "ButtonFrameTemplate,BackdropTemplate")
|
||||
tinsert (UISpecialFrames, name)
|
||||
options_frame:SetSize (500, 200)
|
||||
options_frame:SetSize(500, 200)
|
||||
|
||||
options_frame:SetScript ("OnMouseDown", function(self, button)
|
||||
options_frame:SetScript("OnMouseDown", function(self, button)
|
||||
if (button == "RightButton") then
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
@@ -350,7 +350,7 @@
|
||||
self:StartMoving()
|
||||
end
|
||||
end)
|
||||
options_frame:SetScript ("OnMouseUp", function(self)
|
||||
options_frame:SetScript("OnMouseUp", function(self)
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
self:StopMovingOrSizing()
|
||||
@@ -364,19 +364,19 @@
|
||||
|
||||
options_frame:Hide()
|
||||
|
||||
options_frame:SetPoint ("center", UIParent, "center")
|
||||
--options_frame.TitleText:SetText (title) --10.0 fuck
|
||||
--options_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]])
|
||||
options_frame:SetPoint("center", UIParent, "center")
|
||||
--options_frame.TitleText:SetText(title) --10.0 fuck
|
||||
--options_frame.portrait:SetTexture([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-BLOODELF]])
|
||||
|
||||
return options_frame
|
||||
|
||||
elseif (template == 1) then
|
||||
|
||||
local options_frame = CreateFrame ("frame", name, UIParent,"BackdropTemplate")
|
||||
local options_frame = CreateFrame("frame", name, UIParent,"BackdropTemplate")
|
||||
tinsert (UISpecialFrames, name)
|
||||
options_frame:SetSize (500, 200)
|
||||
options_frame:SetSize(500, 200)
|
||||
|
||||
options_frame:SetScript ("OnMouseDown", function(self, button)
|
||||
options_frame:SetScript("OnMouseDown", function(self, button)
|
||||
if (button == "RightButton") then
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
@@ -388,7 +388,7 @@
|
||||
self:StartMoving()
|
||||
end
|
||||
end)
|
||||
options_frame:SetScript ("OnMouseUp", function(self)
|
||||
options_frame:SetScript("OnMouseUp", function(self)
|
||||
if (self.moving) then
|
||||
self.moving = false
|
||||
self:StopMovingOrSizing()
|
||||
@@ -402,18 +402,18 @@
|
||||
|
||||
options_frame:Hide()
|
||||
|
||||
options_frame:SetPoint ("center", UIParent, "center")
|
||||
options_frame:SetPoint("center", UIParent, "center")
|
||||
|
||||
options_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
|
||||
options_frame:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
|
||||
edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 32,
|
||||
insets = {left = 1, right = 1, top = 1, bottom = 1}})
|
||||
options_frame:SetBackdropColor (0, 0, 0, .7)
|
||||
options_frame:SetBackdropColor(0, 0, 0, .7)
|
||||
|
||||
Details.gump:ApplyStandardBackdrop (options_frame)
|
||||
Details.gump:CreateTitleBar (options_frame, title)
|
||||
|
||||
local bigdog = _detalhes.gump:NewImage (options_frame, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 110, 120, nil, {1, 0, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
|
||||
bigdog:SetPoint ("bottomright", options_frame, "bottomright", -3, 0)
|
||||
bigdog:SetPoint("bottomright", options_frame, "bottomright", -3, 0)
|
||||
bigdog:SetAlpha (.25)
|
||||
|
||||
return options_frame
|
||||
@@ -422,12 +422,12 @@
|
||||
|
||||
function _detalhes:CreatePluginWindowContainer()
|
||||
|
||||
local f = CreateFrame ("frame", "DetailsPluginContainerWindow", UIParent,"BackdropTemplate")
|
||||
local f = CreateFrame("frame", "DetailsPluginContainerWindow", UIParent,"BackdropTemplate")
|
||||
f:EnableMouse (true)
|
||||
f:SetMovable (true)
|
||||
f:SetPoint ("center", UIParent, "center")
|
||||
f:SetBackdrop (_detalhes.PluginDefaults and _detalhes.PluginDefaults.Backdrop or {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
|
||||
f:SetBackdropColor (0, 0, 0, 0.3)
|
||||
f:SetPoint("center", UIParent, "center")
|
||||
f:SetBackdrop(_detalhes.PluginDefaults and _detalhes.PluginDefaults.Backdrop or {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
|
||||
f:SetBackdropColor(0, 0, 0, 0.3)
|
||||
f:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
|
||||
local scaleBar = DetailsFramework:CreateScaleBar(f, Details.options_window)
|
||||
@@ -436,7 +436,7 @@
|
||||
|
||||
f:Hide()
|
||||
|
||||
--> members
|
||||
--members
|
||||
f.MenuX = CONST_PLUGINWINDOW_MENU_X
|
||||
f.MenuY = CONST_PLUGINWINDOW_MENU_Y
|
||||
f.MenuButtonWidth = CONST_PLUGINWINDOW_MENU_WIDTH
|
||||
@@ -445,31 +445,31 @@
|
||||
f.FrameHeight = CONST_PLUGINWINDOW_HEIGHT
|
||||
f.TitleHeight = 20
|
||||
|
||||
--> store button references for the left menu
|
||||
--store button references for the left menu
|
||||
f.MenuButtons = {}
|
||||
--> store all plugins embed
|
||||
--store all plugins embed
|
||||
f.EmbedPlugins = {}
|
||||
|
||||
--> lib window
|
||||
f:SetSize (f.FrameWidth, f.FrameHeight)
|
||||
--lib window
|
||||
f:SetSize(f.FrameWidth, f.FrameHeight)
|
||||
local LibWindow = LibStub ("LibWindow-1.1")
|
||||
LibWindow.RegisterConfig (f, _detalhes.plugin_window_pos)
|
||||
LibWindow.RestorePosition (f)
|
||||
LibWindow.MakeDraggable (f)
|
||||
LibWindow.SavePosition (f)
|
||||
|
||||
--> menu background
|
||||
local menuBackground = CreateFrame ("frame", "$parentMenuFrame", f,"BackdropTemplate")
|
||||
--menu background
|
||||
local menuBackground = CreateFrame("frame", "$parentMenuFrame", f,"BackdropTemplate")
|
||||
_detalhes:FormatBackground (menuBackground)
|
||||
local menuBackgroundTexture = menuBackground:CreateTexture("$parentBackgroundTexture", "background", nil, -2)
|
||||
menuBackgroundTexture:SetAllPoints()
|
||||
menuBackgroundTexture:SetColorTexture(0.2, 0.2, 0.2, .5)
|
||||
|
||||
--> statusbar
|
||||
local statusBar = CreateFrame ("frame", nil, menuBackground,"BackdropTemplate")
|
||||
statusBar:SetPoint ("topleft", menuBackground, "bottomleft", 0, 1)
|
||||
statusBar:SetPoint ("topright", f, "bottomright", 0, 1)
|
||||
statusBar:SetHeight (20)
|
||||
--statusbar
|
||||
local statusBar = CreateFrame("frame", nil, menuBackground,"BackdropTemplate")
|
||||
statusBar:SetPoint("topleft", menuBackground, "bottomleft", 0, 1)
|
||||
statusBar:SetPoint("topright", f, "bottomright", 0, 1)
|
||||
statusBar:SetHeight(20)
|
||||
statusBar:SetAlpha (1)
|
||||
DetailsFramework:BuildStatusbarAuthorInfo (statusBar)
|
||||
DetailsFramework:ApplyStandardBackdrop (statusBar)
|
||||
@@ -478,73 +478,73 @@
|
||||
extraDarkTexture:SetColorTexture(.2, .2, .2, .8)
|
||||
|
||||
--
|
||||
local right_click_to_back = _detalhes.gump:CreateLabel (statusBar, "right click to close", 10, "gray")
|
||||
right_click_to_back:SetPoint ("bottomright", statusBar, "bottomright", -1, 5)
|
||||
local right_click_to_back = _detalhes.gump:CreateLabel(statusBar, "right click to close", 10, "gray")
|
||||
right_click_to_back:SetPoint("bottomright", statusBar, "bottomright", -1, 5)
|
||||
right_click_to_back:SetAlpha (.4)
|
||||
|
||||
--> point
|
||||
menuBackground:SetPoint ("topright", f, "topleft", -2, 0)
|
||||
menuBackground:SetPoint ("bottomright", f, "bottomleft", -2, 0)
|
||||
menuBackground:SetWidth (f.MenuButtonWidth + 6)
|
||||
--point
|
||||
menuBackground:SetPoint("topright", f, "topleft", -2, 0)
|
||||
menuBackground:SetPoint("bottomright", f, "bottomleft", -2, 0)
|
||||
menuBackground:SetWidth(f.MenuButtonWidth + 6)
|
||||
|
||||
local bigdog = _detalhes.gump:NewImage (menuBackground, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 180*0.7, 200*0.7, "overlay", {0, 1, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
|
||||
bigdog:SetPoint ("bottomleft", custom_window, "bottomleft", 0, 1)
|
||||
bigdog:SetPoint("bottomleft", custom_window, "bottomleft", 0, 1)
|
||||
bigdog:SetAlpha (0.3)
|
||||
|
||||
local gradientBelowTheLine = DetailsFramework:CreateTexture(menuBackground, {gradient = "vertical", fromColor = {0, 0, 0, 0.45}, toColor = "transparent"}, 1, 95, "artwork", {0, 1, 0, 1}, "dogGradient")
|
||||
gradientBelowTheLine:SetPoint("bottoms")
|
||||
|
||||
local bigdogRow = menuBackground:CreateTexture (nil, "artwork")
|
||||
bigdogRow:SetPoint ("bottomleft", menuBackground, "bottomleft", 1, 1)
|
||||
bigdogRow:SetPoint ("bottomright", menuBackground, "bottomright", -1, 1)
|
||||
bigdogRow:SetHeight (20)
|
||||
local bigdogRow = menuBackground:CreateTexture(nil, "artwork")
|
||||
bigdogRow:SetPoint("bottomleft", menuBackground, "bottomleft", 1, 1)
|
||||
bigdogRow:SetPoint("bottomright", menuBackground, "bottomright", -1, 1)
|
||||
bigdogRow:SetHeight(20)
|
||||
bigdogRow:SetColorTexture (.5, .5, .5, .1)
|
||||
bigdogRow:Hide()
|
||||
|
||||
--
|
||||
--> plugins menu title bar
|
||||
local titlebar_plugins = CreateFrame ("frame", nil, menuBackground,"BackdropTemplate")
|
||||
--plugins menu title bar
|
||||
local titlebar_plugins = CreateFrame("frame", nil, menuBackground,"BackdropTemplate")
|
||||
PixelUtil.SetPoint (titlebar_plugins, "topleft", menuBackground, "topleft", 2, -3)
|
||||
PixelUtil.SetPoint (titlebar_plugins, "topright", menuBackground, "topright", -2, -3)
|
||||
titlebar_plugins:SetHeight (f.TitleHeight)
|
||||
titlebar_plugins:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
|
||||
titlebar_plugins:SetBackdropColor (.5, .5, .5, 1)
|
||||
titlebar_plugins:SetBackdropBorderColor (0, 0, 0, 1)
|
||||
--> title
|
||||
local titleLabel = _detalhes.gump:NewLabel (titlebar_plugins, titlebar_plugins, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
|
||||
titlebar_plugins:SetHeight(f.TitleHeight)
|
||||
titlebar_plugins:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
|
||||
titlebar_plugins:SetBackdropColor(.5, .5, .5, 1)
|
||||
titlebar_plugins:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
--title
|
||||
local titleLabel = _detalhes.gump:NewLabel(titlebar_plugins, titlebar_plugins, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
|
||||
PixelUtil.SetPoint (titleLabel, "center", titlebar_plugins , "center", 0, 0)
|
||||
PixelUtil.SetPoint (titleLabel, "top", titlebar_plugins , "top", 0, -5)
|
||||
|
||||
--> plugins menu title bar
|
||||
local titlebar_tools = CreateFrame ("frame", nil, menuBackground,"BackdropTemplate")
|
||||
titlebar_tools:SetHeight (f.TitleHeight)
|
||||
titlebar_tools:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
|
||||
titlebar_tools:SetBackdropColor (.5, .5, .5, 1)
|
||||
titlebar_tools:SetBackdropBorderColor (0, 0, 0, 1)
|
||||
--> title
|
||||
local titleLabel = _detalhes.gump:NewLabel (titlebar_tools, titlebar_tools, nil, "titulo", "Tools", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
|
||||
--plugins menu title bar
|
||||
local titlebar_tools = CreateFrame("frame", nil, menuBackground,"BackdropTemplate")
|
||||
titlebar_tools:SetHeight(f.TitleHeight)
|
||||
titlebar_tools:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
|
||||
titlebar_tools:SetBackdropColor(.5, .5, .5, 1)
|
||||
titlebar_tools:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
--title
|
||||
local titleLabel = _detalhes.gump:NewLabel(titlebar_tools, titlebar_tools, nil, "titulo", "Tools", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
|
||||
PixelUtil.SetPoint (titleLabel, "center", titlebar_tools , "center", 0, 0)
|
||||
PixelUtil.SetPoint (titleLabel, "top", titlebar_tools , "top", 0, -5)
|
||||
|
||||
--> scripts
|
||||
f:SetScript ("OnShow", function()
|
||||
--scripts
|
||||
f:SetScript("OnShow", function()
|
||||
--check if the window isn't out of screen
|
||||
C_Timer.After (1, function()
|
||||
local right = f:GetRight()
|
||||
if (right and right > GetScreenWidth() + 500) then
|
||||
f:ClearAllPoints()
|
||||
f:SetPoint ("center", UIParent, "center", 0, 0)
|
||||
f:SetPoint("center", UIParent, "center", 0, 0)
|
||||
LibWindow.SavePosition (f)
|
||||
_detalhes:Msg ("detected options panel out of screen, position has reset")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
f:SetScript ("OnHide", function()
|
||||
f:SetScript("OnHide", function()
|
||||
|
||||
end)
|
||||
|
||||
f:SetScript ("OnMouseDown", function(self, button)
|
||||
f:SetScript("OnMouseDown", function(self, button)
|
||||
if (button == "RightButton") then
|
||||
f.ClosePlugin()
|
||||
end
|
||||
@@ -561,10 +561,10 @@
|
||||
|
||||
function f.OnMenuClick (_, _, pluginAbsName, callRefresh)
|
||||
|
||||
--> get the plugin
|
||||
--get the plugin
|
||||
local pluginObject = _detalhes:GetPlugin (pluginAbsName)
|
||||
if (not pluginObject) then
|
||||
for index, plugin in ipairs (f.EmbedPlugins) do
|
||||
for index, plugin in ipairs(f.EmbedPlugins) do
|
||||
if (plugin.real_name == pluginAbsName) then
|
||||
pluginObject = plugin
|
||||
end
|
||||
@@ -576,62 +576,62 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> hide or show plugin windows
|
||||
for index, plugin in ipairs (f.EmbedPlugins) do
|
||||
--hide or show plugin windows
|
||||
for index, plugin in ipairs(f.EmbedPlugins) do
|
||||
if (plugin ~= pluginObject) then
|
||||
--> hide this plugin
|
||||
--hide this plugin
|
||||
if (plugin.Frame:IsShown()) then
|
||||
plugin.Frame:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--> re set the point of the frame within the main plugin window
|
||||
--re set the point of the frame within the main plugin window
|
||||
f.RefreshFrame (pluginObject.__var_Frame)
|
||||
C_Timer.After (0.016, function()
|
||||
f.RefreshFrame (pluginObject.__var_Frame)
|
||||
end)
|
||||
|
||||
--> show the plugin window
|
||||
--show the plugin window
|
||||
if (pluginObject.RefreshWindow and callRefresh) then
|
||||
DetailsFramework:QuickDispatch (pluginObject.RefreshWindow)
|
||||
end
|
||||
|
||||
--> highlight the plugin button on the menu
|
||||
for index, button in ipairs (f.MenuButtons) do
|
||||
--highlight the plugin button on the menu
|
||||
for index, button in ipairs(f.MenuButtons) do
|
||||
button:Show()
|
||||
|
||||
if (button.PluginAbsName == pluginAbsName) then
|
||||
--> emphatizate this button
|
||||
--emphatizate this button
|
||||
button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTONSELECTED_TEMPLATE"))
|
||||
else
|
||||
--> make this button regular
|
||||
--make this button regular
|
||||
button:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE"))
|
||||
end
|
||||
end
|
||||
|
||||
--> show the container
|
||||
--show the container
|
||||
f:Show()
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function f.CreatePluginMenuButton (pluginObject, isUtility)
|
||||
--> create the button
|
||||
--create the button
|
||||
local newButton = _detalhes.gump:CreateButton (f, f.OnMenuClick, f.MenuButtonWidth, f.MenuButtonHeight, pluginObject.__name, pluginObject.real_name, true)
|
||||
newButton.PluginAbsName = pluginObject.real_name
|
||||
newButton.PluginName = pluginObject.__name
|
||||
newButton.IsUtility = isUtility
|
||||
|
||||
--> add a template
|
||||
--add a template
|
||||
newButton:SetTemplate (_detalhes.gump:GetTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE"))
|
||||
newButton:SetText (pluginObject.__name)
|
||||
newButton:SetText(pluginObject.__name)
|
||||
newButton.textsize = 10
|
||||
|
||||
--> set icon
|
||||
--set icon
|
||||
newButton:SetIcon (pluginObject.__icon, nil, nil, nil, pluginObject.__iconcoords, pluginObject.__iconcolor, 4)
|
||||
|
||||
--> add it to menu table
|
||||
--add it to menu table
|
||||
tinsert (f.MenuButtons, newButton)
|
||||
|
||||
return newButton
|
||||
@@ -643,35 +643,35 @@
|
||||
|
||||
function f.RefreshFrame (frame)
|
||||
frame:EnableMouse (false)
|
||||
frame:SetSize (f.FrameWidth, f.FrameHeight)
|
||||
frame:SetScript ("OnMouseDown", nil)
|
||||
frame:SetScript ("OnMouseUp", nil)
|
||||
--frame:SetScript ("OnHide", on_hide)
|
||||
frame:SetSize(f.FrameWidth, f.FrameHeight)
|
||||
frame:SetScript("OnMouseDown", nil)
|
||||
frame:SetScript("OnMouseUp", nil)
|
||||
--frame:SetScript("OnHide", on_hide)
|
||||
frame:HookScript ("OnHide", on_hide)
|
||||
frame:ClearAllPoints()
|
||||
PixelUtil.SetPoint (frame, "topleft", f, "topleft", 0, 0)
|
||||
frame:Show()
|
||||
end
|
||||
|
||||
--> a plugin request to be embed into the main plugin window
|
||||
--a plugin request to be embed into the main plugin window
|
||||
function f.EmbedPlugin(pluginObject, frame, isUtility)
|
||||
|
||||
--> check if the plugin has a frame
|
||||
--check if the plugin has a frame
|
||||
if (not pluginObject.Frame) then
|
||||
f.DebugMsg ("plugin doesn't have a frame.")
|
||||
return
|
||||
end
|
||||
|
||||
--> create a button for this plugin
|
||||
--create a button for this plugin
|
||||
local newMenuButtom = f.CreatePluginMenuButton(pluginObject, isUtility)
|
||||
|
||||
--> utility is true when the object isn't a real plugin, but instead a tool frame from the main addon being embed on this panel
|
||||
--utility is true when the object isn't a real plugin, but instead a tool frame from the main addon being embed on this panel
|
||||
if (isUtility) then
|
||||
pluginObject.__var_Utility = true
|
||||
end
|
||||
pluginObject.__var_Frame = frame
|
||||
|
||||
--> sort buttons alphabetically, put utilities at the end
|
||||
--sort buttons alphabetically, put utilities at the end
|
||||
table.sort (f.MenuButtons, function(t1, t2)
|
||||
if (t1.IsUtility and t2.IsUtility) then
|
||||
return t1.PluginName < t2.PluginName
|
||||
@@ -684,17 +684,17 @@
|
||||
end
|
||||
end)
|
||||
|
||||
--> reset the buttons points
|
||||
--reset the buttons points
|
||||
local addingTools = false
|
||||
for index, button in ipairs(f.MenuButtons) do
|
||||
button:ClearAllPoints()
|
||||
PixelUtil.SetPoint(button, "center", menuBackground, "center", 0, 0)
|
||||
|
||||
if (button.IsUtility) then
|
||||
--> add -20 to add a gap between plugins and utilities
|
||||
--add -20 to add a gap between plugins and utilities
|
||||
|
||||
if (not addingTools) then
|
||||
--> add the header
|
||||
--add the header
|
||||
addingTools = true
|
||||
PixelUtil.SetPoint (titlebar_tools, "topleft", menuBackground, "topleft", 2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20)
|
||||
PixelUtil.SetPoint (titlebar_tools, "topright", menuBackground, "topright", -2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20)
|
||||
@@ -706,9 +706,9 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> format the plugin main frame
|
||||
--format the plugin main frame
|
||||
f.RefreshFrame (frame)
|
||||
--> add the plugin to embed table
|
||||
--add the plugin to embed table
|
||||
tinsert(f.EmbedPlugins, pluginObject)
|
||||
frame:SetParent(f)
|
||||
|
||||
@@ -716,16 +716,16 @@
|
||||
end
|
||||
|
||||
function f.OpenPlugin (pluginObject)
|
||||
--> just simulate a click on the menu button
|
||||
--just simulate a click on the menu button
|
||||
f.OnMenuClick (_, _, pluginObject.real_name)
|
||||
end
|
||||
|
||||
function f.ClosePlugin()
|
||||
--> hide all embed plugins
|
||||
for index, plugin in ipairs (f.EmbedPlugins) do
|
||||
--hide all embed plugins
|
||||
for index, plugin in ipairs(f.EmbedPlugins) do
|
||||
plugin.Frame:Hide()
|
||||
end
|
||||
--> hide the main frame
|
||||
--hide the main frame
|
||||
f:Hide()
|
||||
end
|
||||
|
||||
@@ -741,20 +741,20 @@
|
||||
function _detalhes:OpenPlugin (wildcard)
|
||||
local originalName = wildcard
|
||||
|
||||
if (type (wildcard) == "string") then
|
||||
if (type(wildcard) == "string") then
|
||||
|
||||
--> check if passed a plugin absolute name
|
||||
--check if passed a plugin absolute name
|
||||
local pluginObject = _detalhes:GetPlugin (wildcard)
|
||||
if (pluginObject) then
|
||||
f.OpenPlugin (pluginObject)
|
||||
return true
|
||||
end
|
||||
|
||||
--> check if passed a plugin name, remove spaces and make it lower case
|
||||
--check if passed a plugin name, remove spaces and make it lower case
|
||||
wildcard = string.lower (wildcard)
|
||||
wildcard = wildcard:gsub ("%s", "")
|
||||
|
||||
for index, pluginInfoTable in ipairs (_detalhes.ToolBar.Menu) do
|
||||
for index, pluginInfoTable in ipairs(_detalhes.ToolBar.Menu) do
|
||||
local pluginName = pluginInfoTable [1]
|
||||
pluginName = string.lower (pluginName)
|
||||
pluginName = pluginName:gsub ("%s", "")
|
||||
@@ -766,15 +766,15 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> check if passed a plugin object
|
||||
elseif (type (wildcard) == "table") then
|
||||
--check if passed a plugin object
|
||||
elseif (type(wildcard) == "table") then
|
||||
if (wildcard.__name) then
|
||||
f.OpenPlugin (wildcard)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
Details:Msg ("|cFFFF7700plugin not found|r:|cFFFFFF00", (originalName or wildcard), "|rcheck if it is enabled in the addons control panel.") --localize-me
|
||||
Details:Msg("|cFFFF7700plugin not found|r:|cFFFFFF00", (originalName or wildcard), "|rcheck if it is enabled in the addons control panel.") --localize-me
|
||||
end
|
||||
|
||||
|
||||
|
||||
+22
-22
@@ -6,7 +6,7 @@
|
||||
local _
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> local pointers
|
||||
--local pointers
|
||||
|
||||
local _math_floor = math.floor --lua local
|
||||
local _cstr = string.format --lua local
|
||||
@@ -19,13 +19,13 @@
|
||||
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> constants
|
||||
--constants
|
||||
|
||||
local modo_raid = _detalhes._detalhes_props["MODO_RAID"]
|
||||
local modo_alone = _detalhes._detalhes_props["MODO_ALONE"]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> internal functions
|
||||
--internal functions
|
||||
|
||||
function _detalhes.RaidTables:DisableRaidMode (instance)
|
||||
--free
|
||||
@@ -59,28 +59,28 @@
|
||||
|
||||
function _detalhes.RaidTables:EnableRaidMode (instance, plugin_name, from_cooltip, from_mode_menu)
|
||||
|
||||
--> check if came from cooltip
|
||||
--check if came from cooltip
|
||||
if (from_cooltip) then
|
||||
self = _detalhes.RaidTables
|
||||
instance = plugin_name
|
||||
plugin_name = from_cooltip
|
||||
end
|
||||
|
||||
--> set the mode
|
||||
--set the mode
|
||||
if (instance.modo == modo_alone) then
|
||||
instance:SoloMode (false)
|
||||
end
|
||||
instance.modo = modo_raid
|
||||
|
||||
--> hide rows, scrollbar
|
||||
Details.FadeHandler.Fader (instance, 1, nil, "barras")
|
||||
--hide rows, scrollbar
|
||||
Details.FadeHandler.Fader(instance, 1, nil, "barras")
|
||||
if (instance.rolagem) then
|
||||
instance:EsconderScrollBar (true) --> hida a scrollbar
|
||||
instance:EsconderScrollBar (true) --hida a scrollbar
|
||||
end
|
||||
_detalhes:ResetaGump (instance)
|
||||
instance:RefreshMainWindow (true)
|
||||
instance:RefreshMainWindow(true)
|
||||
|
||||
--> get the plugin name
|
||||
--get the plugin name
|
||||
|
||||
--if the desired plugin isn't passed, try to get the latest used.
|
||||
if (not plugin_name) then
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
function _detalhes.RaidTables:GetAvailablePlugins()
|
||||
local available = {}
|
||||
for index, plugin in ipairs (self.Menu) do
|
||||
for index, plugin in ipairs(self.Menu) do
|
||||
if (not self.PluginsInUse [ plugin [4] ] and plugin [3].__enabled) then -- 3 = plugin object 4 = absolute name
|
||||
tinsert (available, plugin)
|
||||
end
|
||||
@@ -212,10 +212,10 @@
|
||||
|
||||
self:SetInUse (plugin_name, instance:GetId())
|
||||
plugin_object.instance_id = instance:GetId()
|
||||
plugin_object.Frame:SetPoint ("TOPLEFT", instance.bgframe)
|
||||
plugin_object.Frame:SetPoint("TOPLEFT", instance.bgframe)
|
||||
plugin_object.Frame:Show()
|
||||
instance:ChangeIcon (plugin_object.__icon)--; print (instance:GetId(),"icon",plugin_object.__icon)
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instance, instance.atributo, instance.sub_atributo)
|
||||
_detalhes:SendEvent("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instance, instance.atributo, instance.sub_atributo)
|
||||
|
||||
if (update_menu) then
|
||||
GameCooltip:ExecFunc (instance.baseframe.cabecalho.atributo)
|
||||
@@ -238,7 +238,7 @@
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> built in announcers
|
||||
--built in announcers
|
||||
|
||||
function _detalhes:SendMsgToChannel (msg, channel, towho)
|
||||
if (channel == "RAID" or channel == "PARTY") then
|
||||
@@ -249,10 +249,10 @@
|
||||
|
||||
elseif (channel == "BNET") then
|
||||
|
||||
if (type (towho) == "number") then
|
||||
if (type(towho) == "number") then
|
||||
BNSendWhisper (towho, msg)
|
||||
|
||||
elseif (type (towho) == "string") then
|
||||
elseif (type(towho) == "string") then
|
||||
--local BnetFriends = BNGetNumFriends()
|
||||
--for i = 1, BnetFriends do
|
||||
-- local presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, broadcastTime, canSoR = BNGetFriendInfo (i)
|
||||
@@ -531,13 +531,13 @@
|
||||
channel = "INSTANCE_CHAT"
|
||||
end
|
||||
|
||||
elseif (where == 4) then --> observer
|
||||
elseif (where == 4) then --observer
|
||||
if (zone ~= "raid" and zone ~= "party") then
|
||||
return
|
||||
end
|
||||
channel = "PRINT"
|
||||
|
||||
elseif (where == 5) then --> officers
|
||||
elseif (where == 5) then --officers
|
||||
if (IsInGuild()) then
|
||||
channel = "OFFICER"
|
||||
end
|
||||
@@ -555,7 +555,7 @@
|
||||
alvo_name = _detalhes:GetOnlyName (alvo_name)
|
||||
|
||||
local msg
|
||||
if (where == 4) then --> observer
|
||||
if (where == 4) then --observer
|
||||
local _, class = _UnitClass (alvo_name)
|
||||
local class_color = "|cFFFFFFFF"
|
||||
|
||||
@@ -575,14 +575,14 @@
|
||||
for i = 1, _detalhes.announce_deaths.last_hits do
|
||||
for o = last, 1, -1 do
|
||||
local this_death = death_table [o]
|
||||
if (type (this_death[1]) == "boolean" and this_death[1] and this_death[4]+5 > time) then
|
||||
if (type(this_death[1]) == "boolean" and this_death[1] and this_death[4]+5 > time) then
|
||||
local spelllink
|
||||
if (this_death [2] > 10) then
|
||||
spelllink = GetSpellLink(this_death [2])
|
||||
else
|
||||
spelllink = "[" .. _GetSpellInfo(this_death [2]) .. "]"
|
||||
end
|
||||
spells = spelllink .. ": " .. _detalhes:ToK2 (_math_floor (this_death [3])) .. " " .. spells
|
||||
spells = spelllink .. ": " .. _detalhes:ToK2 (_math_floor(this_death [3])) .. " " .. spells
|
||||
last = o-1
|
||||
break
|
||||
end
|
||||
@@ -591,7 +591,7 @@
|
||||
|
||||
msg = msg .. " " .. spells
|
||||
|
||||
if (where == 4) then --> observer
|
||||
if (where == 4) then --observer
|
||||
local minute, second = _detalhes:GetCombat():GetFormatedCombatTime()
|
||||
if (second < 10) then
|
||||
second = "0" .. second
|
||||
|
||||
+59
-59
@@ -5,7 +5,7 @@
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> local pointers
|
||||
--local pointers
|
||||
|
||||
local _pairs = pairs --lua locals
|
||||
local _math_floor = math.floor --lua locals
|
||||
@@ -16,15 +16,15 @@
|
||||
local gump = _detalhes.gump --details local
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> constants
|
||||
--constants
|
||||
|
||||
local modo_alone = _detalhes._detalhes_props["MODO_ALONE"]
|
||||
local modo_grupo = _detalhes._detalhes_props["MODO_GROUP"]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> internal functions
|
||||
--internal functions
|
||||
|
||||
--> When a combat start
|
||||
--When a combat start
|
||||
function _detalhes:UpdateSolo()
|
||||
local SoloInstance = _detalhes.tabela_instancias[_detalhes.solo]
|
||||
_detalhes.SoloTables.CombatIDLast = _detalhes.SoloTables.CombatID
|
||||
@@ -35,17 +35,17 @@
|
||||
function _detalhes:CreateSoloCloseButton()
|
||||
|
||||
local plugin, frame = self, self.Frame
|
||||
local button = CreateFrame ("Button", nil, frame, "UIPanelCloseButton")
|
||||
local button = CreateFrame("Button", nil, frame, "UIPanelCloseButton")
|
||||
|
||||
button:SetScript ("OnClick", function()
|
||||
button:SetScript("OnClick", function()
|
||||
if (not button.close_confirmation) then
|
||||
button.close_confirmation = gump:CreateSimplePanel (button, 296, 60, "", plugin.real_name .. "CloseConfirmation")
|
||||
button.close_confirmation:SetPoint ("center", frame, 0, 0)
|
||||
button.close_confirmation:SetPoint("center", frame, 0, 0)
|
||||
_G [button.close_confirmation:GetName() .. "TitleBar"]:Hide()
|
||||
local fade_background = button.close_confirmation:CreateTexture (nil, "background")
|
||||
fade_background:SetPoint ("topleft", frame, 0, 0)
|
||||
fade_background:SetPoint ("bottomright", frame, 0, 0)
|
||||
fade_background:SetTexture (0, 0, 0, 0.7)
|
||||
local fade_background = button.close_confirmation:CreateTexture(nil, "background")
|
||||
fade_background:SetPoint("topleft", frame, 0, 0)
|
||||
fade_background:SetPoint("bottomright", frame, 0, 0)
|
||||
fade_background:SetTexture(0, 0, 0, 0.7)
|
||||
|
||||
local close_func = function()
|
||||
local instance = plugin:GetPluginInstance()
|
||||
@@ -66,42 +66,42 @@
|
||||
close_window:SetIcon ([[Interface\Buttons\UI-Panel-MinimizeButton-Up]], nil, nil, nil, {0.143125, 0.8653125, 0.1446875, 0.8653125}, nil, nil, 2)
|
||||
back_to_group_and_raid:SetIcon ([[Interface\AddOns\Details\images\modo_icones]], nil, nil, nil, {32/256, 32/256*2, 0, 1}, nil, nil, 2)
|
||||
|
||||
close_window:SetPoint ("topleft", 3, -4)
|
||||
close_window:SetPoint ("bottomright", -3, 31)
|
||||
back_to_group_and_raid:SetPoint ("topleft", 3, -31)
|
||||
back_to_group_and_raid:SetPoint ("bottomright", -3, 4)
|
||||
close_window:SetPoint("topleft", 3, -4)
|
||||
close_window:SetPoint("bottomright", -3, 31)
|
||||
back_to_group_and_raid:SetPoint("topleft", 3, -31)
|
||||
back_to_group_and_raid:SetPoint("bottomright", -3, 4)
|
||||
end
|
||||
|
||||
button.close_confirmation:Show()
|
||||
end)
|
||||
|
||||
button:SetWidth (20)
|
||||
button:SetHeight (20)
|
||||
button:SetWidth(20)
|
||||
button:SetHeight(20)
|
||||
--button:GetNormalTexture():SetDesaturated (true)
|
||||
return button
|
||||
end
|
||||
|
||||
--> enable and disable Solo Mode for an Instance
|
||||
--enable and disable Solo Mode for an Instance
|
||||
function _detalhes:SoloMode (show)
|
||||
if (show) then
|
||||
|
||||
--> salvar a janela normal
|
||||
if (self.mostrando ~= "solo") then --> caso o addon tenha ligado ja no painel solo, n�o precisa rodar isso aqui
|
||||
--salvar a janela normal
|
||||
if (self.mostrando ~= "solo") then --caso o addon tenha ligado ja no painel solo, n�o precisa rodar isso aqui
|
||||
self:SaveMainWindowPosition()
|
||||
|
||||
if (self.rolagem) then
|
||||
self:EsconderScrollBar() --> hida a scrollbar
|
||||
self:EsconderScrollBar() --hida a scrollbar
|
||||
end
|
||||
self.need_rolagem = false
|
||||
|
||||
self.baseframe:EnableMouseWheel (false)
|
||||
Details.FadeHandler.Fader (self, 1, nil, "barras") --> escondendo a janela da inst�ncia [inst�ncia [force hide [velocidade [hidar o que]]]]
|
||||
Details.FadeHandler.Fader(self, 1, nil, "barras") --escondendo a janela da inst�ncia [inst�ncia [force hide [velocidade [hidar o que]]]]
|
||||
self.mostrando = "solo"
|
||||
end
|
||||
|
||||
_detalhes.SoloTables.instancia = self
|
||||
|
||||
--> default plugin
|
||||
--default plugin
|
||||
if (not _detalhes.SoloTables.built) then
|
||||
gump:PrepareSoloMode (self)
|
||||
end
|
||||
@@ -110,22 +110,22 @@
|
||||
_detalhes.solo = self.meu_id
|
||||
--self:AtualizaSliderSolo (0)
|
||||
|
||||
if (not self.posicao.solo.w) then --> primeira vez que o solo mode � executado nessa inst�ncia
|
||||
self.baseframe:SetWidth (300)
|
||||
self.baseframe:SetHeight (300)
|
||||
if (not self.posicao.solo.w) then --primeira vez que o solo mode � executado nessa inst�ncia
|
||||
self.baseframe:SetWidth(300)
|
||||
self.baseframe:SetHeight(300)
|
||||
self:SaveMainWindowPosition()
|
||||
else
|
||||
self:RestoreMainWindowPosition()
|
||||
local w, h = self:GetSize()
|
||||
if (w ~= 300 or h ~= 300) then
|
||||
self.baseframe:SetWidth (300)
|
||||
self.baseframe:SetHeight (300)
|
||||
self.baseframe:SetWidth(300)
|
||||
self.baseframe:SetHeight(300)
|
||||
self:SaveMainWindowPosition()
|
||||
end
|
||||
end
|
||||
|
||||
local first_enabled_plugin, first_enabled_plugin_index
|
||||
for index, plugin in ipairs (_detalhes.SoloTables.Plugins) do
|
||||
for index, plugin in ipairs(_detalhes.SoloTables.Plugins) do
|
||||
if (plugin.__enabled) then
|
||||
first_enabled_plugin = plugin
|
||||
first_enabled_plugin_index = index
|
||||
@@ -153,7 +153,7 @@
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes.solo = nil --> destranca a janela solo para ser usada em outras inst�ncias
|
||||
_detalhes.solo = nil --destranca a janela solo para ser usada em outras inst�ncias
|
||||
self.mostrando = "normal"
|
||||
self:RestoreMainWindowPosition()
|
||||
|
||||
@@ -161,24 +161,24 @@
|
||||
_detalhes:CancelWaitForPlugin()
|
||||
end
|
||||
|
||||
Details.FadeHandler.Fader (self, 1, nil, "barras")
|
||||
Details.FadeHandler.Fader (self.scroll, 0)
|
||||
Details.FadeHandler.Fader(self, 1, nil, "barras")
|
||||
Details.FadeHandler.Fader(self.scroll, 0)
|
||||
|
||||
if (self.need_rolagem) then
|
||||
self:MostrarScrollBar (true)
|
||||
else
|
||||
--> precisa verificar se ele precisa a rolagem certo?
|
||||
--precisa verificar se ele precisa a rolagem certo?
|
||||
self:ReajustaGump()
|
||||
end
|
||||
|
||||
--> calcula se existem barras, etc...
|
||||
if (not self.rows_fit_in_window) then --> as barras n�o forma iniciadas ainda
|
||||
self.rows_fit_in_window = _math_floor (self.baseframe.BoxBarrasAltura / self.row_height)
|
||||
--calcula se existem barras, etc...
|
||||
if (not self.rows_fit_in_window) then --as barras n�o forma iniciadas ainda
|
||||
self.rows_fit_in_window = _math_floor(self.baseframe.BoxBarrasAltura / self.row_height)
|
||||
if (self.rows_created < self.rows_fit_in_window) then
|
||||
for i = #self.barras+1, self.rows_fit_in_window do
|
||||
local nova_barra = gump:CriaNovaBarra (self, i, 30) --> cria nova barra
|
||||
nova_barra.lineText1:SetText (Loc ["STRING_NEWROW"])
|
||||
nova_barra.statusbar:SetValue (100)
|
||||
local nova_barra = gump:CriaNovaBarra (self, i, 30) --cria nova barra
|
||||
nova_barra.lineText1:SetText(Loc ["STRING_NEWROW"])
|
||||
nova_barra.statusbar:SetValue(100)
|
||||
self.barras [i] = nova_barra
|
||||
end
|
||||
self.rows_created = #self.barras
|
||||
@@ -189,7 +189,7 @@
|
||||
|
||||
function _detalhes.SoloTables:EnableSoloMode (instance, plugin_name, from_cooltip)
|
||||
|
||||
--> check if came from cooltip
|
||||
--check if came from cooltip
|
||||
if (from_cooltip) then
|
||||
self = _detalhes.SoloTables
|
||||
instance = plugin_name
|
||||
@@ -201,15 +201,15 @@
|
||||
_detalhes.SoloTables:switch (nil, plugin_name)
|
||||
end
|
||||
|
||||
--> Build Solo Mode Tables and Functions
|
||||
--Build Solo Mode Tables and Functions
|
||||
function gump:PrepareSoloMode (instancia)
|
||||
|
||||
_detalhes.SoloTables.built = true
|
||||
|
||||
_detalhes.SoloTables.SpellCastTable = {} --> not used
|
||||
_detalhes.SoloTables.TimeTable = {} --> not used
|
||||
_detalhes.SoloTables.SpellCastTable = {} --not used
|
||||
_detalhes.SoloTables.TimeTable = {} --not used
|
||||
|
||||
_detalhes.SoloTables.Mode = _detalhes.SoloTables.Mode or 1 --> solo mode
|
||||
_detalhes.SoloTables.Mode = _detalhes.SoloTables.Mode or 1 --solo mode
|
||||
|
||||
function _detalhes.SoloTables:GetActiveIndex()
|
||||
return _detalhes.SoloTables.Mode
|
||||
@@ -217,17 +217,17 @@
|
||||
|
||||
function _detalhes.SoloTables:switch (_, _switchTo)
|
||||
|
||||
--> just hide all
|
||||
--just hide all
|
||||
if (not _switchTo) then
|
||||
if (#_detalhes.SoloTables.Plugins > 0) then --> have at least one plugin
|
||||
if (#_detalhes.SoloTables.Plugins > 0) then --have at least one plugin
|
||||
_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:Hide()
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
--> if passed the absolute plugin name
|
||||
if (type (_switchTo) == "string") then
|
||||
for index, ptable in ipairs (_detalhes.SoloTables.Menu) do
|
||||
--if passed the absolute plugin name
|
||||
if (type(_switchTo) == "string") then
|
||||
for index, ptable in ipairs(_detalhes.SoloTables.Menu) do
|
||||
if (ptable [3].__enabled and ptable [4] == _switchTo) then
|
||||
_switchTo = index
|
||||
break
|
||||
@@ -243,27 +243,27 @@
|
||||
|
||||
local ThisFrame = _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode]
|
||||
if (not ThisFrame or not ThisFrame.__enabled) then
|
||||
--> frame not found, try in few second again
|
||||
--frame not found, try in few second again
|
||||
_detalhes.SoloTables.Mode = _switchTo
|
||||
_detalhes:WaitForSoloPlugin (instancia)
|
||||
return
|
||||
end
|
||||
|
||||
--> hide current frame
|
||||
--hide current frame
|
||||
_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:Hide()
|
||||
--> switch mode
|
||||
--switch mode
|
||||
_detalhes.SoloTables.Mode = _switchTo
|
||||
--> show and setpoint new frame
|
||||
--show and setpoint new frame
|
||||
|
||||
_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:Show()
|
||||
_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:SetPoint ("TOPLEFT",_detalhes.SoloTables.instancia.bgframe)
|
||||
_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:SetPoint("TOPLEFT",_detalhes.SoloTables.instancia.bgframe)
|
||||
_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].Frame:SetFrameLevel (20)
|
||||
|
||||
_detalhes.SoloTables.instancia:ChangeIcon (_detalhes.SoloTables.Menu [_detalhes.SoloTables.Mode] [2])
|
||||
|
||||
_detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].instance_id = _detalhes.SoloTables.instancia:GetId()
|
||||
|
||||
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, _detalhes.SoloTables.instancia, _detalhes.SoloTables.instancia.atributo, _detalhes.SoloTables.instancia.sub_atributo)
|
||||
_detalhes:SendEvent("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, _detalhes.SoloTables.instancia, _detalhes.SoloTables.instancia.atributo, _detalhes.SoloTables.instancia.sub_atributo)
|
||||
|
||||
end
|
||||
|
||||
@@ -278,16 +278,16 @@
|
||||
|
||||
for SpellId, DebuffTable in _pairs (SoloDebuffUptime) do
|
||||
if (DebuffTable.start) then
|
||||
DebuffTable.duration = DebuffTable.duration + (_detalhes._tempo - DebuffTable.start) --> time do parser ser� igual ao time()?
|
||||
DebuffTable.duration = DebuffTable.duration + (_detalhes._tempo - DebuffTable.start) --time do parser ser� igual ao time()?
|
||||
DebuffTable.start = nil
|
||||
end
|
||||
DebuffTable.Active = false
|
||||
end
|
||||
end
|
||||
|
||||
--> Buffs ter� em todos os Solo Modes
|
||||
--Buffs ter� em todos os Solo Modes
|
||||
function _detalhes.SoloTables:CatchBuffs()
|
||||
--> reset bufftables
|
||||
--reset bufftables
|
||||
_detalhes.SoloTables.SoloBuffUptime = _detalhes.SoloTables.SoloBuffUptime or {}
|
||||
|
||||
for spellname, BuffTable in _pairs (_detalhes.SoloTables.SoloBuffUptime) do
|
||||
@@ -310,7 +310,7 @@
|
||||
BuffTable.droppedAmt = 0
|
||||
end
|
||||
|
||||
--> catch buffs untracked yet
|
||||
--catch buffs untracked yet
|
||||
for buffIndex = 1, 41 do
|
||||
local name = _UnitAura ("player", buffIndex)
|
||||
if (name) then
|
||||
|
||||
+276
-276
File diff suppressed because it is too large
Load Diff
+60
-60
@@ -6,53 +6,53 @@
|
||||
local _
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> local pointers
|
||||
--local pointers
|
||||
-- none
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> details api functions
|
||||
--details api functions
|
||||
|
||||
--> create a button which will be displayed on tooltip
|
||||
--create a button which will be displayed on tooltip
|
||||
function _detalhes.ToolBar:NewPluginToolbarButton (func, icon, pluginname, tooltip, w, h, framename, menu_function)
|
||||
|
||||
--> random name if nameless
|
||||
--random name if nameless
|
||||
if (not framename) then
|
||||
framename = "DetailsToolbarButton" .. math.random (1, 100000)
|
||||
end
|
||||
|
||||
--> create button from template
|
||||
local button = CreateFrame ("button", framename, _detalhes.listener, "DetailsToolbarButton")
|
||||
--create button from template
|
||||
local button = CreateFrame("button", framename, _detalhes.listener, "DetailsToolbarButton")
|
||||
|
||||
--> sizes
|
||||
--sizes
|
||||
if (w) then
|
||||
button:SetWidth (w)
|
||||
button:SetWidth(w)
|
||||
end
|
||||
if (h) then
|
||||
button:SetHeight (h)
|
||||
button:SetHeight(h)
|
||||
end
|
||||
|
||||
button.x = 0
|
||||
button.y = 0
|
||||
|
||||
--> tooltip and function on click
|
||||
--tooltip and function on click
|
||||
button.tooltip = tooltip
|
||||
button.menu = menu_function
|
||||
button:SetScript ("OnClick", func)
|
||||
button:SetScript("OnClick", func)
|
||||
|
||||
--> textures
|
||||
button:SetNormalTexture (icon)
|
||||
button:SetPushedTexture (icon)
|
||||
--textures
|
||||
button:SetNormalTexture(icon)
|
||||
button:SetPushedTexture(icon)
|
||||
button:SetDisabledTexture (icon)
|
||||
button:SetHighlightTexture (icon, "ADD")
|
||||
button:SetHighlightTexture(icon, "ADD")
|
||||
button.__icon = icon
|
||||
button.__name = pluginname
|
||||
|
||||
--> blizzard built-in animation
|
||||
--local FourCornerAnimeFrame = CreateFrame ("frame", framename.."Blink", button) --, "IconIntroAnimTemplate" --stop using 'IconIntroAnimTemplate' as older versions of the game doesn't have it
|
||||
--FourCornerAnimeFrame:SetPoint ("center", button)
|
||||
--FourCornerAnimeFrame:SetWidth (w or 14)
|
||||
--FourCornerAnimeFrame:SetHeight (w or 14)
|
||||
--FourCornerAnimeFrame.glow:SetScript ("OnFinished", nil)
|
||||
--blizzard built-in animation
|
||||
--local FourCornerAnimeFrame = CreateFrame("frame", framename.."Blink", button) --, "IconIntroAnimTemplate" --stop using 'IconIntroAnimTemplate' as older versions of the game doesn't have it
|
||||
--FourCornerAnimeFrame:SetPoint("center", button)
|
||||
--FourCornerAnimeFrame:SetWidth(w or 14)
|
||||
--FourCornerAnimeFrame:SetHeight(w or 14)
|
||||
--FourCornerAnimeFrame.glow:SetScript("OnFinished", nil)
|
||||
--button.blink = FourCornerAnimeFrame
|
||||
|
||||
_detalhes.ToolBar.AllButtons [#_detalhes.ToolBar.AllButtons+1] = button
|
||||
@@ -60,12 +60,12 @@
|
||||
return button
|
||||
end
|
||||
|
||||
--> show your plugin icon on tooltip
|
||||
--show your plugin icon on tooltip
|
||||
function _detalhes:ShowToolbarIcon (Button, Effect)
|
||||
|
||||
local LastIcon
|
||||
|
||||
--> get the lower number instance
|
||||
--get the lower number instance
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
return
|
||||
@@ -74,7 +74,7 @@
|
||||
local instance = _detalhes:GetInstance (lower_instance)
|
||||
|
||||
if (#_detalhes.ToolBar.Shown > 0) then
|
||||
--> already shown
|
||||
--already shown
|
||||
if (_detalhes:tableIN (_detalhes.ToolBar.Shown, Button)) then
|
||||
return
|
||||
end
|
||||
@@ -84,7 +84,7 @@
|
||||
end
|
||||
|
||||
_detalhes.ToolBar.Shown [#_detalhes.ToolBar.Shown+1] = Button
|
||||
Button:SetPoint ("left", LastIcon.widget or LastIcon, "right", Button.x, Button.y)
|
||||
Button:SetPoint("left", LastIcon.widget or LastIcon, "right", Button.x, Button.y)
|
||||
|
||||
Button:Show()
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
end
|
||||
|
||||
if (Effect) then
|
||||
if (type (Effect) == "string") then
|
||||
if (type(Effect) == "string") then
|
||||
if (Effect == "blink") then
|
||||
--Button.blink.glow:Play() --.blink and .glow doesn't exists anymore due to removal of the template 'IconIntroAnimTemplate'
|
||||
elseif (Effect == "star") then
|
||||
@@ -111,46 +111,46 @@
|
||||
return true
|
||||
end
|
||||
|
||||
--> hide your plugin icon from toolbar
|
||||
--hide your plugin icon from toolbar
|
||||
function _detalhes:HideToolbarIcon (Button)
|
||||
|
||||
local index = _detalhes:tableIN (_detalhes.ToolBar.Shown, Button)
|
||||
|
||||
if (not index) then
|
||||
--> current not shown
|
||||
--current not shown
|
||||
return
|
||||
end
|
||||
|
||||
Button:Hide()
|
||||
table.remove (_detalhes.ToolBar.Shown, index)
|
||||
|
||||
--> reorganize icons
|
||||
--reorganize icons
|
||||
_detalhes.ToolBar:ReorganizeIcons (true)
|
||||
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> internal functions
|
||||
--internal functions
|
||||
do
|
||||
local PluginDescPanel = CreateFrame ("frame", "DetailsPluginDescPanel", UIParent)
|
||||
local PluginDescPanel = CreateFrame("frame", "DetailsPluginDescPanel", UIParent)
|
||||
PluginDescPanel:SetFrameStrata ("tooltip")
|
||||
PluginDescPanel:Hide()
|
||||
PluginDescPanel:SetWidth (205)
|
||||
PluginDescPanel:SetWidth(205)
|
||||
PluginDescPanel.BackdropTable = {}
|
||||
|
||||
local background = PluginDescPanel:CreateTexture (nil, "artwork")
|
||||
background:SetPoint ("topleft", 0, 0)
|
||||
background:SetPoint ("bottomright", 0, 0)
|
||||
local background = PluginDescPanel:CreateTexture(nil, "artwork")
|
||||
background:SetPoint("topleft", 0, 0)
|
||||
background:SetPoint("bottomright", 0, 0)
|
||||
PluginDescPanel.background = background
|
||||
|
||||
local icon, title, desc = PluginDescPanel:CreateTexture (nil, "overlay"), PluginDescPanel:CreateFontString (nil, "overlay", "GameFontNormal"), PluginDescPanel:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
icon:SetPoint ("topleft", 10, -10)
|
||||
icon:SetSize (16, 16)
|
||||
title:SetPoint ("left", icon, "right", 2, 0)
|
||||
desc:SetPoint ("topleft", 13, -30)
|
||||
desc:SetWidth (180)
|
||||
desc:SetJustifyH ("left")
|
||||
_detalhes:SetFontColor (desc, "white")
|
||||
local icon, title, desc = PluginDescPanel:CreateTexture(nil, "overlay"), PluginDescPanel:CreateFontString (nil, "overlay", "GameFontNormal"), PluginDescPanel:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
icon:SetPoint("topleft", 10, -10)
|
||||
icon:SetSize(16, 16)
|
||||
title:SetPoint("left", icon, "right", 2, 0)
|
||||
desc:SetPoint("topleft", 13, -30)
|
||||
desc:SetWidth(180)
|
||||
desc:SetJustifyH("left")
|
||||
_detalhes:SetFontColor(desc, "white")
|
||||
|
||||
PluginDescPanel.icon = icon
|
||||
PluginDescPanel.title = title
|
||||
@@ -161,7 +161,7 @@ end
|
||||
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (lower_instance) then
|
||||
_detalhes.OnEnterMainWindow (_detalhes:GetInstance (lower_instance), button, 3)
|
||||
_detalhes.OnEnterMainWindow(_detalhes:GetInstance (lower_instance), button, 3)
|
||||
end
|
||||
|
||||
if (button.tooltip) then
|
||||
@@ -171,13 +171,13 @@ end
|
||||
local next_check = 0.8
|
||||
|
||||
--check if the mouse is still interacting with the menu or with the button
|
||||
button:SetScript ("OnUpdate", function(self, elapsed)
|
||||
button:SetScript("OnUpdate", function(self, elapsed)
|
||||
next_check = next_check - elapsed
|
||||
|
||||
if (next_check < 0) then
|
||||
if (not GameCooltipFrame1:IsMouseOver() and not button:IsMouseOver()) then
|
||||
GameCooltip2:Hide()
|
||||
button:SetScript ("OnUpdate", nil)
|
||||
button:SetScript("OnUpdate", nil)
|
||||
return
|
||||
end
|
||||
next_check = 0.8
|
||||
@@ -186,7 +186,7 @@ end
|
||||
|
||||
--disable the hider menu if the cooltip is required in another place
|
||||
hooksecurefunc (GameCooltip2, "ShowCooltip", function()
|
||||
button:SetScript ("OnUpdate", nil)
|
||||
button:SetScript("OnUpdate", nil)
|
||||
end)
|
||||
|
||||
return
|
||||
@@ -196,13 +196,13 @@ end
|
||||
local plugin_object = _detalhes:GetPlugin (button.__name)
|
||||
|
||||
local f = DetailsPluginDescPanel
|
||||
f.icon:SetTexture (button.__icon)
|
||||
f.title:SetText (button.__name)
|
||||
f.desc:SetText (plugin_object:GetPluginDescription())
|
||||
f.icon:SetTexture(button.__icon)
|
||||
f.title:SetText(button.__name)
|
||||
f.desc:SetText(plugin_object:GetPluginDescription())
|
||||
_detalhes:SetFontSize (f.desc, _detalhes.font_sizes.menus)
|
||||
_detalhes:SetFontFace (f.desc, _detalhes.font_faces.menus)
|
||||
|
||||
--f.background:SetTexture (_detalhes.tooltip.menus_bg_texture)
|
||||
--f.background:SetTexture(_detalhes.tooltip.menus_bg_texture)
|
||||
f.background:SetTexCoord (unpack (_detalhes.tooltip.menus_bg_coords))
|
||||
f.background:SetVertexColor (unpack (_detalhes.tooltip.menus_bg_color))
|
||||
--f.background:SetDesaturated (true)
|
||||
@@ -213,12 +213,12 @@ end
|
||||
f.BackdropTable.edgeSize = 1 --_detalhes.tooltip_backdrop.edgeSize
|
||||
f.BackdropTable.tileSize = _detalhes.tooltip_backdrop.tileSize
|
||||
|
||||
f:SetBackdrop (f.BackdropTable)
|
||||
local r, g, b, a = _detalhes.gump:ParseColors (_detalhes.tooltip_border_color)
|
||||
f:SetBackdropBorderColor (r, g, b, a)
|
||||
f:SetBackdrop(f.BackdropTable)
|
||||
local r, g, b, a = _detalhes.gump:ParseColors(_detalhes.tooltip_border_color)
|
||||
f:SetBackdropBorderColor(r, g, b, a)
|
||||
|
||||
f:SetHeight (40 + f.desc:GetStringHeight())
|
||||
f:SetPoint ("bottom", button, "top", 0, 10)
|
||||
f:SetHeight(40 + f.desc:GetStringHeight())
|
||||
f:SetPoint("bottom", button, "top", 0, 10)
|
||||
f:Show()
|
||||
--SharedMedia:Fetch ("font", "Friz Quadrata TT")
|
||||
|
||||
@@ -229,7 +229,7 @@ end
|
||||
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (lower_instance) then
|
||||
_detalhes.OnLeaveMainWindow (_detalhes:GetInstance (lower_instance), button, 3)
|
||||
_detalhes.OnLeaveMainWindow(_detalhes:GetInstance (lower_instance), button, 3)
|
||||
end
|
||||
|
||||
if (button.tooltip) then
|
||||
@@ -239,7 +239,7 @@ end
|
||||
|
||||
_detalhes:RegisterEvent (_detalhes.ToolBar, "DETAILS_INSTANCE_OPEN", "OnInstanceOpen")
|
||||
_detalhes:RegisterEvent (_detalhes.ToolBar, "DETAILS_INSTANCE_CLOSE", "OnInstanceClose")
|
||||
_detalhes.ToolBar.Enabled = true --> must have this member or wont receive the event
|
||||
_detalhes.ToolBar.Enabled = true --must have this member or wont receive the event
|
||||
_detalhes.ToolBar.__enabled = true
|
||||
|
||||
function _detalhes.ToolBar:OnInstanceOpen()
|
||||
@@ -250,11 +250,11 @@ end
|
||||
end
|
||||
|
||||
function _detalhes.ToolBar:ReorganizeIcons (just_refresh)
|
||||
--> get the lower number instance
|
||||
--get the lower number instance
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
|
||||
if (not lower_instance) then
|
||||
for _, ThisButton in ipairs (_detalhes.ToolBar.Shown) do
|
||||
for _, ThisButton in ipairs(_detalhes.ToolBar.Shown) do
|
||||
ThisButton:Hide()
|
||||
end
|
||||
return
|
||||
|
||||
+28
-28
@@ -5,7 +5,7 @@
|
||||
local _
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> local pointers
|
||||
--local pointers
|
||||
|
||||
local _table_insert = table.insert --lua local
|
||||
local _ipairs = ipairs --lua local
|
||||
@@ -18,25 +18,25 @@
|
||||
local timeMachine = _detalhes.timeMachine --details local
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> constants
|
||||
--constants
|
||||
local _tempo = _time()
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> core
|
||||
--core
|
||||
|
||||
timeMachine.ligada = false
|
||||
|
||||
local calc_for_pvp = function(self)
|
||||
for tipo, tabela in _pairs (self.tabelas) do
|
||||
for nome, jogador in _ipairs (tabela) do
|
||||
for nome, jogador in _ipairs(tabela) do
|
||||
if (jogador) then
|
||||
if (jogador.last_event+3 > _tempo) then --> okey o jogador esta dando dps
|
||||
if (jogador.on_hold) then --> o dps estava pausado, retornar a ativa
|
||||
if (jogador.last_event+3 > _tempo) then --okey o jogador esta dando dps
|
||||
if (jogador.on_hold) then --o dps estava pausado, retornar a ativa
|
||||
jogador:HoldOn (false)
|
||||
end
|
||||
else
|
||||
if (not jogador.on_hold) then --> n�o ta pausado, precisa por em pausa
|
||||
--> verifica se esta castando alguma coisa que leve + que 3 segundos
|
||||
if (not jogador.on_hold) then --n�o ta pausado, precisa por em pausa
|
||||
--verifica se esta castando alguma coisa que leve + que 3 segundos
|
||||
jogador:HoldOn (true)
|
||||
end
|
||||
end
|
||||
@@ -47,15 +47,15 @@
|
||||
|
||||
local calc_for_pve = function(self)
|
||||
for tipo, tabela in _pairs (self.tabelas) do
|
||||
for nome, jogador in _ipairs (tabela) do
|
||||
for nome, jogador in _ipairs(tabela) do
|
||||
if (jogador) then
|
||||
if (jogador.last_event+10 > _tempo) then --> okey o jogador esta dando dps
|
||||
if (jogador.on_hold) then --> o dps estava pausado, retornar a ativa
|
||||
if (jogador.last_event+10 > _tempo) then --okey o jogador esta dando dps
|
||||
if (jogador.on_hold) then --o dps estava pausado, retornar a ativa
|
||||
jogador:HoldOn (false)
|
||||
end
|
||||
else
|
||||
if (not jogador.on_hold) then --> n�o ta pausado, precisa por em pausa
|
||||
--> verifica se esta castando alguma coisa que leve + que 10 segundos
|
||||
if (not jogador.on_hold) then --n�o ta pausado, precisa por em pausa
|
||||
--verifica se esta castando alguma coisa que leve + que 10 segundos
|
||||
jogador:HoldOn (true)
|
||||
end
|
||||
end
|
||||
@@ -79,10 +79,10 @@
|
||||
function timeMachine:Ligar()
|
||||
self.atualizador = self:ScheduleRepeatingTimer ("Core", 1)
|
||||
self.ligada = true
|
||||
self.tabelas = {{}, {}} --> 1 dano 2 cura
|
||||
self.tabelas = {{}, {}} --1 dano 2 cura
|
||||
|
||||
local danos = _detalhes.tabela_vigente[1]._ActorTable
|
||||
for _, jogador in _ipairs (danos) do
|
||||
for _, jogador in _ipairs(danos) do
|
||||
if (jogador.dps_started) then
|
||||
jogador:RegistrarNaTimeMachine()
|
||||
end
|
||||
@@ -101,7 +101,7 @@
|
||||
function timeMachine:Reiniciar()
|
||||
table.wipe (self.tabelas[1])
|
||||
table.wipe (self.tabelas[2])
|
||||
self.tabelas = {{}, {}} --> 1 dano 2 cura
|
||||
self.tabelas = {{}, {}} --1 dano 2 cura
|
||||
end
|
||||
|
||||
function _detalhes:DesregistrarNaTimeMachine()
|
||||
@@ -130,10 +130,10 @@
|
||||
end
|
||||
|
||||
function _detalhes:ManutencaoTimeMachine()
|
||||
for tipo, tabela in _ipairs (timeMachine.tabelas) do
|
||||
for tipo, tabela in _ipairs(timeMachine.tabelas) do
|
||||
local t = {}
|
||||
local removed = 0
|
||||
for index, jogador in _ipairs (tabela) do
|
||||
for index, jogador in _ipairs(tabela) do
|
||||
if (jogador) then
|
||||
t [#t+1] = jogador
|
||||
jogador.timeMachine = #t
|
||||
@@ -153,14 +153,14 @@
|
||||
function _detalhes:Tempo()
|
||||
|
||||
if (self.pvp) then
|
||||
--> pvp timer
|
||||
if (self.end_time) then --> o tempo do jogador esta trancado
|
||||
--pvp timer
|
||||
if (self.end_time) then --o tempo do jogador esta trancado
|
||||
local t = self.end_time - self.start_time
|
||||
if (t < 3) then
|
||||
t = 3
|
||||
end
|
||||
return t
|
||||
elseif (self.on_hold) then --> o tempo esta em pausa
|
||||
elseif (self.on_hold) then --o tempo esta em pausa
|
||||
local t = self.delay - self.start_time
|
||||
if (t < 3) then
|
||||
t = 3
|
||||
@@ -183,14 +183,14 @@
|
||||
return t
|
||||
end
|
||||
else
|
||||
--> pve timer
|
||||
if (self.end_time) then --> o tempo do jogador esta trancado
|
||||
--pve timer
|
||||
if (self.end_time) then --o tempo do jogador esta trancado
|
||||
local t = self.end_time - self.start_time
|
||||
if (t < 10) then
|
||||
t = 10
|
||||
end
|
||||
return t
|
||||
elseif (self.on_hold) then --> o tempo esta em pausa
|
||||
elseif (self.on_hold) then --o tempo esta em pausa
|
||||
local t = self.delay - self.start_time
|
||||
if (t < 10) then
|
||||
t = 10
|
||||
@@ -231,19 +231,19 @@
|
||||
self.end_time = _tempo
|
||||
end
|
||||
|
||||
--> diz se o dps deste jogador esta em pausa
|
||||
--diz se o dps deste jogador esta em pausa
|
||||
function _detalhes:HoldOn (pausa)
|
||||
if (pausa == nil) then
|
||||
return self.on_hold --retorna se o dps esta aberto ou fechado para este jogador
|
||||
|
||||
elseif (pausa) then --> true - colocar como inativo
|
||||
self.delay = _math_floor (self.last_event) --_tempo - 10
|
||||
elseif (pausa) then --true - colocar como inativo
|
||||
self.delay = _math_floor(self.last_event) --_tempo - 10
|
||||
if (self.delay < self.start_time) then
|
||||
self.delay = self.start_time
|
||||
end
|
||||
self.on_hold = true
|
||||
|
||||
else --> false - retornar a atividade
|
||||
else --false - retornar a atividade
|
||||
local diff = _tempo - self.delay - 1
|
||||
if (diff > 0) then
|
||||
self.start_time = self.start_time + diff
|
||||
|
||||
+119
-119
@@ -4,7 +4,7 @@
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
local _
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> local pointers
|
||||
--local pointers
|
||||
|
||||
local upper = string.upper --lua local
|
||||
local _ipairs = ipairs --lua local
|
||||
@@ -32,7 +32,7 @@
|
||||
local gump = _detalhes.gump --details local
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> fade handler
|
||||
--fade handler
|
||||
|
||||
Details.FadeHandler = {
|
||||
frames = {}
|
||||
@@ -204,13 +204,13 @@
|
||||
|
||||
elseif (upper(animationType) == "OUT") then --show the frame
|
||||
|
||||
if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --> ja esta na tela
|
||||
if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --ja esta na tela
|
||||
return
|
||||
elseif (frame.fading_out) then --> j� ta com fading out
|
||||
elseif (frame.fading_out) then --j� ta com fading out
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.fading_in) then --> se tiver uma anima��o de hidar em andamento se for true
|
||||
if (frame.fading_in) then --se tiver uma anima��o de hidar em andamento se for true
|
||||
frame.fading_in = false
|
||||
end
|
||||
|
||||
@@ -286,9 +286,9 @@
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> details api functions
|
||||
--details api functions
|
||||
|
||||
--> get the npc id from guid
|
||||
--get the npc id from guid
|
||||
function _detalhes:GetNpcIdFromGuid (guid)
|
||||
local NpcId = _select ( 6, _strsplit ( "-", guid ) )
|
||||
if (NpcId) then
|
||||
@@ -298,7 +298,7 @@
|
||||
end
|
||||
|
||||
function _detalhes:GetSourceFromNpcId (npcId)
|
||||
for index, container in ipairs (_detalhes.tabela_vigente) do
|
||||
for index, container in ipairs(_detalhes.tabela_vigente) do
|
||||
if (index <= 4) then
|
||||
local t = container._ActorTable
|
||||
for i = 1, #t do
|
||||
@@ -335,7 +335,7 @@
|
||||
return playername, playerclass, deathtime, deathcombattime, deathtimestring, playermaxhealth, deathevents, lastcooldown
|
||||
end
|
||||
|
||||
--> get the fractional number representing the alphabetical letter
|
||||
--get the fractional number representing the alphabetical letter
|
||||
function _detalhes:GetOrderNumber(who_name)
|
||||
--local name = upper (who_name .. "zz")
|
||||
--local byte1 = _math_abs (_string_byte (name, 2)-91)/1000000
|
||||
@@ -345,7 +345,7 @@
|
||||
|
||||
--/script print (tonumber (4/1000000)) - 4e-006
|
||||
--0.000004
|
||||
--> set all table keys to lower
|
||||
--set all table keys to lower
|
||||
local temptable = {}
|
||||
function _detalhes:LowerizeKeys (_table)
|
||||
for key, value in _pairs (_table) do
|
||||
@@ -360,7 +360,7 @@
|
||||
--krKR by @yuk6196 (http://wow.curseforge.com/profiles/yuk6196)
|
||||
function _detalhes:UseEastAsianNumericalSystem()
|
||||
|
||||
--> try to auto detect the language
|
||||
--try to auto detect the language
|
||||
local symbol_1K, symbol_10K, symbol_1B
|
||||
if (LibStub("AceLocale-3.0"):NewLocale ("Details", "koKR")) then --Korea
|
||||
symbol_1K, symbol_10K, symbol_1B = "천", "만", "억"
|
||||
@@ -370,15 +370,15 @@
|
||||
symbol_1K, symbol_10K, symbol_1B = "千", "萬", "億"
|
||||
end
|
||||
|
||||
--> override, force details! to use symbols for a specific language.
|
||||
--> usage: _detalhes:SetNumericalSystemOverride (language) language can be: "kr", "cn", "tw"
|
||||
--override, force details! to use symbols for a specific language.
|
||||
--usage: _detalhes:SetNumericalSystemOverride (language) language can be: "kr", "cn", "tw"
|
||||
|
||||
--> just in case the user mess up something
|
||||
if (type (_detalhes.numerical_system_symbols) ~= "string") then
|
||||
--just in case the user mess up something
|
||||
if (type(_detalhes.numerical_system_symbols) ~= "string") then
|
||||
_detalhes.numerical_system_symbols = "auto"
|
||||
end
|
||||
|
||||
--> do the override
|
||||
--do the override
|
||||
if (_detalhes.numerical_system_symbols ~= "auto") then
|
||||
local locale = string.lower (_detalhes.numerical_system_symbols)
|
||||
|
||||
@@ -392,8 +392,8 @@
|
||||
end
|
||||
|
||||
if (not symbol_1K) then
|
||||
--> if a english client is trying to use east asian numeral system and there is no override, let's just use the chinese as default.
|
||||
--> if the user is from kr or tw and want to use english client, an override must be used.
|
||||
--if a english client is trying to use east asian numeral system and there is no override, let's just use the chinese as default.
|
||||
--if the user is from kr or tw and want to use english client, an override must be used.
|
||||
symbol_1K, symbol_10K, symbol_1B = "千", "万", "亿"
|
||||
end
|
||||
|
||||
@@ -414,7 +414,7 @@
|
||||
elseif (numero > 999999) then
|
||||
return _string_format ("%.2f", numero/10000) .. symbol_10K
|
||||
elseif (numero > 99999) then
|
||||
return _math_floor (numero/10000) .. symbol_10K
|
||||
return _math_floor(numero/10000) .. symbol_10K
|
||||
elseif (numero > 9999) then
|
||||
return _string_format ("%.1f", (numero/10000)) .. symbol_10K
|
||||
elseif (numero > 999) then
|
||||
@@ -423,7 +423,7 @@
|
||||
return _string_format ("%.1f", numero)
|
||||
end
|
||||
|
||||
--> short numbers no numbers after comma
|
||||
--short numbers no numbers after comma
|
||||
function _detalhes:ToK0 (numero)
|
||||
if (numero > 100000000) then
|
||||
return _string_format ("%.0f", numero/100000000) .. symbol_1B
|
||||
@@ -452,7 +452,7 @@
|
||||
elseif (numero > 999999) then
|
||||
return _string_format ("%.2f", numero/10000) .. symbol_10K
|
||||
elseif (numero > 99999) then
|
||||
return _math_floor (numero/10000) .. symbol_10K
|
||||
return _math_floor(numero/10000) .. symbol_10K
|
||||
elseif (numero > 9999) then
|
||||
return _string_format ("%.1f", (numero/10000)) .. symbol_10K
|
||||
elseif (numero > 999) then
|
||||
@@ -461,7 +461,7 @@
|
||||
return _string_format ("%.1f", numero)
|
||||
end
|
||||
|
||||
--> short numbers no numbers after comma
|
||||
--short numbers no numbers after comma
|
||||
function _detalhes:ToK0Min (numero)
|
||||
if (numero > 100000000) then
|
||||
return _string_format ("%.0f", numero/100000000) .. symbol_1B
|
||||
@@ -473,7 +473,7 @@
|
||||
return _string_format ("%.0f", numero)
|
||||
end
|
||||
|
||||
--> short numbers no numbers after comma
|
||||
--short numbers no numbers after comma
|
||||
function _detalhes:ToKReport (numero)
|
||||
if (numero > 100000000) then
|
||||
return _string_format ("%.2f", numero/100000000) .. symbol_1B
|
||||
@@ -486,7 +486,7 @@
|
||||
end
|
||||
|
||||
function _detalhes:Format (n, custom)
|
||||
n = _math_floor (n)
|
||||
n = _math_floor(n)
|
||||
if (custom) then
|
||||
if (n > 99999999) then
|
||||
return _string_format (custom, n/100000000) .. symbol_1B
|
||||
@@ -502,15 +502,15 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> no changes
|
||||
--no changes
|
||||
function _detalhes:NoToK (numero)
|
||||
return _math_floor (numero)
|
||||
return _math_floor(numero)
|
||||
end
|
||||
|
||||
-- thanks http://richard.warburton.it
|
||||
function _detalhes:comma_value (n)
|
||||
if (not n) then return "0" end
|
||||
n = _math_floor (n)
|
||||
n = _math_floor(n)
|
||||
if (n == 0) then
|
||||
return "0"
|
||||
end
|
||||
@@ -536,7 +536,7 @@
|
||||
end
|
||||
|
||||
function _detalhes:UseWestNumericalSystem()
|
||||
--> short numbers
|
||||
--short numbers
|
||||
function _detalhes:ToK (numero)
|
||||
if (numero > 999999999) then
|
||||
return format ("%.2f", numero/1000000000) .. "B"
|
||||
@@ -555,7 +555,7 @@
|
||||
elseif (numero > 999999) then
|
||||
return _string_format ("%.2f", numero/1000000) .. "M"
|
||||
elseif (numero > 99999) then
|
||||
return _math_floor (numero/1000) .. "K"
|
||||
return _math_floor(numero/1000) .. "K"
|
||||
elseif (numero > 999) then
|
||||
return _string_format ("%.1f", (numero/1000)) .. "K"
|
||||
end
|
||||
@@ -563,7 +563,7 @@
|
||||
return _string_format ("%.0f", numero)
|
||||
end
|
||||
|
||||
--> short numbers no numbers after comma
|
||||
--short numbers no numbers after comma
|
||||
function _detalhes:ToK0 (numero)
|
||||
if (numero > 999999999) then
|
||||
return format ("%.2f", numero/1000000000) .. "B"
|
||||
@@ -590,7 +590,7 @@
|
||||
if (numero > 999999) then
|
||||
return _string_format ("%.2f", numero/1000000) .. "m"
|
||||
elseif (numero > 99999) then
|
||||
return _math_floor (numero/1000) .. "k"
|
||||
return _math_floor(numero/1000) .. "k"
|
||||
elseif (numero > 999) then
|
||||
return _string_format ("%.1f", (numero/1000)) .. "k"
|
||||
end
|
||||
@@ -598,7 +598,7 @@
|
||||
return _string_format ("%.0f", numero)
|
||||
end
|
||||
|
||||
--> short numbers no numbers after comma
|
||||
--short numbers no numbers after comma
|
||||
function _detalhes:ToK0Min (numero)
|
||||
if (numero > 1000000) then
|
||||
return _string_format ("%.0f", numero/1000000) .. "m"
|
||||
@@ -609,7 +609,7 @@
|
||||
return _string_format ("%.0f", numero)
|
||||
end
|
||||
|
||||
--> short numbers no numbers after comma
|
||||
--short numbers no numbers after comma
|
||||
function _detalhes:ToKReport (numero)
|
||||
if (numero > 1000000) then
|
||||
return _string_format ("%.2f", numero/1000000) .. "M"
|
||||
@@ -621,7 +621,7 @@
|
||||
end
|
||||
|
||||
function _detalhes:Format (n, custom)
|
||||
n = _math_floor (n)
|
||||
n = _math_floor(n)
|
||||
if (custom) then
|
||||
if (n > 999999) then
|
||||
return _string_format (custom, n/1000000) .. "M"
|
||||
@@ -635,15 +635,15 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> no changes
|
||||
--no changes
|
||||
function _detalhes:NoToK (numero)
|
||||
return _math_floor (numero)
|
||||
return _math_floor(numero)
|
||||
end
|
||||
|
||||
-- thanks http://richard.warburton.it
|
||||
function _detalhes:comma_value (n)
|
||||
if (not n) then return "0" end
|
||||
n = _math_floor (n)
|
||||
n = _math_floor(n)
|
||||
if (n == 0) then
|
||||
return "0"
|
||||
end
|
||||
@@ -669,7 +669,7 @@
|
||||
--
|
||||
end
|
||||
|
||||
--> load western as default, the proper method is loaded within the profile
|
||||
--load western as default, the proper method is loaded within the profile
|
||||
_detalhes:UseWestNumericalSystem()
|
||||
|
||||
function _detalhes:GetCurrentToKFunction()
|
||||
@@ -677,7 +677,7 @@
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> numerical system
|
||||
--numerical system
|
||||
|
||||
function _detalhes:SetNumericalSystemOverride (language)
|
||||
if (not language) then
|
||||
@@ -720,7 +720,7 @@
|
||||
|
||||
--------end of ToK functions----
|
||||
|
||||
--> replacing data for custom texts
|
||||
--replacing data for custom texts
|
||||
_detalhes.string = {}
|
||||
|
||||
local function_cache = {}
|
||||
@@ -731,7 +731,7 @@
|
||||
return arguments_cache [tonumber(i)]
|
||||
end
|
||||
local run_function = function(str)
|
||||
--> cache functions
|
||||
--cache functions
|
||||
local func, errortext = function_cache [str]
|
||||
if (not func) then
|
||||
func = loadstring (str)
|
||||
@@ -763,7 +763,7 @@
|
||||
return (str:gsub ("{data(%d+)}", replace_arg):gsub ("{func(.-)}", run_function))
|
||||
end
|
||||
|
||||
--> remove a index from a hash table
|
||||
--remove a index from a hash table
|
||||
function _detalhes:tableRemove (tabela, indexName)
|
||||
local newtable = {}
|
||||
for hash, value in _pairs (tabela) do
|
||||
@@ -774,9 +774,9 @@
|
||||
return newtable
|
||||
end
|
||||
|
||||
--> return if the numeric table have an object
|
||||
--return if the numeric table have an object
|
||||
function _detalhes:tableIN (tabela, objeto)
|
||||
for index, valor in _ipairs (tabela) do
|
||||
for index, valor in _ipairs(tabela) do
|
||||
if (valor == objeto) then
|
||||
return index
|
||||
end
|
||||
@@ -784,7 +784,7 @@
|
||||
return false
|
||||
end
|
||||
|
||||
--> reverse numerical table
|
||||
--reverse numerical table
|
||||
function _detalhes:reverse_table (t)
|
||||
local new = {}
|
||||
local index = 1
|
||||
@@ -810,7 +810,7 @@
|
||||
|
||||
function _detalhes.table.copy (t1, t2)
|
||||
for key, value in pairs (t2) do
|
||||
if (type (value) == "table") then
|
||||
if (type(value) == "table") then
|
||||
t1 [key] = Details.CopyTable (value)
|
||||
else
|
||||
t1 [key] = value
|
||||
@@ -821,7 +821,7 @@
|
||||
|
||||
function _detalhes.table.deploy (t1, t2)
|
||||
for key, value in pairs (t2) do
|
||||
if (type (value) == "table") then
|
||||
if (type(value) == "table") then
|
||||
t1 [key] = t1 [key] or {}
|
||||
_detalhes.table.deploy (t1 [key], t2 [key])
|
||||
elseif (t1 [key] == nil) then
|
||||
@@ -832,7 +832,7 @@
|
||||
|
||||
function _detalhes.table.overwrite (t1, t2)
|
||||
for key, value in pairs (t2) do
|
||||
if (type (value) == "table") then
|
||||
if (type(value) == "table") then
|
||||
t1 [key] = t1 [key] or {}
|
||||
_detalhes.table.overwrite (t1 [key], t2 [key])
|
||||
else
|
||||
@@ -858,18 +858,18 @@
|
||||
|
||||
local tpe = type (value)
|
||||
|
||||
if (type (key) == "function") then
|
||||
if (type(key) == "function") then
|
||||
key = "#function#"
|
||||
elseif (type (key) == "table") then
|
||||
elseif (type(key) == "table") then
|
||||
key = "#table#"
|
||||
end
|
||||
|
||||
if (type (key) ~= "string" and type (key) ~= "number") then
|
||||
if (type(key) ~= "string" and type (key) ~= "number") then
|
||||
key = "unknown?"
|
||||
end
|
||||
|
||||
if (tpe == "table") then
|
||||
if (type (key) == "number") then
|
||||
if (type(key) == "number") then
|
||||
s = s .. space .. "[" .. key .. "] = |cFFa9ffa9table {|r\n"
|
||||
else
|
||||
s = s .. space .. "[\"" .. key .. "\"] = |cFFa9ffa9table {|r\n"
|
||||
@@ -916,13 +916,13 @@
|
||||
if (value < 50) then
|
||||
r = 255
|
||||
else
|
||||
r = _math_floor ( 255 - (value * 2 - 100) * 255 / 100)
|
||||
r = _math_floor( 255 - (value * 2 - 100) * 255 / 100)
|
||||
end
|
||||
|
||||
if (value > 50) then
|
||||
g = 255
|
||||
else
|
||||
g = _math_floor ( (value * 2) * 255 / 100)
|
||||
g = _math_floor( (value * 2) * 255 / 100)
|
||||
end
|
||||
|
||||
if (inverted) then
|
||||
@@ -932,19 +932,19 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> unpack more than 1 table
|
||||
--unpack more than 1 table
|
||||
-- http://www.dzone.com/snippets/lua-unpack-multiple-tables
|
||||
function _detalhes:unpacks (...)
|
||||
local values = {}
|
||||
for i = 1, select ('#', ...) do
|
||||
for _, value in _ipairs (select (i, ...)) do
|
||||
for _, value in _ipairs(select (i, ...)) do
|
||||
values[ #values + 1] = value
|
||||
end
|
||||
end
|
||||
return unpack (values)
|
||||
end
|
||||
|
||||
--> trim http://lua-users.org/wiki/StringTrim
|
||||
--trim http://lua-users.org/wiki/StringTrim
|
||||
function _detalhes:trim (s)
|
||||
local from = s:match"^%s*()"
|
||||
return from > #s and "" or s:match(".*%S", from)
|
||||
@@ -1011,18 +1011,18 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
--> scale
|
||||
--scale
|
||||
function _detalhes:Scale (rangeMin, rangeMax, scaleMin, scaleMax, x)
|
||||
return 1 + (x - rangeMin) * (scaleMax - scaleMin) / (rangeMax - rangeMin)
|
||||
end
|
||||
|
||||
--> font color
|
||||
function _detalhes:SetFontColor (fontString, r, g, b, a)
|
||||
r, g, b, a = gump:ParseColors (r, g, b, a)
|
||||
--font color
|
||||
function _detalhes:SetFontColor(fontString, r, g, b, a)
|
||||
r, g, b, a = gump:ParseColors(r, g, b, a)
|
||||
fontString:SetTextColor (r, g, b, a)
|
||||
end
|
||||
|
||||
--> font size
|
||||
--font size
|
||||
function _detalhes:SetFontSize (fontString, ...)
|
||||
local fonte, _, flags = fontString:GetFont()
|
||||
fontString:SetFont (fonte, _math_max (...), flags)
|
||||
@@ -1032,7 +1032,7 @@ end
|
||||
return size
|
||||
end
|
||||
|
||||
--> font face
|
||||
--font face
|
||||
function _detalhes:SetFontFace (fontString, fontface)
|
||||
local _, size, flags = fontString:GetFont()
|
||||
fontString:SetFont (fontface, size, flags)
|
||||
@@ -1042,11 +1042,11 @@ end
|
||||
return fontface
|
||||
end
|
||||
|
||||
--> font outline
|
||||
--font outline
|
||||
function _detalhes:SetFontOutline (fontString, outline)
|
||||
local fonte, size = fontString:GetFont()
|
||||
if (outline) then
|
||||
if (type (outline) == "boolean" and outline) then
|
||||
if (type(outline) == "boolean" and outline) then
|
||||
outline = "OUTLINE"
|
||||
elseif (outline == 1) then
|
||||
outline = "OUTLINE"
|
||||
@@ -1081,7 +1081,7 @@ end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> internal functions
|
||||
--internal functions
|
||||
|
||||
function _detalhes:HealthTick()
|
||||
if (UnitExists ("boss1") and IsInRaid() and IsInInstance()) then
|
||||
@@ -1095,7 +1095,7 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
--> is in combat yet?
|
||||
--is in combat yet?
|
||||
function _detalhes:EstaEmCombate()
|
||||
|
||||
_detalhes:TimeDataTick()
|
||||
@@ -1180,7 +1180,7 @@ end
|
||||
for i = 1, instancia.rows_created, 1 do
|
||||
local barra = instancia.barras[i]
|
||||
local red, green, blue, alpha = barra.textura:GetVertexColor()
|
||||
local grayscale = (red*0.03+green+blue) / 3 --> grayscale lightness method
|
||||
local grayscale = (red*0.03+green+blue) / 3 --grayscale lightness method
|
||||
gump:GradientEffect ( barra.textura, "texture", red, green, blue, alpha, grayscale, grayscale, grayscale, alpha, 1)
|
||||
end
|
||||
end
|
||||
@@ -1192,18 +1192,18 @@ end
|
||||
if (self.HaveGradientEffect) then
|
||||
|
||||
local done = false
|
||||
for index, ThisGradient in _ipairs (self.gradientes) do
|
||||
for index, ThisGradient in _ipairs(self.gradientes) do
|
||||
|
||||
if (not ThisGradient.done) then
|
||||
|
||||
local percent = _math_min ((_GetTime() - ThisGradient.TimeStart) / ThisGradient.Duration * 100, 100)
|
||||
local percent = _math_min((_GetTime() - ThisGradient.TimeStart) / ThisGradient.Duration * 100, 100)
|
||||
local red_now = ThisGradient.StartRed + (percent * ThisGradient.OnePercentRed)
|
||||
local green_now = ThisGradient.StartGreen + (percent * ThisGradient.OnePercentGreen)
|
||||
local blue_now = ThisGradient.StartBlue + (percent * ThisGradient.OnePercentBlue)
|
||||
local alpha_now = ThisGradient.StartAlpha + (percent * ThisGradient.OnePercentAlpha)
|
||||
|
||||
if (ThisGradient.ObjectType == "frame") then
|
||||
ThisGradient.Object:SetBackdropColor (red_now, green_now, blue_now, alpha_now)
|
||||
ThisGradient.Object:SetBackdropColor(red_now, green_now, blue_now, alpha_now)
|
||||
elseif (ThisGradient.ObjectType == "texture") then
|
||||
ThisGradient.Object:SetVertexColor (red_now, green_now, blue_now, alpha_now)
|
||||
end
|
||||
@@ -1242,23 +1242,23 @@ end
|
||||
end
|
||||
|
||||
if (not self.HaveGradientEffect) then
|
||||
self:SetScript ("OnUpdate", nil)
|
||||
self:SetScript("OnUpdate", nil)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function gump:GradientEffect (Object, ObjectType, StartRed, StartGreen, StartBlue, StartAlpha, EndRed, EndGreen, EndBlue, EndAlpha, Duration, EndFunction, FuncParam)
|
||||
|
||||
if (type (StartRed) == "table" and type (StartGreen) == "table") then
|
||||
if (type(StartRed) == "table" and type (StartGreen) == "table") then
|
||||
Duration, EndFunction = StartBlue, StartAlpha
|
||||
EndRed, EndGreen, EndBlue, EndAlpha = unpack (StartGreen)
|
||||
StartRed, StartGreen, StartBlue, StartAlpha = unpack (StartRed)
|
||||
|
||||
elseif (type (StartRed) == "table") then
|
||||
elseif (type(StartRed) == "table") then
|
||||
EndRed, EndGreen, EndBlue, EndAlpha, Duration, EndFunction = StartGreen, StartBlue, StartAlpha, EndRed, EndGreen, EndBlue
|
||||
StartRed, StartGreen, StartBlue, StartAlpha = unpack (StartRed)
|
||||
|
||||
elseif (type (EndRed) == "table") then
|
||||
elseif (type(EndRed) == "table") then
|
||||
Duration, EndFunction = EndGreen, EndBlue
|
||||
EndRed, EndGreen, EndBlue, EndAlpha = unpack (EndRed)
|
||||
end
|
||||
@@ -1324,12 +1324,12 @@ end
|
||||
GradientFrameControl.HaveGradientEffect = true
|
||||
|
||||
if (not GradientFrameControl:GetScript ("OnUpdate")) then
|
||||
GradientFrameControl:SetScript ("OnUpdate", frame_task)
|
||||
GradientFrameControl:SetScript("OnUpdate", frame_task)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--> work around to solve the UI Frame Flashes
|
||||
--work around to solve the UI Frame Flashes
|
||||
local onFinish = function(self)
|
||||
if (self.showWhenDone) then
|
||||
self.frame:SetAlpha (1)
|
||||
@@ -1358,10 +1358,10 @@ end
|
||||
fadeIn:Stop()
|
||||
fadeOut:Stop()
|
||||
|
||||
fadeIn:SetDuration (fadeInTime or 1)
|
||||
fadeIn:SetDuration(fadeInTime or 1)
|
||||
fadeIn:SetEndDelay (flashInHoldTime or 0)
|
||||
|
||||
fadeOut:SetDuration (fadeOutTime or 1)
|
||||
fadeOut:SetDuration(fadeOutTime or 1)
|
||||
fadeOut:SetEndDelay (flashOutHoldTime or 0)
|
||||
|
||||
FlashAnimation.duration = flashDuration
|
||||
@@ -1380,13 +1380,13 @@ end
|
||||
|
||||
local FlashAnimation = frame:CreateAnimationGroup()
|
||||
|
||||
FlashAnimation.fadeOut = FlashAnimation:CreateAnimation ("Alpha") --> fade out anime
|
||||
FlashAnimation.fadeOut = FlashAnimation:CreateAnimation("Alpha") --fade out anime
|
||||
FlashAnimation.fadeOut:SetOrder (1)
|
||||
|
||||
FlashAnimation.fadeOut:SetFromAlpha (0)
|
||||
FlashAnimation.fadeOut:SetToAlpha (1)
|
||||
|
||||
FlashAnimation.fadeIn = FlashAnimation:CreateAnimation ("Alpha") --> fade in anime
|
||||
FlashAnimation.fadeIn = FlashAnimation:CreateAnimation("Alpha") --fade in anime
|
||||
FlashAnimation.fadeIn:SetOrder (2)
|
||||
FlashAnimation.fadeIn:SetFromAlpha (0)
|
||||
FlashAnimation.fadeIn:SetToAlpha (1)
|
||||
@@ -1395,15 +1395,15 @@ end
|
||||
FlashAnimation.frame = frame
|
||||
FlashAnimation.onFinishFunc = onFinishFunc
|
||||
|
||||
FlashAnimation:SetScript ("OnLoop", onLoopFunc)
|
||||
FlashAnimation:SetScript ("OnFinished", onFinish)
|
||||
FlashAnimation:SetScript("OnLoop", onLoopFunc)
|
||||
FlashAnimation:SetScript("OnFinished", onFinish)
|
||||
|
||||
frame.Flash = flash
|
||||
frame.Stop = stop
|
||||
|
||||
end
|
||||
|
||||
--> todo: remove the function creation everytime this function run.
|
||||
--todo: remove the function creation everytime this function run.
|
||||
|
||||
|
||||
|
||||
@@ -1437,23 +1437,23 @@ end
|
||||
|
||||
a = a + 1 --throw an error if called
|
||||
|
||||
if (type (frame) == "table") then
|
||||
if (type(frame) == "table") then
|
||||
|
||||
if (frame.meu_id) then --> ups, � uma inst�ncia
|
||||
if (parametros == "barras") then --> hida todas as barras da inst�ncia
|
||||
if (frame.meu_id) then --ups, � uma inst�ncia
|
||||
if (parametros == "barras") then --hida todas as barras da inst�ncia
|
||||
if (velocidade) then
|
||||
for i = 1, frame.rows_created, 1 do
|
||||
Details.FadeHandler.Fader (frame.barras[i], tipo, velocidade)
|
||||
Details.FadeHandler.Fader(frame.barras[i], tipo, velocidade)
|
||||
end
|
||||
return
|
||||
else
|
||||
velocidade = velocidade or 0.3
|
||||
for i = 1, frame.rows_created, 1 do
|
||||
Details.FadeHandler.Fader (frame.barras[i], tipo, 0.3+(i/10))
|
||||
Details.FadeHandler.Fader(frame.barras[i], tipo, 0.3+(i/10))
|
||||
end
|
||||
return
|
||||
end
|
||||
elseif (parametros == "hide_barras") then --> hida todas as barras da inst�ncia
|
||||
elseif (parametros == "hide_barras") then --hida todas as barras da inst�ncia
|
||||
for i = 1, frame.rows_created, 1 do
|
||||
local esta_barra = frame.barras[i]
|
||||
if (esta_barra.fading_in or esta_barra.fading_out) then
|
||||
@@ -1476,25 +1476,25 @@ end
|
||||
|
||||
velocidade = velocidade or 0.3
|
||||
|
||||
--> esse ALL aqui pode dar merda com as inst�ncias n�o ativadas
|
||||
if (frame == "all") then --> todas as inst�ncias
|
||||
for _, instancia in _ipairs (_detalhes.tabela_instancias) do
|
||||
if (parametros == "barras") then --> hida todas as barras da inst�ncia
|
||||
--esse ALL aqui pode dar merda com as inst�ncias n�o ativadas
|
||||
if (frame == "all") then --todas as inst�ncias
|
||||
for _, instancia in _ipairs(_detalhes.tabela_instancias) do
|
||||
if (parametros == "barras") then --hida todas as barras da inst�ncia
|
||||
for i = 1, instancia.rows_created, 1 do
|
||||
Details.FadeHandler.Fader (instancia.barras[i], tipo, velocidade+(i/10))
|
||||
Details.FadeHandler.Fader(instancia.barras[i], tipo, velocidade+(i/10))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
elseif (upper (tipo) == "IN") then
|
||||
|
||||
if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --> ja esta escondida
|
||||
if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --ja esta escondida
|
||||
return
|
||||
elseif (frame.fading_in) then --> ja esta com uma anima��o, se for true
|
||||
elseif (frame.fading_in) then --ja esta com uma anima��o, se for true
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.fading_out) then --> se tiver uma anima��o de aparecer em andamento se for true
|
||||
if (frame.fading_out) then --se tiver uma anima��o de aparecer em andamento se for true
|
||||
frame.fading_out = false
|
||||
end
|
||||
|
||||
@@ -1504,15 +1504,15 @@ end
|
||||
frame.fadeInfo.finishedFunc = fade_IN_finished_func
|
||||
frame.fadeInfo.finishedArg1 = frame
|
||||
|
||||
elseif (upper (tipo) == "OUT") then --> aparecer
|
||||
elseif (upper (tipo) == "OUT") then --aparecer
|
||||
|
||||
if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --> ja esta na tela
|
||||
if (frame:GetAlpha() == 1 and not frame.hidden and not frame.fading_in) then --ja esta na tela
|
||||
return
|
||||
elseif (frame.fading_out) then --> j� ta com fading out
|
||||
elseif (frame.fading_out) then --j� ta com fading out
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.fading_in) then --> se tiver uma anima��o de hidar em andamento se for true
|
||||
if (frame.fading_in) then --se tiver uma anima��o de hidar em andamento se for true
|
||||
frame.fading_in = false
|
||||
end
|
||||
|
||||
@@ -1523,7 +1523,7 @@ end
|
||||
frame.fadeInfo.finishedFunc = fade_OUT_finished_func
|
||||
frame.fadeInfo.finishedArg1 = frame
|
||||
|
||||
elseif (tipo == 0) then --> for�a o frame a ser mostrado
|
||||
elseif (tipo == 0) then --for�a o frame a ser mostrado
|
||||
frame.hidden = false
|
||||
frame.faded = false
|
||||
frame.fading_out = false
|
||||
@@ -1531,7 +1531,7 @@ end
|
||||
frame:Show()
|
||||
frame:SetAlpha (1)
|
||||
|
||||
elseif (tipo == 1) then --> for�a o frame a ser hidado
|
||||
elseif (tipo == 1) then --for�a o frame a ser hidado
|
||||
frame.hidden = true
|
||||
frame.faded = true
|
||||
frame.fading_out = false
|
||||
@@ -1539,14 +1539,14 @@ end
|
||||
frame:SetAlpha (0)
|
||||
frame:Hide()
|
||||
|
||||
elseif (tipo == -1) then --> apenas da fade sem hidar
|
||||
if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --> ja esta escondida
|
||||
elseif (tipo == -1) then --apenas da fade sem hidar
|
||||
if (frame:GetAlpha() == 0 and frame.hidden and not frame.fading_out) then --ja esta escondida
|
||||
return
|
||||
elseif (frame.fading_in) then --> ja esta com uma anima��o, se for true
|
||||
elseif (frame.fading_in) then --ja esta com uma anima��o, se for true
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.fading_out) then --> se tiver uma anima��o de aparecer em andamento se for true
|
||||
if (frame.fading_out) then --se tiver uma anima��o de aparecer em andamento se for true
|
||||
frame.fading_out = false
|
||||
end
|
||||
|
||||
@@ -1562,7 +1562,7 @@ end
|
||||
frame:Show()
|
||||
|
||||
if (currentApha < value) then
|
||||
if (frame.fading_in) then --> se tiver uma anima��o de hidar em andamento se for true
|
||||
if (frame.fading_in) then --se tiver uma anima��o de hidar em andamento se for true
|
||||
frame.fading_in = false
|
||||
frame.fadeInfo.finishedFunc = nil
|
||||
end
|
||||
@@ -1573,7 +1573,7 @@ end
|
||||
frame.fadeInfo.finishedArg1 = frame
|
||||
|
||||
else
|
||||
if (frame.fading_out) then --> se tiver uma anima��o de hidar em andamento se for true
|
||||
if (frame.fading_out) then --se tiver uma anima��o de hidar em andamento se for true
|
||||
frame.fading_out = false
|
||||
frame.fadeInfo.finishedFunc = nil
|
||||
end
|
||||
@@ -1584,7 +1584,7 @@ end
|
||||
frame.fadeInfo.finishedArg1 = frame
|
||||
end
|
||||
|
||||
elseif (upper (tipo) == "ALPHA") then --> setando um alpha determinado
|
||||
elseif (upper (tipo) == "ALPHA") then --setando um alpha determinado
|
||||
if (frame.fading_in or frame.fading_out) then
|
||||
frame.fadeInfo.finishedFunc = nil
|
||||
-- _UIFrameFadeIn (frame, velocidade, frame:GetAlpha(), frame:GetAlpha())
|
||||
@@ -1601,19 +1601,19 @@ end
|
||||
function _detalhes:name_space (barra)
|
||||
--if (barra.icone_secundario_ativo) then
|
||||
-- local tamanho = barra:GetWidth()-barra.lineText4:GetStringWidth()-16-barra:GetHeight()
|
||||
-- barra.lineText1:SetSize (tamanho-2, 15)
|
||||
-- barra.lineText1:SetSize(tamanho-2, 15)
|
||||
--else
|
||||
barra.lineText1:SetSize (barra:GetWidth()-barra.lineText4:GetStringWidth()-18, 15)
|
||||
barra.lineText1:SetSize(barra:GetWidth()-barra.lineText4:GetStringWidth()-18, 15)
|
||||
--end
|
||||
end
|
||||
|
||||
function _detalhes:name_space_info (barra)
|
||||
if (barra.icone_secundario_ativo) then
|
||||
local tamanho = barra:GetWidth()-barra.lineText4:GetStringWidth()-16-barra:GetHeight()
|
||||
barra.lineText1:SetSize (tamanho-10, 15)
|
||||
barra.lineText1:SetSize(tamanho-10, 15)
|
||||
else
|
||||
local tamanho = barra:GetWidth()-barra.lineText4:GetStringWidth()-16
|
||||
barra.lineText1:SetSize (tamanho-10, 15)
|
||||
barra.lineText1:SetSize(tamanho-10, 15)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1621,10 +1621,10 @@ end
|
||||
local texto_direita_tamanho = barra.lineText4:GetStringWidth()
|
||||
local tamanho = barra:GetWidth()-texto_direita_tamanho-16
|
||||
if (separador) then
|
||||
barra.lineText1:SetSize (tamanho+separador, 10)
|
||||
barra.lineText4:SetSize (texto_direita_tamanho+15, 10)
|
||||
barra.lineText1:SetSize(tamanho+separador, 10)
|
||||
barra.lineText4:SetSize(texto_direita_tamanho+15, 10)
|
||||
else
|
||||
barra.lineText1:SetSize (tamanho-10, 15)
|
||||
barra.lineText4:SetSize (texto_direita_tamanho+5, 15)
|
||||
barra.lineText1:SetSize(tamanho-10, 15)
|
||||
barra.lineText4:SetSize(texto_direita_tamanho+5, 15)
|
||||
end
|
||||
end
|
||||
|
||||
+639
-639
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user