- TimeLine (plugin): now also shows marks symbolizing the player death.
- Added raid history panel. Open it through bookmark or /details history. - Added support for skins for Player Detail Window. - Added report history on report button. - Added key bindings settings for report what is shown on window #1 or #2.
This commit is contained in:
+50
-1
@@ -1,3 +1,15 @@
|
||||
|
||||
=======================================
|
||||
Background Tasks
|
||||
=======================================
|
||||
|
||||
Details:RegisterBackgroundTask (name, func, priority, ...)
|
||||
register a function to be called while the player isn't in: combat, group, raid instances.
|
||||
priority determines the interval time and support "LOW", "MEDIUM", "HIGH" values.
|
||||
|
||||
Details:UnregisterBackgroundTask (name)
|
||||
unregister a background task.
|
||||
|
||||
=======================================
|
||||
Item Level
|
||||
=======================================
|
||||
@@ -19,6 +31,43 @@ Details.ilevel:GetInOrder()
|
||||
return a new numeric table with sorted in decreasing order:
|
||||
{{name-realm, item level, time()}, {name-realm, item level, time()}}
|
||||
|
||||
=======================================
|
||||
Raid History
|
||||
=======================================
|
||||
|
||||
=======================================
|
||||
_detalhes.storage:OpenRaidStorage()
|
||||
get the table containing all stored data.
|
||||
|
||||
_detalhes.storage:ListDiffs()
|
||||
return a indexed table with dificulty numbers.
|
||||
|
||||
_detalhes.storage:ListEncounters (diff)
|
||||
return a indexed table with all encounters stored for the dificulty.
|
||||
|
||||
_detalhes.storage:GetEncounterData (diff, encounterId, guildname)
|
||||
return a indexed table with encounter tables playd by the guild.
|
||||
|
||||
_detalhes.storage:GetPlayerData (diff, encounterId, playername)
|
||||
return a indexed table with player tables for the player.
|
||||
|
||||
_detalhes.storage:GetBestFromPlayer (diff, encounterId, role, playername)
|
||||
return the best result from the player.
|
||||
|
||||
Structure:
|
||||
DB = hash{
|
||||
[difficulty index] = hash{
|
||||
[encounter id] = indexed{
|
||||
{
|
||||
--encounter table
|
||||
damage = hash{
|
||||
[playername] = indexed{} --player table
|
||||
}
|
||||
...
|
||||
}--[1]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
encounter table = hash {["time"] = time(), ["guild"] = guild name, ["date"] = formated date, ["healing"] = {[playername] = playertable}, ["elapsed"] = combat time, ["damage"] = {[playername] = playertable}}
|
||||
player table = indexed {total done, item level, class index}
|
||||
|
||||
|
||||
+27
@@ -1,4 +1,8 @@
|
||||
|
||||
local instance = Details:GetInstance (number)
|
||||
returns the window object.
|
||||
|
||||
=============================================================
|
||||
|
||||
instance:DesaturateMenu (enabled)
|
||||
enabled = boolean, if true, buttons on the window's title bar became black and white.
|
||||
@@ -189,3 +193,26 @@ returns true with the 'self instance' is groupped with the passed instance objec
|
||||
instance:GetInstanceGroup()
|
||||
returns a table with instances objects of all instances inside the group.
|
||||
|
||||
--------------------
|
||||
|
||||
Details:SetWindowUpdateSpeed (interval, nosave)
|
||||
set the update speed of all windows, if nosave is true, it won't save this change (apply only).
|
||||
|
||||
Details:SetUseAnimations (enabled, nosave)
|
||||
set on off bar animations on all windows, if nosave is true, it won't save this change (apply only).
|
||||
|
||||
--------------------
|
||||
|
||||
_detalhes:OpenForge()
|
||||
Open Forge Window.
|
||||
|
||||
_detalhes:OpenRaidHistoryWindow()
|
||||
Open Raid History Window.
|
||||
|
||||
_detalhes.switch:ShowMe (instance object)
|
||||
Open the bookmark panel on the top of the desired window.
|
||||
|
||||
_detalhes.switch:CloseMe()
|
||||
Closes the bookmark panel.
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ DETAILS_SUBATTRIBUTE_DEBUFFUPTIME = 8
|
||||
TL;DR
|
||||
=======================================
|
||||
A history segment container is the higher table in the hierarchy, it holds combat objects.
|
||||
Current and overall combat objects are directly attached to the core. When a combat finishes, it detach and is sent to history container.
|
||||
A Combat Object has 4 tables: damage on index 1, healing on index 2, energy on index 3, misc on index 4.
|
||||
Those tables are called 'containers', these containers holds 'Actor Objects'.
|
||||
Actor Objects hold a target table and a spell table.
|
||||
@@ -316,8 +317,11 @@ cc_break_spells =
|
||||
cc_break_oque =
|
||||
|
||||
|
||||
|
||||
|
||||
Other API Calls:
|
||||
=======================================
|
||||
|
||||
Details:SetDeathLogLimit (limit)
|
||||
Set the amount of lines to store on death log.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -466,6 +466,9 @@
|
||||
_detalhes.schedule_store_boss_encounter = true
|
||||
end
|
||||
|
||||
_detalhes:SendEvent ("COMBAT_BOSS_DEFEATED", nil, _detalhes.tabela_vigente)
|
||||
else
|
||||
_detalhes:SendEvent ("COMBAT_BOSS_WIPE", nil, _detalhes.tabela_vigente)
|
||||
end
|
||||
|
||||
--if (_detalhes:GetBossDetails (_detalhes.tabela_vigente.is_boss.mapid, _detalhes.tabela_vigente.is_boss.index) or ) then
|
||||
|
||||
+193
-9
@@ -17,8 +17,6 @@ function _detalhes:UpdateGears()
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function _detalhes:SetDeathLogLimit (limit)
|
||||
@@ -366,7 +364,9 @@ _detalhes.background_tasks_loop = _detalhes:ScheduleRepeatingTimer ("DoBackgroun
|
||||
--> storage stuff ~storage
|
||||
|
||||
--global database
|
||||
function _detalhes:OpenRaidStorage()
|
||||
_detalhes.storage = {}
|
||||
|
||||
function _detalhes.storage:OpenRaidStorage()
|
||||
--> check if the storage is already loaded
|
||||
if (not IsAddOnLoaded ("Details_DataStorage")) then
|
||||
local loaded, reason = LoadAddOn ("Details_DataStorage")
|
||||
@@ -386,14 +386,178 @@ function _detalhes:OpenRaidStorage()
|
||||
elseif (not db) then
|
||||
return
|
||||
end
|
||||
|
||||
--GlobalDatabase = {}
|
||||
--UserChrStorage = {}
|
||||
|
||||
|
||||
return db
|
||||
end
|
||||
|
||||
function _detalhes.storage:GetBestFromPlayer (diff, encounter_id, role, playername)
|
||||
local db = _detalhes.storage:OpenRaidStorage()
|
||||
|
||||
local best
|
||||
local onencounter
|
||||
|
||||
if (not role) then
|
||||
role = "damage"
|
||||
end
|
||||
role = string.lower (role)
|
||||
if (role == "damager") then
|
||||
role = "damage"
|
||||
elseif (role == "healer") then
|
||||
role = "healing"
|
||||
end
|
||||
|
||||
local table = db [diff]
|
||||
if (table) then
|
||||
local encounters = table [encounter_id]
|
||||
if (encounters) then
|
||||
for index, encounter in ipairs (encounters) do
|
||||
local player = encounter [role] and encounter [role] [playername]
|
||||
if (player) then
|
||||
if (best) then
|
||||
if (player[1] > best[1]) then
|
||||
onencounter = encounter
|
||||
best = player
|
||||
end
|
||||
else
|
||||
onencounter = encounter
|
||||
best = player
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return best, onencounter
|
||||
end
|
||||
|
||||
function _detalhes.storage:ListDiffs()
|
||||
local db = _detalhes.storage:OpenRaidStorage()
|
||||
local t = {}
|
||||
for diff, _ in pairs (db) do
|
||||
tinsert (t, diff)
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
function _detalhes.storage:ListEncounters (diff)
|
||||
local db = _detalhes.storage:OpenRaidStorage()
|
||||
|
||||
local t = {}
|
||||
if (diff) then
|
||||
local table = db [diff]
|
||||
if (table) then
|
||||
for encounter_id, _ in pairs (table) do
|
||||
tinsert (t, {diff, encounter_id})
|
||||
end
|
||||
end
|
||||
else
|
||||
for diff, table in pairs (db) do
|
||||
for encounter_id, _ in pairs (table) do
|
||||
tinsert (t, {diff, encounter_id})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
function _detalhes.storage:GetPlayerData (diff, encounter_id, playername)
|
||||
local db = _detalhes.storage:OpenRaidStorage()
|
||||
|
||||
local t = {}
|
||||
assert (type (playername) == "string", "PlayerName must be a string.")
|
||||
|
||||
|
||||
if (not diff) then
|
||||
for diff, table in pairs (db) do
|
||||
if (encounter_id) then
|
||||
local encounters = table [encounter_id]
|
||||
if (encounters) then
|
||||
for i = 1, #encounters do
|
||||
local encounter = encounters [i]
|
||||
local player = encounter.healing [playername] or encounter.damage [playername]
|
||||
if (player) then
|
||||
tinsert (t, player)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
for encounter_id, encounters in pairs (table) do
|
||||
for i = 1, #encounters do
|
||||
local encounter = encounters [i]
|
||||
local player = encounter.healing [playername] or encounter.damage [playername]
|
||||
if (player) then
|
||||
tinsert (t, player)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local table = db [diff]
|
||||
if (table) then
|
||||
if (encounter_id) then
|
||||
local encounters = table [encounter_id]
|
||||
if (encounters) then
|
||||
for i = 1, #encounters do
|
||||
local encounter = encounters [i]
|
||||
local player = encounter.healing [playername] or encounter.damage [playername]
|
||||
if (player) then
|
||||
tinsert (t, player)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
for encounter_id, encounters in pairs (table) do
|
||||
for i = 1, #encounters do
|
||||
local encounter = encounters [i]
|
||||
local player = encounter.healing [playername] or encounter.damage [playername]
|
||||
if (player) then
|
||||
tinsert (t, player)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
function _detalhes.storage:GetEncounterData (diff, encounter_id, guild)
|
||||
local db = _detalhes.storage:OpenRaidStorage()
|
||||
|
||||
if (not diff) then
|
||||
return db
|
||||
end
|
||||
|
||||
local data = db [diff]
|
||||
|
||||
assert (data, "Difficulty not found. Use: 14, 15 or 16.")
|
||||
assert (type (encounter_id) == "number", "EncounterId must be a number.")
|
||||
|
||||
data = data [encounter_id]
|
||||
|
||||
local t = {}
|
||||
|
||||
if (not data) then
|
||||
return t
|
||||
end
|
||||
|
||||
for i = 1, #data do
|
||||
local encounter = data [i]
|
||||
|
||||
if (guild) then
|
||||
if (encounter.guild == guild) then
|
||||
tinsert (t, encounter)
|
||||
end
|
||||
else
|
||||
tinsert (t, encounter)
|
||||
end
|
||||
end
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
local store_instances = {
|
||||
[1205] = true, --Blackrock Foundry
|
||||
@@ -498,7 +662,7 @@ function _detalhes:StoreEncounter (combat)
|
||||
|
||||
local role = UnitGroupRolesAssigned ("raid" .. i)
|
||||
|
||||
if (role == "DAMAGER") then
|
||||
if (role == "DAMAGER" or role == "TANK") then
|
||||
local player_name, player_realm = UnitName ("raid" .. i)
|
||||
if (player_realm and player_realm ~= "") then
|
||||
player_name = player_name .. "-" .. player_realm
|
||||
@@ -532,6 +696,26 @@ function _detalhes:StoreEncounter (combat)
|
||||
|
||||
print ("|cFFFFFF00Details! Storage|r: encounter saved!")
|
||||
|
||||
local myrole = UnitGroupRolesAssigned ("player")
|
||||
local mybest, onencounter = _detalhes.storage:GetBestFromPlayer (diff, encounter_id, myrole, _detalhes.playername)
|
||||
|
||||
print (myrole, mybest and mybest[1], mybest and mybest[2], mybest and mybest[3], onencounter and onencounter.date)
|
||||
|
||||
if (mybest) then
|
||||
local done = 0
|
||||
if (myrole == "DAMAGER" or myrole == "TANK") then
|
||||
done = combat (1, _detalhes.playername) and combat (1, _detalhes.playername).total
|
||||
elseif (myrole == "HEALER") then
|
||||
done = combat (2, _detalhes.playername) and combat (2, _detalhes.playername).total
|
||||
end
|
||||
|
||||
if (mybest[1] > done) then
|
||||
print (Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_NOTBEST"], _detalhes:comma_value (done), mybest[1], onencounter.date, mybest[2]))
|
||||
else
|
||||
print (Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_BEST"], _detalhes:comma_value (done)))
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -660,7 +844,7 @@ function ilvl_core:InspectTimeOut (guid)
|
||||
end
|
||||
|
||||
function ilvl_core:GetItemLevel (unitid, guid)
|
||||
--> double check
|
||||
--> ddouble check
|
||||
if (UnitAffectingCombat ("player") or InCombatLockdown()) then
|
||||
return
|
||||
end
|
||||
|
||||
+14
-2
@@ -84,6 +84,8 @@
|
||||
local last_events_cache = {} --> placeholder
|
||||
--> pets
|
||||
local container_pets = {} --> place holder
|
||||
--> ignore deaths
|
||||
local ignore_death = {}
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> constants
|
||||
@@ -1186,6 +1188,12 @@
|
||||
if (tipo == "BUFF") then
|
||||
------------------------------------------------------------------------------------------------
|
||||
--> buff uptime
|
||||
|
||||
if (spellid == 27827) then --> spirit of redemption (holy priest)
|
||||
parser:dead ("UNIT_DIED", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags)
|
||||
ignore_death [who_name] = true
|
||||
return
|
||||
end
|
||||
|
||||
if (_recording_buffs_and_debuffs) then
|
||||
if (who_name == alvo_name and raid_members_cache [who_serial] and _in_combat) then
|
||||
@@ -2547,6 +2555,11 @@
|
||||
_in_combat
|
||||
) then
|
||||
|
||||
if (ignore_death [alvo_name]) then
|
||||
ignore_death [alvo_name] = nil
|
||||
return
|
||||
end
|
||||
|
||||
_current_misc_container.need_refresh = true
|
||||
|
||||
--> combat totals
|
||||
@@ -3451,8 +3464,6 @@
|
||||
end
|
||||
|
||||
function _detalhes:ClearParserCache()
|
||||
|
||||
--> clear cache | not sure if replacing the old table is the best approach
|
||||
|
||||
_table_wipe (damage_cache)
|
||||
_table_wipe (damage_cache_pets)
|
||||
@@ -3460,6 +3471,7 @@
|
||||
_table_wipe (healing_cache)
|
||||
_table_wipe (energy_cache)
|
||||
_table_wipe (misc_cache)
|
||||
_table_wipe (ignore_death)
|
||||
|
||||
damage_cache = setmetatable ({}, _detalhes.weaktable)
|
||||
damage_cache_pets = setmetatable ({}, _detalhes.weaktable)
|
||||
|
||||
+457
-7
@@ -1,4 +1,3 @@
|
||||
--> this file controls the window position, size and others panels
|
||||
|
||||
local _detalhes = _G._detalhes
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
@@ -1006,6 +1005,453 @@
|
||||
function _detalhes:OpenTranslateWindow()
|
||||
|
||||
end
|
||||
|
||||
--> raid history window
|
||||
function _detalhes:OpenRaidHistoryWindow()
|
||||
|
||||
if (not _G.DetailsRaidHistoryWindow) then
|
||||
|
||||
local db = _detalhes.storage:OpenRaidStorage()
|
||||
if (not db) then
|
||||
return _detalhes:Msg ("Fail to open raid storage, may be the addon is disabled.")
|
||||
end
|
||||
|
||||
local f = CreateFrame ("frame", "DetailsRaidHistoryWindow", UIParent, "ButtonFrameTemplate")
|
||||
f:SetPoint ("center", UIParent, "center")
|
||||
f:SetFrameStrata ("HIGH")
|
||||
f:SetToplevel (true)
|
||||
|
||||
f:SetMovable (true)
|
||||
f:SetWidth (850)
|
||||
f:SetHeight (500)
|
||||
tinsert (UISpecialFrames, "DetailsRaidHistoryWindow")
|
||||
|
||||
local background = f:CreateTexture (nil, "border")
|
||||
background:SetAlpha (0.3)
|
||||
background:SetPoint ("topleft", f, "topleft", 6, -65)
|
||||
background:SetPoint ("bottomright", f, "bottomright", -10, 28)
|
||||
|
||||
local div = f:CreateTexture (nil, "artwork")
|
||||
div:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-MetalBorder-Left]])
|
||||
div:SetAlpha (0.3)
|
||||
div:SetPoint ("topleft", f, "topleft", 180, -64)
|
||||
div:SetHeight (460)
|
||||
|
||||
function f:SetBackgroundImage (encounterId)
|
||||
local instanceId = _detalhes:GetInstanceIdFromEncounterId (encounterId)
|
||||
if (instanceId) then
|
||||
local file, L, R, T, B = _detalhes:GetRaidBackground (instanceId)
|
||||
background:SetTexture (file)
|
||||
background:SetTexCoord (L, R, T, B)
|
||||
end
|
||||
end
|
||||
|
||||
f:SetScript ("OnMouseDown", function(self, button)
|
||||
if (self.isMoving) then
|
||||
return
|
||||
end
|
||||
if (button == "RightButton") then
|
||||
self:Hide()
|
||||
else
|
||||
self:StartMoving()
|
||||
self.isMoving = true
|
||||
end
|
||||
end)
|
||||
f:SetScript ("OnMouseUp", function(self, button)
|
||||
if (self.isMoving and button == "LeftButton") then
|
||||
self:StopMovingOrSizing()
|
||||
self.isMoving = nil
|
||||
end
|
||||
end)
|
||||
|
||||
f.TitleText:SetText ("Raid History")
|
||||
f.portrait:SetTexture ([[Interface\AddOns\Details\images\icons2]])
|
||||
f.portrait:SetTexCoord (192/512, 258/512, 322/512, 388/512)
|
||||
|
||||
local dropdown_size = 160
|
||||
local icon = [[Interface\FriendsFrame\battlenet-status-offline]]
|
||||
|
||||
local diff_list = {}
|
||||
local raid_list = {}
|
||||
local boss_list = {}
|
||||
local guild_list = {}
|
||||
|
||||
local sort_alphabetical = function(a,b) return a[1] < b[1] end
|
||||
local sort_alphabetical2 = function(a,b) return a.value < b.value end
|
||||
|
||||
local on_select = function()
|
||||
if (f.Refresh) then
|
||||
f:Refresh()
|
||||
end
|
||||
end
|
||||
|
||||
--> select raid:
|
||||
local on_raid_select = function (_, _, raid)
|
||||
on_select()
|
||||
end
|
||||
local build_raid_list = function()
|
||||
return raid_list
|
||||
end
|
||||
local raid_dropdown = gump:CreateDropDown (f, build_raid_list, 1, dropdown_size, 20, "select_raid")
|
||||
local raid_string = gump:CreateLabel (f, "Raid:", _, _, "GameFontNormal", "select_raid_label")
|
||||
|
||||
--> select boss:
|
||||
local on_boss_select = function (_, _, boss)
|
||||
on_select()
|
||||
end
|
||||
local build_boss_list = function()
|
||||
return boss_list
|
||||
end
|
||||
local boss_dropdown = gump:CreateDropDown (f, build_boss_list, 1, dropdown_size, 20, "select_boss")
|
||||
local boss_string = gump:CreateLabel (f, "Boss:", _, _, "GameFontNormal", "select_boss_label")
|
||||
|
||||
--> select difficulty:
|
||||
local on_diff_select = function (_, _, diff)
|
||||
on_select()
|
||||
end
|
||||
|
||||
local build_diff_list = function()
|
||||
return diff_list
|
||||
end
|
||||
local diff_dropdown = gump:CreateDropDown (f, build_diff_list, 1, dropdown_size, 20, "select_diff")
|
||||
local diff_string = gump:CreateLabel (f, "Difficulty:", _, _, "GameFontNormal", "select_diff_label")
|
||||
|
||||
--> select role:
|
||||
local on_role_select = function (_, _, role)
|
||||
on_select()
|
||||
end
|
||||
local build_role_list = function()
|
||||
return {
|
||||
{value = "damage", label = "Damager", icon = icon, onclick = on_role_select},
|
||||
{value = "healing", label = "Healer", icon = icon, onclick = on_role_select}
|
||||
}
|
||||
end
|
||||
local role_dropdown = gump:CreateDropDown (f, build_role_list, 1, dropdown_size, 20, "select_role")
|
||||
local role_string = gump:CreateLabel (f, "Role:", _, _, "GameFontNormal", "select_role_label")
|
||||
|
||||
--> select guild:
|
||||
local on_guild_select = function (_, _, guild)
|
||||
on_select()
|
||||
end
|
||||
local build_guild_list = function()
|
||||
return guild_list
|
||||
end
|
||||
local guild_dropdown = gump:CreateDropDown (f, build_guild_list, 1, dropdown_size, 20, "select_guild")
|
||||
local guild_string = gump:CreateLabel (f, "Guild:", _, _, "GameFontNormal", "select_guild_label")
|
||||
|
||||
--> select playerbase:
|
||||
local on_player_select = function (_, _, player)
|
||||
on_select()
|
||||
end
|
||||
local build_player_list = function()
|
||||
return {
|
||||
{value = 1, label = "Raid", icon = icon, onclick = on_player_select},
|
||||
{value = 2, label = "Individual", icon = icon, onclick = on_player_select},
|
||||
}
|
||||
end
|
||||
local player_dropdown = gump:CreateDropDown (f, build_player_list, 1, dropdown_size, 20, "select_player")
|
||||
local player_string = gump:CreateLabel (f, "Player Base:", _, _, "GameFontNormal", "select_player_label")
|
||||
|
||||
--> select player:
|
||||
local on_player2_select = function (_, _, player)
|
||||
f:BuildPlayerTable (player)
|
||||
end
|
||||
local build_player2_list = function()
|
||||
local encounterTable, guild, role = unpack (f.build_player2_data or {})
|
||||
local t = {}
|
||||
local already_listed = {}
|
||||
if (encounterTable) then
|
||||
for encounterIndex, encounter in ipairs (encounterTable) do
|
||||
if (encounter.guild == guild) then
|
||||
local roleTable = encounter [role]
|
||||
for playerName, _ in pairs (roleTable) do
|
||||
if (not already_listed [playerName]) then
|
||||
tinsert (t, {value = playerName, label = playerName, icon = icon, onclick = on_player2_select})
|
||||
already_listed [playerName] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
table.sort (t, sort_alphabetical2)
|
||||
|
||||
return t
|
||||
end
|
||||
local player2_dropdown = gump:CreateDropDown (f, build_player2_list, 1, dropdown_size, 20, "select_player2")
|
||||
local player2_string = gump:CreateLabel (f, "Player:", _, _, "GameFontNormal", "select_player2_label")
|
||||
|
||||
function f:UpdateDropdowns()
|
||||
|
||||
--difficulty
|
||||
wipe (diff_list)
|
||||
wipe (boss_list)
|
||||
wipe (raid_list)
|
||||
wipe (guild_list)
|
||||
|
||||
local boss_repeated = {}
|
||||
local raid_repeated = {}
|
||||
local guild_repeated = {}
|
||||
|
||||
for difficulty, encounterIdTable in pairs (db) do
|
||||
|
||||
if (type (difficulty) == "number") then
|
||||
if (difficulty == 14) then
|
||||
tinsert (diff_list, {value = 14, label = "Normal", icon = icon, onclick = on_diff_select})
|
||||
elseif (difficulty == 15) then
|
||||
tinsert (diff_list, {value = 15, label = "Heroic", icon = icon, onclick = on_diff_select})
|
||||
elseif (difficulty == 16) then
|
||||
tinsert (diff_list, {value = 16, label = "Mythic", icon = icon, onclick = on_diff_select})
|
||||
end
|
||||
|
||||
for encounterId, encounterTable in pairs (encounterIdTable) do
|
||||
if (not boss_repeated [encounterId]) then
|
||||
local encounter, instance = _detalhes:GetBossEncounterDetailsFromEncounterId (_, encounterId)
|
||||
if (encounter) then
|
||||
tinsert (boss_list, {value = encounterId, label = encounter.boss, icon = icon, onclick = on_boss_select})
|
||||
boss_repeated [encounterId] = true
|
||||
|
||||
if (not raid_repeated [instance.name]) then
|
||||
tinsert (raid_list, {value = instance.id, label = instance.name, icon = icon, onclick = on_raid_select})
|
||||
raid_repeated [instance.name] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for index, encounter in ipairs (encounterTable) do
|
||||
local guild = encounter.guild
|
||||
if (not guild_repeated [guild]) then
|
||||
tinsert (guild_list, {value = guild, label = guild, icon = icon, onclick = on_raid_select})
|
||||
guild_repeated [guild] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
diff_dropdown:Refresh()
|
||||
diff_dropdown:Select (1, true)
|
||||
boss_dropdown:Refresh()
|
||||
boss_dropdown:Select (1, true)
|
||||
raid_dropdown:Refresh()
|
||||
raid_dropdown:Select (1, true)
|
||||
guild_dropdown:Refresh()
|
||||
guild_dropdown:Select (1, true)
|
||||
|
||||
end
|
||||
|
||||
--> anchors:
|
||||
raid_string:SetPoint ("topleft", f, "topleft", 10, -70)
|
||||
raid_dropdown:SetPoint ("topleft", f, "topleft", 10, -85)
|
||||
|
||||
boss_string:SetPoint ("topleft", f, "topleft", 10, -110)
|
||||
boss_dropdown:SetPoint ("topleft", f, "topleft", 10, -125)
|
||||
|
||||
diff_string:SetPoint ("topleft", f, "topleft", 10, -150)
|
||||
diff_dropdown:SetPoint ("topleft", f, "topleft", 10, -165)
|
||||
|
||||
role_string:SetPoint ("topleft", f, "topleft", 10, -190)
|
||||
role_dropdown:SetPoint ("topleft", f, "topleft", 10, -205)
|
||||
|
||||
guild_string:SetPoint ("topleft", f, "topleft", 10, -230)
|
||||
guild_dropdown:SetPoint ("topleft", f, "topleft", 10, -245)
|
||||
|
||||
player_string:SetPoint ("topleft", f, "topleft", 10, -270)
|
||||
player_dropdown:SetPoint ("topleft", f, "topleft", 10, -285)
|
||||
|
||||
player2_string:SetPoint ("topleft", f, "topleft", 10, -310)
|
||||
player2_dropdown:SetPoint ("topleft", f, "topleft", 10, -325)
|
||||
player2_string:Hide()
|
||||
player2_dropdown:Hide()
|
||||
|
||||
--> refresh the window:
|
||||
|
||||
function f:BuildPlayerTable (playerName)
|
||||
|
||||
local encounterTable, guild, role = unpack (f.build_player2_data or {})
|
||||
local data = {}
|
||||
|
||||
if (type (playerName) == "string" and string.len (playerName) > 1) then
|
||||
for encounterIndex, encounter in ipairs (encounterTable) do
|
||||
|
||||
if (encounter.guild == guild) then
|
||||
local roleTable = encounter [role]
|
||||
|
||||
local date = encounter.date
|
||||
date = date:gsub (".*%s", "")
|
||||
date = date:sub (1, -4)
|
||||
|
||||
local player = roleTable [playerName]
|
||||
|
||||
if (player) then
|
||||
tinsert (data, {text = date, value = player[1], data = player, fulldate = encounter.date})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--> update graphic
|
||||
if (not f.gframe) then
|
||||
|
||||
local cooltip_block_bg = {0, 0, 0, 1}
|
||||
local menu_wallpaper_tex = {.6, 0.1, 0, 0.64453125}
|
||||
local menu_wallpaper_color = {1, 1, 1, 0.1}
|
||||
|
||||
local onenter = function (self)
|
||||
GameCooltip:Reset()
|
||||
|
||||
GameCooltip:AddLine ("Total Done:", _detalhes:ToK2 (self.data.value))
|
||||
GameCooltip:AddLine ("Item Level:", floor (self.data.data [2]))
|
||||
GameCooltip:AddLine ("Date:", self.data.fulldate)
|
||||
|
||||
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], menu_wallpaper_tex, menu_wallpaper_color, true)
|
||||
GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, cooltip_block_bg, _detalhes.tooltip_border_color)
|
||||
GameCooltip:SetOwner (self.ball.tooltip_anchor)
|
||||
GameCooltip:Show()
|
||||
end
|
||||
local onleave = function (self)
|
||||
GameCooltip:Hide()
|
||||
end
|
||||
f.gframe = gump:CreateGFrame (f, 650, 400, 35, onenter, onleave, "gframe", "$parentGF")
|
||||
f.gframe:SetPoint ("topleft", f, "topleft", 190, -65)
|
||||
end
|
||||
|
||||
f.gframe:Reset()
|
||||
f.gframe:UpdateLines (data)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local fillpanel = gump:NewFillPanel (f, {}, "$parentFP", "fillpanel", 630, 400, false, false, true, nil)
|
||||
fillpanel:SetPoint ("topleft", f, "topleft", 200, -65)
|
||||
|
||||
function f:BuildRaidTable (encounterTable, guild, role)
|
||||
|
||||
local header = {{name = "Player Name", type = "text"}} -- , width = 90
|
||||
local players = {}
|
||||
local players_index = {}
|
||||
local amt_encounters = 0
|
||||
|
||||
for encounterIndex, encounter in ipairs (encounterTable) do
|
||||
if (encounter.guild == guild) then
|
||||
local roleTable = encounter [role]
|
||||
|
||||
local date = encounter.date
|
||||
date = date:gsub (".*%s", "")
|
||||
date = date:sub (1, -4)
|
||||
amt_encounters = amt_encounters + 1
|
||||
|
||||
tinsert (header, {name = date, type = "text"})
|
||||
|
||||
for playerName, playerTable in pairs (roleTable) do
|
||||
local index = players_index [playerName]
|
||||
local player
|
||||
|
||||
if (not index) then
|
||||
player = {playerName}
|
||||
for i = 2, encounterIndex-1 do
|
||||
tinsert (player, "")
|
||||
end
|
||||
tinsert (player, _detalhes:ToK2 (playerTable [1]))
|
||||
tinsert (players, player)
|
||||
players_index [playerName] = #players
|
||||
else
|
||||
player = players [index]
|
||||
for i = #player+1, encounterIndex-1 do
|
||||
tinsert (player, "")
|
||||
end
|
||||
tinsert (player, _detalhes:ToK2 (playerTable [1]))
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for index, playerTable in ipairs (players) do
|
||||
for i = #playerTable, amt_encounters do
|
||||
tinsert (playerTable, "")
|
||||
end
|
||||
end
|
||||
|
||||
--_detalhes:DumpTable (players, true)
|
||||
|
||||
table.sort (players, sort_alphabetical)
|
||||
|
||||
fillpanel:SetFillFunction (function (index) return players [index] end)
|
||||
fillpanel:SetTotalFunction (function() return #players end)
|
||||
|
||||
fillpanel:UpdateRows (header)
|
||||
|
||||
fillpanel:Refresh()
|
||||
|
||||
end
|
||||
|
||||
function f:Refresh()
|
||||
--> build the main table
|
||||
local diff = diff_dropdown.value
|
||||
local boss = boss_dropdown.value
|
||||
local role = role_dropdown.value
|
||||
local guild = guild_dropdown.value
|
||||
local player = player_dropdown.value
|
||||
|
||||
local diffTable = db [diff]
|
||||
|
||||
f:SetBackgroundImage (boss)
|
||||
|
||||
if (diffTable) then
|
||||
local encounters = diffTable [boss]
|
||||
if (encounters) then
|
||||
if (player == 1) then --> raid
|
||||
fillpanel:Show()
|
||||
if (f.gframe) then
|
||||
f.gframe:Hide()
|
||||
end
|
||||
player2_string:Hide()
|
||||
player2_dropdown:Hide()
|
||||
f:BuildRaidTable (encounters, guild, role)
|
||||
elseif (player == 2) then --> only one player
|
||||
fillpanel:Hide()
|
||||
if (f.gframe) then
|
||||
f.gframe:Show()
|
||||
end
|
||||
player2_string:Show()
|
||||
player2_dropdown:Show()
|
||||
f.build_player2_data = {encounters, guild, role}
|
||||
player2_dropdown:Refresh()
|
||||
player2_dropdown:Select (1, true)
|
||||
f:BuildPlayerTable (player2_dropdown.value)
|
||||
end
|
||||
else
|
||||
if (player == 1) then --> raid
|
||||
fillpanel:Show()
|
||||
if (f.gframe) then
|
||||
f.gframe:Hide()
|
||||
end
|
||||
player2_string:Hide()
|
||||
player2_dropdown:Hide()
|
||||
f:BuildRaidTable ({}, guild, role)
|
||||
elseif (player == 2) then --> only one player
|
||||
fillpanel:Hide()
|
||||
if (f.gframe) then
|
||||
f.gframe:Show()
|
||||
end
|
||||
player2_string:Show()
|
||||
player2_dropdown:Show()
|
||||
f.build_player2_data = {{}, guild, role}
|
||||
player2_dropdown:Refresh()
|
||||
player2_dropdown:Select (1, true)
|
||||
f:BuildPlayerTable (player2_dropdown.value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
_G.DetailsRaidHistoryWindow:UpdateDropdowns()
|
||||
_G.DetailsRaidHistoryWindow:Refresh()
|
||||
_G.DetailsRaidHistoryWindow:Show()
|
||||
|
||||
end
|
||||
|
||||
--> feedback window
|
||||
function _detalhes:OpenFeedbackWindow()
|
||||
@@ -1996,10 +2442,12 @@
|
||||
|
||||
--comma_button:SetPoint ("topright", panel, "topright", -100, -14)
|
||||
--tok_button:SetPoint ("topright", panel, "topright", -100, -36)
|
||||
|
||||
|
||||
|
||||
|
||||
local done = function()
|
||||
local text = panel.editbox:GetText()
|
||||
text = text:gsub ("\n", "")
|
||||
--text = text:gsub ("\n", "")
|
||||
|
||||
local test = text
|
||||
|
||||
@@ -2011,11 +2459,13 @@
|
||||
code = code:gsub ("STR", test)
|
||||
|
||||
local f = loadstring (code)
|
||||
local err, two = xpcall (f, errorhandler)
|
||||
|
||||
if (not err) then
|
||||
return
|
||||
if (not f) then
|
||||
print (f)
|
||||
end
|
||||
--local err, two = xpcall (f, errorhandler)
|
||||
--if (not err) then
|
||||
-- return
|
||||
--end
|
||||
|
||||
panel.callback (text)
|
||||
panel:Hide()
|
||||
|
||||
+678
-208
@@ -572,6 +572,306 @@ local button_on_leave = function (self)
|
||||
self.MyObject._icon:SetBlendMode ("BLEND")
|
||||
end
|
||||
|
||||
local add_row = function (self, t, need_update)
|
||||
local index = #self.rows+1
|
||||
|
||||
local thisrow = gump:NewPanel (self, self, "$parentHeader_" .. self._name .. index, nil, 1, 20)
|
||||
thisrow.backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Gold-Background]]}
|
||||
thisrow.color = "silver"
|
||||
thisrow.type = t.type
|
||||
thisrow.func = t.func
|
||||
thisrow.name = t.name
|
||||
thisrow.notext = t.notext
|
||||
thisrow.icon = t.icon
|
||||
thisrow.iconalign = t.iconalign
|
||||
|
||||
thisrow.hidden = t.hidden or false
|
||||
|
||||
local text = gump:NewLabel (thisrow, nil, self._name .. "$parentLabel" .. index, "text")
|
||||
text:SetPoint ("left", thisrow, "left", 2, 0)
|
||||
text:SetText (t.name)
|
||||
|
||||
tinsert (self._raw_rows, t)
|
||||
tinsert (self.rows, thisrow)
|
||||
|
||||
if (need_update) then
|
||||
self:AlignRows()
|
||||
end
|
||||
end
|
||||
|
||||
local align_rows = function (self)
|
||||
|
||||
local rows_shown = 0
|
||||
for index, row in ipairs (self.rows) do
|
||||
if (not row.hidden) then
|
||||
rows_shown = rows_shown + 1
|
||||
end
|
||||
end
|
||||
|
||||
local cur_width = 0
|
||||
local row_width = self._width / rows_shown
|
||||
local sindex = 1
|
||||
|
||||
wipe (self._anchors)
|
||||
|
||||
for index, row in ipairs (self.rows) do
|
||||
if (not row.hidden) then
|
||||
if (self._autowidth) then
|
||||
--row:SetWidth (row_width)
|
||||
if (self._raw_rows [index].width) then
|
||||
row.width = self._raw_rows [index].width
|
||||
else
|
||||
row.width = row_width
|
||||
end
|
||||
row:SetPoint ("topleft", self, "topleft", cur_width, 0)
|
||||
tinsert (self._anchors, cur_width)
|
||||
cur_width = cur_width + row_width + 1
|
||||
else
|
||||
row:SetPoint ("topleft", self, "topleft", cur_width, 0)
|
||||
row.width = self._raw_rows [index].width
|
||||
tinsert (self._anchors, cur_width)
|
||||
cur_width = cur_width + self._raw_rows [index].width + 1
|
||||
end
|
||||
row:Show()
|
||||
|
||||
local type = row.type
|
||||
|
||||
if (type == "text") then
|
||||
for i = 1, #self.scrollframe.lines do
|
||||
local line = self.scrollframe.lines [i]
|
||||
local text = tremove (line.text_available)
|
||||
if (not text) then
|
||||
self:CreateRowText (line)
|
||||
text = tremove (line.text_available)
|
||||
end
|
||||
tinsert (line.text_inuse, text)
|
||||
text:SetPoint ("left", line, "left", self._anchors [#self._anchors], 0)
|
||||
text:SetWidth (row.width)
|
||||
end
|
||||
elseif (type == "entry") then
|
||||
for i = 1, #self.scrollframe.lines do
|
||||
local line = self.scrollframe.lines [i]
|
||||
local entry = tremove (line.entry_available)
|
||||
if (not entry) then
|
||||
self:CreateRowEntry (line)
|
||||
entry = tremove (line.entry_available)
|
||||
end
|
||||
tinsert (line.entry_inuse, entry)
|
||||
entry:SetPoint ("left", line, "left", self._anchors [#self._anchors], 0)
|
||||
if (sindex == rows_shown) then
|
||||
entry:SetWidth (row.width - 25)
|
||||
else
|
||||
entry:SetWidth (row.width)
|
||||
end
|
||||
entry.func = row.func
|
||||
end
|
||||
elseif (type == "button") then
|
||||
for i = 1, #self.scrollframe.lines do
|
||||
local line = self.scrollframe.lines [i]
|
||||
local button = tremove (line.button_available)
|
||||
if (not button) then
|
||||
self:CreateRowButton (line)
|
||||
button = tremove (line.button_available)
|
||||
end
|
||||
tinsert (line.button_inuse, button)
|
||||
button:SetPoint ("left", line, "left", self._anchors [#self._anchors], 0)
|
||||
if (sindex == rows_shown) then
|
||||
button:SetWidth (row.width - 25)
|
||||
else
|
||||
button:SetWidth (row.width)
|
||||
end
|
||||
|
||||
if (row.icon) then
|
||||
button._icon.texture = row.icon
|
||||
button._icon:ClearAllPoints()
|
||||
if (row.iconalign) then
|
||||
if (row.iconalign == "center") then
|
||||
button._icon:SetPoint ("center", button, "center")
|
||||
elseif (row.iconalign == "right") then
|
||||
button._icon:SetPoint ("right", button, "right")
|
||||
end
|
||||
else
|
||||
button._icon:SetPoint ("left", button, "left")
|
||||
end
|
||||
end
|
||||
|
||||
if (row.name and not row.notext) then
|
||||
button._text:SetPoint ("left", button._icon, "right", 2, 0)
|
||||
button._text.text = row.name
|
||||
end
|
||||
|
||||
end
|
||||
elseif (type == "icon") then
|
||||
for i = 1, #self.scrollframe.lines do
|
||||
local line = self.scrollframe.lines [i]
|
||||
local icon = tremove (line.icon_available)
|
||||
if (not icon) then
|
||||
self:CreateRowIcon (line)
|
||||
icon = tremove (line.icon_available)
|
||||
end
|
||||
tinsert (line.icon_inuse, icon)
|
||||
icon:SetPoint ("left", line, "left", self._anchors [#self._anchors] + ( ((row.width or 22) - 22) / 2), 0)
|
||||
icon.func = row.func
|
||||
end
|
||||
end
|
||||
|
||||
sindex = sindex + 1
|
||||
else
|
||||
row:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
if (#self.rows > 0) then
|
||||
if (self._autowidth) then
|
||||
self.rows [#self.rows]:SetWidth (row_width - rows_shown + 1)
|
||||
else
|
||||
self.rows [#self.rows]:SetWidth (self._raw_rows [rows_shown].width - rows_shown + 1)
|
||||
end
|
||||
end
|
||||
|
||||
self.showing_amt = rows_shown
|
||||
end
|
||||
|
||||
local update_rows = function (self, updated_rows)
|
||||
for i = 1, #updated_rows do
|
||||
local t = updated_rows [i]
|
||||
local raw = self._raw_rows [i]
|
||||
|
||||
if (not raw) then
|
||||
self:AddRow (t)
|
||||
else
|
||||
raw.name = t.name
|
||||
raw.hidden = t.hidden or false
|
||||
|
||||
local widget = self.rows [i]
|
||||
widget.name = t.name
|
||||
widget.hidden = t.hidden or false
|
||||
|
||||
widget.text:SetText (t.name)
|
||||
end
|
||||
end
|
||||
|
||||
for i = #updated_rows+1, #self._raw_rows do
|
||||
local raw = self._raw_rows [i]
|
||||
local widget = self.rows [i]
|
||||
raw.hidden = true
|
||||
widget.hidden = true
|
||||
end
|
||||
|
||||
for index, row in ipairs (self.scrollframe.lines) do
|
||||
for i = #row.text_inuse, 1, -1 do
|
||||
tinsert (row.text_available, tremove (row.text_inuse, i))
|
||||
end
|
||||
for i = 1, #row.text_available do
|
||||
row.text_available[i]:Hide()
|
||||
end
|
||||
|
||||
for i = #row.entry_inuse, 1, -1 do
|
||||
tinsert (row.entry_available, tremove (row.entry_inuse, i))
|
||||
end
|
||||
for i = 1, #row.entry_available do
|
||||
row.entry_available[i]:Hide()
|
||||
end
|
||||
|
||||
for i = #row.button_inuse, 1, -1 do
|
||||
tinsert (row.button_available, tremove (row.button_inuse, i))
|
||||
end
|
||||
for i = 1, #row.button_available do
|
||||
row.button_available[i]:Hide()
|
||||
end
|
||||
|
||||
for i = #row.icon_inuse, 1, -1 do
|
||||
tinsert (row.icon_available, tremove (row.icon_inuse, i))
|
||||
end
|
||||
for i = 1, #row.icon_available do
|
||||
row.icon_available[i]:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
self:AlignRows()
|
||||
|
||||
end
|
||||
|
||||
local create_panel_text = function (self, row)
|
||||
row.text_total = row.text_total + 1
|
||||
local text = gump:NewLabel (row, nil, self._name .. "$parentLabel" .. row.text_total, "text" .. row.text_total)
|
||||
tinsert (row.text_available, text)
|
||||
end
|
||||
|
||||
local create_panel_entry = function (self, row)
|
||||
row.entry_total = row.entry_total + 1
|
||||
local editbox = gump:NewTextEntry (row, nil, "$parentEntry" .. row.entry_total, "entry", 120, 20)
|
||||
editbox.align = "left"
|
||||
|
||||
editbox:SetHook ("OnEnterPressed", function()
|
||||
editbox.widget.focuslost = true
|
||||
editbox:ClearFocus()
|
||||
editbox.func (editbox.index, editbox.text)
|
||||
return true
|
||||
end)
|
||||
|
||||
editbox:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = 1})
|
||||
editbox:SetBackdropColor (1, 1, 1, 0.1)
|
||||
editbox:SetBackdropBorderColor (1, 1, 1, 0.1)
|
||||
editbox.editbox.current_bordercolor = {1, 1, 1, 0.1}
|
||||
|
||||
tinsert (row.entry_available, editbox)
|
||||
end
|
||||
|
||||
local create_panel_button = function (self, row)
|
||||
row.button_total = row.button_total + 1
|
||||
local button = gump:NewButton (row, nil, "$parentButton" .. row.button_total, "button" .. row.button_total, 120, 20)
|
||||
button:InstallCustomTexture()
|
||||
|
||||
--> create icon and the text
|
||||
local icon = gump:NewImage (button, nil, 20, 20)
|
||||
local text = gump:NewLabel (button)
|
||||
|
||||
button._icon = icon
|
||||
button._text = text
|
||||
|
||||
button:SetHook ("OnEnter", button_on_enter)
|
||||
button:SetHook ("OnLeave", button_on_leave)
|
||||
|
||||
tinsert (row.button_available, button)
|
||||
end
|
||||
|
||||
local icon_onclick = function (texture, iconbutton)
|
||||
iconbutton._icon.texture = texture
|
||||
iconbutton.func (iconbutton.index, texture)
|
||||
end
|
||||
|
||||
local create_panel_icon = function (self, row)
|
||||
row.icon_total = row.icon_total + 1
|
||||
local iconbutton = gump:NewButton (row, nil, "$parentIconButton" .. row.icon_total, "iconbutton", 22, 20)
|
||||
iconbutton:InstallCustomTexture()
|
||||
|
||||
iconbutton:SetHook ("OnEnter", button_on_enter)
|
||||
iconbutton:SetHook ("OnLeave", button_on_leave)
|
||||
|
||||
iconbutton:SetHook ("OnMouseUp", function()
|
||||
gump:IconPick (icon_onclick, true, iconbutton)
|
||||
return true
|
||||
end)
|
||||
|
||||
local icon = gump:NewImage (iconbutton, nil, 20, 20, "artwork", nil, "_icon", "$parentIcon" .. row.icon_total)
|
||||
iconbutton._icon = icon
|
||||
|
||||
icon:SetPoint ("center", iconbutton, "center", 0, 0)
|
||||
|
||||
tinsert (row.icon_available, iconbutton)
|
||||
end
|
||||
|
||||
local set_fill_function = function (self, func)
|
||||
self._fillfunc = func
|
||||
end
|
||||
local set_total_function = function (self, func)
|
||||
self._totalfunc = func
|
||||
end
|
||||
local drop_header_function = function (self)
|
||||
wipe (self.rows)
|
||||
end
|
||||
-- ~fillpanel
|
||||
function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_row, autowidth, options)
|
||||
|
||||
local panel = gump:NewPanel (parent, parent, name, member, w, h)
|
||||
@@ -579,127 +879,120 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
|
||||
|
||||
options = options or {rowheight = 20}
|
||||
panel.rows = {}
|
||||
|
||||
|
||||
panel.AddRow = add_row
|
||||
panel.AlignRows = align_rows
|
||||
panel.UpdateRows = update_rows
|
||||
panel.CreateRowText = create_panel_text
|
||||
panel.CreateRowEntry = create_panel_entry
|
||||
panel.CreateRowButton = create_panel_button
|
||||
panel.CreateRowIcon = create_panel_icon
|
||||
panel.SetFillFunction = set_fill_function
|
||||
panel.SetTotalFunction = set_total_function
|
||||
panel.DropHeader = drop_header_function
|
||||
|
||||
panel._name = name
|
||||
panel._width = w
|
||||
panel._height = h
|
||||
panel._raw_rows = {}
|
||||
panel._anchors = {}
|
||||
panel._fillfunc = fill_row
|
||||
panel._totalfunc = total_lines
|
||||
panel._autowidth = autowidth
|
||||
|
||||
for index, t in ipairs (rows) do
|
||||
local thisrow = gump:NewPanel (panel, panel, "$parentHeader_" .. name .. index, nil, 1, 20)
|
||||
thisrow.backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Gold-Background]]}
|
||||
thisrow.color = "silver"
|
||||
thisrow.type = t.type
|
||||
thisrow.func = t.func
|
||||
thisrow.name = t.name
|
||||
thisrow.notext = t.notext
|
||||
thisrow.icon = t.icon
|
||||
thisrow.iconalign = t.iconalign
|
||||
|
||||
local text = gump:NewLabel (thisrow, nil, name .. "$parentLabel", "text")
|
||||
text:SetPoint ("left", thisrow, "left", 2, 0)
|
||||
text:SetText (t.name)
|
||||
|
||||
tinsert (panel.rows, thisrow)
|
||||
end
|
||||
|
||||
local cur_width = 0
|
||||
local row_width = w / #rows
|
||||
|
||||
local anchors = {}
|
||||
|
||||
for index, row in ipairs (panel.rows) do
|
||||
if (autowidth) then
|
||||
row:SetWidth (row_width)
|
||||
row:SetPoint ("topleft", panel, "topleft", cur_width, 0)
|
||||
tinsert (anchors, cur_width)
|
||||
cur_width = cur_width + row_width + 1
|
||||
else
|
||||
row:SetPoint ("topleft", panel, "topleft", cur_width, 0)
|
||||
row.width = rows [index].width
|
||||
tinsert (anchors, cur_width)
|
||||
cur_width = cur_width + rows [index].width + 1
|
||||
end
|
||||
end
|
||||
|
||||
if (autowidth) then
|
||||
panel.rows [#panel.rows]:SetWidth (row_width - #rows + 1)
|
||||
else
|
||||
panel.rows [#panel.rows]:SetWidth (rows [#rows].width - #rows + 1)
|
||||
panel.AddRow (panel, t)
|
||||
end
|
||||
|
||||
local refresh_fillbox = function (self)
|
||||
|
||||
local offset = FauxScrollFrame_GetOffset (self)
|
||||
local filled_lines = total_lines (panel)
|
||||
|
||||
local filled_lines = panel._totalfunc (panel)
|
||||
|
||||
for index = 1, #self.lines do
|
||||
|
||||
|
||||
local row = self.lines [index]
|
||||
if (index <= filled_lines) then
|
||||
|
||||
|
||||
local real_index = index + offset
|
||||
local results = fill_row (real_index, panel)
|
||||
|
||||
if (results [1]) then
|
||||
local results = panel._fillfunc (real_index, panel)
|
||||
|
||||
if (results [1]) then
|
||||
row:Show()
|
||||
|
||||
for i = 1, #row.row_widgets do
|
||||
|
||||
row.row_widgets [i].index = real_index
|
||||
|
||||
if (panel.rows [i].type == "icon") then
|
||||
|
||||
local result = results [i]:gsub (".-%\\", "")
|
||||
row.row_widgets [i]._icon.texture = results [i]
|
||||
|
||||
elseif (panel.rows [i].type == "button") then
|
||||
|
||||
if (type (results [i]) == "table") then
|
||||
local text, entry, button, icon = 1, 1, 1, 1
|
||||
|
||||
for index, t in ipairs (panel.rows) do
|
||||
if (not t.hidden) then
|
||||
if (t.type == "text") then
|
||||
local fontstring = row.text_inuse [text]
|
||||
text = text + 1
|
||||
fontstring:SetText (results [index])
|
||||
fontstring.index = real_index
|
||||
fontstring:Show()
|
||||
|
||||
elseif (t.type == "entry") then
|
||||
local entrywidget = row.entry_inuse [entry]
|
||||
entry = entry + 1
|
||||
entrywidget:SetText (results [index])
|
||||
entrywidget.index = real_index
|
||||
entrywidget:Show()
|
||||
|
||||
elseif (t.type == "button") then
|
||||
local buttonwidget = row.button_inuse [button]
|
||||
button = button + 1
|
||||
buttonwidget.index = real_index
|
||||
|
||||
if (results [i].text) then
|
||||
row.row_widgets [i]:SetText (results [i].text)
|
||||
local func = function()
|
||||
t.func (real_index, index)
|
||||
panel:Refresh()
|
||||
end
|
||||
buttonwidget:SetClickFunction (func)
|
||||
|
||||
if (type (results [index]) == "table") then
|
||||
if (results [index].text) then
|
||||
buttonwidget:SetText (results [index].text)
|
||||
end
|
||||
|
||||
if (results [index].icon) then
|
||||
buttonwidget._icon:SetTexture (results [index].icon)
|
||||
end
|
||||
|
||||
if (results [index].func) then
|
||||
buttonwidget:SetClickFunction (results [index].func, real_index, results [index].value)
|
||||
end
|
||||
else
|
||||
buttonwidget:SetText (results [index])
|
||||
end
|
||||
|
||||
if (results [i].icon) then
|
||||
row.row_widgets [i]._icon:SetTexture (results [i].icon)
|
||||
end
|
||||
buttonwidget:Show()
|
||||
|
||||
if (results [i].func) then
|
||||
row.row_widgets [i]:SetClickFunction (results [i].func, real_index, results [i].value)
|
||||
end
|
||||
|
||||
else
|
||||
row.row_widgets [i]:SetText (results [i])
|
||||
end
|
||||
|
||||
else
|
||||
--> text
|
||||
row.row_widgets [i]:SetText (results [i])
|
||||
if (panel.rows [i].type == "entry") then
|
||||
row.row_widgets [i]:SetCursorPosition (0)
|
||||
elseif (t.type == "icon") then
|
||||
local iconwidget = row.icon_inuse [icon]
|
||||
icon = icon + 1
|
||||
|
||||
iconwidget.line = index
|
||||
iconwidget.index = real_index
|
||||
|
||||
local result = results [index]:gsub (".-%\\", "")
|
||||
iconwidget._icon.texture = results [index]
|
||||
|
||||
iconwidget:Show()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
else
|
||||
row:Hide()
|
||||
for i = 1, #row.row_widgets do
|
||||
row.row_widgets [i]:SetText ("")
|
||||
if (panel.rows [i].type == "icon") then
|
||||
row.row_widgets [i]._icon.texture = ""
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
row:Hide()
|
||||
for i = 1, #row.row_widgets do
|
||||
row.row_widgets [i]:SetText ("")
|
||||
if (panel.rows [i].type == "icon") then
|
||||
row.row_widgets [i]._icon.texture = ""
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function panel:Refresh()
|
||||
local filled_lines = total_lines (panel)
|
||||
local filled_lines = panel._totalfunc (panel)
|
||||
local scroll_total_lines = #panel.scrollframe.lines
|
||||
local line_height = options.rowheight
|
||||
refresh_fillbox (panel.scrollframe)
|
||||
@@ -719,130 +1012,44 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
|
||||
--create lines
|
||||
local size = options.rowheight
|
||||
local amount = math.floor (((h-21) / size))
|
||||
|
||||
for i = 1, amount do
|
||||
|
||||
local row = gump:NewPanel (panel, nil, "$parentRow_" .. i, nil, 1, size)
|
||||
row.backdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]]}
|
||||
for i = 1, amount do
|
||||
--local row = gump:NewPanel (panel, nil, , nil, 1, size)
|
||||
local row = CreateFrame ("frame", panel:GetName() .. "Row_" .. i, panel.widget)
|
||||
row:SetSize (1, size)
|
||||
row.color = {1, 1, 1, .2}
|
||||
|
||||
row:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]]})
|
||||
|
||||
if (i%2 == 0) then
|
||||
row:SetBackdropColor (.5, .5, .5, 0.2)
|
||||
else
|
||||
row:SetBackdropColor (1, 1, 1, 0.00)
|
||||
end
|
||||
|
||||
row:SetPoint ("topleft", scrollframe, "topleft", 0, (i-1) * size * -1)
|
||||
row:SetPoint ("topright", scrollframe, "topright", 0, (i-1) * size * -1)
|
||||
tinsert (scrollframe.lines, row)
|
||||
|
||||
row.row_widgets = {}
|
||||
row.text_available = {}
|
||||
row.text_inuse = {}
|
||||
row.text_total = 0
|
||||
|
||||
for o = 1, #rows do
|
||||
row.entry_available = {}
|
||||
row.entry_inuse = {}
|
||||
row.entry_total = 0
|
||||
|
||||
local _type = panel.rows [o].type
|
||||
|
||||
if (_type == "text") then
|
||||
|
||||
--> create text
|
||||
local text = gump:NewLabel (row, nil, name .. "$parentLabel" .. o, "text" .. o)
|
||||
text:SetPoint ("left", row, "left", anchors [o], 0)
|
||||
|
||||
--> insert in the table
|
||||
tinsert (row.row_widgets, text)
|
||||
|
||||
elseif (_type == "entry") then
|
||||
|
||||
--> create editbox
|
||||
local editbox = gump:NewTextEntry (row, nil, "$parentEntry" .. i .. o .. math.random(100), "entry", panel.rows [o].width, 20, panel.rows [o].func, i, o)
|
||||
editbox.align = "left"
|
||||
|
||||
editbox:SetHook ("OnEnterPressed", function()
|
||||
editbox.widget.focuslost = true
|
||||
editbox:ClearFocus()
|
||||
editbox.func (editbox.index, editbox.text)
|
||||
return true
|
||||
end)
|
||||
editbox:SetPoint ("left", row, "left", anchors [o], 0)
|
||||
editbox:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = 1})
|
||||
editbox:SetBackdropColor (1, 1, 1, 0.1)
|
||||
editbox:SetBackdropBorderColor (1, 1, 1, 0.1)
|
||||
editbox.editbox.current_bordercolor = {1, 1, 1, 0.1}
|
||||
--> insert in the table
|
||||
tinsert (row.row_widgets, editbox)
|
||||
|
||||
elseif (_type == "button") then
|
||||
|
||||
--> create button
|
||||
local button = gump:NewButton (row, nil, "$parentButton" .. o, "button", panel.rows [o].width, 20)
|
||||
|
||||
local func = function()
|
||||
panel.rows [o].func (button.index, o)
|
||||
panel:Refresh()
|
||||
end
|
||||
button:SetClickFunction (func)
|
||||
|
||||
button:SetPoint ("left", row, "left", anchors [o], 0)
|
||||
|
||||
--> create icon and the text
|
||||
local icon = gump:NewImage (button, nil, 20, 20)
|
||||
local text = gump:NewLabel (button)
|
||||
|
||||
button._icon = icon
|
||||
button._text = text
|
||||
|
||||
button:SetHook ("OnEnter", button_on_enter)
|
||||
button:SetHook ("OnLeave", button_on_leave)
|
||||
|
||||
if (panel.rows [o].icon) then
|
||||
icon.texture = panel.rows [o].icon
|
||||
if (panel.rows [o].iconalign) then
|
||||
if (panel.rows [o].iconalign == "center") then
|
||||
icon:SetPoint ("center", button, "center")
|
||||
elseif (panel.rows [o].iconalign == "right") then
|
||||
icon:SetPoint ("right", button, "right")
|
||||
end
|
||||
else
|
||||
icon:SetPoint ("left", button, "left")
|
||||
end
|
||||
end
|
||||
|
||||
if (panel.rows [o].name and not panel.rows [o].notext) then
|
||||
text:SetPoint ("left", icon, "right", 2, 0)
|
||||
text.text = panel.rows [o].name
|
||||
end
|
||||
|
||||
--> inser in the table
|
||||
tinsert (row.row_widgets, button)
|
||||
|
||||
elseif (_type == "icon") then
|
||||
|
||||
--> create button and icon
|
||||
local iconbutton = gump:NewButton (row, nil, "$parentIconButton" .. o, "iconbutton", 22, 20)
|
||||
iconbutton:InstallCustomTexture()
|
||||
|
||||
iconbutton:SetHook ("OnEnter", button_on_enter)
|
||||
iconbutton:SetHook ("OnLeave", button_on_leave)
|
||||
|
||||
--iconbutton:InstallCustomTexture()
|
||||
local icon = gump:NewImage (iconbutton, nil, 20, 20, "artwork", nil, "_icon", "$parentIcon" .. o)
|
||||
iconbutton._icon = icon
|
||||
|
||||
iconbutton:SetPoint ("left", row, "left", anchors [o] + ( (panel.rows [o].width - 22) / 2), 0)
|
||||
icon:SetPoint ("center", iconbutton, "center", 0, 0)
|
||||
|
||||
--> set functions
|
||||
local function iconcallback (texture)
|
||||
iconbutton._icon.texture = texture
|
||||
panel.rows [o].func (iconbutton.index, texture)
|
||||
end
|
||||
|
||||
iconbutton:SetClickFunction (function()
|
||||
gump:IconPick (iconcallback, true)
|
||||
return true
|
||||
end)
|
||||
|
||||
--> insert in the table
|
||||
tinsert (row.row_widgets, iconbutton)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
row.button_available = {}
|
||||
row.button_inuse = {}
|
||||
row.button_total = 0
|
||||
|
||||
row.icon_available = {}
|
||||
row.icon_inuse = {}
|
||||
row.icon_total = 0
|
||||
end
|
||||
|
||||
panel.AlignRows (panel)
|
||||
|
||||
return panel
|
||||
end
|
||||
|
||||
@@ -884,7 +1091,7 @@ function gump:ColorPick (frame, r, g, b, alpha, callback)
|
||||
end
|
||||
|
||||
------------icon pick
|
||||
function gump:IconPick (callback, close_when_select)
|
||||
function gump:IconPick (callback, close_when_select, param1, param2)
|
||||
|
||||
if (not gump.IconPickFrame) then
|
||||
|
||||
@@ -995,7 +1202,7 @@ function gump:IconPick (callback, close_when_select)
|
||||
gump.IconPickFrame.buttons = {}
|
||||
|
||||
local OnClickFunction = function (self)
|
||||
gump.IconPickFrame.callback (self.icon:GetTexture())
|
||||
gump.IconPickFrame.callback (self.icon:GetTexture(), gump.IconPickFrame.param1, gump.IconPickFrame.param2)
|
||||
if (gump.IconPickFrame.click_close) then
|
||||
close_button:Click()
|
||||
end
|
||||
@@ -1217,6 +1424,8 @@ function gump:IconPick (callback, close_when_select)
|
||||
|
||||
end
|
||||
|
||||
gump.IconPickFrame.param1, gump.IconPickFrame.param2 = param1, param2
|
||||
|
||||
gump.IconPickFrame:Show()
|
||||
gump.IconPickFrameScroll.update (gump.IconPickFrameScroll)
|
||||
gump.IconPickFrame.callback = callback or gump.IconPickFrame.emptyFunction
|
||||
@@ -1959,5 +2168,266 @@ function gump:CreateChartPanel (parent, w, h, name)
|
||||
return f
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ~gframe
|
||||
local gframe_on_enter_line = function (self)
|
||||
self:SetBackdropColor (0, 0, 0, 0)
|
||||
|
||||
local parent = self:GetParent()
|
||||
local ball = self.ball
|
||||
ball:SetBlendMode ("ADD")
|
||||
|
||||
local on_enter = parent._onenter_line
|
||||
if (on_enter) then
|
||||
return on_enter (self, parent)
|
||||
end
|
||||
end
|
||||
|
||||
local gframe_on_leave_line = function (self)
|
||||
self:SetBackdropColor (0, 0, 0, .6)
|
||||
|
||||
local parent = self:GetParent()
|
||||
local ball = self.ball
|
||||
ball:SetBlendMode ("BLEND")
|
||||
|
||||
local on_leave = parent._onleave_line
|
||||
if (on_leave) then
|
||||
return on_leave (self, parent)
|
||||
end
|
||||
end
|
||||
|
||||
local gframe_create_line = function (self)
|
||||
local index = #self._lines+1
|
||||
|
||||
local f = CreateFrame ("frame", nil, self)
|
||||
self._lines [index] = f
|
||||
f.id = index
|
||||
f:SetScript ("OnEnter", gframe_on_enter_line)
|
||||
f:SetScript ("OnLeave", gframe_on_leave_line)
|
||||
|
||||
f:SetWidth (self._linewidth)
|
||||
|
||||
if (index == 1) then
|
||||
f:SetPoint ("topleft", self, "topleft")
|
||||
f:SetPoint ("bottomleft", self, "bottomleft")
|
||||
else
|
||||
local previous_line = self._lines [index-1]
|
||||
f:SetPoint ("topleft", previous_line, "topright")
|
||||
f:SetPoint ("bottomleft", previous_line, "bottomright")
|
||||
end
|
||||
|
||||
local t = f:CreateTexture (nil, "background")
|
||||
t:SetWidth (1)
|
||||
t:SetPoint ("topright", f, "topright")
|
||||
t:SetPoint ("bottomright", f, "bottomright")
|
||||
t:SetTexture (1, 1, 1, .1)
|
||||
f.grid = t
|
||||
|
||||
local b = f:CreateTexture (nil, "overlay")
|
||||
b:SetTexture ([[Interface\COMMON\Indicator-Yellow]])
|
||||
b:SetSize (16, 16)
|
||||
f.ball = b
|
||||
local anchor = CreateFrame ("frame", nil, f)
|
||||
anchor:SetAllPoints (b)
|
||||
b.tooltip_anchor = anchor
|
||||
|
||||
local spellicon = f:CreateTexture (nil, "artwork")
|
||||
spellicon:SetPoint ("bottom", b, "bottom", 0, 10)
|
||||
spellicon:SetSize (16, 16)
|
||||
f.spellicon = spellicon
|
||||
|
||||
local timeline = f:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
timeline:SetPoint ("bottomright", f, "bottomright", -2, 0)
|
||||
_detalhes:SetFontSize (timeline, 8)
|
||||
f.timeline = timeline
|
||||
|
||||
return f
|
||||
end
|
||||
|
||||
local gframe_getline = function (self, index)
|
||||
local line = self._lines [index]
|
||||
if (not line) then
|
||||
line = gframe_create_line (self)
|
||||
end
|
||||
return line
|
||||
end
|
||||
|
||||
local gframe_reset = function (self)
|
||||
for i, line in ipairs (self._lines) do
|
||||
line:Hide()
|
||||
end
|
||||
if (self.GraphLib_Lines_Used) then
|
||||
for i = #self.GraphLib_Lines_Used, 1, -1 do
|
||||
local line = tremove (self.GraphLib_Lines_Used)
|
||||
tinsert (self.GraphLib_Lines, line)
|
||||
line:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local gframe_update = function (self, lines)
|
||||
|
||||
local g = LibStub:GetLibrary ("LibGraph-2.0")
|
||||
local h = self:GetHeight()/100
|
||||
local amtlines = #lines
|
||||
local linewidth = self._linewidth
|
||||
|
||||
local max_value = 0
|
||||
for i = 1, amtlines do
|
||||
if (lines [i].value > max_value) then
|
||||
max_value = lines [i].value
|
||||
end
|
||||
end
|
||||
|
||||
local o = 1
|
||||
local lastvalue = self:GetHeight()/2
|
||||
|
||||
for i = 1, min (amtlines, self._maxlines) do
|
||||
|
||||
local data = lines [i]
|
||||
|
||||
local pvalue = data.value / max_value * 100
|
||||
if (pvalue > 98) then
|
||||
pvalue = 98
|
||||
end
|
||||
pvalue = pvalue * h
|
||||
|
||||
g:DrawLine (self, (o-1)*linewidth, lastvalue, o*linewidth, pvalue, linewidth, {1, 1, 1, 1}, "overlay")
|
||||
lastvalue = pvalue
|
||||
|
||||
local line = self:GetLine (i)
|
||||
line:Show()
|
||||
line.ball:Show()
|
||||
|
||||
line.ball:SetPoint ("bottomleft", self, "bottomleft", (o*linewidth)-8, pvalue-8)
|
||||
line.spellicon:SetTexture (nil)
|
||||
line.timeline:SetText (data.text)
|
||||
line.timeline:Show()
|
||||
|
||||
line.data = data
|
||||
|
||||
o = o + 1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function gump:CreateGFrame (parent, w, h, linewidth, onenter, onleave, member, name)
|
||||
local f = CreateFrame ("frame", name, parent)
|
||||
f:SetSize (w or 450, h or 150)
|
||||
f.CustomLine = [[Interface\AddOns\Details\Libs\LibGraph-2.0\line]]
|
||||
|
||||
if (member) then
|
||||
parent [member] = f
|
||||
end
|
||||
|
||||
f.CreateLine = gframe_create_line
|
||||
f.GetLine = gframe_getline
|
||||
f.Reset = gframe_reset
|
||||
f.UpdateLines = gframe_update
|
||||
|
||||
f._lines = {}
|
||||
|
||||
f._onenter_line = onenter
|
||||
f._onleave_line = onleave
|
||||
|
||||
f._linewidth = linewidth or 50
|
||||
f._maxlines = floor (f:GetWidth() / f._linewidth)
|
||||
|
||||
return f
|
||||
end
|
||||
|
||||
--[=[
|
||||
|
||||
function gframe:Reset()
|
||||
for i = #gframe.GraphLib_Lines_Used, 1, -1 do
|
||||
local line = tremove (gframe.GraphLib_Lines_Used)
|
||||
tinsert (gframe.GraphLib_Lines, line)
|
||||
line:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
function DeathGraphs:ShowGraphicForDeath (data)
|
||||
|
||||
gframe:Reset()
|
||||
gframe:ShowGrid()
|
||||
gframe:Show()
|
||||
|
||||
if (not data) then
|
||||
return
|
||||
end
|
||||
|
||||
local timeline = data [1]
|
||||
local max_health = data[4]
|
||||
|
||||
if (#timeline < 16) then
|
||||
while (#timeline < 16) do
|
||||
table.insert (timeline, 1, {false, 0, 0, data[6], max_health, "-1"})
|
||||
end
|
||||
end
|
||||
|
||||
log = timeline
|
||||
|
||||
local h = gframe:GetHeight()/100
|
||||
|
||||
local o = 1
|
||||
local lastlife = 156
|
||||
|
||||
--for i = 16, 1, -1 do
|
||||
for i = 1, 16, 1 do
|
||||
local t = timeline [i]
|
||||
if (type (t) == "table") then
|
||||
|
||||
--> death parser
|
||||
|
||||
local evtype = t [1] --event type
|
||||
local spellid = t [2] --spellid
|
||||
local amount = t [3] --amount healed or damaged
|
||||
local time = t [4] --time
|
||||
local life = t [5] --health
|
||||
local source = t [6] --source
|
||||
|
||||
local plife = life / max_health * 100
|
||||
if (plife > 98) then
|
||||
plife = 98
|
||||
end
|
||||
plife = plife*h
|
||||
|
||||
local line
|
||||
|
||||
line = g:DrawLine (gframe, (o-1)*29, lastlife, o*29, plife, 50, red, "overlay")
|
||||
|
||||
local ball = gballs [o]
|
||||
ball:SetPoint ("bottomleft", gframe, "bottomleft", (o*29)-8, plife-8)
|
||||
if (type (evtype) == "boolean" and evtype) then --> damage
|
||||
ball.spellicon:SetTexture (select (3, GetSpellInfo (spellid)))
|
||||
ball.spellicon:SetTexCoord (4/64, 60/64, 4/64, 60/64)
|
||||
else
|
||||
ball.spellicon:SetTexture (nil)
|
||||
end
|
||||
|
||||
ball.line = line
|
||||
|
||||
local clock = data[6] - time
|
||||
if (type (evtype) == "number" and evtype == 2) then
|
||||
if (clock <= 100) then
|
||||
timeline_bg.labels [o]:SetText (math.floor (clock))
|
||||
else
|
||||
timeline_bg.labels [o]:SetText (string.format ("%.1f", clock))
|
||||
end
|
||||
else
|
||||
timeline_bg.labels [o]:SetText ("-" .. string.format ("%.1f", clock))
|
||||
end
|
||||
|
||||
local frame = gradeframes [o]
|
||||
frame.data = t
|
||||
|
||||
lastlife = plife
|
||||
o = o + 1
|
||||
end
|
||||
end
|
||||
|
||||
DeathGraphs:UpdateOverall()
|
||||
|
||||
end
|
||||
|
||||
--]=]
|
||||
@@ -23,8 +23,42 @@ do
|
||||
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].trash_ids
|
||||
end
|
||||
|
||||
function _detalhes:GetInstanceIdFromEncounterId (encounterid)
|
||||
for id, instanceTable in pairs (_detalhes.EncounterInformation) do
|
||||
local ids = instanceTable.encounter_ids2
|
||||
if (ids) then
|
||||
if (ids [encounterid]) then
|
||||
return id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--> return the boss table using a encounter id
|
||||
function _detalhes:GetBossEncounterDetailsFromEncounterId (mapid, encounterid)
|
||||
if (not mapid) then
|
||||
local bossIndex, instance
|
||||
for id, instanceTable in pairs (_detalhes.EncounterInformation) do
|
||||
local ids = instanceTable.encounter_ids2
|
||||
if (ids) then
|
||||
bossIndex = ids [encounterid]
|
||||
if (bossIndex) then
|
||||
instance = instanceTable
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (instance) then
|
||||
local bosses = instance.encounters
|
||||
if (bosses) then
|
||||
return bosses [bossIndex], instance
|
||||
end
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local bossindex = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [encounterid]
|
||||
if (bossindex) then
|
||||
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex], bossindex
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
["COMBAT_PLAYER_ENTER"] = {},
|
||||
["COMBAT_PLAYER_LEAVE"] = {},
|
||||
["COMBAT_PLAYER_TIMESTARTED"] = {},
|
||||
["COMBAT_BOSS_WIPE"] = {},
|
||||
["COMBAT_BOSS_DEFEATED"] = {},
|
||||
["COMBAT_BOSS_FOUND"] = {},
|
||||
["COMBAT_INVALID"] = {},
|
||||
["COMBAT_PREPOTION_UPDATED"] = {},
|
||||
@@ -86,6 +88,8 @@ local common_events = {
|
||||
["COMBAT_PLAYER_ENTER"] = true,
|
||||
["COMBAT_PLAYER_LEAVE"] = true,
|
||||
["COMBAT_PLAYER_TIMESTARTED"] = true,
|
||||
["COMBAT_BOSS_WIPE"] = true,
|
||||
["COMBAT_BOSS_DEFEATED"] = true,
|
||||
["COMBAT_BOSS_FOUND"] = true,
|
||||
["COMBAT_INVALID"] = true,
|
||||
["COMBAT_PREPOTION_UPDATED"] = true,
|
||||
|
||||
@@ -20,6 +20,9 @@ function SlashCmdList.DETAILS (msg, editbox)
|
||||
if (command == Loc ["STRING_SLASH_NEW"] or command == "new") then
|
||||
_detalhes:CriarInstancia (nil, true)
|
||||
|
||||
elseif (command == Loc ["STRING_SLASH_HISTORY"] or command == "history") then
|
||||
_detalhes:OpenRaidHistoryWindow()
|
||||
|
||||
elseif (command == Loc ["STRING_SLASH_TOGGLE"] or command == "toggle") then
|
||||
|
||||
local instance = rest:match ("^(%S*)%s*(.-)$")
|
||||
|
||||
@@ -4,6 +4,10 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
local g = _detalhes.gump
|
||||
local _
|
||||
|
||||
function _detalhes:DumpTable (text_to_show, dumpvalues, keeptext)
|
||||
return _detalhes:OpenNewsWindow (text_to_show, dumpvalues, keeptext)
|
||||
end
|
||||
|
||||
function _detalhes:OpenNewsWindow (text_to_show, dumpvalues, keeptext)
|
||||
local news_window = _detalhes:CreateOrOpenNewsWindow()
|
||||
|
||||
|
||||
+55
-1
@@ -135,7 +135,7 @@ do
|
||||
local options_button = gump:CreateButton (frame.topbg_frame, open_options, 14, 14, open_options)
|
||||
options_button:SetPoint ("right", window_color, "left", -2, 0)
|
||||
|
||||
local options_button_texture = gump:CreateImage (options_button, [[Interface\AddOns\Details\images\modo_icones]], 14, 14, "artwork", {0.5, 0.625, 0, 1})
|
||||
local options_button_texture = gump:CreateImage (options_button, [[Interface\AddOns\Details\images\icons]], 14, 14, "artwork", {396/512, 428/512, 277/512, 307/512})
|
||||
options_button_texture:SetAlpha (0.35)
|
||||
options_button_texture:SetAllPoints()
|
||||
|
||||
@@ -154,6 +154,60 @@ do
|
||||
GameCooltip:Hide()
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local open_forge = function()
|
||||
_detalhes:OpenForge()
|
||||
end
|
||||
local forge_button = gump:CreateButton (frame.topbg_frame, open_forge, 14, 14, open_forge)
|
||||
forge_button:SetPoint ("right", options_button, "left", -2, 0)
|
||||
|
||||
local forge_button_texture = gump:CreateImage (forge_button, [[Interface\AddOns\Details\images\icons]], 14, 14, "artwork", {396/512, 428/512, 243/512, 273/512})
|
||||
forge_button_texture:SetAlpha (0.35)
|
||||
forge_button_texture:SetAllPoints()
|
||||
|
||||
forge_button:SetHook ("OnEnter", function()
|
||||
forge_button_texture:SetAlpha (1)
|
||||
GameCooltip:Reset()
|
||||
_detalhes:CooltipPreset (1)
|
||||
GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, backgroundColor, _detalhes.tooltip_border_color)
|
||||
GameCooltip:AddLine ("Open Forge")
|
||||
GameCooltip:SetOwner (window_color.widget)
|
||||
GameCooltip:SetType ("tooltip")
|
||||
GameCooltip:Show()
|
||||
end)
|
||||
forge_button:SetHook ("OnLeave", function()
|
||||
forge_button_texture:SetAlpha (0.35)
|
||||
GameCooltip:Hide()
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local open_history = function()
|
||||
_detalhes:OpenRaidHistoryWindow()
|
||||
end
|
||||
local history_button = gump:CreateButton (frame.topbg_frame, open_history, 14, 14, open_history)
|
||||
history_button:SetPoint ("right", forge_button, "left", -2, 0)
|
||||
|
||||
local history_button_texture = gump:CreateImage (history_button, [[Interface\AddOns\Details\images\icons]], 14, 14, "artwork", {434/512, 466/512, 243/512, 273/512})
|
||||
history_button_texture:SetAlpha (0.35)
|
||||
history_button_texture:SetAllPoints()
|
||||
|
||||
history_button:SetHook ("OnEnter", function()
|
||||
history_button_texture:SetAlpha (1)
|
||||
GameCooltip:Reset()
|
||||
_detalhes:CooltipPreset (1)
|
||||
GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, backgroundColor, _detalhes.tooltip_border_color)
|
||||
GameCooltip:AddLine ("Open History Panel")
|
||||
GameCooltip:SetOwner (window_color.widget)
|
||||
GameCooltip:SetType ("tooltip")
|
||||
GameCooltip:Show()
|
||||
end)
|
||||
history_button:SetHook ("OnLeave", function()
|
||||
history_button_texture:SetAlpha (0.35)
|
||||
GameCooltip:Hide()
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function _detalhes.switch:CloseMe()
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user