Main Page Namespace List Class Hierarchy Alphabetical List Data Structures File List Namespace Members Data Fields Globals

# ExManagerConsole Class Reference

`#include <ExManagerConsole.h>`

Inheritance diagram for ExManagerConsole:

## Public Methods
void | SetManagerWindow (ExManagerWindow *Window)
void | SetManagerTexture (ExManagerTexture *Texture)
void | ClearConsol (void)
void | Reset (void)
void | Write (const char *)
void | Draw (void)
void | Init (void)
int | NextAviableState (void)
void | SetConsoleState (int state)
int | GetConsoleState (void)
void | ConsoleMove (bool)
bool | isConsoleMove (void)
void | SetConsoleBackGroudTexture (std::string FileName)
void | SetConsoleBackGroudTextureState (bool state)
void | SetConsoleBackGroudBlendingState (bool state)
void | SetConsoleBackGroudBlending (float blending)
void | SetConsoleBackGroudColorRed (float value)
void | SetConsoleBackGroudColorGreen (float value)
void | SetConsoleBackGroudColorBlue (float value)
void | SetConsoleBackGroudColor (float R, float G, float B)
void | LoadStringActionFile (const char *FileName)
ExCAction | InputCommand (ExCCommand Command)
void | ListConsoleCommand (void)
void | LineUp (void)
void | LineDown (void)
ExCAction | InputAction (ExCAction Action)
## Static Public Methods
ExManagerConsole * | CreateSingleton (void)
## Private Types
typedef std::pair< std::string, int > | StringAction
## Private Methods
void | AddStringAction (std::string String, int Action)
void | AddStringAction (StringAction StrAction)
void | AddStringAction (ExCFileDataAction)
ExCAction | ApplyBuffCommand (void)
void | WriteInDaFile (std::string str)
| ExManagerConsole (void)
| ~ExManagerConsole (void)
## Private Attributes
ExManagerWindow * | ManagerWindow
ExManagerTexture * | ManagerTexture
int | m_ConsoleState
int | m_LineCounter
int | m_ConsoleTrans
int | m_NextConsoleState
int | m_ConsoleTransPalier
bool | console_move
int | m_Move
std::string | m_BackGroundTexture
std::string | m_BuffCommand
std::vector< std::string > | m_BuffOldCommand
int | PosIntoBuffOldCommand
std::vector< StringAction > | m_VecStringAction
std::vector< StringAction >::iterator | m_ItVecStringAction
std::vector< std::string > | m_BufferConsol
std::vector< std::string >::reverse_iterator | m_RItBufferConsol
std::vector< std::string >::iterator | m_ItBufferConsol
ofstream | logfilecsl
bool | LogConsol
bool | m_BackGroundTextureState
bool | m_Blending
float | m_fBlending
float | m_fBackGroundBlue
float | m_fBackGroundRed
float | m_fBackGroundGreen
int | m_LineToStar
int | m_LineInConsol
## Static Private Attributes
bool | m_flag = false
ExManagerConsole * | m_instance = NULL

## Member Typedef Documentation

typedef std::pair<std::string,int> StringAction`[private]`

| Definition at line 105 of file ExManagerConsole.h. Referenced by AddStringAction(), and LoadStringActionFile().

## Constructor & Destructor Documentation

ExManagerConsole | ( | void |  | ) | `[private]`

| Definition at line 43 of file ExManagerConsole.cpp. References console_move, ExManagerConsole(), Guard, HIDE, LogConsol, logfilecsl, ExManager::m_AskForCommand, m_BackGroundTextureState, m_Blending, m_ConsoleState, m_ConsoleTransPalier, m_fBackGroundBlue, m_fBackGroundGreen, m_fBackGroundRed, m_fBlending, m_LineCounter, m_Move, PosIntoBuffOldCommand, ExManager::SetAskForCommand(), ExManager::SetAskForExclusifCommand(), and ExManager::SetStatus(). Referenced by ExManagerConsole(), and ~ExManagerConsole().
    00044 {
    00045 Guard(ExManagerConsole::ExManagerConsole(void))
    00046         m_ConsoleState=HIDE;
    00047         m_LineCounter=2;
    00048         PosIntoBuffOldCommand=0;
    00049         m_ConsoleTransPalier=20;
    00050         m_fBlending=0.3f;
    00051         m_fBackGroundBlue=1.0f;
    00052         m_fBackGroundRed=1.0f;
    00053         m_fBackGroundGreen=1.0f;
    00054         console_move = false;
    00055         m_BackGroundTextureState=true;
    00056         m_Blending = false;
    00057         LogConsol =true;
    00058         m_AskForCommand=true;
    00059         m_Move=0;
    00060         #ifdef UNIX_SRC
    00061         logfilecsl.open("/tmp/logConsol.txt",ios::out);
    00062         #else
    00063         logfilecsl.open("logConsol.txt",ios::out);
    00064         #endif
    00065         logfilecsl.close();
    00066         SetStatus(false);
    00067         SetAskForCommand(false);
    00068         SetAskForExclusifCommand(false);
    00069 UnGuard
    00070 }

~ExManagerConsole | ( | void |  | ) | `[private]`

| Definition at line 87 of file ExManagerConsole.cpp. References ExManagerConsole(), and Guard.
    00088 {
    00089 Guard(ExManagerConsole::~ExManagerConsole(void))
    00090 UnGuard
    00091 }

## Member Function Documentation

void AddStringAction | ( | ExCFileDataAction |  | ) | `[private]`

| Definition at line 920 of file ExManagerConsole.cpp. References AddStringAction(), ExCFileDataAction::getAction(), ExCFileDataAction::getCommand(), Guard, and StringAction.
    00920                                                           {
    00921 Guard(void ExManagerConsole::AddStringAction(ExCFileDataAction p))
    00922         StringAction foo;
    00923         foo.first = p.getAction();
    00924         foo.second = p.getCommand();
    00925         AddStringAction(foo);
    00926 UnGuard
    00927 }

void AddStringAction | ( | StringAction | StrAction | ) | `[private]`

| Definition at line 913 of file ExManagerConsole.cpp. References AddStringAction(), Guard, and StringAction.
    00914 {
    00915 Guard(void ExManagerConsole::AddStringAction(StringAction StrAction))
    00916         AddStringAction(StrAction.first.data(),StrAction.second);
    00917 UnGuard
    00918 }

void AddStringAction | ( | std::string | String,
|  | int | Action
| ) | `[private]`

| Definition at line 902 of file ExManagerConsole.cpp. References AddStringAction(), ExManager::Consol, Guard, m_VecStringAction, and StringAction. Referenced by AddStringAction(), and LoadStringActionFile().
    00903 {
    00904 Guard(void ExManagerConsole::AddStringAction(std::string String,int Action))
    00905         StringAction ac;
    00906         ac.first=String;
    00907         ac.second=Action;
    00908         m_VecStringAction.push_back(ac);
    00909         *Consol<<"Add new command to console command:"<<String<<" Action:"<<Action<<std::endl;
    00910 UnGuard
    00911 }

ExCAction ApplyBuffCommand | ( | void |  | ) | `[private]`

| Definition at line 804 of file ExManagerConsole.cpp. References ApplyBuffCommand(), ClearConsol(), ExManager::Consol, Guard, ListConsoleCommand(), ExCAction::m_Action, m_BuffCommand, m_BufferConsol, m_BuffOldCommand, m_ItVecStringAction, ExCAction::m_StartingLife, m_VecStringAction, PREDIFINEDCOMMAND, and ExCAction::SetParam(). Referenced by ApplyBuffCommand(), and InputCommand().
    00805 {
    00806 Guard(ExCAction ExManagerConsole::ApplyBuffCommand(void))
    00807 bool findaction=false;
    00808         ExCAction Action;
    00809         Action.m_StartingLife=(double)((double)glutGet(GLUT_ELAPSED_TIME)/1000);
    00810         *Consol<<m_BuffCommand.data()<<std::endl;
    00811         for(m_ItVecStringAction=m_VecStringAction.begin();m_ItVecStringAction!=m_VecStringAction.end();m_ItVecStringAction++)
    00812         {
    00813                 if(m_BuffCommand.find(m_ItVecStringAction->first.data())==0)
    00814                 {
    00815                         findaction=true;
    00816                         char buffer[255];
    00817                         memset(buffer,0,255);
    00818                         Action.m_Action=m_ItVecStringAction->second;
    00819                         m_BuffCommand.copy(buffer,(m_BuffCommand.size())-(strlen(m_ItVecStringAction->first.data())),strlen(m_ItVecStringAction->first.data()));
    00820                         Action.SetParam(buffer);
    00821                         m_BuffOldCommand.push_back(m_BuffCommand);
    00822                         m_BuffCommand.erase(m_BuffCommand.begin(),m_BuffCommand.end());
    00823                 }
    00824         }
    00825         if(!findaction)
    00826         {
    00827                 if(strcmp(m_BuffCommand.data(),"clear")==0)
    00828                 {
    00829                         m_BuffOldCommand.push_back(m_BuffCommand);
    00830                         m_BuffCommand.erase(m_BuffCommand.begin(),m_BuffCommand.end());
    00831                         m_BufferConsol.clear();
    00832                         ClearConsol();
    00833                         Action.m_Action= NOTHING;
    00834                         return Action;
    00835                 }
    00836
    00837                 if(m_BuffCommand.find("help")==0)
    00838                 {
    00839                         ListConsoleCommand();
    00840                         m_BuffOldCommand.push_back(m_BuffCommand);
    00841                         m_BuffCommand.erase(m_BuffCommand.begin(),m_BuffCommand.end());
    00842                         Action.m_Action= NOTHING;
    00843                         return Action;
    00844                 }
    00845                 if(m_BuffCommand.find("cmd ")==0)
    00846                 {
    00847                         int cmd=0;
    00848                         char *SBuffer;
    00849                         SBuffer=new char[strlen(m_BuffCommand.data())-5] ;
    00850                         memset(SBuffer,0,strlen(m_BuffCommand.data()));
    00851                         m_BuffCommand.copy(SBuffer,m_BuffCommand.size()-4,4);
    00852                         m_BuffCommand.erase(m_BuffCommand.begin(),m_BuffCommand.end());
    00853                         try
    00854                         {
    00855                                 cmd=atoi(SBuffer);
    00856                                 Action.m_Action= m_VecStringAction.at(cmd-PREDIFINEDCOMMAND).second;
    00857                         }catch(...)
    00858                         {
    00859                                 *Consol<<"Bad argument use list to show command list"<<std::endl;
    00860                                 Action.m_Action= NOTHING;
    00861                                 return Action;
    00862                         }
    00863                 }
    00864
    00865                 if(strcmp(m_BuffCommand.data(),"quit")==0)
    00866                 {
    00867                         m_BuffOldCommand.push_back(m_BuffCommand);
    00868                         m_BuffCommand.erase(m_BuffCommand.begin(),m_BuffCommand.end());
    00869                         Action.m_Action= QUIT;
    00870                         return Action;
    00871                 }
    00872
    00873                 if(strcmp(m_BuffCommand.data(),"reset")==0)
    00874                 {
    00875                         m_BuffOldCommand.push_back(m_BuffCommand);
    00876                         m_BuffCommand.erase(m_BuffCommand.begin(),m_BuffCommand.end());
    00877                         Action.m_Action= RESET;
    00878                         return Action;
    00879                 }
    00880
    00881                 if(m_BuffCommand.find("load")!=(unsigned)-1)
    00882                 {
    00883                         char buffer[255];
    00884                         memset(buffer,0,255);
    00885                         Action.m_Action=LOAD_FILE;
    00886                         m_BuffCommand.copy(buffer,m_BuffCommand.size()-4,4);
    00887                         Action.SetParam(buffer);
    00888                         m_BuffOldCommand.push_back(m_BuffCommand);
    00889                         m_BuffCommand.erase(m_BuffCommand.begin(),m_BuffCommand.end());
    00890                         return Action;
    00891                 }
    00892
    00893                 *Consol<<"Unknow command"<<std::endl;
    00894                 m_BuffOldCommand.push_back(m_BuffCommand);
    00895                 m_BuffCommand.erase(m_BuffCommand.begin(),m_BuffCommand.end());
    00896                 Action.m_Action= NOTHING;
    00897         }
    00898         return Action;
    00899 UnGuard
    00900 }

void ClearConsol | ( | void |  | ) |

| Definition at line 965 of file ExManagerConsole.cpp. References ClearConsol(), Guard, m_BuffCommand, m_BufferConsol, and m_BuffOldCommand. Referenced by ApplyBuffCommand(), ClearConsol(), and ExManagerCommand::ProcesExCAction().
    00966 {
    00967 Guard(void ExManagerConsole::ClearConsol(void))
    00968         m_BuffOldCommand.push_back(m_BuffCommand);
    00969         m_BuffCommand.erase(m_BuffCommand.begin(),m_BuffCommand.end());
    00970         m_BufferConsol.clear();
    00971 UnGuard
    00972 }

void ConsoleMove | ( | bool |  | ) |

| Definition at line 334 of file ExManagerConsole.cpp. References console_move. Referenced by InputAction().
    00334                                           {
    00335         console_move = p;
    00336 }

ExManagerConsole * CreateSingleton | ( | void |  | ) | `[static]`

| Definition at line 29 of file ExManagerConsole.cpp. References CreateSingleton(), Guard, m_flag, and m_instance. Referenced by CreateSingleton(), and main().
    00029                                                        {
    00030 Guard(ExManagerConsole* ExManagerConsole::CreateSingleton(void))
    00031         if(!m_flag)
    00032         {
    00033                 m_flag = true; // We are creating the error log now, so set flag to true
    00034                 m_instance = new ExManagerConsole; // Create the error log
    00035         }else
    00036         {
    00037                 std::cout<<"Error singleton already created"<<std::endl;
    00038         }
    00039         return m_instance;
    00040 UnGuard
    00041 }

void Draw | ( | void |  | ) |

| Definition at line 107 of file ExManagerConsole.cpp. References ExManager::Consol, console_move, Draw(), ExNihilo::EnterOrthoMode(), FULL, FULLTOHALF, FULLTOHIDE, ExManagerWindow::GetResolutionX(), ExManagerWindow::GetResolutionY(), ExManager::GetStatus(), Guard, HALF, HALFTOFULL, HALFTOHIDE, HIDE, HIDETOFULL, HIDETOHALF, ExNihilo::LeaveOrthoMode(), LineDown(), LineUp(), LogConsol, logfilecsl, m_BackGroundTexture, m_BuffCommand, m_BufferConsol, m_ConsoleState, m_ConsoleTrans, m_ConsoleTransPalier, m_fBackGroundBlue, m_fBackGroundGreen, m_fBackGroundRed, m_fBlending, m_ItBufferConsol, m_LineInConsol, m_LineToStar, m_Move, m_NextConsoleState, m_RItBufferConsol, ManagerTexture, ManagerWindow, ExNihilo::RenderBitmapString(), ExManagerTexture::SetCurrentObject(), ExManager::SetStatus(), and VERSION. Referenced by Draw(), and ExManagerOutput::DrawScene().
    00108 {
    00109 Guard(void ExManagerConsole::Draw(void))
    00110         if(!GetStatus())return;
    00111         int i=0;
    00112         float   textcoordy=0;
    00113         float   cordy=0;
    00114         char buffer[80];
    00115         sprintf(buffer,"version %s ",VERSION);
    00116
    00117         char bufferdata[255];
    00118         sprintf(bufferdata,"]%s",m_BuffCommand.data());
    00119
    00120         switch(m_ConsoleState)
    00121         {
    00122         case HIDE:
    00123                 SetStatus(false);
    00124                 break;
    00125
    00126         case HALF:
    00127                 textcoordy=0.5f;
    00128                 cordy=ManagerWindow->GetResolutionY()/2;
    00129                 break;
    00130
    00131         case FULL:
    00132                 textcoordy=1.0f;
    00133                 cordy=ManagerWindow->GetResolutionY();
    00134                 break;
    00135
    00136         case HIDETOHALF:
    00137                 //cout<<"Draw hide to half "<<endl;
    00138                 textcoordy=(1.0f/m_ConsoleTransPalier)*m_ConsoleTrans;
    00139                 cordy=(ManagerWindow->GetResolutionY()/m_ConsoleTransPalier)*m_ConsoleTrans;
    00140                 m_ConsoleTrans++;
    00141                 if(cordy>((ManagerWindow->GetResolutionY()/2)-(ManagerWindow->GetResolutionY()/m_ConsoleTransPalier)))
    00142                 {
    00143                         m_ConsoleState=m_NextConsoleState;
    00144                 }
    00145                 break;
    00146
    00147         case HIDETOFULL:
    00148                 //cout<<"Draw hide to full "<<endl;
    00149                 textcoordy=((1.0f/m_ConsoleTransPalier)*m_ConsoleTrans);
    00150                 cordy=(ManagerWindow->GetResolutionY()/m_ConsoleTransPalier)*m_ConsoleTrans;
    00151                 m_ConsoleTrans++;
    00152                 if(cordy>(ManagerWindow->GetResolutionY()))
    00153                 {
    00154                         m_ConsoleState=m_NextConsoleState;
    00155                 }
    00156                 break;
    00157
    00158         case HALFTOFULL:
    00159                 //cout<<"Draw half to full"<<endl;
    00160                 textcoordy=((1.0f/m_ConsoleTransPalier)*m_ConsoleTrans)+0.5f;
    00161                 cordy=((ManagerWindow->GetResolutionY()/m_ConsoleTransPalier)*m_ConsoleTrans)+ManagerWindow->GetResolutionY()/2;
    00162                 m_ConsoleTrans++;
    00163                 if(cordy>(ManagerWindow->GetResolutionY()))
    00164                 {
    00165                         m_ConsoleState=m_NextConsoleState;
    00166                 }
    00167                 break;
    00168
    00169         case FULLTOHIDE:
    00170                 //cout<<"Draw full to hide"<<endl;
    00171                 textcoordy=1.0f-((1.0f/m_ConsoleTransPalier)*m_ConsoleTrans);
    00172                 cordy=ManagerWindow->GetResolutionY()-((ManagerWindow->GetResolutionY()/m_ConsoleTransPalier)*m_ConsoleTrans);
    00173                 m_ConsoleTrans++;
    00174                 if(cordy<0)
    00175                 {
    00176                         m_ConsoleState=m_NextConsoleState;
    00177                 }
    00178                 break;
    00179
    00180         case FULLTOHALF:
    00181                 //cout<<"Draw full to half"<<endl;
    00182                 textcoordy=1.0f-((1.0f/m_ConsoleTransPalier)*m_ConsoleTrans);
    00183                 cordy=(ManagerWindow->GetResolutionY())-((ManagerWindow->GetResolutionY()/m_ConsoleTransPalier)*m_ConsoleTrans);
    00184                 m_ConsoleTrans++;
    00185                 if(cordy<ManagerWindow->GetResolutionY()/2)
    00186                 {
    00187                         m_ConsoleState=m_NextConsoleState;
    00188                 }
    00189                 break;
    00190
    00191         case HALFTOHIDE:
    00192                 //cout<<"Draw half to hide"<<endl;
    00193                 textcoordy=0.5f-((1.0f/m_ConsoleTransPalier)*m_ConsoleTrans);
    00194                 cordy=(ManagerWindow->GetResolutionY()/2)-((ManagerWindow->GetResolutionY()/m_ConsoleTransPalier)*m_ConsoleTrans);
    00195                 m_ConsoleTrans++;
    00196                 if(cordy<0)
    00197                 {
    00198                         m_ConsoleState=m_NextConsoleState;
    00199                 }
    00200                 break;
    00201         }
    00202         //-------------------
    00203         //Draw back console
    00204         //-------------------
    00205         if(m_Move>0)LineUp();
    00206         if(m_Move<0)LineDown();
    00207
    00208         ExNihilo::EnterOrthoMode();
    00209         glPushAttrib(GL_ALL_ATTRIB_BITS);
    00210         if(m_BackGroundTextureState)glEnable(GL_TEXTURE_2D);
    00211         glDisable(GL_LIGHTING);
    00212         glDisable(GL_DEPTH_TEST);
    00213         ManagerTexture->SetCurrentObject(m_BackGroundTexture);
    00214         if(m_Blending)
    00215         {
    00216                 glColor4f(m_fBackGroundRed,m_fBackGroundGreen,m_fBackGroundBlue,m_fBlending);
    00217                 glEnable(GL_BLEND);
    00218                 glEnable(GL_ALPHA);
    00219                 glBlendFunc(GL_ONE,GL_ONE);
    00220                 glEnable(GL_ALPHA_TEST);
    00221                 glAlphaFunc(GL_GREATER,0);
    00222                 glDisable(GL_LIGHTING);
    00223                 glBegin(GL_QUADS);
    00224                         glTexCoord2f(0.0f, textcoordy);         glVertex2f(0, 0);
    00225                         glTexCoord2f(0.0f, 0.0f);                       glVertex2f(0,cordy );
    00226                         glTexCoord2f(1.0f, 0.0f);                       glVertex2f(ManagerWindow->GetResolutionX(),cordy);
    00227                         glTexCoord2f(1.0f, textcoordy );        glVertex2f(ManagerWindow->GetResolutionX(),0);
    00228                 glEnd();
    00229         }else
    00230         {
    00231                 glColor4f(1,1,1,1);
    00232                 glBegin(GL_QUADS);
    00233                         glTexCoord2f(0.0f, textcoordy);         glVertex2f(0, 0);
    00234                         glTexCoord2f(0.0f, 0.0f);                       glVertex2f(0,cordy );
    00235                         glTexCoord2f(1.0f, 0.0f);                       glVertex2f(ManagerWindow->GetResolutionX(),cordy);
    00236                         glTexCoord2f(1.0f, textcoordy );        glVertex2f(ManagerWindow->GetResolutionX(),0);
    00237                 glEnd();
    00238         }
    00239         glPopAttrib();
    00240
    00241     //-------------------
    00242         //Draw credits
    00243         //-------------------
    00244         glColor4f(0,0,1,1);
    00245
    00246         ExNihilo::RenderBitmapString(ManagerWindow->GetResolutionX()-160,cordy-40,GLUT_BITMAP_8_BY_13,"ExNihilo Engine ");
    00247         ExNihilo::RenderBitmapString(ManagerWindow->GetResolutionX()-160,cordy-30,GLUT_BITMAP_8_BY_13,buffer);
    00248         ExNihilo::RenderBitmapString(ManagerWindow->GetResolutionX()-160,cordy-20,GLUT_BITMAP_8_BY_13,"Plok Software");
    00249         //-------------------
    00250         //Draw buffer console
    00251         //-------------------
    00252         glColor3f(0.5,0,0);
    00253
    00254         std::string             bufferstring,bufferstring2;
    00255
    00256         bufferstring=Consol->rdbuf( )->str();
    00257         Consol->freeze(false);
    00258         Consol->clear();
    00259         Consol->flush();
    00260         m_LineInConsol=0;
    00261         do
    00262         {
    00263                 bufferstring2 = bufferstring.substr(0,bufferstring.find ( "\n" ,0));
    00264                 bufferstring.erase(0,bufferstring.find ( "\n" ,0)+1);
    00265                 do
    00266                 {
    00267                         if(bufferstring2.size()>(unsigned)(ManagerWindow->GetResolutionX()/8)-1)
    00268                         {
    00269                                 m_BufferConsol.push_back(bufferstring2.substr(0,((int)(ManagerWindow->GetResolutionX()/8))-1));
    00270                                 bufferstring2=bufferstring2.substr(((int)(ManagerWindow->GetResolutionX()/8))-1,bufferstring2.size());
    00271                                 m_LineInConsol++;
    00272             }else
    00273                         {
    00274                                 m_BufferConsol.push_back(bufferstring2);
    00275                                 m_LineInConsol++;
    00276                                 break;
    00277                         }
    00278                 }while(1);
    00279         }while((unsigned)-1 != bufferstring.find( "\n" ,0));
    00280
    00281         if(LogConsol=true)
    00282         {
    00283                 #ifdef UNIX_SRC
    00284                 logfilecsl.open("/tmp/logConsol.txt",ios::out);
    00285                 #else
    00286                 logfilecsl.open("logConsol.txt",ios::out);
    00287                 #endif
    00288                 i=0;
    00289                 for(m_ItBufferConsol=m_BufferConsol.begin();m_ItBufferConsol!=m_BufferConsol.end();m_ItBufferConsol++,i++)
    00290                 {
    00291                         logfilecsl<<i<<"::"<<m_ItBufferConsol->data()<<std::endl;
    00292                 }
    00293                 logfilecsl.close();
    00294         }
    00295         i=0;
    00296
    00297         for(m_RItBufferConsol=m_BufferConsol.rbegin();i<m_LineToStar;i++)
    00298         {
    00299                 m_RItBufferConsol++;
    00300         }
    00301
    00302         for(i=0;m_RItBufferConsol!=m_BufferConsol.rend();m_RItBufferConsol++,i++)
    00303         {
    00304                 ExNihilo::RenderBitmapString(10,cordy-(10*i)-20,GLUT_BITMAP_8_BY_13,m_RItBufferConsol->data());
    00305                 if(i*10>cordy)break;
    00306         }
    00307         m_BufferConsol.clear();
    00308
    00309         ExNihilo::RenderBitmapString(10,cordy-10,GLUT_BITMAP_8_BY_13,bufferdata);
    00310         glEnable(GL_DEPTH_TEST);
    00311         glEnable(GL_LIGHTING);
    00312         glDisable(GL_TEXTURE_2D);
    00313         ExNihilo::LeaveOrthoMode();
    00314
    00315         if (m_ConsoleState == m_NextConsoleState && console_move == true) {
    00316                 console_move = false;
    00317         }
    00318
    00319         //DrawBuffer();
    00320 UnGuard
    00321 }

int GetConsoleState | ( | void |  | ) | `[inline]`

| Definition at line 157 of file ExManagerConsole.h. References m_ConsoleState.
    00158 { return m_ConsoleState; }

void Init | ( | void |  | ) | `[virtual]`

| Reimplemented from ExManager. Definition at line 93 of file ExManagerConsole.cpp. References Guard, and SetConsoleBackGroudTexture(). Referenced by InitManager(), and SetGlutCallBack().
    00094 {
    00095 Guard(void ExManagerConsole::init(void))
    00096         SetConsoleBackGroudTexture("back.bmp");
    00097 UnGuard
    00098 }

ExCAction InputAction | ( | ExCAction | Action | ) | `[virtual]`

| Reimplemented from ExManager. Definition at line 975 of file ExManagerConsole.cpp. References ExManager::Consol, ConsoleMove(), FULL, FULLTOHALF, FULLTOHIDE, Guard, HALF, HALFTOFULL, HALFTOHIDE, HIDE, HIDETOFULL, HIDETOHALF, InputAction(), isConsoleMove(), LineDown(), LineUp(), ExCAction::m_Action, ExCAction::m_NextAction, ExCAction::m_Param, NextAviableState(), ExManager::SetAskForCommand(), ExManager::SetAskForExclusifCommand(), SetConsoleBackGroudBlending(), SetConsoleBackGroudBlendingState(), SetConsoleBackGroudColorBlue(), SetConsoleBackGroudColorGreen(), SetConsoleBackGroudColorRed(), SetConsoleBackGroudTexture(), SetConsoleBackGroudTextureState(), SetConsoleState(), and ExManager::SetStatus(). Referenced by InputAction(), InputCommand(), and ExManagerCommand::ProcesExCAction().
    00976 {
    00977 Guard(ExCAction ExManagerConsole::InputAction(ExCAction Action))
    00978         //std::cout<<"ManagerConsol::Input action :"<<Action<<std::endl;
    00979         switch(Action.m_Action)
    00980         {
    00981         case CONSOL_LINE_UP:LineUp();break;
    00982         case CONSOL_LINE_DOWN:LineDown();break;
    00983     case SHOW_HALF_CONSOL:
    00984                 if (!isConsoleMove ())
    00985                 {
    00986                         ConsoleMove (true);
    00987                         SetStatus(true);
    00988                         SetAskForCommand(true);
    00989                         SetAskForExclusifCommand(true);
    00990                         SetConsoleState(HALF);
    00991                 }
    00992                 break;
    00993         case SHOW_FULL_CONSOL:
    00994                 if (!isConsoleMove ())
    00995                 {
    00996                         ConsoleMove (true);
    00997                         SetStatus(true);
    00998                         SetAskForCommand(true);
    00999                         SetAskForExclusifCommand(true);
    01000                         SetConsoleState(FULL);
    01001                 }
    01002                 break;
    01003         case HIDE_CONSOL:
    01004                 if (!isConsoleMove ())
    01005                 {
    01006                         ConsoleMove (true);
    01007                         SetStatus(false);
    01008                         SetConsoleState(HIDE);
    01009                         SetAskForCommand(false);
    01010                         SetAskForExclusifCommand(false);
    01011                 }
    01012                 break;
    01013         case CONSOL_NEXT_AVIABLE_STATE:
    01014                 switch(NextAviableState())
    01015                 {
    01016                 case HIDE:
    01017                 case FULLTOHIDE:
    01018                 case HALFTOHIDE:
    01019                         if (!isConsoleMove ())
    01020                         {
    01021                                 ConsoleMove (true);
    01022                                 SetStatus(false);
    01023                                 SetConsoleState(HIDE);
    01024                                 SetAskForCommand(false);
    01025                                 SetAskForExclusifCommand(false);
    01026                         }
    01027                         break;
    01028                 case HALF:
    01029                 case HIDETOHALF:
    01030                 case FULLTOHALF:
    01031                         if (!isConsoleMove ())
    01032                         {
    01033                                 ConsoleMove (true);
    01034                                 SetStatus(true);
    01035                                 SetAskForCommand(true);
    01036                                 SetAskForExclusifCommand(true);
    01037                                 SetConsoleState(HALF);
    01038                         }
    01039                         break;
    01040                 case FULL:
    01041                 case HIDETOFULL:
    01042                 case HALFTOFULL:
    01043                         if (!isConsoleMove ())
    01044                         {
    01045                                 ConsoleMove (true);
    01046                                 SetStatus(true);
    01047                                 SetAskForCommand(true);
    01048                                 SetAskForExclusifCommand(true);
    01049                                 SetConsoleState(FULL);
    01050                         }
    01051                         break;
    01052                 }
    01053                 break;
    01054
    01055         case SET_CONSOL_BACKGROUND_TEXURE:SetConsoleBackGroudTexture(Action.m_Param);break;
    01056         case ENABLE_CONSOL_BACKGROUND_TEXTURE:SetConsoleBackGroudTextureState(true);break;
    01057         case DISABLE_CONSOL_BACKGROUND_TEXTURE:SetConsoleBackGroudTextureState(false);break;
    01058         case SET_CONSOL_BACKGROUND_COLOR:break;
    01059         case SET_CONSOL_BACKGROUND_COLOR_BLUE:
    01060                 try
    01061                 {
    01062                         SetConsoleBackGroudColorBlue(atof(Action.m_Param.data()));
    01063                 }catch(...)
    01064                 {
    01065                         *Consol<<"Enter a float value"<<std::endl;
    01066                 }
    01067                 break;
    01068         case SET_CONSOL_BACKGROUND_COLOR_GREEN:
    01069                 try
    01070                 {
    01071                         SetConsoleBackGroudColorGreen(atof(Action.m_Param.data()));
    01072                 }catch(...)
    01073                 {
    01074                         *Consol<<"Enter a float value"<<std::endl;
    01075                 }
    01076                 break;
    01077         case SET_CONSOL_BACKGROUND_COLOR_RED:
    01078                 try
    01079                 {
    01080                         SetConsoleBackGroudColorRed(atof(Action.m_Param.data()));
    01081                 }catch(...)
    01082                 {
    01083                         *Consol<<"Enter a float value"<<std::endl;
    01084                 }
    01085         case ENABLE_CONSOL_BACKGROUND_BLENDING:SetConsoleBackGroudBlendingState(true);break;
    01086         case DISABLE_CONSOL_BACKGROUND_BLENDING:SetConsoleBackGroudBlendingState(false);break;
    01087         case SET_CONSOL_BACKGROUND_BLENDING:
    01088                 try
    01089                 {
    01090                         SetConsoleBackGroudBlending(atof(Action.m_Param.data()));
    01091                 }catch(...)
    01092                 {
    01093                         *Consol<<"Enter a float value"<<std::endl;
    01094                 }
    01095                 break;
    01096         }
    01097     if(Action.m_NextAction){return *Action.m_NextAction;}
    01098         else{return NOTHING;}
    01099 UnGuard
    01100 }

ExCAction InputCommand | ( | ExCCommand | Command | ) | `[virtual]`

| Reimplemented from ExManager. Definition at line 412 of file ExManagerConsole.cpp. References ApplyBuffCommand(), Guard, InputAction(), InputCommand(), m_BuffCommand, m_BuffOldCommand, ExCCommand::m_Command, m_ItVecStringAction, m_Move, m_VecStringAction, and PosIntoBuffOldCommand. Referenced by InputCommand(), and ExManagerCommand::InputCommand().
    00413 {
    00414 Guard(ExCAction ExManagerConsole::InputCommand(ExCCommand Command))
    00415         //std::cout<<"ManagerConsol::Input Command consol:"<<Command.m_Command<<std::endl;
    00416         switch(Command.m_Command)
    00417         {
    00418         case KEYBOARD_DOWN_EXP:
    00419                 InputAction(CONSOL_NEXT_AVIABLE_STATE);
    00420                 return NOTHING;
    00421
    00422         case KEYBOARD_DOWN_ESC:
    00423                 InputAction(HIDE_CONSOL);
    00424                 return NOTHING;
    00425
    00426         case KEYBOARD_DOWN_A:
    00427                 m_BuffCommand.append("a");
    00428                 return NOTHING;
    00429
    00430         case KEYBOARD_DOWN_Z:
    00431                 m_BuffCommand.append("z");
    00432                 return NOTHING;
    00433
    00434         case KEYBOARD_DOWN_E:
    00435                 m_BuffCommand.append("e");
    00436                 return NOTHING;
    00437
    00438         case KEYBOARD_DOWN_R:
    00439                 m_BuffCommand.append("r");
    00440                 return NOTHING;
    00441
    00442         case KEYBOARD_DOWN_T:
    00443                 m_BuffCommand.append("t");
    00444                 return NOTHING;
    00445
    00446         case KEYBOARD_DOWN_Y:
    00447                 m_BuffCommand.append("y");
    00448                 return NOTHING;
    00449
    00450         case KEYBOARD_DOWN_U:
    00451                 m_BuffCommand.append("u");
    00452                 return NOTHING;
    00453         case KEYBOARD_DOWN_I:
    00454                 m_BuffCommand.append("i");
    00455                 return NOTHING;
    00456
    00457         case KEYBOARD_DOWN_O:
    00458                 m_BuffCommand.append("o");
    00459                 return NOTHING;
    00460
    00461         case KEYBOARD_DOWN_P:
    00462                 m_BuffCommand.append("p");
    00463                 return NOTHING;
    00464
    00465         case KEYBOARD_DOWN_Q:
    00466                 m_BuffCommand.append("q");
    00467                 return NOTHING;
    00468
    00469         case KEYBOARD_DOWN_S:
    00470                 m_BuffCommand.append("s");
    00471                 return NOTHING;
    00472
    00473         case KEYBOARD_DOWN_D:
    00474                 m_BuffCommand.append("d");
    00475                 return NOTHING;
    00476
    00477         case KEYBOARD_DOWN_F:
    00478                 m_BuffCommand.append("f");
    00479                 return NOTHING;
    00480
    00481         case KEYBOARD_DOWN_G:
    00482                 m_BuffCommand.append("g");
    00483                 return NOTHING;
    00484
    00485         case KEYBOARD_DOWN_H:
    00486                 m_BuffCommand.append("h");
    00487                 return NOTHING;
    00488
    00489         case KEYBOARD_DOWN_J:
    00490                 m_BuffCommand.append("j");
    00491                 return NOTHING;
    00492
    00493         case KEYBOARD_DOWN_K:
    00494                 m_BuffCommand.append("k");
    00495                 return NOTHING;
    00496
    00497         case KEYBOARD_DOWN_L:
    00498                 m_BuffCommand.append("l");
    00499                 return NOTHING;
    00500
    00501         case KEYBOARD_DOWN_M:
    00502                 m_BuffCommand.append("m");
    00503                 return NOTHING;
    00504
    00505         case KEYBOARD_DOWN_W:
    00506                 m_BuffCommand.append("w");
    00507                 return NOTHING;
    00508
    00509         case KEYBOARD_DOWN_X:
    00510                 m_BuffCommand.append("x");
    00511                 return NOTHING;
    00512
    00513         case KEYBOARD_DOWN_C:
    00514                 m_BuffCommand.append("c");
    00515                 return NOTHING;
    00516
    00517         case KEYBOARD_DOWN_V:
    00518                 m_BuffCommand.append("v");
    00519                 return NOTHING;
    00520
    00521         case KEYBOARD_DOWN_B:
    00522                 m_BuffCommand.append("b");
    00523                 return NOTHING;
    00524
    00525         case KEYBOARD_DOWN_N:
    00526                 m_BuffCommand.append("n");
    00527                 return NOTHING;
    00528
    00529         case KEYBOARD_DOWN_M_A:
    00530                 m_BuffCommand.append("A");
    00531                 return NOTHING;
    00532
    00533         case KEYBOARD_DOWN_M_Z:
    00534                 m_BuffCommand.append("Z");
    00535                 return NOTHING;
    00536
    00537         case KEYBOARD_DOWN_M_E:
    00538                 m_BuffCommand.append("E");
    00539                 return NOTHING;
    00540
    00541         case KEYBOARD_DOWN_M_R:
    00542                 m_BuffCommand.append("R");
    00543                 return NOTHING;
    00544
    00545         case KEYBOARD_DOWN_M_T:
    00546                 m_BuffCommand.append("T");
    00547                 return NOTHING;
    00548
    00549         case KEYBOARD_DOWN_M_Y:
    00550                 m_BuffCommand.append("Y");
    00551                 return NOTHING;
    00552
    00553         case KEYBOARD_DOWN_M_U:
    00554                 m_BuffCommand.append("U");
    00555                 return NOTHING;
    00556         case KEYBOARD_DOWN_M_I:
    00557                 m_BuffCommand.append("I");
    00558                 return NOTHING;
    00559
    00560         case KEYBOARD_DOWN_M_O:
    00561                 m_BuffCommand.append("O");
    00562                 return NOTHING;
    00563
    00564         case KEYBOARD_DOWN_M_P:
    00565                 m_BuffCommand.append("P");
    00566                 return NOTHING;
    00567
    00568         case KEYBOARD_DOWN_M_Q:
    00569                 m_BuffCommand.append("Q");
    00570                 return NOTHING;
    00571
    00572         case KEYBOARD_DOWN_M_S:
    00573                 m_BuffCommand.append("S");
    00574                 return NOTHING;
    00575
    00576         case KEYBOARD_DOWN_M_D:
    00577                 m_BuffCommand.append("D");
    00578                 return NOTHING;
    00579
    00580         case KEYBOARD_DOWN_M_F:
    00581                 m_BuffCommand.append("F");
    00582                 return NOTHING;
    00583
    00584         case KEYBOARD_DOWN_M_G:
    00585                 m_BuffCommand.append("G");
    00586                 return NOTHING;
    00587
    00588         case KEYBOARD_DOWN_M_H:
    00589                 m_BuffCommand.append("H");
    00590                 return NOTHING;
    00591
    00592         case KEYBOARD_DOWN_M_J:
    00593                 m_BuffCommand.append("J");
    00594                 return NOTHING;
    00595
    00596         case KEYBOARD_DOWN_M_K:
    00597                 m_BuffCommand.append("K");
    00598                 return NOTHING;
    00599
    00600         case KEYBOARD_DOWN_M_L:
    00601                 m_BuffCommand.append("L");
    00602                 return NOTHING;
    00603
    00604         case KEYBOARD_DOWN_M_M:
    00605                 m_BuffCommand.append("M");
    00606                 return NOTHING;
    00607
    00608         case KEYBOARD_DOWN_M_W:
    00609                 m_BuffCommand.append("W");
    00610                 return NOTHING;
    00611
    00612         case KEYBOARD_DOWN_M_X:
    00613                 m_BuffCommand.append("X");
    00614                 return NOTHING;
    00615
    00616         case KEYBOARD_DOWN_M_C:
    00617                 m_BuffCommand.append("C");
    00618                 return NOTHING;
    00619
    00620         case KEYBOARD_DOWN_M_V:
    00621                 m_BuffCommand.append("V");
    00622                 return NOTHING;
    00623
    00624         case KEYBOARD_DOWN_M_B:
    00625                 m_BuffCommand.append("B");
    00626                 return NOTHING;
    00627
    00628         case KEYBOARD_DOWN_M_N:
    00629                 m_BuffCommand.append("N");
    00630                 return NOTHING;
    00631
    00632         case KEYBOARD_DOWN_0:
    00633                 m_BuffCommand.append("0");
    00634                 return NOTHING;
    00635
    00636         case KEYBOARD_DOWN_1:
    00637                 m_BuffCommand.append("1");
    00638                 return NOTHING;
    00639
    00640         case KEYBOARD_DOWN_2:
    00641                 m_BuffCommand.append("2");
    00642                 return NOTHING;
    00643
    00644         case KEYBOARD_DOWN_3:
    00645                 m_BuffCommand.append("3");
    00646                 return NOTHING;
    00647
    00648         case KEYBOARD_DOWN_4:
    00649                 m_BuffCommand.append("4");
    00650                 return NOTHING;
    00651
    00652         case KEYBOARD_DOWN_5:
    00653                 m_BuffCommand.append("5");
    00654                 return NOTHING;
    00655
    00656         case KEYBOARD_DOWN_6:
    00657                 m_BuffCommand.append("6");
    00658                 return NOTHING;
    00659
    00660         case KEYBOARD_DOWN_7:
    00661                 m_BuffCommand.append("7");
    00662                 return NOTHING;
    00663
    00664         case KEYBOARD_DOWN_8:
    00665                 m_BuffCommand.append("8");
    00666                 return NOTHING;
    00667
    00668         case KEYBOARD_DOWN_9:
    00669                 m_BuffCommand.append("9");
    00670                 return NOTHING;
    00671
    00672         case KEYBOARD_DOWN__:
    00673                 m_BuffCommand.append("_");
    00674                 return NOTHING;
    00675
    00676         case KEYBOARD_DOWN_2POINTS:
    00677                 m_BuffCommand.append(":");
    00678                 return NOTHING;
    00679
    00680         case KEYBOARD_DOWN_POINT:
    00681                 m_BuffCommand.append(".");
    00682                 return NOTHING;
    00683
    00684         case KEYBOARD_DOWN_PAGE_UP:
    00685                 m_Move=-1;
    00686                 return NOTHING;
    00687
    00688         case KEYBOARD_DOWN_PAGE_DOWN:
    00689                 m_Move=1;
    00690                 return NOTHING;
    00691
    00692         case KEYBOARD_UP_PAGE_UP:
    00693                 m_Move=0;
    00694                 return NOTHING;
    00695
    00696         case KEYBOARD_UP_PAGE_DOWN:
    00697                 m_Move=0;
    00698                 return NOTHING;
    00699
    00700         case KEYBOARD_DOWN_SPACE:
    00701                 m_BuffCommand.append(" ");
    00702                 return NOTHING;
    00703
    00704         case KEYBOARD_DOWN_ENTER:
    00705                 return ApplyBuffCommand();
    00706
    00707         case KEYBOARD_DOWN_TAB: {
    00708                 std::vector<std::string> vec_tmp;
    00709                 std::vector<std::string>::iterator i_tmp;
    00710
    00711                 vec_tmp.push_back ("load");
    00712                 vec_tmp.push_back ("cmd");
    00713                 vec_tmp.push_back ("help");
    00714                 vec_tmp.push_back ("clear");
    00715                 vec_tmp.push_back ("quit");
    00716
    00717                 for (m_ItVecStringAction = m_VecStringAction.begin(); m_ItVecStringAction != m_VecStringAction.end(); m_ItVecStringAction++) {
    00718                         vec_tmp.push_back (m_ItVecStringAction->first);
    00719                 }
    00720
    00721                 i_tmp = vec_tmp.begin ();
    00722                 std::string tmp;
    00723
    00724                 while (i_tmp != vec_tmp.end ()) {
    00725                         tmp = *i_tmp++;
    00726
    00727                         if (tmp.find (m_BuffCommand) == 0) {
    00728                                 if (tmp.find (' ') < tmp.length ())
    00729                                         m_BuffCommand = tmp.substr (0, tmp.find (' '));
    00730                                 else m_BuffCommand = tmp;
    00731                                 //m_BuffCommand += ' '; // this add a space after command
    00732                                 // but it sucks with some commands like quit :/
    00733                         }
    00734                 }
    00735                 return NOTHING;
    00736         }
    00737         case KEYBOARD_DOWN_CTRL_U:
    00738                 m_BuffCommand = "";
    00739                 return NOTHING;
    00740
    00741         case KEYBOARD_UP_ARROW_DOWN:
    00742                 PosIntoBuffOldCommand++;
    00743                 if(PosIntoBuffOldCommand<(int)m_BuffOldCommand.size()&&PosIntoBuffOldCommand>=-1)
    00744                 {
    00745                         m_BuffCommand=m_BuffOldCommand.at(PosIntoBuffOldCommand);
    00746                 }else
    00747                 {
    00748                         PosIntoBuffOldCommand=0;
    00749                 }
    00750
    00751
    00752                 return NOTHING;
    00753
    00754         case KEYBOARD_UP_ARROW_UP:
    00755                 PosIntoBuffOldCommand--;
    00756                 if(PosIntoBuffOldCommand<(int)m_BuffOldCommand.size()&&PosIntoBuffOldCommand>=0)
    00757                 {
    00758                         m_BuffCommand=m_BuffOldCommand.at(PosIntoBuffOldCommand);
    00759                 }else
    00760                 {
    00761                         PosIntoBuffOldCommand=0;
    00762                 }
    00763                 return NOTHING;
    00764
    00765         case KEYBOARD_UP_ARROW_LEFT:
    00766                 if(m_BuffCommand.size()>0)
    00767                 {
    00768                         m_BuffCommand.erase(m_BuffCommand.end()-1,m_BuffCommand.end());
    00769                 }
    00770                 return NOTHING;
    00771
    00772         case KEYBOARD_UP_BACKSPACE:
    00773                 if(m_BuffCommand.size()>0)
    00774                 {
    00775                         m_BuffCommand.erase(m_BuffCommand.end()-1,m_BuffCommand.end());
    00776                 }
    00777                 return NOTHING;
    00778
    00779         default :return NOTHING;
    00780         }
    00781 UnGuard
    00782 }

bool isConsoleMove | ( | void |  | ) | `[inline]`

| Definition at line 159 of file ExManagerConsole.h. References console_move. Referenced by InputAction().
    00160 { return console_move; }

void LineDown | ( | void |  | ) |

| Definition at line 328 of file ExManagerConsole.cpp. References m_LineToStar. Referenced by Draw(), and InputAction().
    00329 {
    00330         m_LineToStar--;
    00331         if(m_LineToStar<0){m_LineToStar=0;}
    00332 }

void LineUp | ( | void |  | ) |

| Definition at line 323 of file ExManagerConsole.cpp. References m_LineInConsol, and m_LineToStar. Referenced by Draw(), and InputAction().
    00324 {
    00325         m_LineToStar++;
    00326         if(m_LineToStar>m_LineInConsol)m_LineToStar=m_LineInConsol;
    00327 }

void ListConsoleCommand | ( | void |  | ) |

| Definition at line 784 of file ExManagerConsole.cpp. References ExManager::Consol, Guard, ListConsoleCommand(), m_ItVecStringAction, m_VecStringAction, and PREDIFINEDCOMMAND. Referenced by ApplyBuffCommand(), and ListConsoleCommand().
    00785 {
    00786 Guard(void ExManagerConsole::ListConsoleCommand(void))
    00787         *Consol<<"*******************************"<<std::endl;
    00788         *Consol<<"*List of all available command*"<<std::endl;
    00789         *Consol<<"*******************************"<<std::endl;
    00790         *Consol<<"load 'FILENAME'"<<std::endl;
    00791         *Consol<<"cmd 'number of command'"<<std::endl;;
    00792         *Consol<<"help 'command'"<<std::endl;
    00793         *Consol<<"clear 'clear console screen'"<<std::endl;
    00794         *Consol<<"quit 'exit ExNihilo'"<<std::endl;
    00795         int i=PREDIFINEDCOMMAND;
    00796         for(m_ItVecStringAction=m_VecStringAction.begin(); m_ItVecStringAction != m_VecStringAction.end(); m_ItVecStringAction++, i++)
    00797         {
    00798                 *Consol<<m_ItVecStringAction->first.data()<<std::endl;
    00799         }
    00800         *Consol<<"*****************************"<<std::endl;
    00801 UnGuard
    00802 }

void LoadStringActionFile | ( | const char * | FileName | ) |

| Definition at line 929 of file ExManagerConsole.cpp. References AddStringAction(), ExNihilo::ExtracValueFromSring(), Guard, LoadStringActionFile(), PREFIX, and StringAction. Referenced by ExManagerCommand::InputAction(), ExManagerCommand::LoadSetOfFile(), and LoadStringActionFile().
    00930 {
    00931 Guard(void ExManagerConsole::LoadStringActionFile(const char *FileName))
    00932     char                        buffer[255];
    00933
    00934 #ifdef UNIX_SRC
    00935         sprintf(buffer, PREFIX "/ExNihilo/Data/Console/%s", FileName);
    00936 #else
    00937         sprintf(buffer, "../Data/Console/%s", FileName);
    00938 #endif
    00939         StringAction BuffStringAction;
    00940         std::ifstream fin;
    00941         std::string buffstring;
    00942         char b[256];
    00943         fin.open(buffer,std::ios::in);
    00944         if(fin.is_open())
    00945         {
    00946                 try
    00947                 {
    00948                         do
    00949                         {
    00950                                 memset(b,0,255);
    00951                                 fin.getline(b,256,'\n');
    00952                                 try
    00953                                 {
    00954                                         buffstring=ExNihilo::ExtracValueFromSring(b,"<consolcommand>","<#consolcommand>");
    00955                                         AddStringAction(ExNihilo::ExtracValueFromSring(buffstring,"<string>","<#string>")
    00956                                                 ,ExNihilo::ExtractIntValueFromSring(buffstring,"<action>","<#action>"));
    00957                                 }catch(ExCExpStringNotFound){}
    00958                         }while(!fin.eof());
    00959                         fin.close();
    00960                 }catch(...){throw ExCExpFileReadError();}
    00961         }else throw   ExCExpFileNotFound();
    00962 UnGuard
    00963 }

int NextAviableState | ( | void |  | ) |

| Definition at line 386 of file ExManagerConsole.cpp. References FULL, FULLTOHALF, FULLTOHIDE, Guard, HALF, HALFTOFULL, HALFTOHIDE, HIDE, HIDETOFULL, HIDETOHALF, and NextAviableState(). Referenced by InputAction(), and NextAviableState().
    00386                                            {
    00387 Guard(int ExManagerConsole::NextAviableState(void))
    00388         switch(m_ConsoleState) {
    00389                 case HIDE: return HALF;
    00390                 case HALF: return FULL;
    00391                 case FULL: return HIDE;
    00392                 case HIDETOHALF : return HALF;
    00393                 case HIDETOFULL : return FULL;
    00394                 case HALFTOFULL : return FULL;
    00395                 case FULLTOHALF : return HALF;
    00396                 case FULLTOHIDE : return HIDE;
    00397                 case HALFTOHIDE : return HIDE;
    00398                 default: return HALF;
    00399         }
    00400 UnGuard
    00401 }

void Reset | ( | void |  | ) | `[virtual]`

| Reimplemented from ExManager. Definition at line 73 of file ExManagerConsole.cpp. References console_move, Guard, HIDE, m_ConsoleState, m_ConsoleTransPalier, m_LineCounter, m_VecStringAction, PosIntoBuffOldCommand, and Reset(). Referenced by ExManagerCommand::ProcesExCAction(), and Reset().
    00074 {
    00075 Guard(ExManagerConsole::Reset(void))
    00076         m_ConsoleState=HIDE;
    00077         m_LineCounter=2;
    00078         PosIntoBuffOldCommand=0;
    00079         m_ConsoleTransPalier=20;
    00080         //m_BufferConsol.clear();
    00081         m_VecStringAction.clear();
    00082 //      SetConsoleBackGroudTexture("back2.tga");
    00083         console_move = false;
    00084 UnGuard
    00085 }

void SetConsoleBackGroudBlending | ( | float | blending | ) | `[inline]`

| Definition at line 163 of file ExManagerConsole.h. References m_Blending. Referenced by InputAction().
    00163 {m_Blending=state;}

void SetConsoleBackGroudBlendingState | ( | bool | state | ) | `[inline]`

| Definition at line 162 of file ExManagerConsole.h. References m_BackGroundTextureState. Referenced by InputAction().
    00162 {m_BackGroundTextureState=state;}

void SetConsoleBackGroudColor | ( | float | R,
|  | float | G,
|  | float | B
| ) | `[inline]`

| Definition at line 167 of file ExManagerConsole.h. References m_fBackGroundBlue.
    00167 {m_fBackGroundBlue=value;}

void SetConsoleBackGroudColorBlue | ( | float | value | ) | `[inline]`

| Definition at line 166 of file ExManagerConsole.h. References m_fBackGroundGreen. Referenced by InputAction().
    00166 {m_fBackGroundGreen=value;}

void SetConsoleBackGroudColorGreen | ( | float | value | ) | `[inline]`

| Definition at line 165 of file ExManagerConsole.h. References m_fBackGroundRed. Referenced by InputAction().
    00165 {m_fBackGroundRed=value;}

void SetConsoleBackGroudColorRed | ( | float | value | ) | `[inline]`

| Definition at line 164 of file ExManagerConsole.h. References m_fBlending. Referenced by InputAction().
    00164 {m_fBlending=blending;}

void SetConsoleBackGroudTexture | ( | std::string | FileName | ) |

| Definition at line 101 of file ExManagerConsole.cpp. References ExManagerTexture::Add(), Guard, m_BackGroundTexture, ManagerTexture, and SetConsoleBackGroudTexture(). Referenced by Init(), InputAction(), and SetConsoleBackGroudTexture().
    00102 {
    00103 Guard(void ExManagerConsole::SetConsoleBackGroudTexture(std::string     FileName))
    00104         if(ManagerTexture->Add(FileName))m_BackGroundTexture=FileName;
    00105 UnGuard
    00106 }

void SetConsoleBackGroudTextureState | ( | bool | state | ) | `[inline]`

| Definition at line 161 of file ExManagerConsole.h. Referenced by InputAction().
    00162 {m_BackGroundTextureState=state;}

void SetConsoleState | ( | int | state | ) |

| Definition at line 338 of file ExManagerConsole.cpp. References FULL, FULLTOHALF, FULLTOHIDE, Guard, HALF, HALFTOFULL, HALFTOHIDE, HIDE, HIDETOFULL, HIDETOHALF, m_ConsoleState, m_ConsoleTrans, m_NextConsoleState, SetConsoleState(), and ExManager::SetStatus(). Referenced by InputAction(), and SetConsoleState().
    00339 {
    00340 Guard(void ExManagerConsole::SetConsoleState(int state))
    00341         //cout<<"set console state :"<<state<<endl;
    00342         SetStatus(true);
    00343         switch(m_ConsoleState)
    00344         {
    00345         case HIDE:
    00346                 m_NextConsoleState=state;
    00347                 switch(state)
    00348                 {
    00349                 case HALF:
    00350                         m_ConsoleState=HIDETOHALF;
    00351                         break;
    00352                 case FULL:
    00353                         m_ConsoleState=HIDETOFULL;
    00354                         break;
    00355                 }
    00356                 break;
    00357         case HALF:
    00358                 m_NextConsoleState=state;
    00359                 switch(state)
    00360                 {
    00361                 case FULL:
    00362                         m_ConsoleState=HALFTOFULL;
    00363                         break;
    00364                 case HIDE:
    00365                         m_ConsoleState=HALFTOHIDE;
    00366                         break;
    00367                 }
    00368                 break;
    00369         case FULL:
    00370                 m_NextConsoleState=state;
    00371                 switch(state)
    00372                 {
    00373                 case HALF:
    00374                         m_ConsoleState=FULLTOHALF;
    00375                         break;
    00376                 case HIDE:
    00377                         m_ConsoleState=FULLTOHIDE;
    00378                         break;
    00379                 }
    00380                 break;
    00381         }
    00382         m_ConsoleTrans=1;
    00383 UnGuard
    00384 }

void SetManagerTexture | ( | ExManagerTexture * | Texture | ) | `[inline]`

| Definition at line 147 of file ExManagerConsole.h. References ManagerWindow. Referenced by SetManagerLink().
    00147 {ManagerWindow = Window;}

void SetManagerWindow | ( | ExManagerWindow * | Window | ) | `[inline]`

| Definition at line 146 of file ExManagerConsole.h. Referenced by SetManagerLink().
    00147 {ManagerWindow = Window;}

void Write | ( | const char * |  | ) |

| Definition at line 403 of file ExManagerConsole.cpp. References ExManager::Consol, Guard, and Write(). Referenced by RoutingtoConsole(), and Write().
    00404 {
    00405 Guard(void ExManagerConsole::Write(const char *Label))
    00406         //*Consol<<"<<==================Write to consol===========================>>"<<std::endl;
    00407         *Consol << Label << std::endl;
    00408         //*Consol<<"<<============================================================>>"<<std::endl;
    00409 UnGuard
    00410 }

void WriteInDaFile | ( | std::string | str | ) | `[private]`

## Field Documentation

bool console_move`[private]`

| Definition at line 95 of file ExManagerConsole.h. Referenced by ConsoleMove(), Draw(), ExManagerConsole(), isConsoleMove(), and Reset().

bool LogConsol`[private]`

| Definition at line 115 of file ExManagerConsole.h. Referenced by Draw(), and ExManagerConsole().

ofstream logfilecsl`[private]`

| Definition at line 113 of file ExManagerConsole.h. Referenced by Draw(), and ExManagerConsole().

std::string m_BackGroundTexture`[private]`

| Definition at line 98 of file ExManagerConsole.h. Referenced by Draw(), and SetConsoleBackGroudTexture().

bool m_BackGroundTextureState`[private]`

| Definition at line 116 of file ExManagerConsole.h. Referenced by ExManagerConsole(), and SetConsoleBackGroudBlendingState().

bool m_Blending`[private]`

| Definition at line 117 of file ExManagerConsole.h. Referenced by ExManagerConsole(), and SetConsoleBackGroudBlending().

std::string m_BuffCommand`[private]`

| Definition at line 100 of file ExManagerConsole.h. Referenced by ApplyBuffCommand(), ClearConsol(), Draw(), and InputCommand().

std::vector<std::string> m_BufferConsol`[private]`

| Definition at line 109 of file ExManagerConsole.h. Referenced by ApplyBuffCommand(), ClearConsol(), and Draw().

std::vector<std::string> m_BuffOldCommand`[private]`

| Definition at line 101 of file ExManagerConsole.h. Referenced by ApplyBuffCommand(), ClearConsol(), and InputCommand().

int m_ConsoleState`[private]`

| Definition at line 90 of file ExManagerConsole.h. Referenced by Draw(), ExManagerConsole(), GetConsoleState(), Reset(), and SetConsoleState().

int m_ConsoleTrans`[private]`

| Definition at line 92 of file ExManagerConsole.h. Referenced by Draw(), and SetConsoleState().

int m_ConsoleTransPalier`[private]`

| Definition at line 94 of file ExManagerConsole.h. Referenced by Draw(), ExManagerConsole(), and Reset().

float m_fBackGroundBlue`[private]`

| Definition at line 119 of file ExManagerConsole.h. Referenced by Draw(), ExManagerConsole(), and SetConsoleBackGroudColor().

float m_fBackGroundGreen`[private]`

| Definition at line 121 of file ExManagerConsole.h. Referenced by Draw(), ExManagerConsole(), and SetConsoleBackGroudColorBlue().

float m_fBackGroundRed`[private]`

| Definition at line 120 of file ExManagerConsole.h. Referenced by Draw(), ExManagerConsole(), and SetConsoleBackGroudColorGreen().

float m_fBlending`[private]`

| Definition at line 118 of file ExManagerConsole.h. Referenced by Draw(), ExManagerConsole(), and SetConsoleBackGroudColorRed().

bool m_flag = false`[static, private]`

| Definition at line 26 of file ExManagerConsole.cpp. Referenced by CreateSingleton().

ExManagerConsole * m_instance = NULL`[static, private]`

| Definition at line 27 of file ExManagerConsole.cpp. Referenced by CreateSingleton().

std::vector<std::string>::iterator m_ItBufferConsol`[private]`

| Definition at line 111 of file ExManagerConsole.h. Referenced by Draw().

std::vector<StringAction>::iterator m_ItVecStringAction`[private]`

| Definition at line 107 of file ExManagerConsole.h. Referenced by ApplyBuffCommand(), InputCommand(), and ListConsoleCommand().

int m_LineCounter`[private]`

| Definition at line 91 of file ExManagerConsole.h. Referenced by ExManagerConsole(), and Reset().

int m_LineInConsol`[private]`

| Definition at line 123 of file ExManagerConsole.h. Referenced by Draw(), and LineUp().

int m_LineToStar`[private]`

| Definition at line 122 of file ExManagerConsole.h. Referenced by Draw(), LineDown(), and LineUp().

int m_Move`[private]`

| Definition at line 96 of file ExManagerConsole.h. Referenced by Draw(), ExManagerConsole(), and InputCommand().

int m_NextConsoleState`[private]`

| Definition at line 93 of file ExManagerConsole.h. Referenced by Draw(), and SetConsoleState().

std::vector<std::string>::reverse_iterator m_RItBufferConsol`[private]`

| Definition at line 110 of file ExManagerConsole.h. Referenced by Draw().

std::vector<StringAction> m_VecStringAction`[private]`

| Definition at line 106 of file ExManagerConsole.h. Referenced by AddStringAction(), ApplyBuffCommand(), InputCommand(), ListConsoleCommand(), and Reset().

ExManagerTexture* ManagerTexture`[private]`

| Definition at line 89 of file ExManagerConsole.h. Referenced by Draw(), and SetConsoleBackGroudTexture().

ExManagerWindow* ManagerWindow`[private]`

| Definition at line 88 of file ExManagerConsole.h. Referenced by Draw().

int PosIntoBuffOldCommand`[private]`

| Definition at line 103 of file ExManagerConsole.h. Referenced by ExManagerConsole(), InputCommand(), and Reset().

The documentation for this class was generated from the following files:

- ExManagerConsole.h
- ExManagerConsole.cpp