mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-04 01:49:05 +00:00
Changed to use concepts instead of static_assert
This commit is contained in:
@@ -34,9 +34,9 @@ namespace LX
|
||||
void InvalidFilePath::PrintToConsole() const
|
||||
{
|
||||
// Tells the user the input file could not be found and how to fix the issue //
|
||||
LX::PrintStringAsColor("Error: ", LX::Color::LIGHT_RED);
|
||||
LX::PrintAsColor<Color::LIGHT_RED>("Error: ");
|
||||
std::cout << "Invalid " << name << ": ";
|
||||
LX::PrintStringAsColor(fileLocation, LX::Color::WHITE);
|
||||
LX::PrintAsColor<Color::WHITE>(fileLocation);
|
||||
std::cout << "\n\nMake sure the file exists and the process has the correct path to the file\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#include <LX-Common.h>
|
||||
|
||||
namespace LX
|
||||
{
|
||||
void PrintStringAsColor(const std::string& str, Color c)
|
||||
{
|
||||
// Gets a handle to the console //
|
||||
static HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
|
||||
// Sets the color of the console to the desired color //
|
||||
SetConsoleTextAttribute(hConsole, (WORD)c);
|
||||
|
||||
// Outputs the text //
|
||||
std::cout << str;
|
||||
|
||||
// Resets the color //
|
||||
SetConsoleTextAttribute(hConsole, (WORD)Color::LIGHT_GRAY);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user