- Fixed dungeon chart at the end of a mythic dungeon run.

- Added console run command: /run Details.show_arena_role_icon = true; this enable or disable the role icon in arena.
- Added console run command: /run Details.data_cleanup_logout = false; when true, clean all data on logoff.
This commit is contained in:
Tercio
2018-03-23 14:50:11 -03:00
parent a6cfb2a188
commit 66e4561a0c
7 changed files with 156 additions and 52 deletions
+4 -4
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -2660,7 +2660,7 @@ end
end
if (enemy) then
if (arena_enemy) then
if (arena_enemy and _detalhes.show_arena_role_icon) then
if (UsingCustomLeftText) then
bar.texto_esquerdo:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instance.row_info.height .. ":" .. instance.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing))
else
@@ -2682,7 +2682,7 @@ end
end
end
else
if (arena_ally) then
if (arena_ally and _detalhes.show_arena_role_icon) then
if (UsingCustomLeftText) then
bar.texto_esquerdo:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. instance.row_info.height .. ":" .. instance.row_info.height .. ":0:0:256:256:" .. _detalhes.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing))
else
+1
View File
@@ -228,6 +228,7 @@ _detalhes.instance_defaults = {
icon_file = [[Interface\AddOns\Details\images\classes_small]],
no_icon = false,
start_after_icon = true,
icon_grayscale = false,
--percent type
percent_type = 1,
--backdrop
+7
View File
@@ -711,6 +711,13 @@
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
end
end
--> 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
_detalhes.clear:c_atributo_custom()
+131 -45
View File
@@ -7,6 +7,7 @@
--local pointer to details object
local Details = _G._detalhes
local debugmode = false
local verbosemode = true
--constants
local CONST_USE_PLAYER_EDPS = false
@@ -20,10 +21,11 @@ Should the chart data be volatile?
--]=]
local mythicDungeonCharts = Details:CreateEventListener()
_G.DetailsMythicDungeonChartHandler = mythicDungeonCharts
function mythicDungeonCharts:Debug (...)
if (debugmode) then
print ("Details! DungeonCharts (debug.Alpha " .. Details.build_counter .. "." .. Details.realversion .. " ): ", ...)
if (debugmode or verbosemode) then
print ("Details! DungeonCharts: ", ...)
end
end
@@ -198,6 +200,9 @@ function mythicDungeonCharts:OnStartMythicDungeon()
if (not Details.mythic_plus.show_damage_graphic) then
mythicDungeonCharts:Debug ("Dungeon started, no capturing mythic dungeon chart data, disabled on profile")
if (verbosemode) then
mythicDungeonCharts:Debug ("OnStartMythicDungeon() not allowed")
end
return
else
mythicDungeonCharts:Debug ("Dungeon started, new capture started")
@@ -221,6 +226,10 @@ function mythicDungeonCharts:OnStartMythicDungeon()
if (debugmode) then
_detalhes.mythic_plus.last_mythicrun_chart = mythicDungeonCharts.ChartTable
end
if (verbosemode) then
mythicDungeonCharts:Debug ("OnStartMythicDungeon() success")
end
end
function mythicDungeonCharts:OnEndMythicDungeon()
@@ -235,9 +244,17 @@ function mythicDungeonCharts:OnEndMythicDungeon()
mythicDungeonCharts:Debug ("Dungeon ended, chart data capture stopped")
C_Timer.After (_detalhes.mythic_plus.delay_to_show_graphic or 5, mythicDungeonCharts.ShowChart)
_detalhes.mythic_plus.delay_to_show_graphic = 20
C_Timer.After (_detalhes.mythic_plus.delay_to_show_graphic or 20, mythicDungeonCharts.ShowChart)
if (verbosemode) then
mythicDungeonCharts:Debug ("OnEndMythicDungeon() success")
end
else
mythicDungeonCharts:Debug ("Dungeon ended, no chart data was running")
if (verbosemode) then
mythicDungeonCharts:Debug ("OnEndMythicDungeon() fail")
end
end
end
@@ -245,6 +262,8 @@ mythicDungeonCharts:RegisterEvent ("COMBAT_MYTHICDUNGEON_START", "OnStartMythicD
mythicDungeonCharts:RegisterEvent ("COMBAT_MYTHICDUNGEON_END", "OnEndMythicDungeon")
mythicDungeonCharts:RegisterEvent ("COMBAT_BOSS_DEFEATED", "OnBossDefeated")
-- /run _G.DetailsMythicDungeonChartHandler.ShowChart(); DetailsMythicDungeonChartFrame.ShowChartFrame()
function mythicDungeonCharts.ShowChart()
if (not mythicDungeonCharts.Frame) then
@@ -324,41 +343,93 @@ function mythicDungeonCharts.ShowChart()
f.BossWidgetsFrame.GraphPinGlow:SetBlendMode ("ADD")
f.BossWidgetsFrame.GraphPinGlow:SetPoint ("center", f.BossWidgetsFrame.GraphPin, "center", 0, 0)
--> show animation
--> single animation group
local MainAnimationGroup = f:CreateAnimationGroup ("fAnimationGroup")
MainAnimationGroup:SetLooping ("NONE")
--> widgets:
----------------------------------------------
local NewTexture1 = f:CreateTexture ("NewTexture1Texture", "ARTWORK")
NewTexture1:SetTexture ([[Interface\Scenarios\ScenarioParts]])
NewTexture1:SetDrawLayer ("ARTWORK", 0)
NewTexture1:SetPoint ("center", f, "center", 0, 0)
NewTexture1:SetSize (1200, 600)
NewTexture1:SetTexCoord (0.0010000000149012, 0.63868587493897, 0.0010000000149012, 0.19874391555786)
--> animations for NewTexture1
--[[
NewTexture1.scale = MainAnimationGroup:CreateAnimation ("SCALE")
NewTexture1.scale:SetTarget (f)
NewTexture1.scale:SetOrder (1)
NewTexture1.scale:SetDuration (0.090000038147)
NewTexture1.scale:SetStartDelay (0)
NewTexture1.scale:SetEndDelay (0)
NewTexture1.scale:SetFromScale (1, 1)
NewTexture1.scale:SetToScale (1.10, 1.10)
NewTexture1.scale:SetOrigin ("center", 0, 0)
NewTexture1.scale = MainAnimationGroup:CreateAnimation ("SCALE")
NewTexture1.scale:SetTarget (f)
NewTexture1.scale:SetOrder (2)
NewTexture1.scale:SetDuration (0.090000038147)
NewTexture1.scale:SetStartDelay (0)
NewTexture1.scale:SetEndDelay (0)
NewTexture1.scale:SetFromScale (1.10, 1.10)
NewTexture1.scale:SetToScale (1, 1)
NewTexture1.scale:SetOrigin ("center", 0, 0)
--]]
NewTexture1.alpha = MainAnimationGroup:CreateAnimation ("ALPHA")
NewTexture1.alpha:SetTarget (f)
NewTexture1.alpha:SetOrder (1)
NewTexture1.alpha:SetDuration (0.090000038147)
NewTexture1.alpha:SetStartDelay (0)
NewTexture1.alpha:SetEndDelay (0)
NewTexture1.alpha:SetFromAlpha (0)
NewTexture1.alpha:SetToAlpha (0.5)
NewTexture1.alpha = MainAnimationGroup:CreateAnimation ("ALPHA")
NewTexture1.alpha:SetTarget (f)
NewTexture1.alpha:SetOrder (2)
NewTexture1.alpha:SetDuration (0.090000038147)
NewTexture1.alpha:SetStartDelay (0)
NewTexture1.alpha:SetEndDelay (0)
NewTexture1.alpha:SetFromAlpha (0.5)
NewTexture1.alpha:SetToAlpha (1)
MainAnimationGroup:SetScript ("OnPlay", function()
NewTexture1:Hide()
end)
MainAnimationGroup:SetScript ("OnFinished", function()
NewTexture1:Hide()
end)
f:Hide()
function f.ShowChartFrame()
f:Show()
MainAnimationGroup:Play()
end
local closeButton = CreateFrame ("button", "$parentCloseButton", f, "UIPanelCloseButton")
closeButton:GetNormalTexture():SetDesaturated (true)
closeButton:SetWidth (20)
closeButton:SetHeight (20)
closeButton:SetPoint ("topright", f, "topright", 0, -3)
closeButton:SetWidth (24)
closeButton:SetHeight (24)
closeButton:SetPoint ("topright", f, "topright", 0, -1)
closeButton:SetFrameLevel (f:GetFrameLevel()+16)
local configButton = CreateFrame ("button", "$parentConfigButton", f)
configButton:SetWidth (14)
configButton:SetHeight (14)
configButton:SetPoint ("right", closeButton, "left", -2, 0)
configButton:SetFrameLevel (f:GetFrameLevel()+16)
configButton:SetScript ("OnClick", function()
local lowerInstance = _detalhes:GetLowerInstanceNumber()
if (lowerInstance) then
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lowerInstance), false, 15)
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lowerInstance), false, 15)
else
local instance1 = _detalhes:GetInstance (1)
if (instance1) then
_detalhes:OpenOptionsWindow (instance1, false, 18)
end
end
end)
local gearImage = configButton:CreateTexture (nil, "overlay")
gearImage:SetAllPoints()
gearImage:SetTexture ([[Interface\BUTTONS\UI-OptionsButton]])
gearImage:SetDesaturated (true)
gearImage:SetVertexColor (.4, .4, .4, 1)
local gearImage = configButton:CreateTexture (nil, "highlight")
gearImage:SetAllPoints()
gearImage:SetTexture ([[Interface\BUTTONS\UI-OptionsButton]])
gearImage:SetDesaturated (true)
--gearImage:SetVertexColor (.4, .4, .4, 1)
--enabled box
-- /run _G.DetailsMythicDungeonChartHandler.ShowChart(); DetailsMythicDungeonChartFrame.ShowChartFrame()
local on_switch_enable = function (_, _, state)
_detalhes.mythic_plus.show_damage_graphic = state
end
local enabledSwitch, enabledLabel = Details.gump:CreateSwitch (f, on_switch_enable, _detalhes.mythic_plus.show_damage_graphic, _, _, _, _, _, _, _, _, _, "Enabled", Details.gump:GetTemplate ("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"), "GameFontHighlightLeft")
enabledSwitch:SetAsCheckBox()
enabledSwitch.tooltip = "Show this chart at the end of a mythic dungeon run.\n\nIf disabled, you can reactivate it again at the options panel > streamer settings."
enabledLabel:SetPoint ("right", closeButton, "left", -22, 0)
enabledSwitch:SetSize (16, 16)
Details.gump:SetFontColor (enabledLabel, "gray")
enabledSwitch.checked_texture:SetVertexColor (.6, .6, .6)
local leftDivisorLine = f.BossWidgetsFrame:CreateTexture (nil, "overlay")
leftDivisorLine:SetSize (2, f.ChartFrame.Graphic:GetHeight())
@@ -428,17 +499,28 @@ function mythicDungeonCharts.ShowChart()
mythicDungeonCharts.Frame.ChartFrame:Reset()
if (not mythicDungeonCharts.ChartTable and debugmode) then
--development
if (Details.mythic_plus.last_mythicrun_chart) then
--load the last mythic dungeon run chart
local t = {}
Details:GetFramework().table.copy (t, Details.mythic_plus.last_mythicrun_chart)
mythicDungeonCharts.ChartTable = t
if (not mythicDungeonCharts.ChartTable) then
if (debugmode) then
--development
if (Details.mythic_plus.last_mythicrun_chart) then
--load the last mythic dungeon run chart
local t = {}
Details:GetFramework().table.copy (t, Details.mythic_plus.last_mythicrun_chart)
mythicDungeonCharts.ChartTable = t
mythicDungeonCharts:Debug ("no valid data, saved data loaded")
else
mythicDungeonCharts:Debug ("no valid data and no saved data, canceling")
mythicDungeonCharts.Frame:Hide()
return
end
else
mythicDungeonCharts.Frame:Hide()
mythicDungeonCharts:Debug ("no data found, canceling")
if (verbosemode) then
mythicDungeonCharts:Debug ("mythicDungeonCharts.ShowChart() failed: no chart table")
end
return
end
else
mythicDungeonCharts.Frame:Hide()
return
end
local charts = mythicDungeonCharts.ChartTable.Players
@@ -526,7 +608,11 @@ function mythicDungeonCharts.ShowChart()
mythicDungeonCharts.Frame.TitleText:SetText (mythicDungeonCharts.ChartTable.DungeonName and phrase .. mythicDungeonCharts.ChartTable.DungeonName or phrase)
mythicDungeonCharts.Frame:Show()
mythicDungeonCharts.Frame.ShowChartFrame()
if (verbosemode) then
mythicDungeonCharts:Debug ("mythicDungeonCharts.ShowChart() success")
end
end
local showID = 0
+2
View File
@@ -905,6 +905,7 @@ local default_profile = {
--> PvP
only_pvp_frags = false,
color_by_arena_team = true,
show_arena_role_icon = true,
--> window settings
max_window_size = {width = 480, height = 450},
@@ -1014,6 +1015,7 @@ local default_profile = {
overall_clear_newboss = true,
overall_clear_newchallenge = true,
overall_clear_logout = false,
data_cleanup_logout = false,
close_shields = false,
pvp_as_group = true,
use_battleground_server_parser = true,
+9 -1
View File
@@ -4491,7 +4491,7 @@ function _detalhes:FastPSUpdate (enabled)
end
-- search key: ~row
-- search key: ~row ~bar ~updatebar
function _detalhes:InstanceRefreshRows (instancia)
if (instancia) then
@@ -4554,6 +4554,8 @@ function _detalhes:InstanceRefreshRows (instancia)
if (self.row_info.use_spec_icons) then
icon_texture = self.row_info.spec_file
end
local icon_force_grayscale = self.row_info.icon_grayscale
--custom right text
local custom_right_text_enabled = self.row_info.textR_enable_custom_text
@@ -4591,6 +4593,12 @@ function _detalhes:InstanceRefreshRows (instancia)
row.icone_classe:SetHeight (height)
row.icone_classe:SetWidth (height)
if (icon_force_grayscale) then
row.icone_classe:SetDesaturated (true)
else
row.icone_classe:SetDesaturated (false)
end
--> icon and texture anchors
if (not is_mirror) then