Kouhai
Kouhai
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
Well...a program shouldn't crash because the user is hovering over X
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
Because it's outside the console screen 😜
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
Also, your program will crash here Console.SetCursorPosition(defPnt.X * Console.WindowWidth / 1919, defPnt.Y * Console.WindowHeight / 1079); Because sometimes the cursor will be outside the console screen
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
It's all good
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
Yup
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
ForegroundColor is getting set to i
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
We enter the function
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
Let's say before exeuting the method that ForegroundColor is DarkRed
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
Yes, and that's the problem
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
You're setting ForegroundColor to i to display the colors, but ForegroundColor is not being reset to the previous color
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
Yes, the problem is with it
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
void ColourList()
{

for (int i = 0; i < Colours.Length; i++)
{
if (i % 2 == 0)
{
Console.SetCursorPosition(2, (Console.WindowHeight / 2 - Colours.Length / 2) + i);
}
else { Console.SetCursorPosition(4, (Console.WindowHeight / 2 - Colours.Length / 2) + i); }
Console.ForegroundColor = (ConsoleColor)(i);
Console.WriteLine("█");

}
}
void ColourList()
{

for (int i = 0; i < Colours.Length; i++)
{
if (i % 2 == 0)
{
Console.SetCursorPosition(2, (Console.WindowHeight / 2 - Colours.Length / 2) + i);
}
else { Console.SetCursorPosition(4, (Console.WindowHeight / 2 - Colours.Length / 2) + i); }
Console.ForegroundColor = (ConsoleColor)(i);
Console.WriteLine("█");

}
}
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
No, what you have is literally what I copy pasted
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
for (int i = 0; i < Colours.Length; i++) // Iterate from 0 to Colours.Length which is 16, meaning the last value of i will be 15
{
if (i % 2 == 0)
{
Console.SetCursorPosition(2, (Console.WindowHeight / 2 - Colours.Length / 2) + i);
}
else { Console.SetCursorPosition(4, (Console.WindowHeight / 2 - Colours.Length / 2) + i); }
Console.ForegroundColor = (ConsoleColor)(i); // Set the foreground color to i, which means the last color would be white
Console.WriteLine("█");

}
for (int i = 0; i < Colours.Length; i++) // Iterate from 0 to Colours.Length which is 16, meaning the last value of i will be 15
{
if (i % 2 == 0)
{
Console.SetCursorPosition(2, (Console.WindowHeight / 2 - Colours.Length / 2) + i);
}
else { Console.SetCursorPosition(4, (Console.WindowHeight / 2 - Colours.Length / 2) + i); }
Console.ForegroundColor = (ConsoleColor)(i); // Set the foreground color to i, which means the last color would be white
Console.WriteLine("█");

}
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
Well
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
The problem is most likely with ColourList
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
$paste
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
If it's too long
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
Show your full code please 😅
94 replies
CC#
Created by dragon on 10/1/2024 in #help
✅ Is it possible to ask check for a keypress without pausing the whole console?
You don't need if (Console.KeyAvailable == true) you can just do if (Console.KeyAvailable)
94 replies