Code changes, see commit description
Combat Objects which has been discarded due to any reason will have the boolean member: __destroyed set to true. With this change, 3rd party code can see if the data cached is up to date or obsolete. - Removed several deprecated code from March 2023 and earlier. - Large amount of code cleanup and refactoring, some functions got renamed, they are listed below: * TravarTempos renamed to LockActivityTime. * ClearTempTables renamed to ClearCacheTables. * SpellIsDot renamed to SetAsDotSpell. * FlagCurrentCombat remamed to FlagNewCombat_PVPState. * UpdateContainerCombatentes renamed to UpdatePetCache. * segmentClass:AddCombat(combatObject) renamed to Details222.Combat.AddCombat(combatToBeAdded) - CurrentCombat.verifica_combate timer is now obsolete. - Details.last_closed_combat is now obsolete. - Details.EstaEmCombate is now obsolete. - Details.options is now obsolete. - Added: Details:RemoveSegmentByCombatObject(combatObject) - Spec Guess Timers are now stored within Details222.GuessSpecSchedules.Schedules, all timers are killed at the end of the combat or at a data reset. - Initial time to send startup signal reduced from 5 to 4 seconds. - Fixed some division by zero on ptr 10.1.5. - Fixed DETAILS_STARTED event not triggering in some cases due to 'event not registered'.
This commit is contained in:
@@ -959,7 +959,12 @@ local updateSpellBar = function(spellBar, index, actorName, combatObject, scroll
|
||||
local r, g, b = Details:GetSpellSchoolColor(spellTable.spellschool or 1)
|
||||
spellBar.statusBar:SetStatusBarColor(r, g, b, 0.963)
|
||||
|
||||
spellBar.average = value / spellTable.counter
|
||||
if (spellTable.counter > 0) then
|
||||
spellBar.average = value / spellTable.counter
|
||||
else
|
||||
spellBar.average = 0.0001
|
||||
end
|
||||
|
||||
spellBar.combatTime = combatTime
|
||||
|
||||
---@type fontstring
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
local Details = Details
|
||||
local GameTooltip = GameTooltip
|
||||
local detailsFramework = DetailsFramework
|
||||
local unpack = unpack
|
||||
local CreateFrame = CreateFrame
|
||||
local GetSpellInfo = GetSpellInfo
|
||||
|
||||
local auras_tab_create = function(tab, frame)
|
||||
local DF = DetailsFramework
|
||||
local createAuraTabOnBreakdownWindow = function(tab, frame)
|
||||
local scroll_line_amount = 22
|
||||
local scroll_width = 410
|
||||
local scrollHeight = 445
|
||||
@@ -25,192 +25,159 @@ local auras_tab_create = function(tab, frame)
|
||||
426, 630, 729, 775, 820
|
||||
}
|
||||
|
||||
local line_onenter = function(self)
|
||||
local onEnterLine = function(self)
|
||||
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
|
||||
Details:GameTooltipSetSpellByID (self.spellID)
|
||||
Details:GameTooltipSetSpellByID(self.spellID)
|
||||
GameTooltip:Show()
|
||||
self:SetBackdropColor(1, 1, 1, .2)
|
||||
end
|
||||
|
||||
local line_onleave = function(self)
|
||||
local onLeaveLine = function(self)
|
||||
GameTooltip:Hide()
|
||||
self:SetBackdropColor(unpack(self.BackgroundColor))
|
||||
end
|
||||
|
||||
local line_onclick = function(self)
|
||||
local onClickLine = function(self)
|
||||
|
||||
end
|
||||
|
||||
--buff scroll
|
||||
--icon - name - applications - refreshes - uptime
|
||||
--
|
||||
|
||||
--local wa_button = function(self, mouseButton, spellID, auraType)
|
||||
-- local spellName, _, spellIcon = GetSpellInfo(spellID)
|
||||
-- Details:OpenAuraPanel (spellID, spellName, spellIcon, nil, auraType == "BUFF" and 4 or 2, 1)
|
||||
--end
|
||||
|
||||
local scroll_createline = function(self, index)
|
||||
local createLineScroll = function(self, index)
|
||||
local line = CreateFrame("button", "$parentLine" .. index, self,"BackdropTemplate")
|
||||
line:SetPoint("topleft", self, "topleft", 1, -((index-1)*(scroll_line_height+1)))
|
||||
line:SetSize(scroll_width -2, scroll_line_height)
|
||||
line:SetScript("OnEnter", line_onenter)
|
||||
line:SetScript("OnLeave", line_onleave)
|
||||
line:SetScript("OnClick", line_onclick)
|
||||
line:SetScript("OnEnter", onEnterLine)
|
||||
line:SetScript("OnLeave", onLeaveLine)
|
||||
line:SetScript("OnClick", onClickLine)
|
||||
|
||||
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
line:SetBackdrop({bgFile =[[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
line:SetBackdropColor(0, 0, 0, 0.2)
|
||||
|
||||
local icon = line:CreateTexture("$parentIcon", "overlay")
|
||||
icon:SetSize(scroll_line_height -2 , scroll_line_height - 2)
|
||||
local name = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
|
||||
local uptime = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
|
||||
local apply = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
|
||||
local refresh = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
|
||||
local iconTexture = line:CreateTexture("$parentIcon", "overlay")
|
||||
iconTexture:SetSize(scroll_line_height -2 , scroll_line_height - 2)
|
||||
local nameLabel = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
|
||||
local uptimeLabel = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
|
||||
local applyLabel = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
|
||||
local refreshLabel = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
|
||||
|
||||
--local waButton = DF:CreateButton(line, wa_button, 18, 18)
|
||||
--waButton:SetIcon ([[Interface\AddOns\WeakAuras\Media\Textures\icon]])
|
||||
detailsFramework:SetFontSize(nameLabel, text_size)
|
||||
detailsFramework:SetFontSize(uptimeLabel, text_size)
|
||||
detailsFramework:SetFontSize(applyLabel, text_size)
|
||||
detailsFramework:SetFontSize(refreshLabel, text_size)
|
||||
|
||||
DF:SetFontSize(name, text_size)
|
||||
DF:SetFontSize(uptime, text_size)
|
||||
DF:SetFontSize(apply, text_size)
|
||||
DF:SetFontSize(refresh, text_size)
|
||||
iconTexture:SetPoint("left", line, "left", 2, 0)
|
||||
nameLabel:SetPoint("left", iconTexture, "right", 2, 0)
|
||||
uptimeLabel:SetPoint("left", line, "left", 186, 0)
|
||||
applyLabel:SetPoint("left", line, "left", 276, 0)
|
||||
refreshLabel:SetPoint("left", line, "left", 322, 0)
|
||||
|
||||
icon:SetPoint("left", line, "left", 2, 0)
|
||||
name:SetPoint("left", icon, "right", 2, 0)
|
||||
uptime:SetPoint("left", line, "left", 186, 0)
|
||||
apply:SetPoint("left", line, "left", 276, 0)
|
||||
refresh:SetPoint("left", line, "left", 322, 0)
|
||||
--waButton:SetPoint("left", line, "left", 372, 0)
|
||||
line.Icon = iconTexture
|
||||
line.Name = nameLabel
|
||||
line.Uptime = uptimeLabel
|
||||
line.Apply = applyLabel
|
||||
line.Refresh = refreshLabel
|
||||
|
||||
line.Icon = icon
|
||||
line.Name = name
|
||||
line.Uptime = uptime
|
||||
line.Apply = apply
|
||||
line.Refresh = refresh
|
||||
--line.WaButton = waButton
|
||||
nameLabel:SetJustifyH("left")
|
||||
uptimeLabel:SetJustifyH("left")
|
||||
|
||||
name:SetJustifyH("left")
|
||||
uptime:SetJustifyH("left")
|
||||
|
||||
apply:SetJustifyH("center")
|
||||
refresh:SetJustifyH("center")
|
||||
apply:SetWidth(26)
|
||||
refresh:SetWidth(26)
|
||||
applyLabel:SetJustifyH("center")
|
||||
refreshLabel:SetJustifyH("center")
|
||||
applyLabel:SetWidth(26)
|
||||
refreshLabel:SetWidth(26)
|
||||
|
||||
return line
|
||||
end
|
||||
|
||||
local line_bg_color = {{1, 1, 1, .1}, {1, 1, 1, 0}}
|
||||
|
||||
local scroll_buff_refresh = function(self, data, offset, total_lines)
|
||||
|
||||
local haveWA = false --_G.WeakAuras
|
||||
local lineBackgroundColor = {{1, 1, 1, .1}, {1, 1, 1, 0}}
|
||||
|
||||
local scrollRefreshBuffs = function(self, data, offset, total_lines)
|
||||
for i = 1, total_lines do
|
||||
local index = i + offset
|
||||
local aura = data [index]
|
||||
local aura = data[index]
|
||||
|
||||
if (aura) then
|
||||
local line = self:GetLine (i)
|
||||
local line = self:GetLine(i)
|
||||
line.spellID = aura.spellID
|
||||
line.Icon:SetTexture(aura [1])
|
||||
line.Icon:SetTexture(aura[1])
|
||||
|
||||
line.Icon:SetTexCoord(.1, .9, .1, .9)
|
||||
|
||||
line.Name:SetText(aura [2])
|
||||
line.Uptime:SetText(DF:IntegerToTimer(aura [3]) .. " (|cFFBBAAAA" .. math.floor(aura [6]) .. "%|r)")
|
||||
line.Apply:SetText(aura [4])
|
||||
line.Refresh:SetText(aura [5])
|
||||
line.Name:SetText(aura[2])
|
||||
line.Uptime:SetText(detailsFramework:IntegerToTimer(aura[3]) .. "(|cFFBBAAAA" .. math.floor(aura[6]) .. "%|r)")
|
||||
line.Apply:SetText(aura[4])
|
||||
line.Refresh:SetText(aura[5])
|
||||
|
||||
--if (haveWA) then
|
||||
-- line.WaButton:SetClickFunction(wa_button, aura.spellID, line.AuraType)
|
||||
--else
|
||||
-- line.WaButton:Disable()
|
||||
--end
|
||||
|
||||
if (i%2 == 0) then
|
||||
line:SetBackdropColor(unpack(line_bg_color [1]))
|
||||
line.BackgroundColor = line_bg_color [1]
|
||||
if (i % 2 == 0) then
|
||||
line:SetBackdropColor(unpack(lineBackgroundColor[1]))
|
||||
line.BackgroundColor = lineBackgroundColor[1]
|
||||
else
|
||||
line:SetBackdropColor(unpack(line_bg_color [2]))
|
||||
line.BackgroundColor = line_bg_color [2]
|
||||
line:SetBackdropColor(unpack(lineBackgroundColor[2]))
|
||||
line.BackgroundColor = lineBackgroundColor[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local create_titledesc_frame = function(anchorWidget, desc)
|
||||
local f = CreateFrame("frame", nil, frame)
|
||||
f:SetSize(40, 20)
|
||||
f:SetPoint("center", anchorWidget, "center")
|
||||
f:SetScript("OnEnter", function()
|
||||
GameTooltip:SetOwner(f, "ANCHOR_TOPRIGHT")
|
||||
local createTitleDesc_Frame = function(anchorWidget, desc)
|
||||
local newTitleDescFrame = CreateFrame("frame", nil, frame)
|
||||
newTitleDescFrame:SetSize(40, 20)
|
||||
newTitleDescFrame:SetPoint("center", anchorWidget, "center")
|
||||
|
||||
newTitleDescFrame:SetScript("OnEnter", function()
|
||||
GameTooltip:SetOwner(newTitleDescFrame, "ANCHOR_TOPRIGHT")
|
||||
GameTooltip:AddLine(desc)
|
||||
GameTooltip:Show()
|
||||
end)
|
||||
f:SetScript("OnLeave", function()
|
||||
|
||||
newTitleDescFrame:SetScript("OnLeave", function()
|
||||
GameTooltip:Hide()
|
||||
end)
|
||||
return f
|
||||
|
||||
return newTitleDescFrame
|
||||
end
|
||||
|
||||
|
||||
|
||||
local buffLabel = DF:CreateLabel(frame, "Buff Name")
|
||||
local buffLabel = detailsFramework:CreateLabel(frame, "Buff Name")
|
||||
buffLabel:SetPoint(headerOffsetsBuffs[1], -10)
|
||||
local uptimeLabel = DF:CreateLabel(frame, "Uptime")
|
||||
local uptimeLabel = detailsFramework:CreateLabel(frame, "Uptime")
|
||||
uptimeLabel:SetPoint(headerOffsetsBuffs[2], -10)
|
||||
|
||||
local appliedLabel = DF:CreateLabel(frame, "A")
|
||||
local appliedLabel = detailsFramework:CreateLabel(frame, "A")
|
||||
appliedLabel:SetPoint(headerOffsetsBuffs[3], -10)
|
||||
create_titledesc_frame (appliedLabel.widget, "applications")
|
||||
createTitleDesc_Frame(appliedLabel.widget, "applications")
|
||||
|
||||
local refreshedLabel = DF:CreateLabel(frame, "R")
|
||||
local refreshedLabel = detailsFramework:CreateLabel(frame, "R")
|
||||
refreshedLabel:SetPoint(headerOffsetsBuffs[4], -10)
|
||||
create_titledesc_frame (refreshedLabel.widget, "refreshes")
|
||||
createTitleDesc_Frame(refreshedLabel.widget, "refreshes")
|
||||
|
||||
--local waLabel = DF:CreateLabel(frame, "WA")
|
||||
--waLabel:SetPoint(headerOffsetsBuffs[5], -10)
|
||||
--create_titledesc_frame (waLabel.widget, "create weak aura")
|
||||
|
||||
local buffScroll = DF:CreateScrollBox (frame, "$parentBuffUptimeScroll", scroll_buff_refresh, {}, scroll_width, scrollHeight, scroll_line_amount, scroll_line_height)
|
||||
local buffScroll = detailsFramework:CreateScrollBox(frame, "$parentBuffUptimeScroll", scrollRefreshBuffs, {}, scroll_width, scrollHeight, scroll_line_amount, scroll_line_height)
|
||||
buffScroll:SetPoint("topleft", frame, "topleft", 5, -30)
|
||||
for i = 1, scroll_line_amount do
|
||||
local line = buffScroll:CreateLine (scroll_createline)
|
||||
local line = buffScroll:CreateLine(createLineScroll)
|
||||
line.AuraType = "BUFF"
|
||||
end
|
||||
DF:ReskinSlider(buffScroll)
|
||||
detailsFramework:ReskinSlider(buffScroll)
|
||||
tab.BuffScroll = buffScroll
|
||||
|
||||
--debuff scroll
|
||||
--icon - name - applications - refreshes - uptime
|
||||
--
|
||||
|
||||
local debuffLabel = DF:CreateLabel(frame, "Debuff Name")
|
||||
local debuffLabel = detailsFramework:CreateLabel(frame, "Debuff Name")
|
||||
debuffLabel:SetPoint(headerOffsetsDebuffs[1], -10)
|
||||
local uptimeLabel2 = DF:CreateLabel(frame, "Uptime")
|
||||
|
||||
local uptimeLabel2 = detailsFramework:CreateLabel(frame, "Uptime")
|
||||
uptimeLabel2:SetPoint(headerOffsetsDebuffs[2], -10)
|
||||
|
||||
local appliedLabel2 = DF:CreateLabel(frame, "A")
|
||||
local appliedLabel2 = detailsFramework:CreateLabel(frame, "A")
|
||||
appliedLabel2:SetPoint(headerOffsetsDebuffs[3], -10)
|
||||
create_titledesc_frame (appliedLabel2.widget, "applications")
|
||||
createTitleDesc_Frame(appliedLabel2.widget, "applications")
|
||||
|
||||
local refreshedLabel2 = DF:CreateLabel(frame, "R")
|
||||
local refreshedLabel2 = detailsFramework:CreateLabel(frame, "R")
|
||||
refreshedLabel2:SetPoint(headerOffsetsDebuffs[4], -10)
|
||||
create_titledesc_frame (refreshedLabel2.widget, "refreshes")
|
||||
createTitleDesc_Frame(refreshedLabel2.widget, "refreshes")
|
||||
|
||||
--local waLabel2 = DF:CreateLabel(frame, "WA")
|
||||
--waLabel2:SetPoint(headerOffsetsDebuffs[5], -10)
|
||||
--create_titledesc_frame (waLabel2.widget, "create weak aura")
|
||||
|
||||
local debuffScroll = DF:CreateScrollBox (frame, "$parentDebuffUptimeScroll", scroll_buff_refresh, {}, scroll_width, scrollHeight, scroll_line_amount, scroll_line_height)
|
||||
local debuffScroll = detailsFramework:CreateScrollBox(frame, "$parentDebuffUptimeScroll", scrollRefreshBuffs, {}, scroll_width, scrollHeight, scroll_line_amount, scroll_line_height)
|
||||
debuffScroll:SetPoint("topleft", frame, "topleft", debuffScrollStartX, -30)
|
||||
for i = 1, scroll_line_amount do
|
||||
local line = debuffScroll:CreateLine (scroll_createline)
|
||||
local line = debuffScroll:CreateLine(createLineScroll)
|
||||
line.AuraType = "DEBUFF"
|
||||
end
|
||||
DF:ReskinSlider(debuffScroll)
|
||||
detailsFramework:ReskinSlider(debuffScroll)
|
||||
|
||||
tab.DebuffScroll = debuffScroll
|
||||
|
||||
@@ -220,9 +187,9 @@ local auras_tab_create = function(tab, frame)
|
||||
end
|
||||
end
|
||||
|
||||
local auras_tab_fill = function(tab, player, combat)
|
||||
local aurasTabFillCallback = function(tab, player, combat)
|
||||
---@type actor
|
||||
local miscActor = combat:GetActor(4, player:name())
|
||||
local miscActor = combat:GetActor(DETAILS_ATTRIBUTE_MISC, player:Name())
|
||||
---@type number
|
||||
local combatTime = combat:GetCombatTime()
|
||||
|
||||
@@ -233,14 +200,11 @@ local auras_tab_fill = function(tab, player, combat)
|
||||
if (spellContainer) then
|
||||
for spellId, spellTable in spellContainer:ListSpells() do
|
||||
local spellName, _, spellIcon = GetSpellInfo(spellId)
|
||||
if (not spellTable.uptime) then
|
||||
--print(_GetSpellInfo(spellID))
|
||||
--dumpt(spellObject)
|
||||
end
|
||||
local uptime = spellTable.uptime or 0
|
||||
table.insert(newAuraTable, {spellIcon, spellName, uptime, spellTable.appliedamt, spellTable.refreshamt, uptime / combatTime * 100, spellID = spellId})
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(newAuraTable, Details.Sort3)
|
||||
tab.BuffScroll:SetData(newAuraTable)
|
||||
tab.BuffScroll:Refresh()
|
||||
@@ -255,6 +219,7 @@ local auras_tab_fill = function(tab, player, combat)
|
||||
table.insert(newAuraTable, {spellIcon, spellName, spellTable.uptime, spellTable.appliedamt, spellTable.refreshamt, spellTable.uptime / combatTime * 100, spellID = spellId})
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(newAuraTable, Details.Sort3)
|
||||
tab.DebuffScroll:SetData(newAuraTable)
|
||||
tab.DebuffScroll:Refresh()
|
||||
@@ -284,11 +249,11 @@ function Details:InitializeAurasTab()
|
||||
return true
|
||||
end,
|
||||
|
||||
auras_tab_fill, --[4] fill function
|
||||
aurasTabFillCallback, --[4] fill function
|
||||
|
||||
nil, --[5] onclick
|
||||
|
||||
auras_tab_create, --[6] oncreate
|
||||
createAuraTabOnBreakdownWindow, --[6] oncreate
|
||||
iconTableAuras --icon table
|
||||
)
|
||||
end
|
||||
+14
-13
@@ -2,12 +2,13 @@ if (true) then
|
||||
--return
|
||||
end
|
||||
|
||||
local addonName, Details222 = ...
|
||||
local Details = _G.Details
|
||||
local detailsFramework = _G.DetailsFramework
|
||||
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details")
|
||||
|
||||
--options panel namespace
|
||||
Details.options = {}
|
||||
Details222.OptionsPanel = {}
|
||||
|
||||
--local tinsert = _G.tinsert
|
||||
local unpack = _G.unpack
|
||||
@@ -32,10 +33,10 @@ local section_menu_button_height = 20
|
||||
|
||||
--build the options window
|
||||
function Details:InitializeOptionsWindow(instance)
|
||||
return Details.options.InitializeOptionsWindow(instance)
|
||||
return Details222.OptionsPanel.InitializeOptionsWindow(instance)
|
||||
end
|
||||
|
||||
function Details.options.InitializeOptionsWindow(instance)
|
||||
function Details222.OptionsPanel.InitializeOptionsWindow(instance)
|
||||
local DetailsOptionsWindow = detailsFramework:NewPanel(UIParent, _, "DetailsOptionsWindow", _, 897, 592)
|
||||
local optionsFrame = DetailsOptionsWindow.frame
|
||||
|
||||
@@ -81,7 +82,7 @@ function Details.options.InitializeOptionsWindow(instance)
|
||||
Details.CriarInstancia (_, _, instanceObject.meu_id)
|
||||
end
|
||||
|
||||
Details.options.SetCurrentInstanceAndRefresh(instanceObject)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(instanceObject)
|
||||
optionsFrame.updateMicroFrames()
|
||||
end
|
||||
|
||||
@@ -311,11 +312,11 @@ function Details.options.InitializeOptionsWindow(instance)
|
||||
maxSectionIds = maxSectionIds + 1
|
||||
end
|
||||
|
||||
Details.options.maxSectionIds = maxSectionIds
|
||||
Details222.OptionsPanel.maxSectionIds = maxSectionIds
|
||||
|
||||
local buttonYPosition = -40
|
||||
|
||||
function Details.options.SelectOptionsSection(sectionId)
|
||||
function Details222.OptionsPanel.SelectOptionsSection(sectionId)
|
||||
for i = 1, maxSectionIds do
|
||||
optionsFrame.sectionFramesContainer[i]:Hide()
|
||||
if (optionsFrame.sectionFramesContainer[i].sectionButton) then
|
||||
@@ -330,7 +331,7 @@ function Details.options.InitializeOptionsWindow(instance)
|
||||
optionsFrame.sectionFramesContainer[sectionId].sectionButton:SetIcon({1, 1, 0}, 4, section_menu_button_height -4, "overlay")
|
||||
end
|
||||
|
||||
Details.options.SetCurrentInstance(instance)
|
||||
Details222.OptionsPanel.SetCurrentInstance(instance)
|
||||
|
||||
--create frames for sections
|
||||
for index, sectionId in ipairs(optionsSectionsOrder) do
|
||||
@@ -368,7 +369,7 @@ function Details.options.InitializeOptionsWindow(instance)
|
||||
buildOptionSectionFunc(sectionFrame)
|
||||
|
||||
--create a button for the section
|
||||
local sectionButton = detailsFramework:CreateButton(optionsFrame, function() Details.options.SelectOptionsSection(sectionId) end, section_menu_button_width, section_menu_button_height, sectionsName[sectionId], sectionId, nil, nil, nil, "$parentButtonSection" .. sectionId, nil, options_button_template, options_text_template)
|
||||
local sectionButton = detailsFramework:CreateButton(optionsFrame, function() Details222.OptionsPanel.SelectOptionsSection(sectionId) end, section_menu_button_width, section_menu_button_height, sectionsName[sectionId], sectionId, nil, nil, nil, "$parentButtonSection" .. sectionId, nil, options_button_template, options_text_template)
|
||||
sectionButton:SetIcon({.4, .4, .4}, 4, section_menu_button_height -4, "overlay")
|
||||
sectionButton:SetPoint("topleft", optionsFrame, "topleft", 10, buttonYPosition)
|
||||
buttonYPosition = buttonYPosition - (section_menu_button_height + 1)
|
||||
@@ -386,7 +387,7 @@ function Details.options.InitializeOptionsWindow(instance)
|
||||
end
|
||||
end
|
||||
|
||||
function Details.options.GetOptionsSection(sectionId)
|
||||
function Details222.OptionsPanel.GetOptionsSection(sectionId)
|
||||
return optionsFrame.sectionFramesContainer[sectionId]
|
||||
end
|
||||
|
||||
@@ -405,7 +406,7 @@ function Details.options.InitializeOptionsWindow(instance)
|
||||
end
|
||||
end
|
||||
|
||||
Details.options.SelectOptionsSection(1)
|
||||
Details222.OptionsPanel.SelectOptionsSection(1)
|
||||
end
|
||||
|
||||
-- ~options
|
||||
@@ -426,15 +427,15 @@ function Details:OpenOptionsWindow(instance, bNoReopen, section)
|
||||
|
||||
local window = _G.DetailsOptionsWindow
|
||||
if (not window) then
|
||||
Details.options.InitializeOptionsWindow(instance)
|
||||
Details222.OptionsPanel.InitializeOptionsWindow(instance)
|
||||
window = _G.DetailsOptionsWindow
|
||||
end
|
||||
|
||||
Details.options.SetCurrentInstanceAndRefresh(instance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(instance)
|
||||
_G.DetailsPluginContainerWindow.OpenPlugin(_G.DetailsOptionsWindow)
|
||||
|
||||
if (section) then
|
||||
Details.options.SelectOptionsSection(section)
|
||||
Details222.OptionsPanel.SelectOptionsSection(section)
|
||||
end
|
||||
|
||||
window.instanceDropdown:Refresh()
|
||||
|
||||
@@ -58,25 +58,25 @@ local font_select_icon, font_select_texcoord = [[Interface\AddOns\Details\images
|
||||
--store the current instance being edited
|
||||
local currentInstance
|
||||
|
||||
function Details.options.SetCurrentInstance(instance)
|
||||
function Details222.OptionsPanel.SetCurrentInstance(instance)
|
||||
currentInstance = instance
|
||||
end
|
||||
|
||||
function Details.options.SetCurrentInstanceAndRefresh(instance)
|
||||
function Details222.OptionsPanel.SetCurrentInstanceAndRefresh(instance)
|
||||
currentInstance = instance
|
||||
_G.DetailsOptionsWindow.instance = instance
|
||||
|
||||
--get all the frames created and update the options
|
||||
for i = 1, Details.options.maxSectionIds do
|
||||
local sectionFrame = Details.options.GetOptionsSection(i)
|
||||
for i = 1, Details222.OptionsPanel.maxSectionIds do
|
||||
local sectionFrame = Details222.OptionsPanel.GetOptionsSection(i)
|
||||
if (sectionFrame.RefreshOptions) then
|
||||
sectionFrame:RefreshOptions()
|
||||
end
|
||||
end
|
||||
Details.options.UpdateAutoHideSettings(instance)
|
||||
Details222.OptionsPanel.UpdateAutoHideSettings(instance)
|
||||
end
|
||||
|
||||
function Details.options.UpdateAutoHideSettings(instance)
|
||||
function Details222.OptionsPanel.UpdateAutoHideSettings(instance)
|
||||
for contextId, line in ipairs(_G.DetailsOptionsWindowTab13.AutoHideOptions) do --tab13 = automation settings
|
||||
line.enabledCheckbox:SetValue(instance.hide_on_context[contextId].enabled)
|
||||
line.reverseCheckbox:SetValue(instance.hide_on_context[contextId].inverse)
|
||||
@@ -84,7 +84,7 @@ function Details.options.UpdateAutoHideSettings(instance)
|
||||
end
|
||||
end
|
||||
|
||||
function Details.options.RefreshInstances(instance)
|
||||
function Details222.OptionsPanel.RefreshInstances(instance)
|
||||
if (instance) then
|
||||
Details:InstanceGroupCall(instance, "InstanceRefreshRows")
|
||||
instance:InstanceReset()
|
||||
@@ -94,7 +94,7 @@ function Details.options.RefreshInstances(instance)
|
||||
end
|
||||
end
|
||||
|
||||
function Details.options.GetCurrentInstanceInOptionsPanel()
|
||||
function Details222.OptionsPanel.GetCurrentInstanceInOptionsPanel()
|
||||
return currentInstance
|
||||
end
|
||||
|
||||
@@ -577,7 +577,7 @@ do
|
||||
local accepted, errortext = Details:SetNickname(text)
|
||||
if (not accepted) then
|
||||
Details:ResetPlayerPersona()
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
end
|
||||
afterUpdate()
|
||||
end,
|
||||
@@ -588,7 +588,7 @@ do
|
||||
type = "execute",
|
||||
func = function(self)
|
||||
Details:ResetPlayerPersona()
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
end,
|
||||
icontexture = [[Interface\GLUES\LOGIN\Glues-CheckBox-Check]],
|
||||
--icontexcoords = {160/512, 179/512, 142/512, 162/512},
|
||||
@@ -769,7 +769,7 @@ do
|
||||
--add the new skin
|
||||
Details.savedStyles [#Details.savedStyles+1] = dataTable
|
||||
Details:Msg(Loc ["STRING_OPTIONS_SAVELOAD_IMPORT_OKEY"])
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
afterUpdate()
|
||||
else
|
||||
Details:Msg(Loc ["STRING_CUSTOM_IMPORT_ERROR"])
|
||||
@@ -807,7 +807,7 @@ do
|
||||
type = "execute",
|
||||
func = function(self)
|
||||
Details:InstanceGroupCall(currentInstance, "SetUserCustomSkinFile", "")
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
afterUpdate()
|
||||
end,
|
||||
icontexture = [[Interface\GLUES\LOGIN\Glues-CheckBox-Check]],
|
||||
@@ -821,7 +821,7 @@ do
|
||||
get = function() return "" end,
|
||||
set = function(self, _, text)
|
||||
saveAsSkin(text)
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details:Msg(Loc ["STRING_OPTIONS_SAVELOAD_SKINCREATED"])
|
||||
afterUpdate()
|
||||
end,
|
||||
@@ -848,7 +848,7 @@ do
|
||||
end
|
||||
|
||||
Details:Msg(Loc ["STRING_OPTIONS_SAVELOAD_APPLYALL"])
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
afterUpdate()
|
||||
end,
|
||||
icontexture = [[Interface\Buttons\UI-HomeButton]],
|
||||
@@ -887,7 +887,7 @@ do
|
||||
for index, _table in ipairs(Details.savedStyles) do
|
||||
tinsert(loadtable, {value = index, label = _table.name, onclick = function(_, _, index)
|
||||
table.remove (Details.savedStyles, index)
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
afterUpdate()
|
||||
Details:Msg(Loc ["STRING_OPTIONS_SKIN_REMOVED"])
|
||||
end,
|
||||
@@ -914,7 +914,7 @@ do
|
||||
else
|
||||
Details:Msg("failed to export skin.") --localize-me
|
||||
end
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
afterUpdate()
|
||||
end,
|
||||
icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], color = {1, 1, 1}, iconcolor = {1, .9, .9, 0.8}, texcoord = {1, 0, 0, 1}})
|
||||
@@ -944,7 +944,7 @@ do
|
||||
get = function() return Details.chat_tab_embed.enabled end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.chat_embed:SetTabSettings(nil, value)
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
afterUpdate()
|
||||
end,
|
||||
name = Loc ["STRING_ENABLED"],
|
||||
@@ -966,7 +966,7 @@ do
|
||||
get = function() return Details.chat_tab_embed.single_window end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.chat_embed:SetTabSettings (nil, nil, value)
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
afterUpdate()
|
||||
end,
|
||||
name = Loc ["STRING_OPTIONS_TABEMB_SINGLE"],
|
||||
@@ -1409,7 +1409,7 @@ do
|
||||
editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, text)
|
||||
end
|
||||
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
afterUpdate()
|
||||
end,
|
||||
name = Loc ["STRING_OPTIONS_BARS_CUSTOM_TEXTURE"],
|
||||
@@ -1539,7 +1539,7 @@ do
|
||||
set = function(self, fixedparam, value)
|
||||
editInstanceSetting(currentInstance, "fontstrings_text_limit_offset", value)
|
||||
editInstanceSetting(currentInstance, "InstanceRefreshRows")
|
||||
Details.options.RefreshInstances(currentInstance)
|
||||
Details222.OptionsPanel.RefreshInstances(currentInstance)
|
||||
afterUpdate()
|
||||
end,
|
||||
min = -30,
|
||||
@@ -1604,7 +1604,7 @@ do
|
||||
set = function(self, fixedparam, value)
|
||||
editInstanceSetting(currentInstance, "total_bar", "enabled", value)
|
||||
afterUpdate()
|
||||
Details.options.RefreshInstances(currentInstance)
|
||||
Details222.OptionsPanel.RefreshInstances(currentInstance)
|
||||
end,
|
||||
name = Loc ["STRING_ENABLED"],
|
||||
desc = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_DESC"],
|
||||
@@ -2116,8 +2116,8 @@ do
|
||||
local separatorOption = sectionFrame.widget_list[25]
|
||||
local bracketOption = sectionFrame.widget_list[26]
|
||||
local warningLabel = sectionFrame.widget_list[27]
|
||||
Details.options.textSeparatorOption = separatorOption
|
||||
Details.options.textbracketOption = bracketOption
|
||||
Details222.OptionsPanel.textSeparatorOption = separatorOption
|
||||
Details222.OptionsPanel.textbracketOption = bracketOption
|
||||
|
||||
sectionFrame:SetScript("OnShow", function()
|
||||
if (currentInstance.use_multi_fontstrings) then
|
||||
@@ -3854,7 +3854,7 @@ do
|
||||
local selectProfile = function(_, _, profileName)
|
||||
Details:ApplyProfile(profileName)
|
||||
Details:Msg(Loc ["STRING_OPTIONS_PROFILE_LOADED"], profileName)
|
||||
--Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
--Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
--afterUpdate()
|
||||
_G.DetailsOptionsWindow:Hide()
|
||||
Details:OpenOptionsWindow(currentInstance, false, 9)
|
||||
@@ -3930,7 +3930,7 @@ do
|
||||
if (new_profile) then
|
||||
Details:ApplyProfile(profileName)
|
||||
afterUpdate()
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
else
|
||||
return Details:Msg(Loc ["STRING_OPTIONS_PROFILE_NOTCREATED"])
|
||||
end
|
||||
@@ -3970,7 +3970,7 @@ do
|
||||
|
||||
Details:EraseProfile(profileName)
|
||||
|
||||
Details.options.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
Details222.OptionsPanel.SetCurrentInstanceAndRefresh(currentInstance)
|
||||
afterUpdate()
|
||||
Details:Msg(Loc ["STRING_OPTIONS_PROFILE_REMOVEOKEY"])
|
||||
end,
|
||||
@@ -5496,7 +5496,7 @@ do
|
||||
sectionFrame.AutoHideOptions[i] = line
|
||||
end
|
||||
|
||||
Details.options.UpdateAutoHideSettings(currentInstance)
|
||||
Details222.OptionsPanel.UpdateAutoHideSettings(currentInstance)
|
||||
|
||||
--profile by spec
|
||||
|
||||
|
||||
Reference in New Issue
Block a user