diff --git a/BootMenu.cs b/BootMenu.cs index 00b70d9..e475ada 100644 --- a/BootMenu.cs +++ b/BootMenu.cs @@ -66,10 +66,10 @@ namespace CMLeonOS bool userDatExists = UserDatExists(); int optionIndex = 0; - PrintOption("Normal Boot", selIdx == optionIndex++); + PrintOption("CMLeonOS (Shell)", selIdx == optionIndex++); if (userDatExists) { - PrintOption("GUI Boot", selIdx == optionIndex++); + PrintOption("CMLeonOS (Desktop)", selIdx == optionIndex++); } PrintOption("Reboot", selIdx == optionIndex++); PrintOption("Shutdown", selIdx == optionIndex++); diff --git a/BuildTime.txt b/BuildTime.txt index 44ebc81..e30962e 100644 --- a/BuildTime.txt +++ b/BuildTime.txt @@ -1 +1 @@ -2026-03-08 20:08:00 \ No newline at end of file +2026-03-08 22:18:30 \ No newline at end of file diff --git a/GitCommit.txt b/GitCommit.txt index 98a2724..f0a20af 100644 --- a/GitCommit.txt +++ b/GitCommit.txt @@ -1 +1 @@ -b878cc7 \ No newline at end of file +2138a4b \ No newline at end of file diff --git a/Gui/Resources/CodeStudio/Splash.bmp b/Gui/Resources/CodeStudio/Splash.bmp index 8334a94..1d3c6fb 100644 Binary files a/Gui/Resources/CodeStudio/Splash.bmp and b/Gui/Resources/CodeStudio/Splash.bmp differ diff --git a/Gui/Resources/Wallpaper_1280_800.bmp b/Gui/Resources/Wallpaper_1280_800.bmp index 3825f19..817b4eb 100644 Binary files a/Gui/Resources/Wallpaper_1280_800.bmp and b/Gui/Resources/Wallpaper_1280_800.bmp differ diff --git a/Gui/UILib/TextBox.cs b/Gui/UILib/TextBox.cs index 1cfaab0..3d403f2 100644 --- a/Gui/UILib/TextBox.cs +++ b/Gui/UILib/TextBox.cs @@ -330,8 +330,8 @@ namespace CMLeonOS.Gui.UILib private List lines = new List() { string.Empty }; - private int markedLinesBegin = 0; - private int markedLinesEnd = 0; + private int markedLinesBegin = -1; + private int markedLinesEnd = -1; private const int fontWidth = 8; private const int fontHeight = 16; @@ -363,14 +363,8 @@ namespace CMLeonOS.Gui.UILib AutoScroll(); - int startLine = markedLinesBegin; - int endLine = markedLinesEnd; - - if (startLine == -1 || endLine == -1) - { - startLine = (scrollY / fontHeight); - endLine = Math.Min(lines.Count - 1, ((scrollY + Height) / fontHeight)); - } + int startLine = (scrollY / fontHeight); + int endLine = Math.Min(lines.Count - 1, ((scrollY + Height) / fontHeight)); for (int i = startLine; i <= endLine; i++) { diff --git a/shell/CommandList.cs b/shell/CommandList.cs index 0344416..e29ef56 100644 --- a/shell/CommandList.cs +++ b/shell/CommandList.cs @@ -239,6 +239,9 @@ namespace CMLeonOS.shell case "unalias": shell.ProcessUnalias(args); break; + case "exportbackground": + shell.ProcessExportBackground(args); + break; default: shell.ShowError($"Unknown command: {command}"); break; diff --git a/shell/Commands/ExportBackgroundCommand.cs b/shell/Commands/ExportBackgroundCommand.cs new file mode 100644 index 0000000..cbba525 --- /dev/null +++ b/shell/Commands/ExportBackgroundCommand.cs @@ -0,0 +1,50 @@ +// The CMLeonOS Project (https://github.com/Leonmmcoset/CMLeonOS) +// Copyright (C) 2025-present LeonOS 2 Developer Team +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +using System; +using System.IO; +using Cosmos.System.Graphics; +using IL2CPU.API.Attribs; + +namespace CMLeonOS.Commands +{ + public static class ExportBackgroundCommand + { + [ManifestResourceStream(ResourceName = "CMLeonOS.Gui.Resources.Wallpaper_1280_800.bmp")] + private static byte[] wallpaperBytes; + + public static void ExportBackground(string outputPath) + { + try + { + if (wallpaperBytes == null || wallpaperBytes.Length == 0) + { + Console.WriteLine("Error: No wallpaper found in embedded resources."); + return; + } + + string destinationPath = string.IsNullOrEmpty(outputPath) ? @"0:\background.bmp" : outputPath; + + File.WriteAllBytes(destinationPath, wallpaperBytes); + Console.WriteLine($"Background exported successfully to: {destinationPath}"); + } + catch (Exception ex) + { + Console.WriteLine($"Error exporting background: {ex.Message}"); + } + } + } +} \ No newline at end of file diff --git a/shell/Shell.cs b/shell/Shell.cs index 17c917b..1913714 100644 --- a/shell/Shell.cs +++ b/shell/Shell.cs @@ -425,7 +425,7 @@ namespace CMLeonOS "cpass", "hostname", "ipconfig", "setdns", "setgateway", "nslookup", "ping", "wget", "ftp", "tcpserver", "tcpclient", "lua", "lua2cla", "cla", "branswe", "beep", "env", "whoami", "uptime", "alias", - "unalias", "base64", "testgui", "ps", "kill", "hex" + "unalias", "base64", "testgui", "ps", "kill", "hex", "exportbackground" }; } @@ -1694,6 +1694,11 @@ namespace CMLeonOS Commands.AliasCommand.RemoveAlias(name); } + public void ProcessExportBackground(string args) + { + Commands.ExportBackgroundCommand.ExportBackground(args); + } + public void SetDnsServer(string args) { if (string.IsNullOrWhiteSpace(args))