mirror of
https://github.com/kepler155c/opus
synced 2025-01-18 19:32:52 +00:00
fix ui default device via args
This commit is contained in:
parent
30b7199976
commit
ec7fc5bb23
@ -125,9 +125,9 @@ function Manager:init()
|
|||||||
focused = true })
|
focused = true })
|
||||||
|
|
||||||
elseif ie and currentPage then
|
elseif ie and currentPage then
|
||||||
--if not self.currentPage.parent.device.side then
|
if not currentPage.parent.device.side then
|
||||||
self:click(currentPage, ie.code, button, x, y)
|
self:click(currentPage, ie.code, button, x, y)
|
||||||
--end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -158,21 +158,16 @@ function Manager:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Manager:configure(appName, ...)
|
function Manager:configure(appName, ...)
|
||||||
local options = {
|
|
||||||
device = { arg = 'd', type = 'string',
|
|
||||||
desc = 'Device type' },
|
|
||||||
textScale = { arg = 't', type = 'number',
|
|
||||||
desc = 'Text scale' },
|
|
||||||
}
|
|
||||||
local defaults = Util.loadTable('usr/config/' .. appName) or { }
|
local defaults = Util.loadTable('usr/config/' .. appName) or { }
|
||||||
if not defaults.device then
|
if not defaults.device then
|
||||||
defaults.device = { }
|
defaults.device = { }
|
||||||
end
|
end
|
||||||
|
|
||||||
Util.getOptions(options, { ... }, true)
|
-- starting a program: gpsServer --display=monitor_3148 --scale=.5 gps
|
||||||
|
local _, options = Util.parse(...)
|
||||||
local optionValues = {
|
local optionValues = {
|
||||||
name = options.device.value,
|
name = options.display,
|
||||||
textScale = options.textScale.value,
|
textScale = tonumber(options.scale),
|
||||||
}
|
}
|
||||||
|
|
||||||
Util.merge(defaults.device, optionValues)
|
Util.merge(defaults.device, optionValues)
|
||||||
@ -183,7 +178,7 @@ function Manager:configure(appName, ...)
|
|||||||
if defaults.device.name == 'terminal' then
|
if defaults.device.name == 'terminal' then
|
||||||
dev = term.current()
|
dev = term.current()
|
||||||
else
|
else
|
||||||
dev = peripheral.wrap(defaults.device.name)
|
dev = _G.device[defaults.device.name]
|
||||||
end
|
end
|
||||||
|
|
||||||
if not dev then
|
if not dev then
|
||||||
|
Loading…
Reference in New Issue
Block a user