1
0
Fork 0

Added more options to settings page. Functionality of these options NYI.

This commit is contained in:
Andrew Tomaka 2011-09-22 22:56:56 -04:00
parent c63388354c
commit 8cb8121d7b
1 changed files with 43 additions and 7 deletions

View File

@ -15,13 +15,15 @@ local defaults = {
}, },
sortType = 1, sortType = 1,
sortDirection = 1, sortDirection = 1,
vertSortDirection = 1,
vpPos = 1,
-- Change table? ['Baradin Hold'] = { abbreviation = 'BH', enable = true } -- Change table? ['Baradin Hold'] = { abbreviation = 'BH', enable = true }
instances = { instances = {
[Z['Baradin Hold']] = { abbreviation = 'BH', enable = true }, [Z['Baradin Hold']] = { abbreviation = 'BH', enable = true },
[Z['Firelands']] = { abbreviation = 'FL', enable = true }, [Z['Firelands']] = { abbreviation = 'FL', enable = true },
[Z['The Bastion of Twilight']] = { abbreviation = 'BoT', enable = true }, [Z['The Bastion of Twilight']] = { abbreviation = 'BoT', enable = true },
[Z['Blackwing Descent']] = { abbreviation = 'BWD', enable = true }, [Z['Blackwing Descent']] = { abbreviation = 'BWD', enable = true },
[Z['Throne of the Four Winds']] = { abbreviation = '4W', enable = true }, [Z['Throne of the Four Winds']] = { abbreviation = '4W', enable = true },
}, },
}, },
} }
@ -39,13 +41,20 @@ local options = {
name = 'Hide Minimap Icon', name = 'Hide Minimap Icon',
desc = 'Removes the icon from your minimap.', desc = 'Removes the icon from your minimap.',
type = 'toggle', type = 'toggle',
order = 1,
get = function(info) return db.profile.minimap.hide end, get = function(info) return db.profile.minimap.hide end,
set = function(info, value) db.profile.minimap.hide = value LDBIcon[value and 'Hide' or 'Show'](LDBIcon, 'ChoreTracker') end, set = function(info, value) db.profile.minimap.hide = value LDBIcon[value and 'Hide' or 'Show'](LDBIcon, 'ChoreTracker') end,
}, },
verticalHeader = {
name = 'Vertical Sorting',
type = 'header',
order = 2,
},
sortType = { sortType = {
name = 'Sort Field', name = 'Sort Field',
desc = 'Field to sort the tooltip by.', desc = 'Field to sort the tooltip by.',
type = 'select', type = 'select',
order = 3,
values = { 'Character', 'Valor Points', 'Class' }, values = { 'Character', 'Valor Points', 'Class' },
get = function(info) return db.profile.sortType end, get = function(info) return db.profile.sortType end,
set = function(info, value) db.profile.sortType = value end, set = function(info, value) db.profile.sortType = value end,
@ -54,10 +63,34 @@ local options = {
name = 'Sorting Direction', name = 'Sorting Direction',
desc = 'Which direction to sort.', desc = 'Which direction to sort.',
type = 'select', type = 'select',
order = 4,
values = { 'Ascending', 'Descending' }, values = { 'Ascending', 'Descending' },
get = function(info) return db.profile.sortDirection end, get = function(info) return db.profile.sortDirection end,
set = function(info, value) db.profile.sortDirection = value end, set = function(info, value) db.profile.sortDirection = value end,
}, },
horizontalHeader = {
name = 'Horizontal Sorting',
type = 'header',
order = 5,
},
vpPos = {
name = 'Valor Point Position',
desc = 'Decides the positioning of the Valor Point column.',
type = 'select',
order = 6,
values = { 'Start', 'End', 'Sorted' },
get = function(info) return db.profile.vpPos end,
set = function(info, value) db.profile.vpPos = value end,
},
vertSortingDirection = {
name = 'Sorting Direction',
desc = 'Which direction to sort.',
type = 'select',
order = 7,
values = { 'Ascending', 'Descending' },
get = function(info) return db.profile.vertSortDirection end,
set = function(info, value) db.profile.vertSortDirection = value end,
},
}, },
}, },
instances = { instances = {
@ -67,19 +100,20 @@ local options = {
args = { args = {
instance = { instance = {
name = 'Add instance to track.', name = 'Add instance to track.',
desc = 'Enter an instance on a seven day lockout that you would like ChoreTracker to track.', desc = 'Enter an instance on a lockout that you would like ChoreTracker to track.',
type = 'input', type = 'input',
order = 1, order = 1,
set = function(info, value) set = function(info, value)
if core:VerifyInstance(value) then if core:VerifyInstance(value) then
print('Adding',value)
db.profile.instances[value].abbreviation = '' db.profile.instances[value].abbreviation = ''
db.profile.instances[value].enable = true db.profile.instances[value].enable = true
else else
print('invalid instance') print('Invalid instance')
end end
end, end,
}, },
barHeader = { instancesHeader = {
name = 'Instances', name = 'Instances',
type = 'header', type = 'header',
order = 2, order = 2,
@ -193,8 +227,8 @@ function core:OnEnable()
name = '', name = '',
order = 4 * i + 1, order = 4 * i + 1,
width = 'half', width = 'half',
get = function(info) return db.profile.instances[info[#info]].abbreviation end, get = function(info) return db.profile.instances[instance].abbreviation end,
set = function(info, value) db.profile.instances[info[#info]].abbreviation = value end, set = function(info, value) db.profile.instances[instance].abbreviation = value end,
} }
options.args.instances.args[instance .. 'Remove'] = { options.args.instances.args[instance .. 'Remove'] = {
type = 'execute', type = 'execute',
@ -202,7 +236,7 @@ function core:OnEnable()
order = 4 * i + 2, order = 4 * i + 2,
width = 'half', width = 'half',
confirm = true, confirm = true,
func = function() db.profile.instances[instance] = nil end, func = function(info) db.profile.instances[instance] = nil end,
} }
options.args.instances.args[instance .. 'Spacer'] = { options.args.instances.args[instance .. 'Spacer'] = {
type = 'description', type = 'description',
@ -463,6 +497,8 @@ function core:DrawTooltip()
end end
table.sort(tooltipTable, sortTooltip ) table.sort(tooltipTable, sortTooltip )
-- Create a table for the header; vpPos to decide where to place Valor Points column
-- Draw tooltip table then looped through.
-- Draw the tooltip -- Draw the tooltip
tooltip:AddHeader('') tooltip:AddHeader('')