Left click for clycling through sort methods; Right click for options. (column count issue, currently)
This commit is contained in:
parent
f8f20f2229
commit
79b2b215ce
1 changed files with 20 additions and 9 deletions
|
@ -62,11 +62,6 @@ local options = {
|
||||||
get = function(info) return db.profile.currentOnTop end,
|
get = function(info) return db.profile.currentOnTop end,
|
||||||
set = function(info, value) db.profile.currentOnTop = value end,
|
set = function(info, value) db.profile.currentOnTop = value end,
|
||||||
},
|
},
|
||||||
--sortSpacer = {
|
|
||||||
-- type = 'description',
|
|
||||||
-- name = '',
|
|
||||||
-- order = 4,
|
|
||||||
--},
|
|
||||||
sortType = {
|
sortType = {
|
||||||
name = L['Sort Field'],
|
name = L['Sort Field'],
|
||||||
desc = L['Field to sort the tooltip by.'],
|
desc = L['Field to sort the tooltip by.'],
|
||||||
|
@ -181,14 +176,26 @@ function core:OnEnable()
|
||||||
type = 'data source',
|
type = 'data source',
|
||||||
text = 'ChoreTracker',
|
text = 'ChoreTracker',
|
||||||
icon = 'Interface\\AddOns\\ChoreTracker\\icon',
|
icon = 'Interface\\AddOns\\ChoreTracker\\icon',
|
||||||
OnClick = function()
|
OnClick = function(self, button)
|
||||||
|
if button == 'RightButton' then
|
||||||
if LibStub("AceConfigDialog-3.0").OpenFrames['ChoreTracker'] then
|
if LibStub("AceConfigDialog-3.0").OpenFrames['ChoreTracker'] then
|
||||||
LibStub('AceConfigDialog-3.0'):Close('ChoreTracker')
|
LibStub('AceConfigDialog-3.0'):Close('ChoreTracker')
|
||||||
else
|
else
|
||||||
LibStub('AceConfigDialog-3.0'):Open('ChoreTracker')
|
LibStub('AceConfigDialog-3.0'):Open('ChoreTracker')
|
||||||
end
|
end
|
||||||
|
else
|
||||||
-- Implement right click to change sorting?
|
-- Cycle through our sort options
|
||||||
|
if db.profile.sortType == 1 then
|
||||||
|
db.profile.sortType = 2
|
||||||
|
core:DrawTooltip()
|
||||||
|
elseif db.profile.sortType == 2 then
|
||||||
|
db.profile.sortType = 3
|
||||||
|
core:DrawTooltip()
|
||||||
|
else
|
||||||
|
db.profile.sortType = 1
|
||||||
|
core:DrawTooltip()
|
||||||
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
OnEnter = function(self)
|
OnEnter = function(self)
|
||||||
core:DrawTooltip()
|
core:DrawTooltip()
|
||||||
|
@ -479,7 +486,11 @@ end
|
||||||
function core:DrawTooltip()
|
function core:DrawTooltip()
|
||||||
-- UpdateChores before we show the tooltip to make sure we have the most recent data
|
-- UpdateChores before we show the tooltip to make sure we have the most recent data
|
||||||
core:UpdateChores()
|
core:UpdateChores()
|
||||||
|
|
||||||
|
if tooltip then
|
||||||
|
tooltip:Clear()
|
||||||
|
tooltip = nil
|
||||||
|
end
|
||||||
local columnCount = 2
|
local columnCount = 2
|
||||||
for instance in pairs(db.profile.instances) do
|
for instance in pairs(db.profile.instances) do
|
||||||
if db.profile.instances[instance].enable == true and db.profile.instances[instance].removed == false then
|
if db.profile.instances[instance].enable == true and db.profile.instances[instance].removed == false then
|
||||||
|
|
Loading…
Reference in a new issue