Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Console.h 842B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*!
  2. * \file include/Console.h
  3. * \brief Console 'overlay'
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _CONSOLE_H_
  8. #define _CONSOLE_H_
  9. #include <string>
  10. #include <vector>
  11. #include "UI.h"
  12. /*!
  13. * \brief Console 'overlay'
  14. */
  15. class Console : public UI {
  16. public:
  17. Console();
  18. ~Console();
  19. virtual void moveToTop();
  20. virtual void makeInvisible();
  21. virtual void display();
  22. virtual void handleKeyboard(KeyboardButton key, bool pressed);
  23. virtual void handleText(char *text, bool notFinished);
  24. virtual void handleMouseScroll(int xrel, int yrel);
  25. private:
  26. void moveInHistory(bool up);
  27. std::string mInputBuffer;
  28. std::string mPartialInput;
  29. size_t mHistoryPointer;
  30. std::vector<std::string> mCommandHistory;
  31. std::string mUnfinishedInput;
  32. unsigned int mLineOffset;
  33. };
  34. Console &getConsole();
  35. #endif