|
FIFE
|
#include <console.h>
Inherits Container, ActionListener, and FocusListener.
Collaboration diagram for FIFE::Console:Public Member Functions | |
| Console () | |
| Constructor. More... | |
| virtual | ~Console () |
| Destructor. More... | |
| void | println (const std::string &s) |
| Print one or more lines to the console output. More... | |
| void | show () |
| Show the console Adds the Console to the fifechan toplevel container and pushes an input Context so that keys are not send to the rest of the game. More... | |
| void | hide () |
| Hide the console Removes itself from the toplevel container and pops it's input context. More... | |
| void | clear () |
| Clear the console output. More... | |
| void | toggleShowHide () |
| Toggle the console Toggles whether the Console is shown or not. More... | |
| void | execute (std::string cmd) |
| Execute a command Normally just sends the command to runString() Checks whether the cmd is just one token and print it's value rather than throw an useless error. More... | |
| void | updateCaption () |
| Update the FPS caption. More... | |
| void | updateAnimation () |
| Update the scroll in/out animation. More... | |
| void | action (const fcn::ActionEvent &event) |
| Callback from fifechan to respond to button press. More... | |
| void | setConsoleExecuter (ConsoleExecuter *const consoleexec) |
| Sets executer for the console. More... | |
| void | removeConsoleExecuter () |
| Removes executer for the console. More... | |
| void | reLayout () |
| Layouts the console to match e.g. More... | |
| void | setIOFont (GuiFont *font) |
| Sets the font used for the input and output areas. More... | |
| void | focusLost (const fcn::Event &event) |
| Hide if we loose focus. More... | |
Private Member Functions | |
| void | doShow () |
| void | doHide () |
Private Attributes | |
| bool | m_isAttached |
| ConsoleExecuter * | m_consoleexec |
| CommandLine * | m_input |
| fcn::TextBox * | m_output |
| fcn::ScrollArea * | m_outputscrollarea |
| fcn::Label * | m_status |
| fcn::Button * | m_toolsbutton |
| std::string | m_prompt |
| int32_t | m_hiddenPos |
| int32_t | m_animationDelta |
| bool | m_hiding |
| Timer | m_fpsTimer |
| Timer | m_animationTimer |
Static Private Attributes | |
| static const unsigned | m_maxOutputRows = 50 |
| FIFE::Console::Console | ( | ) |
Constructor.
Definition at line 49 of file console.cpp.
References FIFE::FifechanManager::createFont(), execute(), FIFE::DynamicSingleton< FifechanManager >::instance(), m_animationTimer, m_fpsTimer, m_hiding, m_input, m_isAttached, m_outputscrollarea, m_prompt, m_status, m_toolsbutton, reLayout(), FIFE::CommandLine::setCallback(), FIFE::Timer::setCallback(), FIFE::GuiFont::setColor(), FIFE::Timer::setInterval(), setIOFont(), updateAnimation(), and updateCaption().
|
virtual |
Destructor.
Definition at line 144 of file console.cpp.
References doHide(), m_input, m_output, m_outputscrollarea, m_status, and m_toolsbutton.
| void FIFE::Console::action | ( | const fcn::ActionEvent & | event | ) |
Callback from fifechan to respond to button press.
Definition at line 280 of file console.cpp.
References FIFE::_log, FL_WARN, m_consoleexec, and FIFE::ConsoleExecuter::onToolsClick().
| void FIFE::Console::clear | ( | ) |
|
private |
Definition at line 197 of file console.cpp.
References FIFE::DynamicSingleton< FifechanManager >::instance(), m_fpsTimer, m_isAttached, FIFE::FifechanManager::remove(), and FIFE::Timer::stop().
Referenced by updateAnimation(), and ~Console().
Here is the caller graph for this function:
|
private |
Definition at line 185 of file console.cpp.
References FIFE::FifechanManager::add(), FIFE::FifechanManager::getTopContainer(), FIFE::DynamicSingleton< FifechanManager >::instance(), m_fpsTimer, m_input, m_isAttached, and FIFE::Timer::start().
Referenced by show(), and toggleShowHide().
Here is the caller graph for this function:| void FIFE::Console::execute | ( | std::string | cmd | ) |
Execute a command Normally just sends the command to runString() Checks whether the cmd is just one token and print it's value rather than throw an useless error.
Definition at line 227 of file console.cpp.
References FIFE::_log, FL_DBG, FL_WARN, m_consoleexec, m_prompt, FIFE::ConsoleExecuter::onConsoleCommand(), println(), and FIFE::Exception::what().
Referenced by Console().
Here is the caller graph for this function:| void FIFE::Console::focusLost | ( | const fcn::Event & | event | ) |
| void FIFE::Console::hide | ( | ) |
Hide the console Removes itself from the toplevel container and pops it's input context.
Definition at line 213 of file console.cpp.
References m_animationTimer, m_hiding, and FIFE::Timer::start().
Referenced by focusLost().
Here is the caller graph for this function:| void FIFE::Console::println | ( | const std::string & | s | ) |
Print one or more lines to the console output.
Definition at line 250 of file console.cpp.
References m_maxOutputRows, m_output, and m_outputscrollarea.
Referenced by execute().
Here is the caller graph for this function:| void FIFE::Console::reLayout | ( | ) |
Layouts the console to match e.g.
font changes
Definition at line 89 of file console.cpp.
References FIFE::RenderBackend::getScreenHeight(), FIFE::RenderBackend::getScreenWidth(), FIFE::DynamicSingleton< RenderBackend >::instance(), m_animationDelta, m_hiddenPos, m_input, m_output, m_outputscrollarea, m_status, and m_toolsbutton.
Referenced by Console(), FIFE::FifechanManager::resizeTopContainer(), and FIFE::FifechanManager::setDefaultFont().
Here is the caller graph for this function:| void FIFE::Console::removeConsoleExecuter | ( | ) |
Removes executer for the console.
Definition at line 292 of file console.cpp.
References m_consoleexec.
| void FIFE::Console::setConsoleExecuter | ( | ConsoleExecuter *const | consoleexec | ) |
Sets executer for the console.
Definition at line 288 of file console.cpp.
References m_consoleexec.
| void FIFE::Console::setIOFont | ( | GuiFont * | font | ) |
Sets the font used for the input and output areas.
Definition at line 296 of file console.cpp.
References m_input, and m_output.
Referenced by Console().
Here is the caller graph for this function:| void FIFE::Console::show | ( | ) |
Show the console Adds the Console to the fifechan toplevel container and pushes an input Context so that keys are not send to the rest of the game.
Definition at line 205 of file console.cpp.
References doShow(), m_animationTimer, m_hiding, and FIFE::Timer::start().
| void FIFE::Console::toggleShowHide | ( | ) |
Toggle the console Toggles whether the Console is shown or not.
Calls show() or hide() respectively.
Definition at line 220 of file console.cpp.
References doShow(), m_animationTimer, m_hiding, and FIFE::Timer::start().
| void FIFE::Console::updateAnimation | ( | ) |
Update the scroll in/out animation.
Definition at line 165 of file console.cpp.
References doHide(), m_animationDelta, m_animationTimer, m_hiddenPos, m_hiding, and FIFE::Timer::stop().
Referenced by Console().
Here is the caller graph for this function:| void FIFE::Console::updateCaption | ( | ) |
Update the FPS caption.
Definition at line 158 of file console.cpp.
References FIFE::TimeManager::getAverageFrameTime(), FIFE::DynamicSingleton< TimeManager >::instance(), and m_status.
Referenced by Console().
Here is the caller graph for this function:
|
private |
Definition at line 159 of file console.h.
Referenced by reLayout(), and updateAnimation().
|
private |
Definition at line 164 of file console.h.
Referenced by Console(), hide(), show(), toggleShowHide(), and updateAnimation().
|
private |
Definition at line 147 of file console.h.
Referenced by action(), execute(), removeConsoleExecuter(), and setConsoleExecuter().
|
private |
|
private |
Definition at line 158 of file console.h.
Referenced by reLayout(), and updateAnimation().
|
private |
Definition at line 161 of file console.h.
Referenced by Console(), hide(), show(), toggleShowHide(), and updateAnimation().
|
private |
Definition at line 149 of file console.h.
Referenced by Console(), doShow(), reLayout(), setIOFont(), and ~Console().
|
private |
|
staticprivate |
|
private |
Definition at line 150 of file console.h.
Referenced by clear(), println(), reLayout(), setIOFont(), and ~Console().
|
private |
Definition at line 151 of file console.h.
Referenced by Console(), println(), reLayout(), and ~Console().
|
private |
|
private |
Definition at line 152 of file console.h.
Referenced by Console(), reLayout(), updateCaption(), and ~Console().
|
private |
Definition at line 153 of file console.h.
Referenced by Console(), reLayout(), and ~Console().