Skip to content

Commit 99b1304

Browse files
committed
Better console mode information
1 parent 0f4df0c commit 99b1304

File tree

5 files changed

+32
-25
lines changed

5 files changed

+32
-25
lines changed

Aura Operating System/Aura_OS/Properties/VersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace Aura_OS
22
{
33
public class VersionInfo
44
{
5-
public static string revision = "261220211352";
5+
public static string revision = "261220211425";
66
}
77
}

Aura Operating System/Aura_OS/System/AConsole/Console.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,17 @@ public enum Mode1920x1080
119119
Rows = 141, // Not good value
120120
Cols = 48 // Not good value
121121
};
122+
123+
public static string GetConsoleInfo()
124+
{
125+
if (Kernel.AConsole.Type == ConsoleType.Graphical)
126+
{
127+
return Kernel.AConsole.Name + " (" + Kernel.AConsole.Width + "x" + Kernel.AConsole.Height + " - " + global::System.Console.OutputEncoding.BodyName + ")";
128+
}
129+
else
130+
{
131+
return Kernel.AConsole.Name + " (" + global::System.Console.OutputEncoding.BodyName + ")";
132+
}
133+
}
122134
}
123135
}

Aura Operating System/Aura_OS/System/AConsole/GraphicConsole.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ public GraphicalConsole()
2525
Name = graphics.canvas.Name();
2626
Type = ConsoleType.Graphical;
2727

28-
mWidth = graphics.canvas.Mode.Columns / graphics.font.Width;
29-
mHeight = graphics.canvas.Mode.Rows / graphics.font.Height;
28+
mWidth = graphics.canvas.Mode.Columns;
29+
mHeight = graphics.canvas.Mode.Rows;
3030

31-
mCols = mWidth;
32-
mRows = mHeight;
31+
mCols = graphics.canvas.Mode.Columns / graphics.font.Width;
32+
mRows = graphics.canvas.Mode.Rows / graphics.font.Height;
3333
}
3434

3535
protected int mX = 0;

Aura Operating System/Aura_OS/System/Drawable/Menu.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public class Menu
1616
/// </summary>
1717
public static void DispInstallationDialog(int percent)
1818
{
19-
int x = (Kernel.AConsole.Width / 2) - (64 / 2);
20-
int y = (Kernel.AConsole.Height / 2) - (10 / 2);
19+
int x = (Kernel.AConsole.Cols / 2) - (64 / 2);
20+
int y = (Kernel.AConsole.Rows / 2) - (10 / 2);
2121

2222
if (percent == 0)
2323
{
@@ -337,8 +337,8 @@ public static string DispLoginForm(string title)
337337
{
338338
Console.Clear();
339339

340-
int x = (Kernel.AConsole.Width / 2) - (64 / 2);
341-
int y = (Kernel.AConsole.Height / 2) - (10 / 2);
340+
int x = (Kernel.AConsole.Cols / 2) - (64 / 2);
341+
int y = (Kernel.AConsole.Rows / 2) - (10 / 2);
342342

343343
Console.BackgroundColor = ConsoleColor.DarkBlue;
344344

@@ -401,8 +401,8 @@ public static void DispErrorDialog(string error)
401401
{
402402
Console.Clear();
403403

404-
int x = (Kernel.AConsole.Width / 2) - (64 / 2);
405-
int y = (Kernel.AConsole.Height / 2) - (4 / 2);
404+
int x = (Kernel.AConsole.Cols / 2) - (64 / 2);
405+
int y = (Kernel.AConsole.Rows / 2) - (4 / 2);
406406

407407
Console.BackgroundColor = ConsoleColor.DarkRed;
408408

@@ -438,8 +438,8 @@ public static string DispDialogOneArg(string title, string input)
438438
title = "║ " + title;
439439
input = "║ " + input;
440440

441-
int x = (Kernel.AConsole.Width / 2) - (64 / 2);
442-
int y = (Kernel.AConsole.Height / 2) - (10 / 2);
441+
int x = (Kernel.AConsole.Cols / 2) - (64 / 2);
442+
int y = (Kernel.AConsole.Rows / 2) - (10 / 2);
443443

444444
Console.BackgroundColor = ConsoleColor.DarkBlue;
445445

@@ -494,8 +494,8 @@ public static string DispDialogOneArg(string title, string input)
494494
/// </summary>
495495
public static string DispLanguageDialog()
496496
{
497-
int x = (Kernel.AConsole.Width / 2) - (64 / 2);
498-
int y = (Kernel.AConsole.Height / 2) - (10 / 2);
497+
int x = (Kernel.AConsole.Cols / 2) - (64 / 2);
498+
int y = (Kernel.AConsole.Rows / 2) - (10 / 2);
499499
x_ = x;
500500
y_ = y;
501501
LanguageMenu(x, y);

Aura Operating System/Aura_OS/System/Translation/Text/List_Translation.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ public static void Systeminfo()
107107
Console.WriteLine("Mémoire utilisée: " + Core.MemoryManager.GetUsedMemory() + "MB");
108108
Console.WriteLine("Mémoire restante: " + Core.MemoryManager.GetFreeMemory() + "MB");
109109
Console.WriteLine("Processeur(s): " + CPU.GetCPUBrandString());
110-
Console.WriteLine("Mode de la console: " + Kernel.AConsole.Name);
111-
Console.WriteLine("Encoding: " + Console.OutputEncoding.BodyName);
110+
Console.WriteLine("Mode de la console: " + AConsole.ConsoleMode.GetConsoleInfo());
112111
break;
113112

114113
case "en_US":
@@ -126,8 +125,7 @@ public static void Systeminfo()
126125
Console.WriteLine("Used memory: " + Core.MemoryManager.GetUsedMemory() + "MB");
127126
Console.WriteLine("Free memory: " + Core.MemoryManager.GetFreeMemory() + "MB");
128127
Console.WriteLine("Processor(s): " + CPU.GetCPUBrandString());
129-
Console.WriteLine("Console mode: " + Kernel.AConsole.Name);
130-
Console.WriteLine("Encoding: " + Console.OutputEncoding.BodyName);
128+
Console.WriteLine("Console mode: " + AConsole.ConsoleMode.GetConsoleInfo());
131129
break;
132130

133131
case "nl_NL":
@@ -145,8 +143,7 @@ public static void Systeminfo()
145143
Console.WriteLine("Gebruikt geheugen: " + Core.MemoryManager.GetUsedMemory() + "MB");
146144
Console.WriteLine("Gratis geheugen: " + Core.MemoryManager.GetFreeMemory() + "MB");
147145
Console.WriteLine("Processor(s): " + CPU.GetCPUBrandString());
148-
Console.WriteLine("Consolewijze: " + Kernel.AConsole.Name);
149-
Console.WriteLine("Encoding: " + Console.OutputEncoding.BodyName);
146+
Console.WriteLine("Consolewijze: " + AConsole.ConsoleMode.GetConsoleInfo());
150147
break;
151148

152149
case "it_IT":
@@ -164,8 +161,7 @@ public static void Systeminfo()
164161
Console.WriteLine("Memoria utilizzata: " + Core.MemoryManager.GetUsedMemory() + "MB");
165162
Console.WriteLine("Memoria libera: " + Core.MemoryManager.GetFreeMemory() + "MB");
166163
Console.WriteLine("Processor(s): " + CPU.GetCPUBrandString());
167-
Console.WriteLine("Modalità console: " + Kernel.AConsole.Name);
168-
Console.WriteLine("Encoding: " + Console.OutputEncoding.BodyName);
164+
Console.WriteLine("Modalità console: " + AConsole.ConsoleMode.GetConsoleInfo());
169165
break;
170166

171167
case "pl_PL":
@@ -183,8 +179,7 @@ public static void Systeminfo()
183179
Console.WriteLine("RAM w uzyciu: " + Core.MemoryManager.GetUsedMemory() + "MB");
184180
Console.WriteLine("Wolny RAM: " + Core.MemoryManager.GetFreeMemory() + "MB");
185181
Console.WriteLine("Procesor(y): " + CPU.GetCPUBrandString());
186-
Console.WriteLine("Tryb konsoli: " + Kernel.AConsole.Name);
187-
Console.WriteLine("Encoding: " + Console.OutputEncoding.BodyName);
182+
Console.WriteLine("Tryb konsoli: " + AConsole.ConsoleMode.GetConsoleInfo());
188183
break;
189184
}
190185
}

0 commit comments

Comments
 (0)