| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #ifndef CONSOLE_H
- #define CONSOLE_H
- #include <OgreColourValue.h>
- #include <OgreLog.h>
- #include <OgreSingleton.h>
- #include <OgreStringVector.h>
- #include <OIS.h>
- #include <list>
- #include <vector>
- #include "Event.h"
- class Console : public Ogre::Singleton< Console >, public Ogre::LogListener
- {
- public:
- Console();
- ~Console();
- void Input( const Event& event );
- void Update();
- void UpdateDraw();
- void UpdateNotification();
- void OnResize();
- void SetToVisible();
- void SetToHide();
- bool IsVisible() const;
- void AddTextToOutput( const Ogre::String& text, const Ogre::ColourValue& colour = Ogre::ColourValue::White );
- void ExecuteCommand( const Ogre::String& command );
- void ExecuteScript();
- void CompleteInput();
- void ResetAutoCompletion();
- void AddInputToHistory();
- void SetInputLineFromHistory();
- virtual void messageLogged( const Ogre::String& message, Ogre::LogMessageLevel lml, bool maskDebug, const Ogre::String &logName, bool& skipThisMessage );
- private:
- int m_ConsoleWidth;
- int m_ConsoleHeight;
- unsigned int m_LineWidth;
- int m_LetterWidth;
- bool m_ToVisible;
- bool m_Visible;
- float m_Height;
- struct OutputLine
- {
- Ogre::String text;
- Ogre::ColourValue colour;
- float time;
- };
- std::list< OutputLine > m_OutputLine;
- unsigned int m_MaxOutputLine; // max number of lines in output list
- unsigned int m_DisplayLine; // bottom of console displays this line
- Ogre::String m_InputLine;
- unsigned int m_CursorPosition;
- float m_CursorBlinkTime;
- std::list< Ogre::String > m_History;
- int m_HistoryLine;
- unsigned int m_HistorySize;
- Ogre::StringVector m_AutoCompletition;
- unsigned int m_AutoCompletitionLine;
- };
- #endif // CONSOLE_H
|