From 09992e46e7a36bcfe883469fedbaf9373d0074e8 Mon Sep 17 00:00:00 2001 From: MCorange Date: Sun, 18 Aug 2024 03:36:52 +0300 Subject: [PATCH] :3 --- keypadOS.lua | 9 ++++----- src/ui.lua | 7 +++---- src/updater.lua | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/keypadOS.lua b/keypadOS.lua index 5383d3a..2307c5c 100644 --- a/keypadOS.lua +++ b/keypadOS.lua @@ -50,7 +50,7 @@ __BUNDLER_FILES["updater.lua"] = function () sleep(60) os.reboot() end - file.write(Cast(basalt_code)) + file.write(utils.Cast(basalt_code)) file.close() utils.MonPrint("Rebooting...") os.reboot() @@ -71,13 +71,14 @@ __BUNDLER_FILES["config.lua"] = function () end -- FILE END: config.lua -- __BUNDLER_FILES["ui.lua"] = function () + local utils = require("utils.lua") local basalt = require("basalt") local config = require("config.lua") local updater = require("updater.lua") --- @type Monitor - local monitor = Cast(peripheral.find("monitor")) + local monitor = utils.Cast(peripheral.find("monitor")) --- @type drive - local drive = Cast(peripheral.find("drive")) + local drive = utils.Cast(peripheral.find("drive")) --- @class Ui --- @field pin string --- @field main any @@ -137,11 +138,9 @@ __BUNDLER_FILES["ui.lua"] = function () main = basalt.addMonitor(monitor), } ui.main:setMonitor(monitor) - -- local pinLabel = ui.pinLabel = ui.main:addLabel() :setText("") :setFontSize(1) - -- local enterButton = ui.enterButton = ui.main:addButton() :setText(">>>>") :setBackground(colors.blue) diff --git a/src/ui.lua b/src/ui.lua index 99cfcfb..9950f46 100644 --- a/src/ui.lua +++ b/src/ui.lua @@ -1,10 +1,11 @@ +local utils = require("utils.lua") local basalt = require("basalt") local config = require("config.lua") local updater = require("updater.lua") --- @type Monitor -local monitor = Cast(peripheral.find("monitor")) +local monitor = utils.Cast(peripheral.find("monitor")) --- @type drive -local drive = Cast(peripheral.find("drive")) +local drive = utils.Cast(peripheral.find("drive")) --- @class Ui --- @field pin string @@ -74,12 +75,10 @@ function InitUi() } ui.main:setMonitor(monitor) - -- local pinLabel = ui.pinLabel = ui.main:addLabel() :setText("") :setFontSize(1) - -- local enterButton = ui.enterButton = ui.main:addButton() :setText(">>>>") :setBackground(colors.blue) diff --git a/src/updater.lua b/src/updater.lua index 27a4ecd..8221381 100644 --- a/src/updater.lua +++ b/src/updater.lua @@ -50,7 +50,7 @@ function GetBasalt() os.reboot() end - file.write(Cast(basalt_code)) + file.write(utils.Cast(basalt_code)) file.close() utils.MonPrint("Rebooting...")