diff --git a/data/computercraft/lua/bios.lua b/data/computercraft/lua/bios.lua index 104adbd..c262f09 100644 --- a/data/computercraft/lua/bios.lua +++ b/data/computercraft/lua/bios.lua @@ -1,4 +1,4 @@ -_G._HOST = _G._HOST .. " (LeonOS 0.2.2)" +_G._HOST = _G._HOST .. " (LeonOS 0.2.3)" local fs = rawget(_G, "fs") _G._RC_ROM_DIR = _RC_ROM_DIR or (...) and fs.exists("/leonos") and "/leonos" or "/rom" @@ -32,7 +32,7 @@ local rc = { _VERSION = { major = 0, minor = 2, - patch = 2 + patch = 3 }, queueEvent = pull(os, "queueEvent"), startTimer = pull(os, "startTimer"), diff --git a/data/computercraft/lua/rom/startup/50_audio.lua b/data/computercraft/lua/rom/startup/50_audio.lua deleted file mode 100644 index 66ca3f4..0000000 --- a/data/computercraft/lua/rom/startup/50_audio.lua +++ /dev/null @@ -1,27 +0,0 @@ --- LeonOS Startup Music -local rc = ... -local peripheral = require("peripheral") -local speaker = peripheral.find("speaker") - --- 检查是否连接了扬声器 -if speaker then - -- 简单的开机音乐(C大调音阶) - -- 格式: {instrument = 乐器, pitch = 音高(半音), duration = 持续时间} - local notes = { - {instrument = "harp", pitch = 6, duration = 0.25}, -- C4 - {instrument = "harp", pitch = 8, duration = 0.25}, -- D4 - {instrument = "harp", pitch = 10, duration = 0.25}, -- E4 - {instrument = "harp", pitch = 11, duration = 0.25}, -- F4 - {instrument = "harp", pitch = 13, duration = 0.25}, -- G4 - {instrument = "harp", pitch = 15, duration = 0.25}, -- A4 - {instrument = "harp", pitch = 17, duration = 0.25}, -- B4 - {instrument = "harp", pitch = 18, duration = 0.5} -- C5 - } - - -- 播放音乐 - for _, note_info in ipairs(notes) do - -- 播放音符,使用默认音量1.0 - speaker.playNote(note_info.instrument, 1.0, note_info.pitch) - rc.sleep(note_info.duration) - end -end \ No newline at end of file diff --git a/data/computercraft/lua/rom/startup/50_settings.lua b/data/computercraft/lua/rom/startup/50_settings.lua new file mode 100644 index 0000000..b546ee2 --- /dev/null +++ b/data/computercraft/lua/rom/startup/50_settings.lua @@ -0,0 +1,101 @@ +-- setting definitions + +local settings = require("settings") + +settings.define("list.show_hidden", { + description = "Show hidden files in list's output", + type = "boolean", + default = false +}) + +settings.define("bios.compat_mode", { + description = "Attempt some LeonOS compatibility by injecting APIs into _G.", + type = "boolean", + default = false +}) + +settings.define("shell.tracebacks", { + description = "Show error tracebacks in the shell.", + type = "boolean", + default = false +}) + +settings.define("edit.scroll_offset", { + description = "How many lines to keep between the cursor and the screen edge.", + type = "number", + default = 3 +}) + +settings.define("edit.force_highlight", { + description = "Whether to use the highlighting editor, even on basic computers.", + type = "boolean", + default = false +}) + +settings.define("edit.scroll_factor", { + description = "Related to how many lines the editor should jump at a time when scrolling. Determined by term_height/scroll_factor. Adjust this for performance.", + type = "number", + default = 8 +}) + +settings.define("edit.color_separator", { + description = "What color separating characters (e.g. ()[];{}) should be.", + type = "string", + default = "lightBlue" +}) + +settings.define("edit.color_operator", { + description = "What color operators (e.g. +-/*) should be.", + type = "string", + default = "lightGray" +}) + +settings.define("edit.color_keyword", { + description = "What color keywords (e.g. local, for, if) should be.", + type = "string", + default = "orange" +}) + +settings.define("edit.color_boolean", { + description = "What color booleans (true/false) should be.", + type = "string", + default = "purple" +}) + +settings.define("edit.color_comment", { + description = "What color comments should be.", + type = "string", + default = "gray" +}) + +settings.define("edit.color_global", { + description = "What color globals (e.g. print, require) should be.", + type = "string", + default = "lime" +}) + +settings.define("edit.color_string", { + description = "What color strings should be.", + type = "string", + default = "red" +}) + +settings.define("edit.color_number", { + description = "What color numbers (e.g. 2, 0xF3, 0.42) should be.", + type = "string", + default = "magenta" +}) + +settings.define("bios.restrict_globals", { + description = "Disallow global variables", + type = "boolean", + default = false +}) + +settings.define("bios.parallel_startup", { + description = "Run startup scripts from /startup in parallel", + type = "boolean", + default = false +}) + +settings.load() diff --git a/installer.lua b/installer.lua index 56b0651..276cdc5 100644 --- a/installer.lua +++ b/installer.lua @@ -1,5 +1,5 @@ -- LeonOS installer -local INSTALLER_VERSION = "0.2.2" +local INSTALLER_VERSION = "0.2.3" local DEFAULT_ROM_DIR = "/leonos" print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")