

Definition at line 16 of file KeyConsole.h.
Public Member Functions | |
| KeyConsole () | |
| Console starts as deactivated. | |
| virtual | ~KeyConsole () |
| virtual const char * | getName () const |
| virtual bool | allowBg () const |
| void | setInput (const std::string &input) |
| std::string | getInput () const |
| bool | sendCommand () |
| Send console input to scriptAgent. | |
| virtual void | drawOn (SDL_Surface *screen) |
| Draw console. | |
Protected Member Functions | |
| virtual void | own_initState () |
| virtual void | own_updateState () |
| virtual void | own_pauseState () |
| virtual void | own_resumeState () |
| virtual void | own_cleanState () |
|
|
Console starts as deactivated.
Definition at line 25 of file KeyConsole.cpp. 00026 : m_color(0, 200, 0)
00027 {
00028 m_font = new Font(Path::dataReadPath("font/font_console.ttf"), 16);
00029 takeHandler(new ConsoleInput(this));
00030 registerDrawable(this);
00031 }
|
|
|
Definition at line 33 of file KeyConsole.cpp. 00034 {
00035 delete m_font;
00036 }
|
|
|
Reimplemented from GameState. Definition at line 31 of file KeyConsole.h. 00031 { return true; }
|
|
|
Draw console.
Implements Drawable. Definition at line 63 of file KeyConsole.cpp. 00064 {
00065 SDL_Rect rect;
00066 rect.x = 10;
00067 rect.y = 10;
00068
00069 SDL_Surface *surface = m_font->renderText("console] " + m_input, m_color);
00070 SDL_BlitSurface(surface, NULL, screen, &rect);
00071 SDL_FreeSurface(surface);
00072 }
|
|
|
Definition at line 34 of file KeyConsole.h. 00034 { return m_input; }
|
|
|
Implements INamed. Definition at line 30 of file KeyConsole.h. 00030 { return "state_console"; };
|
|
|
Implements GameState. Definition at line 26 of file KeyConsole.h. 00026 {};
|
|
|
Implements GameState. Definition at line 22 of file KeyConsole.h. 00022 {};
|
|
|
Implements GameState. Definition at line 24 of file KeyConsole.h. 00024 {};
|
|
|
Implements GameState. Definition at line 25 of file KeyConsole.h. 00025 {};
|
|
|
Implements GameState. Definition at line 23 of file KeyConsole.h. 00023 {};
|
|
|
Send console input to scriptAgent. NOTE: debug script fail is not critical
Definition at line 44 of file KeyConsole.cpp. 00045 {
00046 bool result = false;
00047 try {
00048 StringMsg *msg = new StringMsg(Name::SCRIPT_NAME,
00049 "dostring", m_input);
00050 MessagerAgent::agent()->forwardNewMsg(msg);
00051 result = true;
00052 }
00053 catch (BaseException &e) {
00054 LOG_WARNING(e.info());
00055 }
00056 return result;
00057 }
|
|
|
Definition at line 33 of file KeyConsole.h. 00033 { m_input = input; }
|
1.4.2