mirror of
https://github.com/kepler155c/opus
synced 2025-01-05 21:30:28 +00:00
alternative updates
This commit is contained in:
parent
340e37da82
commit
4a6af34d7c
@ -1,3 +1,4 @@
|
|||||||
|
local Array = require('opus.array')
|
||||||
local Config = require('opus.config')
|
local Config = require('opus.config')
|
||||||
local Util = require('opus.util')
|
local Util = require('opus.util')
|
||||||
|
|
||||||
@ -33,10 +34,22 @@ end
|
|||||||
function Alt.set(key, value)
|
function Alt.set(key, value)
|
||||||
local config = getConfig()
|
local config = getConfig()
|
||||||
|
|
||||||
|
Alt.addChoice(key, value)
|
||||||
|
|
||||||
config.default[key] = value
|
config.default[key] = value
|
||||||
Config.update('alternate', config)
|
Config.update('alternate', config)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Alt.remove(key, value)
|
||||||
|
local config = getConfig()
|
||||||
|
|
||||||
|
Array.removeByValue(config.choices[key], value)
|
||||||
|
if config.default[key] == value then
|
||||||
|
config.default[key] = config.choices[key][1]
|
||||||
|
end
|
||||||
|
Config.update('alternate', config)
|
||||||
|
end
|
||||||
|
|
||||||
function Alt.addChoice(key, value)
|
function Alt.addChoice(key, value)
|
||||||
local config = getConfig()
|
local config = getConfig()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user