mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 09:06:23 +02:00
Show CPU core count in CLI and add window creation helper methods
This commit is contained in:
@@ -18,6 +18,7 @@ internal class CliProcess() : Process("Cli")
|
||||
Console.Clear();
|
||||
Console.WriteLine("Welcome RemSox!");
|
||||
Console.WriteLine("Type 'help' to see available commands.");
|
||||
Console.WriteLine(Environment.ProcessorCount + " CPU cores detected");
|
||||
Console.Write("> ");
|
||||
|
||||
historyIndex = CommandManager.GetCommandHistory().Count;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class TerminalProcess() : Process("Terminal")
|
||||
|
||||
internal override void Start(string[] args)
|
||||
{
|
||||
window = WindowManager.CreateWindow(this, "Terminal", new Size(400, 300));
|
||||
window = CreateWindow("Terminal", new Size(400, 300), new Point(100, 100));
|
||||
|
||||
PrintLine("RemSox GUI Terminal v1.0");
|
||||
PrintLine("Type 'help' for commands.");
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Drawing;
|
||||
using RemSox.Logging;
|
||||
using RemSox.Processing.IPC;
|
||||
using RemSox.UI.GUI.Windows;
|
||||
|
||||
namespace RemSox.Processing;
|
||||
|
||||
@@ -25,6 +27,16 @@ public abstract class Process(string name)
|
||||
{
|
||||
}
|
||||
|
||||
protected Window CreateWindow(string title, Size size)
|
||||
{
|
||||
return WindowManager.CreateWindow(this, title, size);
|
||||
}
|
||||
|
||||
protected Window CreateWindow(string title, Size size, Point position)
|
||||
{
|
||||
return WindowManager.CreateWindow(this, title, size, position);
|
||||
}
|
||||
|
||||
protected void SendMessageToProcess(int targetProcessId, Message message)
|
||||
{
|
||||
InterProcessCommunicator.Send(targetProcessId, message, this);
|
||||
|
||||
@@ -84,7 +84,7 @@ public static class WindowManager
|
||||
/// <summary>
|
||||
/// Creates and registers a new window for the specified process.
|
||||
/// </summary>
|
||||
public static Window CreateWindow(Process process, string title, Point position, Size size)
|
||||
public static Window CreateWindow(Process process, string title, Size size, Point position)
|
||||
{
|
||||
Window window = new(title, process.Id, GetNextWindowId(), renderSource)
|
||||
{
|
||||
@@ -208,7 +208,7 @@ public static class WindowManager
|
||||
}
|
||||
}
|
||||
|
||||
return CreateWindow(process, title, new Point(bestX, bestY), size);
|
||||
return CreateWindow(process, title, size, new Point(bestX, bestY));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user