forked from pioneerspacesim/pioneer
/
LuaConsole.h
39 lines (31 loc) · 831 Bytes
/
LuaConsole.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _LUACONSOLE_H
#define _LUACONSOLE_H
#include "LuaManager.h"
#include "gui/GuiBox.h"
#include <deque>
namespace Gui {
class Label;
class TextEntry;
}
class TextureFont;
class LuaConsole : public Gui::VBox {
public:
explicit LuaConsole(int displayedOutputLines);
virtual ~LuaConsole();
bool IsActive() const;
Gui::TextEntry *GetTextEntryField() const { return m_entryField; }
void AddOutput(const std::string &line);
static void Register();
private:
bool OnFilterKeys(const SDL_keysym*);
void OnKeyPressed(const SDL_keysym*);
void ExecOrContinue();
std::deque<std::string> m_statementHistory;
std::string m_stashedStatement;
int m_historyPosition;
Gui::TextEntry *m_entryField;
std::vector<Gui::Label*> m_outputLines;
int m_nextOutputLine;
const int m_maxOutputLines;
};
#endif /* _LUACHATFORM_H */