iw4x-client/src/Components/Modules/Console.hpp

70 lines
1.7 KiB
C++
Raw Normal View History

2016-08-30 13:27:14 -04:00
#define OUTPUT_HEIGHT 250
#define OUTPUT_MAX_TOP (OUTPUT_HEIGHT - (Console::Height - 2))
namespace Components
{
class Console : public Component
{
public:
Console();
2016-08-15 10:40:30 -04:00
~Console();
2016-09-16 05:04:28 -04:00
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
2016-08-30 13:27:14 -04:00
const char* GetName() { return "Console"; };
#endif
2016-08-30 18:23:17 -04:00
static void SetSkipShutdown();
2016-08-30 13:27:14 -04:00
2016-09-08 15:46:12 -04:00
static void FreeNativeConsole();
2016-08-30 13:27:14 -04:00
private:
// Text-based console stuff
static WINDOW* OutputWindow;
static WINDOW* InputWindow;
static WINDOW* InfoWindow;
static int Width;
static int Height;
static int OutputTop;
static int OutBuffer;
static int LastRefresh;
static char LineBuffer[1024];
static char LineBuffer2[1024];
static int LineBufferIndex;
static bool HasConsole;
2016-08-30 18:23:17 -04:00
static bool SkipShutdown;
2016-08-30 13:27:14 -04:00
static std::thread ConsoleThread;
static Game::SafeArea OriginalSafeArea;
static void ShowPrompt();
static void RefreshStatus();
static void RefreshOutput();
static void ScrollOutput(int amount);
static const char* Input();
static void Print(const char* message);
static void Error(const char* format, ...);
static void Create();
static void Destroy();
static void StdOutPrint(const char* message);
static void StdOutError(const char* format, ...);
static void ConsoleRunner();
static void DrawSolidConsoleStub();
static void StoreSafeArea();
static void RestoreSafeArea();
2016-08-30 18:23:17 -04:00
static void ToggleConsole();
static char** GetAutoCompleteFileList(const char *path, const char *extension, Game::FsListBehavior_e behavior, int *numfiles, int allocTrackType);
2016-11-14 13:26:15 -05:00
static Game::dvar_t* RegisterConColor(const char* name, float r, float g, float b, float a, float min, float max, int flags, const char* description);
2016-08-30 13:27:14 -04:00
};
}