Compare commits
No commits in common. "7ed9f76f1501ed2dbe57ec7a247973b8e229c8c2" and "28ceac864313891a6d046a2f5ba76bab51c64bc5" have entirely different histories.
7ed9f76f15
...
28ceac8643
11
keypadOS.lua
11
keypadOS.lua
|
@ -7,7 +7,7 @@ local require = function(path)
|
|||
return __DEFAULT_IMPORT(path)
|
||||
end
|
||||
end
|
||||
local __UPDATE_HASH = "18ceba38b88d8a5429e953d23257a26a01c642cf"
|
||||
local __UPDATE_HASH = "c4faab9a8d910c7a5777c0d0c8190204a9ae1f53"
|
||||
rawset(__BUNDLER_FILES, "updater.lua", function ()
|
||||
local utils = require("utils.lua")
|
||||
local config = require("config.lua")
|
||||
|
@ -109,7 +109,6 @@ rawset(__BUNDLER_FILES, "ui.lua", function ()
|
|||
local basalt = require("basalt")
|
||||
local config = require("config.lua")
|
||||
local updater = require("updater.lua")
|
||||
local blibs = require("main").blibs;
|
||||
local monitor = utils.Cast(peripheral.find("monitor"))
|
||||
local drive = utils.Cast(peripheral.find("drive"))
|
||||
local mod = {}
|
||||
|
@ -129,7 +128,6 @@ rawset(__BUNDLER_FILES, "ui.lua", function ()
|
|||
end
|
||||
basalt.debug("test")
|
||||
if ui.pin == config.correctPin then
|
||||
blibs.notifier.notify("5", "Unlocked door :3 love u");
|
||||
ui.enterButton:setBackground(colors.green)
|
||||
ui.pinLabel:setText("Welcome")
|
||||
redstone.setOutput("front", true)
|
||||
|
@ -232,16 +230,15 @@ end)
|
|||
rawset(__BUNDLER_FILES, "main.lua", function ()
|
||||
local utils = require("utils.lua")
|
||||
local updater = require("updater.lua")
|
||||
local mod = {}
|
||||
local main = {}
|
||||
KEYPADOS_VERSION = "4.0"
|
||||
function mod.main(blibs)
|
||||
mod.blibs = blibs;
|
||||
function main.Main()
|
||||
utils.MonReset(0.5)
|
||||
updater.GetBasalt()
|
||||
utils.MonPrint("keypadOS v" .. KEYPADOS_VERSION)
|
||||
utils.MonReset(1)
|
||||
require("ui.lua").InitUi()
|
||||
end
|
||||
return mod;
|
||||
return main
|
||||
end)
|
||||
return require("main.lua").Main
|
||||
|
|
33
src/main.lua
33
src/main.lua
|
@ -1,36 +1,13 @@
|
|||
-- keycardOS "bootloader", has no access to basalt
|
||||
-- intended for checking for updates, and automatically updating basalt if it is missing
|
||||
local utils = require("utils.lua")
|
||||
local updater = require("updater.lua")
|
||||
local main = {}
|
||||
|
||||
local mod = {}
|
||||
|
||||
KEYPADOS_VERSION = "4.0"
|
||||
|
||||
--- @class BootloaderLibs
|
||||
--- @field log Logger
|
||||
--- @field updater Updater
|
||||
--- @field notifier Notifier
|
||||
--- @field json JsonParser
|
||||
|
||||
|
||||
--- @class Logger
|
||||
--- @field error fun(...)
|
||||
--- @field warn fun(...)
|
||||
--- @field info fun(...)
|
||||
--- @field debug fun(...)
|
||||
|
||||
--- @class Updater
|
||||
--- @field addEntry fun(path: string, branch: string, url: string)
|
||||
|
||||
--- @class JsonParser
|
||||
--- @field decode fun(s: string): table
|
||||
--- @field encode fun(s: table): string
|
||||
|
||||
--- @class Notifier
|
||||
--- @field notify fun(priority: "1"|"2"|"3"|"4"|"5", body: string)
|
||||
|
||||
---@param blibs BootloaderLibs
|
||||
function mod.main(blibs)
|
||||
mod.blibs = blibs;
|
||||
function main.Main()
|
||||
utils.MonReset(0.5)
|
||||
updater.GetBasalt()
|
||||
utils.MonPrint("keypadOS v" .. KEYPADOS_VERSION)
|
||||
|
@ -39,5 +16,5 @@ function mod.main(blibs)
|
|||
end
|
||||
|
||||
|
||||
return mod;
|
||||
return main
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@ local utils = require("utils.lua")
|
|||
local basalt = require("basalt")
|
||||
local config = require("config.lua")
|
||||
local updater = require("updater.lua")
|
||||
local blibs = require("main").blibs;
|
||||
|
||||
--- @type Monitor
|
||||
local monitor = utils.Cast(peripheral.find("monitor"))
|
||||
--- @type drive
|
||||
|
@ -40,7 +38,6 @@ local function unlockDoor(ui)
|
|||
|
||||
basalt.debug("test")
|
||||
if ui.pin == config.correctPin then
|
||||
blibs.notifier.notify("5", "Unlocked door :3 love u");
|
||||
ui.enterButton:setBackground(colors.green)
|
||||
ui.pinLabel:setText("Welcome")
|
||||
redstone.setOutput("front", true)
|
||||
|
|
Loading…
Reference in New Issue
Block a user