diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-21 17:56:17 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-21 17:56:17 -0500 |
| commit | 5df0d0616ee3996add0b14e0fb0becd6257d04a2 (patch) | |
| tree | 19bf067462ea04abf500e0427d3daeb3a39434ee /src/input_system.h | |
| parent | ecbe17b582803aaeaa9ccee88a3d093ff93a6cd3 (diff) | |
| download | tanetane-5df0d0616ee3996add0b14e0fb0becd6257d04a2.tar.gz tanetane-5df0d0616ee3996add0b14e0fb0becd6257d04a2.tar.bz2 tanetane-5df0d0616ee3996add0b14e0fb0becd6257d04a2.zip | |
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.
Diffstat (limited to 'src/input_system.h')
| -rw-r--r-- | src/input_system.h | 7 |
1 files changed, 7 insertions, 0 deletions
| 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 @@ | |||
| 1 | #ifndef INPUT_SYSTEM_H_47764575 | 1 | #ifndef INPUT_SYSTEM_H_47764575 |
| 2 | #define INPUT_SYSTEM_H_47764575 | 2 | #define INPUT_SYSTEM_H_47764575 |
| 3 | 3 | ||
| 4 | #include <string> | ||
| 4 | #include "system.h" | 5 | #include "system.h" |
| 5 | 6 | ||
| 6 | class Game; | 7 | class Game; |
| @@ -14,9 +15,15 @@ public: | |||
| 14 | 15 | ||
| 15 | void tick(double dt) override; | 16 | void tick(double dt) override; |
| 16 | 17 | ||
| 18 | bool isDebugConsoleOpen() const { return debugConsole_; } | ||
| 19 | |||
| 20 | const std::string& getDebugText() const { return debugText_; } | ||
| 21 | |||
| 17 | private: | 22 | private: |
| 18 | 23 | ||
| 19 | Game& game_; | 24 | Game& game_; |
| 25 | bool debugConsole_ = false; | ||
| 26 | std::string debugText_; | ||
| 20 | }; | 27 | }; |
| 21 | 28 | ||
| 22 | #endif /* end of include guard: INPUT_SYSTEM_H_47764575 */ | 29 | #endif /* end of include guard: INPUT_SYSTEM_H_47764575 */ |
