Added code page setting for the console window

This commit is contained in:
NovaRain
2023-06-15 23:28:04 +08:00
parent f0784e2987
commit be6947e3d2
3 changed files with 7 additions and 1 deletions
+3
View File
@@ -900,3 +900,6 @@ ConsoleWindow=0
;Console window position and size data. Do not modify
ConsoleWindowData=
;Set the code page for the console window (Default is your system code page)
ConsoleCodePage=0
+3
View File
@@ -133,6 +133,9 @@ void ConsoleWindow::init() {
dlog_f("Failed to allocate console: 0x%x\n", DL_MAIN, GetLastError());
return;
}
int cp = IniReader::GetIntDefaultConfig("Debugging", "ConsoleCodePage", 0);
if (cp > 0) SetConsoleOutputCP(cp);
freopen("CONOUT$", "w", stdout); // this allows to print to console via std::cout
if (_mode & ConsoleSource::GAME) {
+1 -1
View File
@@ -375,7 +375,6 @@ static void __stdcall NewGame_Before() {
}
static void __stdcall NewGame_After() {
dlogr("New Game started.", DL_MAIN);
// OnAfterNewGame
if (HeroAppearance::appModEnabled) {
SetNewCharAppearanceGlobals();
@@ -383,6 +382,7 @@ static void __stdcall NewGame_After() {
}
RunOnAfterGameStarted();
gameLoaded = true;
dlogr("New Game started.", DL_MAIN);
}
static void __declspec(naked) main_load_new_hook() {