00001 /* 00002 * ExNihilo 3D Engine 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * 00018 * Please read AUTHORS file !!! 00019 * 00020 * $Id: ExManagerConsole.h,v 1.12 2002/08/02 18:55:14 data Exp $ 00021 * 00022 */ 00023 00024 #ifndef __EXMANAGERCONSOLE_H__ 00025 #define __EXMANAGERCONSOLE_H__ 00026 //-------------------------------- 00027 // File to include 00028 //-------------------------------- 00029 #include "ExDefine.h" 00030 #include "ExMath.h" 00031 #include "InputActionList.h" 00032 #include "ExManagerWindow.h" 00033 #include "ExManagerTexture.h" 00034 #include "ExPredefinedObject.h" 00035 #include "ExCFile.h" 00036 00037 #include <stdarg.h> 00038 00039 #define HIDE 0 00040 #define HALF 1 00041 #define FULL 2 00042 #define HIDETOHALF 3 00043 #define HIDETOFULL 4 00044 #define HALFTOFULL 5 00045 #define FULLTOHALF 6 00046 #define FULLTOHIDE 7 00047 #define HALFTOHIDE 8 00048 00049 #define PREDIFINEDCOMMAND 10 00050 //-------------------------------- 00051 class ExManagerConsole 00052 { 00053 private: 00054 //-------------------------------- 00055 // Variable 00056 //-------------------------------- 00057 ExManagerWindow *ManagerWindow; 00058 ExManagerTexture *ManagerTexture; 00059 int m_ConsoleState; //HIDE,HALF,FULL 00060 int m_LineCounter; 00061 int m_ConsoleTrans; 00062 int m_NextConsoleState; 00063 int m_ConsoleTransPalier; 00064 bool console_move; 00065 00066 char *m_BackGroundTexture; 00067 00068 std::string m_BuffCommand; 00069 std::vector<std::string> m_BuffOldCommand; 00070 00071 int PosIntoBuffOldCommand; 00072 00073 typedef std::pair<std::string,int> StringAction; 00074 std::vector<StringAction> m_VecStringAction; 00075 std::vector<StringAction>::iterator m_ItVecStringAction; 00076 00077 std::vector<std::string> m_BufferConsol; 00078 std::vector<std::string>::reverse_iterator m_RItBufferConsol; 00079 std::vector<std::string>::iterator m_ItBufferConsol; 00080 00081 ofstream logfilecsl; 00082 00083 bool LogConsol; 00084 bool m_BackGroundTextureState; 00085 bool m_Blending; 00086 float m_fBlending; 00087 float m_fBackGroundBlue; 00088 float m_fBackGroundRed; 00089 float m_fBackGroundGreen; 00090 int m_LineToStar; 00091 int m_LineInConsol; 00092 //-------------------------------- 00093 // Methode 00094 //-------------------------------- 00095 void AddStringAction(const char *String,int Action); 00096 void AddStringAction(StringAction StrAction); 00097 void AddStringAction(ExCFileDataAction); 00098 SAction ApplyBuffCommand(void); 00099 void WriteInDaFile (std::string str); 00100 00101 00102 public: 00103 //-------------------------------- 00104 // Constructor // Destructor 00105 //-------------------------------- 00106 ExManagerConsole(void); 00107 ~ExManagerConsole(void); 00108 //-------------------------------- 00109 // Methode 00110 //-------------------------------- 00111 std::ostrstream *Consol; 00112 void (*WriteToConsol)(const char *Label); 00113 00114 inline void SetManagerWindow(ExManagerWindow *Window){ManagerWindow = Window;} 00115 inline void SetManagerTexture(ExManagerTexture *Texture){ManagerTexture = Texture;} 00116 00117 void ClearConsol(void); 00118 void Reset(void); 00119 void Write (const char *); 00120 //void Write (const char *, ...); 00121 //void Write (std::string); 00122 void Init(void); 00123 int NextAviableState(void); 00124 void SetConsoleState(int state); 00125 int GetConsoleState (void) { return m_ConsoleState; } 00126 void ConsoleMove (bool); 00127 bool isConsoleMove (void) { return console_move; } 00128 void SetConsoleBackGroudTexture(const char *FileName); 00129 inline void SetConsoleBackGroudTextureState(bool state){m_BackGroundTextureState=state;} 00130 inline void SetConsoleBackGroudBlendingState(bool state){m_Blending=state;} 00131 inline void SetConsoleBackGroudBlending(float blending){m_fBlending=blending;} 00132 inline void SetConsoleBackGroudColorRed(float value){m_fBackGroundRed=value;} 00133 inline void SetConsoleBackGroudColorGreen(float value){m_fBackGroundGreen=value;} 00134 inline void SetConsoleBackGroudColorBlue(float value){m_fBackGroundBlue=value;} 00135 inline void SetConsoleBackGroudColor(float R,float G,float B ){m_fBackGroundBlue=B;m_fBackGroundGreen=G;m_fBackGroundRed=R;} 00136 00137 void LoadStringActionFile(const char *FileName); 00138 00139 void DrawConsole(void); 00140 SAction InputCommand(int command,int mousex,int mousey); 00141 void ListConsoleCommand(void); 00142 00143 void LineUp(void); 00144 void LineDown(void); 00145 }; 00146 #endif //__EXMANAGERCONSOLE_H__