[1494] | 1 | /* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Felix Schulthess * Co-authors: * Fabian 'x3n' Landau * */#ifndef _InGameConsole_H__#define _InGameConsole_H__ |
---|
[1137] | 2 | |
---|
| 3 | #include "OrxonoxPrereqs.h" |
---|
| 4 | #include <OgrePrerequisites.h> |
---|
| 5 | #include <OgreBorderPanelOverlayElement.h> |
---|
| 6 | #include <OgreTextAreaOverlayElement.h> |
---|
[1143] | 7 | |
---|
| 8 | #include "core/Tickable.h" |
---|
[1446] | 9 | #include "core/Shell.h" |
---|
[1494] | 10 | namespace orxonox{ |
---|
[1468] | 11 | class _OrxonoxExport InGameConsole : public TickableReal, public ShellListener |
---|
[1143] | 12 | { |
---|
[1494] | 13 | public: static InGameConsole& getInstance(); void setConfigValues(); void tick(float dt); |
---|
[1137] | 14 | void activate(); |
---|
[1494] | 15 | void deactivate(); void resize(); static void openConsole(); static void closeConsole(); |
---|
[1137] | 16 | |
---|
| 17 | private: |
---|
[1494] | 18 | InGameConsole(); InGameConsole(const InGameConsole& other); ~InGameConsole(); virtual void linesChanged(); virtual void onlyLastLineChanged(); virtual void lineAdded(); virtual void inputChanged(); virtual void cursorChanged(); virtual void exit(); void init(); void shiftLines(); void colourLine(int colourcode, int index); |
---|
[1470] | 19 | void setCursorPosition(int pos); |
---|
[1446] | 20 | void print(const std::string& text, int index, bool alwaysShift = false); |
---|
| 21 | static Ogre::UTFString convert2UTF(std::string s); |
---|
[1494] | 22 | static float REL_WIDTH; static float REL_HEIGHT; static float BLINK; int windowW_; |
---|
| 23 | int windowH_; int desiredTextWidth_; unsigned int maxCharsPerLine_; unsigned int numLinesShifted_; |
---|
[1446] | 24 | int scroll_; |
---|
| 25 | float scrollTimer_; |
---|
[1494] | 26 | float cursor_; unsigned int inputWindowStart_; char cursorSymbol_; |
---|
[1446] | 27 | bool active_; |
---|
[1470] | 28 | bool bShowCursor_; |
---|
| 29 | std::string displayedText_; |
---|
[1446] | 30 | Ogre::OverlayManager* om_; |
---|
| 31 | Ogre::Overlay* consoleOverlay_; |
---|
| 32 | Ogre::OverlayContainer* consoleOverlayContainer_; |
---|
| 33 | Ogre::PanelOverlayElement* consoleOverlayNoise_; |
---|
[1469] | 34 | Ogre::PanelOverlayElement* consoleOverlayCursor_; |
---|
[1446] | 35 | Ogre::BorderPanelOverlayElement* consoleOverlayBorder_; |
---|
| 36 | Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_; |
---|
[1494] | 37 | };}#endif /* _InGameConsole_H__ */ |
---|