From 1927d1222d668ab911d3cc0a4e1a811c465cf2ef Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Fri, 12 Sep 2025 17:27:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor(installer):=20=E4=BD=BF=E7=94=A8appgui?= =?UTF-8?q?=E9=87=8D=E6=9E=84=E9=A1=B6=E9=83=A8=E6=A0=8F=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除手动实现的顶部栏代码,改用appgui模块统一处理 更新安装器版本号为1.0.3 Beta 4 --- installer.lua | 52 +++++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/installer.lua b/installer.lua index 353f13e..c78ba15 100644 --- a/installer.lua +++ b/installer.lua @@ -1,9 +1,5 @@ -- LeonOS installer -local term = require("term") -local colors = require("colors") -local rc = require("rc") - -local INSTALLER_VERSION = "1.0.3 Beta 3" +local INSTALLER_VERSION = "1.0.3 Beta 4" local DEFAULT_ROM_DIR = "/leonos" term.at(1, y).clearLine() @@ -58,6 +54,7 @@ print("[Installer] Loading done.") print("[Installer] Loading module 8") -- get LeonOS's textutils with its extra utilities local tu = rcload("apis/textutils.lua") +local appgui = rcload("apis/appgui.lua") local function progress(y, a, b) local progress = a/b @@ -70,30 +67,31 @@ local function progress(y, a, b) colors.yellow, "]") end term.write("[Installer] Loading done.\n") --- 程序顶部名称栏 -local term = require("term") -local colors = require("colors") -local rc = require("rc") --- local appgui = require("appgui") --- 保存当前颜色设置 -local old_fg = term.getTextColor() -local old_bg = term.getBackgroundColor() +-- -- 程序顶部名称栏 +-- local term = require("term") +-- local colors = require("colors") +-- local rc = require("rc") +-- -- local appgui = require("appgui") +-- -- 保存当前颜色设置 +-- local old_fg = term.getTextColor() +-- local old_bg = term.getBackgroundColor() --- 设置名称栏颜色并显示 -term.setTextColor(colors.white) -term.setBackgroundColor(colors.cyan) -term.at(1, 1).clearLine() -term.at(1, 1).write("=== LeonOS Installer ===") +-- -- 设置名称栏颜色并显示 +-- term.setTextColor(colors.white) +-- term.setBackgroundColor(colors.cyan) +-- term.at(1, 1).clearLine() +-- term.at(1, 1).write("=== LeonOS Installer ===") --- 恢复颜色设置 -term.setTextColor(old_fg) -term.setBackgroundColor(old_bg) -term.at(1, 2) --- 只清除顶栏以下的区域 -for y=2, term.getSize() do - term.at(1, y).clearLine() -end -term.at(1, 2) +-- -- 恢复颜色设置 +-- term.setTextColor(old_fg) +-- term.setBackgroundColor(old_bg) +-- term.at(1, 2) +-- -- 只清除顶栏以下的区域 +-- for y=2, term.getSize() do +-- term.at(1, y).clearLine() +-- end +-- term.at(1, 2) +appgui.topbar("=== LeonOS Installer ===") tu.coloredPrint(colors.yellow, "LeonOS Installer (v"..INSTALLER_VERSION..")\n=======================") tu.coloredPrint("You are going to install LeonOS "..INSTALLER_VERSION.." to your computer.")