diff --git a/SDK/include/NDK/Console.hpp b/SDK/include/NDK/Console.hpp index 0f6c08d43..78caac3f2 100644 --- a/SDK/include/NDK/Console.hpp +++ b/SDK/include/NDK/Console.hpp @@ -7,6 +7,8 @@ #ifndef NDK_CONSOLE_HPP #define NDK_CONSOLE_HPP +#include +#include #include #include #include @@ -21,9 +23,12 @@ namespace Nz namespace Ndk { + class Console; class Entity; - class NDK_API Console : public Nz::Node + using ConsoleHandle = Nz::ObjectHandle; + + class NDK_API Console : public Nz::Node, public Nz::HandledObject { public: Console(World& world, const Nz::Vector2f& size, Nz::LuaInstance& instance); @@ -33,6 +38,8 @@ namespace Ndk void AddLine(const Nz::String& text, const Nz::Color& color = Nz::Color::White); + void Clear(); + inline unsigned int GetCharacterSize() const; inline const EntityHandle& GetHistory() const; inline const EntityHandle& GetHistoryBackground() const; diff --git a/SDK/src/NDK/Console.cpp b/SDK/src/NDK/Console.cpp index 976bb7fd1..ae6461b83 100644 --- a/SDK/src/NDK/Console.cpp +++ b/SDK/src/NDK/Console.cpp @@ -92,6 +92,12 @@ namespace Ndk RefreshHistory(); } + void Console::Clear() + { + m_historyLines.clear(); + RefreshHistory(); + } + void Console::SendCharacter(char32_t character) { switch (character)