Sdk/Console: Add Clear method
Former-commit-id: 6230bf71538d3436cd1c247e9645e54fff0e0a2d
This commit is contained in:
parent
9a472a4a1c
commit
8732cc9459
|
|
@ -7,6 +7,8 @@
|
|||
#ifndef NDK_CONSOLE_HPP
|
||||
#define NDK_CONSOLE_HPP
|
||||
|
||||
#include <Nazara/Core/HandledObject.hpp>
|
||||
#include <Nazara/Core/ObjectHandle.hpp>
|
||||
#include <Nazara/Graphics/Sprite.hpp>
|
||||
#include <Nazara/Graphics/TextSprite.hpp>
|
||||
#include <Nazara/Utility/Event.hpp>
|
||||
|
|
@ -21,9 +23,12 @@ namespace Nz
|
|||
|
||||
namespace Ndk
|
||||
{
|
||||
class Console;
|
||||
class Entity;
|
||||
|
||||
class NDK_API Console : public Nz::Node
|
||||
using ConsoleHandle = Nz::ObjectHandle<Console>;
|
||||
|
||||
class NDK_API Console : public Nz::Node, public Nz::HandledObject<Console>
|
||||
{
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -92,6 +92,12 @@ namespace Ndk
|
|||
RefreshHistory();
|
||||
}
|
||||
|
||||
void Console::Clear()
|
||||
{
|
||||
m_historyLines.clear();
|
||||
RefreshHistory();
|
||||
}
|
||||
|
||||
void Console::SendCharacter(char32_t character)
|
||||
{
|
||||
switch (character)
|
||||
|
|
|
|||
Loading…
Reference in New Issue