From 5df0d0616ee3996add0b14e0fb0becd6257d04a2 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 21 Feb 2021 17:56:17 -0500 Subject: Added a debug console Open it by pressing backtick, close it by hitting escape. Pressing backtick does not open it in release builds. Current shortcomings: opening it for the first time also types a backtick for some reason, but not on subsequent times. Also, it doesn't create a coroutine, so any script function that yields is going to fail. This also added a "is gameplay paused" flag to Game, which will be useful for adding a pause menu. --- src/input_system.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/input_system.h') diff --git a/src/input_system.h b/src/input_system.h index 4e5bb22..a7757b8 100644 --- a/src/input_system.h +++ b/src/input_system.h @@ -1,6 +1,7 @@ #ifndef INPUT_SYSTEM_H_47764575 #define INPUT_SYSTEM_H_47764575 +#include #include "system.h" class Game; @@ -14,9 +15,15 @@ public: void tick(double dt) override; + bool isDebugConsoleOpen() const { return debugConsole_; } + + const std::string& getDebugText() const { return debugText_; } + private: Game& game_; + bool debugConsole_ = false; + std::string debugText_; }; #endif /* end of include guard: INPUT_SYSTEM_H_47764575 */ -- cgit 1.4.1