Round of fixes

This commit is contained in:
Tercio Jose
2023-03-24 15:15:56 -03:00
parent 383f21ed7c
commit 7cf01d114b
6 changed files with 265 additions and 183 deletions
+11 -14
View File
@@ -2,13 +2,9 @@ if (true) then
--return
end
local Details = _G.Details
local DF = _G.DetailsFramework
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details")
--local SharedMedia = _G.LibStub:GetLibrary("LibSharedMedia-3.0")
--local LDB = _G.LibStub("LibDataBroker-1.1", true)
--local LDBIcon = LDB and _G.LibStub("LibDBIcon-1.0", true)
--options panel namespace
Details.options = {}
@@ -26,7 +22,6 @@ local options_text_template = DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE")
local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local options_switch_template = DF:GetTemplate("switch", "OPTIONS_CHECKBOX_TEMPLATE")
local options_slider_template = DF:GetTemplate("slider", "OPTIONS_SLIDER_TEMPLATE")
local options_button_template = DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE")
local options_button_template_selected = DF.table.copy({}, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
options_button_template_selected.backdropbordercolor = {1, .8, .2}
@@ -95,7 +90,7 @@ function Details.options.InitializeOptionsWindow(instance)
--what the window is showing
local atributo = instance.atributo
local sub_atributo = instance.sub_atributo
if (atributo == 5) then --custom
local CustomObject = _detalhes.custom [sub_atributo]
if (not CustomObject) then
@@ -108,7 +103,7 @@ function Details.options.InitializeOptionsWindow(instance)
end
else
local modo = instance.modo
if (modo == 1) then --solo plugin
atributo = _detalhes.SoloTables.Mode or 1
local SoloInfo = _detalhes.SoloTables.Menu [atributo]
@@ -117,7 +112,7 @@ function Details.options.InitializeOptionsWindow(instance)
else
instanceList [#instanceList+1] = {value = index, label = "#".. index .. " unknown", onclick = onSelectInstance, icon = ""}
end
elseif (modo == 4) then --raid plugin
local plugin_name = instance.current_raid_plugin or instance.last_raid_plugin
if (plugin_name) then
@@ -298,18 +293,20 @@ function Details.options.InitializeOptionsWindow(instance)
[15] = "Broadcaster Tools",
[16] = Loc ["STRING_OPTIONSMENU_SPELLS"],
[17] = Loc ["STRING_OPTIONSMENU_DATACHART"],
[18] = "Mythic Dungeon",
[19] = "Search Results",
[20] = "Combat Log",
}
local optionsSectionsOrder = {
1, "", 3, 4, "", 5, 6, 7, 12, 13, "", 9, 2, 8, 10, 11, 18, "", 14, 15, 16, 17, "", 19
1, 20, "", 3, 4, "", 5, 6, 7, 12, 13, "", 9, 2, 8, 10, 11, 18, "", 14, 15, 16, 17, "", 19
}
local maxSectionIds = 19
local maxSectionIds = 0
for k in pairs(sectionsName) do
maxSectionIds = maxSectionIds + 1
end
Details.options.maxSectionIds = maxSectionIds
local buttonYPosition = -40
@@ -403,7 +400,7 @@ function Details.options.InitializeOptionsWindow(instance)
Details:OpenOptionsWindow(_G.DetailsOptionsWindow.instance)
end
end
Details.options.SelectOptionsSection(1)
end
+194 -127
View File
@@ -24,6 +24,7 @@ end
~17 - charts data
~18 - mythic dungeon
~19 - search results
~20 - combatlog options
--]]
@@ -226,31 +227,8 @@ do
return eraseDataOptions
end
--deathlog limit
local onSelectDeathLogLimit = function(_, _, limitAmount)
_detalhes:SetDeathLogLimit(limitAmount)
end
local DeathLogLimitOptions = {
{value = 16, label = "16 Records", onclick = onSelectDeathLogLimit, icon = [[Interface\WorldStateFrame\ColumnIcon-GraveyardDefend0]]},
{value = 32, label = "32 Records", onclick = onSelectDeathLogLimit, icon = [[Interface\WorldStateFrame\ColumnIcon-GraveyardDefend0]]},
{value = 45, label = "45 Records", onclick = onSelectDeathLogLimit, icon = [[Interface\WorldStateFrame\ColumnIcon-GraveyardDefend0]]},
}
local buildDeathLogLimitMenu = function()
return DeathLogLimitOptions
end
local sectionOptions = {
{type = "label", get = function() return Loc ["STRING_OPTIONS_GENERAL_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--segments locked
type = "toggle",
get = function() return Details.instances_segments_locked end,
set = function(self, fixedparam, value)
Details.instances_segments_locked = value
end,
name = Loc ["STRING_OPTIONS_LOCKSEGMENTS"],
desc = Loc ["STRING_OPTIONS_LOCKSEGMENTS_DESC"],
boxfirst = true,
},
{--animate bars
type = "toggle",
get = function() return _detalhes.use_row_animations end,
@@ -329,48 +307,16 @@ do
},
{type = "blank"},
{type = "label", get = function() return "Segments:" end, text_template = subSectionTitleTextTemplate},
{--auto erase settings | erase data
type = "select",
get = function() return _detalhes.segments_auto_erase end,
values = function()
return buildEraseDataMenu()
end,
name = Loc ["STRING_OPTIONS_ED"],
desc = Loc ["STRING_OPTIONS_ED_DESC"],
},
{--auto erase trash segments
{--segments locked
type = "toggle",
get = function() return _detalhes.trash_auto_remove end,
get = function() return Details.instances_segments_locked end,
set = function(self, fixedparam, value)
_detalhes.trash_auto_remove = value
afterUpdate()
Details.instances_segments_locked = value
end,
name = Loc ["STRING_OPTIONS_CLEANUP"],
desc = Loc ["STRING_OPTIONS_CLEANUP_DESC"],
boxfirst = true,
},
{--auto erase world segments
type = "toggle",
get = function() return _detalhes.world_combat_is_trash end,
set = function(self, fixedparam, value)
_detalhes.world_combat_is_trash = value
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_PERFORMANCE_ERASEWORLD"],
desc = Loc ["STRING_OPTIONS_PERFORMANCE_ERASEWORLD_DESC"],
boxfirst = true,
},
{--erase chart data
type = "toggle",
get = function() return _detalhes.clear_graphic end,
set = function(self, fixedparam, value)
_detalhes.clear_graphic = value
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_ERASECHARTDATA"],
desc = Loc ["STRING_OPTIONS_ERASECHARTDATA_DESC"],
name = Loc ["STRING_OPTIONS_LOCKSEGMENTS"],
desc = Loc ["STRING_OPTIONS_LOCKSEGMENTS_DESC"],
boxfirst = true,
},
@@ -424,52 +370,50 @@ do
},
{type = "blank"},
{type = "label", get = function() return "Auto Erase:" end, text_template = subSectionTitleTextTemplate},
{--pvp frags
type = "toggle",
get = function() return _detalhes.only_pvp_frags end,
set = function(self, fixedparam, value)
_detalhes.only_pvp_frags = value
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_PVPFRAGS"],
desc = Loc ["STRING_OPTIONS_PVPFRAGS_DESC"],
boxfirst = true,
},
{--damage taken everything
type = "toggle",
get = function() return _detalhes.damage_taken_everything end,
set = function(self, fixedparam, value)
_detalhes.damage_taken_everything = value
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_DTAKEN_EVERYTHING"],
desc = Loc ["STRING_OPTIONS_DTAKEN_EVERYTHING_DESC"],
boxfirst = true,
},
{--death log size
{--auto erase settings | erase data
type = "select",
get = function() return _detalhes.deadlog_events end,
get = function() return _detalhes.segments_auto_erase end,
values = function()
return buildDeathLogLimitMenu()
return buildEraseDataMenu()
end,
name = Loc ["STRING_OPTIONS_DEATHLIMIT"],
desc = Loc ["STRING_OPTIONS_DEATHLIMIT_DESC"],
name = Loc ["STRING_OPTIONS_ED"],
desc = Loc ["STRING_OPTIONS_ED_DESC"],
},
{--death log min healing
type = "range",
get = function() return _detalhes.deathlog_healingdone_min end,
{--auto erase trash segments
type = "toggle",
get = function() return _detalhes.trash_auto_remove end,
set = function(self, fixedparam, value)
_detalhes.deathlog_healingdone_min = value
_detalhes.trash_auto_remove = value
afterUpdate()
end,
min = 0,
max = 100000,
step = 1,
name = Loc ["STRING_OPTIONS_DEATHLOG_MINHEALING"],
desc = Loc ["STRING_OPTIONS_DEATHLOG_MINHEALING_DESC"],
name = Loc ["STRING_OPTIONS_CLEANUP"],
desc = Loc ["STRING_OPTIONS_CLEANUP_DESC"],
boxfirst = true,
},
{--auto erase world segments
type = "toggle",
get = function() return _detalhes.world_combat_is_trash end,
set = function(self, fixedparam, value)
_detalhes.world_combat_is_trash = value
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_PERFORMANCE_ERASEWORLD"],
desc = Loc ["STRING_OPTIONS_PERFORMANCE_ERASEWORLD_DESC"],
boxfirst = true,
},
{--erase chart data
type = "toggle",
get = function() return _detalhes.clear_graphic end,
set = function(self, fixedparam, value)
_detalhes.clear_graphic = value
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_ERASECHARTDATA"],
desc = Loc ["STRING_OPTIONS_ERASECHARTDATA_DESC"],
boxfirst = true,
},
{type = "breakline"},
@@ -601,31 +545,6 @@ do
{type = "blank"},
{--click through
type = "toggle",
get = function() return currentInstance.clickthrough_window end,
set = function(self, fixedparam, value)
Details:InstanceGroupCall(currentInstance, "UpdateClickThroughSettings", nil, value, value, value)
afterUpdate()
end,
name = "Click Through",
desc = "Click Through",
boxfirst = true,
},
{--click only in combat
type = "toggle",
get = function() return currentInstance.clickthrough_incombatonly end,
set = function(self, fixedparam, value)
Details:InstanceGroupCall(currentInstance, "UpdateClickThroughSettings", value)
afterUpdate()
end,
name = "Click Through Only in Combat",
desc = "Click Through Only in Combat",
boxfirst = true,
},
{type = "blank"},
{type = "label", get = function() return "Immersion" end, text_template = subSectionTitleTextTemplate}, --localize-me
{--show pets when solo
type = "toggle",
@@ -2948,6 +2867,29 @@ do
desc = Loc ["STRING_OPTIONS_INSTANCE_BACKDROP_DESC"],
},
{type = "blank"},
{--click through
type = "toggle",
get = function() return currentInstance.clickthrough_window end,
set = function(self, fixedparam, value)
Details:InstanceGroupCall(currentInstance, "UpdateClickThroughSettings", nil, value, value, value)
afterUpdate()
end,
name = "Click Through",
desc = "Click Through",
boxfirst = true,
},
{--click only in combat
type = "toggle",
get = function() return currentInstance.clickthrough_incombatonly end,
set = function(self, fixedparam, value)
Details:InstanceGroupCall(currentInstance, "UpdateClickThroughSettings", value)
afterUpdate()
end,
name = "Click Through Only in Combat",
desc = "Click Through Only in Combat",
boxfirst = true,
},
{type = "blank"},
{--disable grouping
@@ -6982,7 +6924,133 @@ do
end
--[[]
-- ~20 combat log settings
do
local buildSection = function(sectionFrame)
--deathlog limit
local onSelectDeathLogLimit = function(_, _, limitAmount)
_detalhes:SetDeathLogLimit(limitAmount)
end
local DeathLogLimitOptions = {
{value = 16, label = "16 Records", onclick = onSelectDeathLogLimit, icon = [[Interface\WorldStateFrame\ColumnIcon-GraveyardDefend0]]},
{value = 32, label = "32 Records", onclick = onSelectDeathLogLimit, icon = [[Interface\WorldStateFrame\ColumnIcon-GraveyardDefend0]]},
{value = 45, label = "45 Records", onclick = onSelectDeathLogLimit, icon = [[Interface\WorldStateFrame\ColumnIcon-GraveyardDefend0]]},
}
local buildDeathLogLimitMenu = function()
return DeathLogLimitOptions
end
local sectionOptions = {
{type = "label", get = function() return "Death Log Options:" end, text_template = subSectionTitleTextTemplate},
{--reverse death logs
type = "toggle",
get = function() return Details.combat_log.inverse_deathlog_raid end,
set = function(self, fixedparam, value)
Details.combat_log.inverse_deathlog_raid = value
end,
name = "Invert Death Log (Raid)",
desc = "Invert Death Log (Raid)",
},
{--reverse death logs
type = "toggle",
get = function() return Details.combat_log.inverse_deathlog_mplus end,
set = function(self, fixedparam, value)
Details.combat_log.inverse_deathlog_mplus = value
end,
name = "Invert Death Log (M+)",
desc = "Invert Death Log (M+)",
},
{--reverse death logs
type = "toggle",
get = function() return Details.combat_log.inverse_deathlog_overalldata end,
set = function(self, fixedparam, value)
Details.combat_log.inverse_deathlog_overalldata = value
end,
name = "Invert Death Log (Overall Data)",
desc = "Invert Death Log (Overall Data)",
},
{--pvp frags
type = "toggle",
get = function() return _detalhes.only_pvp_frags end,
set = function(self, fixedparam, value)
_detalhes.only_pvp_frags = value
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_PVPFRAGS"],
desc = Loc ["STRING_OPTIONS_PVPFRAGS_DESC"],
boxfirst = true,
},
{--death log size
type = "select",
get = function() return _detalhes.deadlog_events end,
values = function()
return buildDeathLogLimitMenu()
end,
name = Loc ["STRING_OPTIONS_DEATHLIMIT"],
desc = Loc ["STRING_OPTIONS_DEATHLIMIT_DESC"],
},
{--death log min healing
type = "range",
get = function() return _detalhes.deathlog_healingdone_min end,
set = function(self, fixedparam, value)
_detalhes.deathlog_healingdone_min = value
afterUpdate()
end,
min = 0,
max = 100000,
step = 1,
name = Loc ["STRING_OPTIONS_DEATHLOG_MINHEALING"],
desc = Loc ["STRING_OPTIONS_DEATHLOG_MINHEALING_DESC"],
},
{type = "blank"},
{type = "label", get = function() return "Damage Options:" end, text_template = subSectionTitleTextTemplate},
{--damage taken everything
type = "toggle",
get = function() return _detalhes.damage_taken_everything end,
set = function(self, fixedparam, value)
_detalhes.damage_taken_everything = value
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_DTAKEN_EVERYTHING"],
desc = Loc ["STRING_OPTIONS_DTAKEN_EVERYTHING_DESC"],
boxfirst = true,
},
{type = "blank"},
{type = "label", get = function() return "Class Options:" end, text_template = subSectionTitleTextTemplate},
{--damage taken everything
type = "toggle",
get = function() return Details.combat_log.track_hunter_frenzy end,
set = function(self, fixedparam, value)
Details.combat_log.track_hunter_frenzy = value
afterUpdate()
Details:ClearParserCache()
end,
name = DF:AddClassIconToText("Hunter Track Pet Frenzy", false, "HUNTER"),
desc = "Hunter Track Pet Frenzy",
boxfirst = true,
},
}
sectionFrame.sectionOptions = sectionOptions
sectionOptions.always_boxfirst = true
DF:BuildMenu(sectionFrame, sectionOptions, startX, startY-20, heightSize, false, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
end
tinsert(Details.optionsSection, buildSection)
end
--[=[
do
local buildSection = function(sectionFrame)
@@ -6995,5 +7063,4 @@ do
tinsert(Details.optionsSection, buildSection)
end
--]]
--]=]