mirror of
https://github.com/kepler155c/opus
synced 2025-10-18 17:27:39 +00:00
remove dependency on device global
This commit is contained in:
@@ -8,7 +8,6 @@ local Util = require('util')
|
||||
local _rep = string.rep
|
||||
local _sub = string.sub
|
||||
local colors = _G.colors
|
||||
local device = _G.device
|
||||
local fs = _G.fs
|
||||
local os = _G.os
|
||||
local peripheral = _G.peripheral
|
||||
@@ -914,9 +913,9 @@ UI.Device.defaults = {
|
||||
function UI.Device:postInit()
|
||||
self.device = self.device or term.current()
|
||||
|
||||
if self.deviceType then
|
||||
self.device = device[self.deviceType]
|
||||
end
|
||||
--if self.deviceType then
|
||||
-- self.device = device[self.deviceType]
|
||||
--end
|
||||
|
||||
if not self.device.setTextScale then
|
||||
self.device.setTextScale = function() end
|
||||
@@ -1197,6 +1196,7 @@ end
|
||||
|
||||
loadComponents()
|
||||
|
||||
UI.theme = { }
|
||||
UI:loadTheme('usr/config/ui.theme')
|
||||
if Util.getVersion() >= 1.76 then
|
||||
UI:loadTheme('sys/etc/ext.theme')
|
||||
|
@@ -404,6 +404,10 @@ function Util.readFile(fname)
|
||||
end
|
||||
end
|
||||
|
||||
function Util.backupFile(fname)
|
||||
fs.copy(fname, fname .. '.bak')
|
||||
end
|
||||
|
||||
function Util.writeFile(fname, data)
|
||||
if not fname or not data then error('Util.writeFile: invalid parameters', 2) end
|
||||
local file = io.open(fname, "w")
|
||||
|
Reference in New Issue
Block a user