Files
LeonOS/data/computercraft/lua/rom/packages/example-pkg/1.0.0/programs/example.lua
Leonmmcoset a7b1ad4cba docs(example-pkg): 将注释和用户界面文本从中文翻译为英文
将示例包的注释和用户界面文本从中文翻译为英文,以提高国际兼容性。修改包括命令补全描述、程序标题格式和用户指南文本。
2025-09-02 08:52:28 +08:00

29 lines
910 B
Lua

-- Example Package Program
local colors = require('colors')
local term = require('term')
function drawTopBar()
local w, h = term.getSize()
term.setBackgroundColor(colors.cyan)
term.setTextColor(colors.white)
term.setCursorPos(1, 1)
term.clearLine()
local title = "=== Example Package v1.0.0 ==="
local pos = math.floor((w - #title) / 2) + 1
term.setCursorPos(pos, 1)
term.write(title)
term.setBackgroundColor(colors.black)
term.setTextColor(colors.white)
term.setCursorPos(1, 3)
end
drawTopBar()
print("\nThis is an example package that demonstrates the features of LeonOS package manager.")
print("\nUsage:")
print(" pkg install example-pkg - Install this package")
print(" pkg remove example-pkg - Uninstall this package")
print(" pkg list - List installed packages")
print("\nPress any key to exit...")
os.pullEvent("key")
term.clear()
term.setCursorPos(1, 1)