Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
koteProgrammist committed Apr 21, 2024
1 parent b012f28 commit e455dc3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 51 deletions.
43 changes: 21 additions & 22 deletions Hattory/Kernel.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
using Cosmos.System.Graphics;
using Cosmos.Core;
using Cosmos.Core.Multiboot;
using Cosmos.HAL;
using Cosmos.HAL.Drivers.Video;
using Cosmos.System.FileSystem;
using Cosmos.System.FileSystem.VFS;
using Cosmos.System.Graphics;
using IL2CPU.API.Attribs;
using System;
using System.IO;
using System.Drawing;
using sus = Cosmos.System;
using System.IO;
using ConsoleKeyy = Cosmos.System.ConsoleKeyEx;
using Cosmos.Core;
using IL2CPU.API.Attribs;
using Cosmos.System.FileSystem;
using Cosmos.System.FileSystem.VFS;
using Cosmos.HAL.Drivers.Video;
using Cosmos.Core.Multiboot;
using Cosmos.HAL;
using Cosmos.System.Audio;
using Cosmos.HAL.Drivers.Audio;
using Cosmos.System.Audio.IO;
using System.Diagnostics;
using sus = Cosmos.System;

#pragma warning disable CA1416 // бля меня этот ебучий варнинг заебал

Expand Down Expand Up @@ -126,8 +122,7 @@ bool canvber()
if (VBEDriver.ISAModeAvailable()) { return true; }
if (PCI.Exists(VendorID.VirtualBox, DeviceID.VBVGA)) { return true; }
if (PCI.Exists(VendorID.Bochs, DeviceID.BGA)) { return true; }
if (Multiboot2.IsVBEAvailable) { return true; }
return false;
return Multiboot2.IsVBEAvailable;
}
colora = Color.Black;
if (PCI.GetDevice(VendorID.VMWare, DeviceID.SVGAIIAdapter) != null && PCI.Exists(PCI.GetDevice(VendorID.VMWare, DeviceID.SVGAIIAdapter)))
Expand All @@ -154,8 +149,8 @@ bool canvber()
sus.MouseManager.ScreenHeight = 200;
FVGAIU = true;
}
sus.MouseManager.X = sus.MouseManager.ScreenWidth/2;
sus.MouseManager.Y = sus.MouseManager.ScreenHeight/2;
sus.MouseManager.X = sus.MouseManager.ScreenWidth / 2;
sus.MouseManager.Y = sus.MouseManager.ScreenHeight / 2;
FpsShower.ShouldRender = true;
//Console.Beep(3000, 1000);
}
Expand Down Expand Up @@ -362,7 +357,7 @@ protected override void Run()
}
}
//FileManager
if (ClickRight(10, 60, 270 + Notepad.path.Length * 2, 250))
if (ClickRight(10, 60, 270 + (Notepad.path.Length * 2), 250))
{
if (isfilemanager == true && isformatsure == false)
{
Expand Down Expand Up @@ -518,6 +513,7 @@ protected override void Run()
isdiskman = false; //disk manager
isfilerename = false; //Are you want to rename file?
isguessit = true;
klavaypr.On = false;
randomnum = new Random().Next(0, 101);
status = "New number has made";
enterrednum = "";
Expand Down Expand Up @@ -854,15 +850,18 @@ protected override void Run()
try
{
int num = Convert.ToInt32(enterrednum);
if (num > randomnum) {
if (num > randomnum)
{
status = "Guessed number less than " + num.ToString();
}
else if (num < randomnum)
{
status = "Guessed number greater than " + num.ToString();
}
else if (num == randomnum) {
else if (num == randomnum)
{
status = "You guess it! Congratulations!";
randomnum = new System.Random().Next(0, 101);
}
}
catch (Exception) { }
Expand All @@ -880,7 +879,7 @@ protected override void Run()
status = "New number has made";
enterrednum = "";
}
}
}
//======SureDelete
if (isformatsure == true)
{
Expand Down
16 changes: 8 additions & 8 deletions Hattory/calc.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Cosmos.System.Graphics;
using System;
using System.Drawing;
using sus = Cosmos.System;
using System.Windows.Input;
using kern = Hattory.Kernel;

namespace Hattory
Expand Down Expand Up @@ -120,7 +118,7 @@ public static void Calculator()
//4
if (kern.Click(30, 220, 40, 40))
{
if(iscalcready == false)
if (iscalcready == false)
{
if (first.Length < 22)
{
Expand Down Expand Up @@ -275,7 +273,7 @@ public static void Calculator()
{
second = second.Remove(second.Length - 1, 1);
}

}
}
//.
Expand Down Expand Up @@ -329,7 +327,8 @@ public static void Calculator()
Otrisovka.Write("Minus", 70, 100, Color.Black); // 40 + 5
Otrisovka.Write("Devide", 120, 100, Color.Black); // 48 + 5
Otrisovka.Write("Multiply", 175, 100, Color.Black); //64 + 5
try {
try
{
firstI = Convert.ToSingle(first);
secondI = Convert.ToSingle(second);
}
Expand All @@ -353,12 +352,12 @@ public static void Calculator()
//SQRT()
if (kern.Click(180, 220, 40, 40))
{
c = (float)Math.Sqrt(firstI);
c = !iscalcready ? (float)Math.Sqrt(firstI) : (float)Math.Sqrt(secondI);
}
//SQR()
if (kern.Click(180, 270, 40, 40))
{
c = firstI * firstI;
c = !iscalcready ? (float)Math.Pow(firstI,2) : (float)Math.Pow(secondI,2);
}
//pow()
if (kern.Click(180, 320, 40, 40))
Expand All @@ -367,7 +366,8 @@ public static void Calculator()
}
Cosmos.Core.Memory.Heap.Collect();
}
catch (Exception) {
catch (Exception)
{
Otrisovka.Write("ERROR 1000-7", 30, 145, Color.Black);
}
}
Expand Down
10 changes: 1 addition & 9 deletions Hattory/klavaypr.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
using System;
using Cosmos.System.Graphics;
using System.Drawing;
using ConsoleKeyy = Cosmos.System.ConsoleKeyEx;
using ConsoleKeyy = Cosmos.System.ConsoleKeyEx;
using sus = Cosmos.System;
using Cosmos.HAL.BlockDevice;
using System.Linq;
using System.Text.RegularExpressions;
using aik = Hattory.Kernel;
using System.IO;
#pragma warning disable CA1416 // Проверка совместимости платформы

namespace Hattory
Expand Down
18 changes: 6 additions & 12 deletions Hattory/ntepad.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using System;
using System.IO;
using Cosmos.System.Graphics;
using Cosmos.System.Graphics;
using System;
using System.Drawing;
using System.IO;
using ConsoleKeyy = Cosmos.System.ConsoleKeyEx;
using sus = Cosmos.System;
using Cosmos.HAL.BlockDevice;
using System.Linq;
using System.Text.RegularExpressions;
using Cosmos.System.Graphics.Fonts;
using static System.Net.Mime.MediaTypeNames;
using System.Runtime.CompilerServices;
#pragma warning disable CA1416 // Проверка совместимости платформы

namespace Hattory
Expand All @@ -32,8 +26,8 @@ internal class Notepad

public static void enternote()
{
canvas.DrawFilledRectangle(Color.Wheat, 10, 60, 270 + path.Length*2, 250);
Otrisovka.Write("File Manager: " + path,30,70,Color.Black);
canvas.DrawFilledRectangle(Color.Wheat, 10, 60, 270 + (path.Length * 2), 250);
Otrisovka.Write("File Manager: " + path, 30, 70, Color.Black);
try
{
var files_list = Directory.GetFiles(path);
Expand Down Expand Up @@ -105,7 +99,7 @@ public static void enternote()
iznai += 16;
}
//RENAME
if (Hattory.Kernel.ClickMiddle(150, 90, 270 + path.Length * 2, 220) && islock == false)
if (Hattory.Kernel.ClickMiddle(150, 90, 270 + (path.Length * 2), 220) && islock == false)
{
islock = true;
klavaypr.On = false;
Expand Down

0 comments on commit e455dc3

Please sign in to comment.