#ifndef SIMPLECONSOLEOVERLAY #define SIMPLECONSOLEOVERLAY #include "Variables.h" #include #include namespace Engine { class OverlayBase; class SimpleConsoleOverlay : public OverlayBase { public: SimpleConsoleOverlay () { mActive = false; mDrawLogBar = false; }; virtual ~SimpleConsoleOverlay() {}; virtual bool OnKeyDown (const SDL_keysym &keysym); virtual bool OnKeyUp (const SDL_keysym &keysym) { if(mActive) return true; return false; }; virtual void Draw (); void DrawLogBar (); void DrawConsole (); /** \brief Returns the last n lines */ const std::vector GetLastLines (const unsigned int n); /** \brief Returns true if the Console is active */ bool GetActive () { return mActive; }; /** \brief Activates or deactivates the the Console */ void SetActive (bool active) { if (active) { SDL_EnableUNICODE (1); SDL_EnableKeyRepeat (500, 50); } else { SDL_EnableUNICODE (-1); SDL_EnableKeyRepeat (0, 100); } mActive = active; }; void SetDrawLogBar (bool value) { mDrawLogBar = value; }; /** \brief Draws the console with the current content */ void DrawLastLines (); void DrawCurrentInput (); private: std::vector mLastLines; std::string mCurrentInput; bool mActive; bool mDrawLogBar; float mLeft; float mTop; float mRight; float mBottom; }; } #endif /* SIMPLECONSOLEOVERLAY */