#pragma once #include "zstring.h" #include "printf.h" #include #define WIN32_LEAN_AND_MEAN #include // The WndProc used when the game view is active LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); class MainWindow { public: void Create(const FString& title, int x, int y, int width, int height); void ShowGameView(); void RestoreConView(); void ShowErrorPane(const char* text); bool CheckForRestart(); void PrintStr(const char* cp); void GetLog(std::function writeFile); void ShowNetStartPane(const char* message, int maxpos); void SetNetStartProgress(int pos); bool RunMessageLoop(bool (*timer_callback)(void*), void* userdata); void HideNetStartPane(); void SetWindowTitle(const char* caption); HWND GetHandle() { return Window; } private: static LRESULT CALLBACK LConProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); HWND Window = 0; bool restartrequest = false; TArray bufferedConsoleStuff; }; extern MainWindow mainwindow;