diff --git a/Applications.cfg b/Applications.cfg index 26e5e6d6..76f6baa4 100644 --- a/Applications.cfg +++ b/Applications.cfg @@ -5,7 +5,13 @@ about="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/MineOS/About/", type="Script", forceDownload=true, - version=3.52, + version=3.53, + }, + { + path="/MineOS/Pictures/MoonTouch.pic", + url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/MineOS/Wallpapers/MoonTouch.pic", + type="Wallpaper", + version=1.0, }, { path="/MineOS/Pictures/Raspberry.pic", @@ -55,12 +61,6 @@ type="Wallpaper", version=1.0, }, - { - path="/MineOS/Pictures/ChristmasTree.pic", - url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/MineOS/Wallpapers/ChristmasTree.pic", - type="Wallpaper", - version=1.0, - }, { path="/MineOS/System/OS/Localization/Russian.lang", url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/MineOS/Localization/Russian.lang", @@ -198,7 +198,7 @@ path="/lib/MineOSCore.lua", url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/MineOSCore.lua", type="Library", - version=1.55, + version=1.56, }, { path="/lib/advancedLua.lua", diff --git a/Installer/Installer.lua b/Installer/Installer.lua index 5a04c632..cec13ac4 100644 --- a/Installer/Installer.lua +++ b/Installer/Installer.lua @@ -295,6 +295,7 @@ stages[5] = function() stageContainer:addLabel(1, 22, stageContainer.width, 1, 0x666666, localization.needToReboot):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top) stageContainer:addAdaptiveRoundedButton(math.floor(stageContainer.width / 2 - (unicode.len(localization.reboot) + 4) / 2), stageContainer.height - 4, 2, 1, 0xAAAAAA, 0xDDDDDD, 0x777777, 0xDDDDDD, localization.reboot).onTouch = function() + _G.OSSettings.wallpaper = stageContainer.downloadWallpapersSwitch.state and "/MineOS/Pictures/MoonTouch.pic" or nil _G.OSSettings.screensaver = "Matrix" _G.OSSettings.screensaverDelay = 20 _G.OSSettings.showHelpOnApplicationStart = stageContainer.showApplicationsHelpSwitch.state diff --git a/MineOS/OS.lua b/MineOS/OS.lua index f0ce3422..af10b59f 100755 --- a/MineOS/OS.lua +++ b/MineOS/OS.lua @@ -254,12 +254,9 @@ end ---------------------------------------------- Основные функции ------------------------------------------------------------------------ local function changeWallpaper() - if fs.exists(MineOSCore.paths.wallpaper) then - local path = ecs.readShortcut(MineOSCore.paths.wallpaper) - if fs.exists(path) then - workspace.wallpaper.image = image.load(path) - workspace.wallpaper.isHidden = false - end + if _G.OSSettings.wallpaper and fs.exists(_G.OSSettings.wallpaper) then + workspace.wallpaper.image = image.load(_G.OSSettings.wallpaper) + workspace.wallpaper.isHidden = false else workspace.wallpaper.image = nil workspace.wallpaper.isHidden = true @@ -565,7 +562,7 @@ local function createWorkspace() end end menu:addItem(MineOSCore.localization.contextMenuRemoveWallpaper, workspace.wallpaper.isHidden).onTouch = function() - fs.remove(MineOSCore.paths.wallpaper) + _G.OSSettings.wallpaper = nil changeWallpaper() end menu:show() diff --git a/MineOS/Wallpapers/MoonTouch.pic b/MineOS/Wallpapers/MoonTouch.pic new file mode 100644 index 00000000..cf323262 Binary files /dev/null and b/MineOS/Wallpapers/MoonTouch.pic differ diff --git a/lib/MineOSCore.lua b/lib/MineOSCore.lua index 922be6b0..4f377aec 100755 --- a/lib/MineOSCore.lua +++ b/lib/MineOSCore.lua @@ -26,7 +26,6 @@ MineOSCore.iconClickDelay = 0.2 MineOSCore.paths = {} MineOSCore.paths.OS = "/MineOS/" MineOSCore.paths.system = MineOSCore.paths.OS .. "System/" -MineOSCore.paths.wallpaper = MineOSCore.paths.system .. "OS/Wallpaper.lnk" MineOSCore.paths.localizationFiles = MineOSCore.paths.system .. "OS/Localization/" MineOSCore.paths.icons = MineOSCore.paths.system .. "OS/Icons/" MineOSCore.paths.applications = MineOSCore.paths.OS .. "Applications/" @@ -718,8 +717,8 @@ function MineOSCore.iconRightClick(icon, eventData) require("compressor").pack(fs.path(icon.path) .. fs.hideExtension(fs.name(icon.path)) .. ".pkg", icon.path) computer.pushSignal("MineOSCore", "updateFileList") elseif action == MineOSCore.localization.contextMenuSetAsWallpaper then - fs.remove(MineOSCore.paths.wallpaper) - ecs.createShortCut(MineOSCore.paths.wallpaper, icon.path) + _G.OSSettings.wallpaper = icon.path + MineOSCore.saveOSSettings() computer.pushSignal("MineOSCore", "updateWallpaper") elseif action == MineOSCore.localization.contextMenuFlashEEPROM then local file = io.open(icon.path, "r")