Back to index

extremetuxracer  0.5beta
race_select.cpp
Go to the documentation of this file.
00001 /* 
00002  * Extreme Tux Racer
00003  * Copyleft 2007-2008 The ETR Team <http://www.extremetuxracer.com/>
00004  * 
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 #include "race_select.h"
00021 
00022 #include "ppgltk/button.h"
00023 #include "ppgltk/ssbutton.h"
00024 #include "ppgltk/listbox.h"
00025 #include "ppgltk/textarea.h"
00026 #include "ppgltk/font.h"
00027 
00028 #include "ppgltk/audio/audio.h"
00029 
00030 #include "course_load.h"
00031 #include "textures.h"
00032 #include "joystick.h"
00033 
00034 #include "stuff.h"
00035 #include "game_mgr.h"
00036 
00037 #include <iostream>
00038 
00039 
00040 
00041 static std::list<CourseData> *courseList;
00042 static std::list<CourseData>::iterator curElem;
00043 static std::list<CourseData>::iterator lastCompletedRace;
00044 
00045 RaceSelect::RaceSelect()
00046 {
00047     pp::Vec2d pos(0,0);
00048 
00049        m_modelList = ModelHndl->l_models;
00050        std::list<model_t>::iterator modelit=m_modelList.begin();
00051 
00052        courseList = &openCourseList;
00053               
00054     // Unless we're coming back from a race, initialize the race data to 
00055     //   defaults.
00056     
00057     if ( GameMode::prevmode != GAME_OVER ) {
00058               // Initialize the race data 
00059               curElem = courseList->begin();
00060               gameMgr->setCurrentRace(curElem);
00061               
00062            gameMgr->getCurrentRace().mirrored = false;
00063            gameMgr->getCurrentRace().condition = RACE_CONDITIONS_SUNNY;
00064            gameMgr->getCurrentRace().windy = false;
00065            gameMgr->getCurrentRace().snowing = false;
00066         gameMgr->getCurrentRace().snowtype = -1;
00067         gameMgr->getCurrentRace().windtype = -1;
00068     }
00069 
00070        mp_titleLbl = new pp::Label(pos, "heading", _("Select a race"));
00071        mp_titleLbl->alignment.center();
00072        mp_titleLbl->alignment.middle();   
00073        
00074     mp_backBtn = new pp::Button(pos,
00075                            pp::Vec2d(150, 40), 
00076                            "button_label", 
00077                            _("Back") );
00078     mp_backBtn->setHilitFontBinding( "button_label_hilit" );
00079     mp_backBtn->signalClicked.Connect(pp::CreateSlot(this,&RaceSelect::back));
00080 
00081        
00082     mp_startBtn = new pp::Button(pos,
00083                             pp::Vec2d(150, 40),
00084                             "button_label",
00085                             _("Race!") );
00086     mp_startBtn->setHilitFontBinding( "button_label_hilit" );
00087     mp_startBtn->setDisabledFontBinding( "button_label_disabled" );
00088        mp_startBtn->signalClicked.Connect(pp::CreateSlot(this,&RaceSelect::start));
00089 
00090     
00091     mp_nameLbl = new pp::Label( pos,"event_and_cup_label",_("Player name:"));
00092        mp_nameEnt = new pp::Entry(pos,pp::Vec2d(176,32),"event_and_cup_label",players[0].name.c_str());
00093        mp_nameEnt->setMaxChars(13);
00094 
00095 
00096        mp_modelEnt = new pp::Listbox<model_t>( pos, pp::Vec2d(139, 32), "listbox_item", m_modelList);
00097     mp_modelEnt->signalChange.Connect(pp::CreateSlot(this,&RaceSelect::listboxModelChange));
00098 
00099     #define MODELID_TUX 0
00100     #define MODELID_SAMUEL 1
00101     #define MODELID_TRIXI 2
00102     #define MODELID_SPEEDY 3
00103     // model icon
00104        mp_modelSSBtn = new pp::SSButton( pos,
00105                                   pp::Vec2d(89, 99),
00106                                   4 );
00107     mp_modelSSBtn->setStateImage(MODELID_TUX,"modelpreviews_button",
00108                               pp::Vec2d( 0.0, 0.0 ),
00109                               pp::Vec2d( 0.25, 1.0 ),
00110                               pp::Color::white );
00111        mp_modelSSBtn->setStateImage(MODELID_SAMUEL,"modelpreviews_button",
00112                               pp::Vec2d( 0.25, 0.0 ),
00113                               pp::Vec2d( 0.50, 1.0 ),
00114                               pp::Color::white );
00115 
00116        mp_modelSSBtn->setStateImage(MODELID_TRIXI,"modelpreviews_button",
00117                               pp::Vec2d( 0.50, 0.0 ),
00118                               pp::Vec2d( 0.75, 1.0 ),
00119                               pp::Color::white );
00120                   
00121     mp_modelSSBtn->setStateImage(MODELID_SPEEDY,"modelpreviews_button",
00122                               pp::Vec2d( 0.75, 0.0 ),
00123                               pp::Vec2d( 1.0, 1.0 ),
00124                               pp::Color::white );
00125 
00126     
00127     
00128     modelit = mp_modelEnt->getCurrentItem();    
00129        mp_modelSSBtn->setState((*modelit).id);
00130     mp_modelSSBtn->signalClicked.Connect(pp::CreateSlot(this,&RaceSelect::buttonModelChange));
00131   
00132        mp_raceListbox = new pp::Listbox<CourseData>(pos,
00133                                pp::Vec2d(460, 44),
00134                                "listbox_item",
00135                                *courseList);
00136     mp_raceListbox->setCurrentItem( curElem );
00137        mp_raceListbox->signalChange.Connect(pp::CreateSlot(this,&RaceSelect::listboxItemChange));
00138     // Create text area 
00139      
00140     mp_descTa = new pp::Textarea( pos,
00141                             pp::Vec2d(312, 107),
00142                             "race_description",
00143                             "" );
00144        mp_descTa->setText( (*curElem).description.c_str() );
00145 // Create preview
00146 
00147        mp_previewSSBtn = new pp::SSButton( pos, pp::Vec2d(132,99), 1);
00148        handlePreview( (*curElem).course.c_str() );
00149        mp_previewSSBtn->signalClicked.Connect(pp::CreateSlot(this,&RaceSelect::start));
00150        
00151 
00152     // Create state buttons - only if practicing or if cup_complete
00153     
00154        // mirror 
00155        mp_mirrorSSBtn = new pp::SSButton( pos,
00156                                    pp::Vec2d(32, 32),
00157                                    2 );
00158        mp_mirrorSSBtn->setStateImage(0,"mirror_button",
00159                               pp::Vec2d( 0.0/64.0, 32.0/64.0 ),
00160                               pp::Vec2d( 32.0/64.0, 64.0/64.0 ),
00161                               pp::Color::white );
00162 
00163        mp_mirrorSSBtn->setStateImage(1,"mirror_button",
00164                               pp::Vec2d( 32.0/64.0, 32.0/64.0 ),
00165                               pp::Vec2d( 64.0/64.0, 64.0/64.0 ),
00166                               pp::Color::white );
00167 
00168        mp_mirrorSSBtn->setState( (int)gameMgr->getCurrentRace().mirrored );
00169        // conditions
00170        mp_conditionsSSBtn = new pp::SSButton( pos,
00171                                        pp::Vec2d(32, 32),
00172                                        4 );
00173        mp_conditionsSSBtn->setStateImage(0,"conditions_button",
00174                               pp::Vec2d( 0.0/64.0, 32.0/64.0 ),
00175                               pp::Vec2d( 32.0/64.0, 64.0/64.0 ),
00176                               pp::Color::white );
00177 
00178        mp_conditionsSSBtn->setStateImage(1,"conditions_button",
00179                               pp::Vec2d( 32.0/64.0, 0.0/64.0 ),
00180                               pp::Vec2d( 64.0/64.0, 32.0/64.0 ),
00181                               pp::Color::white );
00182 
00183        mp_conditionsSSBtn->setStateImage(2,"conditions_button",
00184                               pp::Vec2d( 32.0/64.0, 32.0/64.0 ),
00185                               pp::Vec2d( 64.0/64.0, 64.0/64.0 ),
00186                               pp::Color::white );       
00187 
00188        mp_conditionsSSBtn->setStateImage(3,"conditions_button",
00189                               pp::Vec2d( 0.0/64.0, 0.0/64.0 ),
00190                               pp::Vec2d( 32.0/64.0, 32.0/64.0 ),
00191                               pp::Color::white );       
00192 
00193        mp_conditionsSSBtn->setState( (int)gameMgr->getCurrentRace().condition );
00194        // wind
00195        mp_windSSBtn = new pp::SSButton( pos,
00196                                   pp::Vec2d(32, 32),
00197                                   7 );
00198        mp_windSSBtn->setStateImage(0,"wind_button",
00199                               pp::Vec2d( 0.0/64.0, 96.0/128.0 ),
00200                               pp::Vec2d( 32.0/64.0, 128.0/128.0 ),
00201                               pp::Color::white );
00202 
00203        mp_windSSBtn->setStateImage(1,"wind_button",
00204                               pp::Vec2d( 32.0/64.0, 96.0/128.0 ),
00205                               pp::Vec2d( 64.0/64.0, 128.0/128.0 ),
00206                               pp::Color::white );
00207                   
00208     mp_windSSBtn->setStateImage(2,"wind_button",
00209                               pp::Vec2d( 0.0/64.0, 64.0/128.0 ),
00210                               pp::Vec2d( 32.0/64.0, 96.0/128.0 ),
00211                               pp::Color::white );
00212 
00213     mp_windSSBtn->setStateImage(3,"wind_button",
00214                               pp::Vec2d( 32.0/64.0, 64.0/128.0 ),
00215                               pp::Vec2d( 64.0/64.0, 96.0/128.0 ),
00216                               pp::Color::white );
00217 
00218     mp_windSSBtn->setStateImage(4,"wind_button",
00219                               pp::Vec2d( 0.0/64.0, 32.0/128.0 ),
00220                               pp::Vec2d( 32.0/64.0, 64.0/128.0 ),
00221                               pp::Color::white );
00222 
00223     mp_windSSBtn->setStateImage(5,"wind_button",
00224                               pp::Vec2d( 32.0/64.0, 32.0/128.0 ),
00225                               pp::Vec2d( 64.0/64.0, 64.0/128.0 ),
00226                               pp::Color::white );
00227                   
00228     mp_windSSBtn->setStateImage(6,"wind_button",
00229                               pp::Vec2d( 0.0/64.0, 0.0/128.0 ),
00230                               pp::Vec2d( 32.0/64.0, 32.0/128.0 ),
00231                               pp::Color::white );
00232 
00233        mp_windSSBtn->setState( gameMgr->getCurrentRace().windtype + 1 );
00234 
00235        // snow 
00236        mp_snowSSBtn = new pp::SSButton( pos,
00237                                   pp::Vec2d(32, 32),
00238                                   4 );
00239        mp_snowSSBtn->setStateImage(0,"snow_button",
00240                               pp::Vec2d( 0.0/64.0, 32.0/64.0 ),
00241                               pp::Vec2d( 32.0/64.0, 64.0/64.0 ),
00242                               pp::Color::white );
00243 
00244        mp_snowSSBtn->setStateImage(1,"snow_button",
00245                               pp::Vec2d( 32.0/64.0, 32.0/64.0 ),
00246                               pp::Vec2d( 64.0/64.0, 64.0/64.0 ),
00247                               pp::Color::white );
00248                   
00249     mp_snowSSBtn->setStateImage(2,"snow_button",
00250                               pp::Vec2d( 0.0/64.0, 0.0/64.0 ),
00251                               pp::Vec2d( 32.0/64.0, 32.0/64.0 ),
00252                               pp::Color::white );
00253 
00254     mp_snowSSBtn->setStateImage(3,"snow_button",
00255                               pp::Vec2d( 32.0/64.0, 0.0/64.0 ),
00256                               pp::Vec2d( 64.0/64.0, 32.0/64.0 ),
00257                               pp::Color::white );
00258 
00259        mp_snowSSBtn->setState( gameMgr->getCurrentRace().snowtype + 1 );
00260        
00261     updateButtonEnabledStates();
00262 
00263     play_music( "start_screen" );
00264 
00265 
00266 
00267 }
00268 
00269 RaceSelect::~RaceSelect()
00270 {
00271        delete mp_backBtn;
00272        delete mp_startBtn;
00273        delete mp_raceListbox;
00274        delete mp_previewSSBtn;
00275        delete mp_conditionsSSBtn;
00276        delete mp_snowSSBtn;
00277        delete mp_modelSSBtn;
00278        delete mp_windSSBtn;
00279        delete mp_mirrorSSBtn;
00280        delete mp_descTa;    
00281        delete mp_titleLbl;
00282        delete mp_nameLbl;
00283        delete mp_nameEnt;
00284        delete mp_modelEnt;
00285 }
00286 
00287 void
00288 RaceSelect::loop(float timeStep)
00289 {
00290        update_audio();
00291 
00292     set_gl_options( GUI );
00293 
00294     clear_rendering_context();
00295 
00296     UIMgr.setupDisplay();
00297 
00298        // draw snow and set windy to the winSSBtn state
00299        drawSnow(timeStep, mp_windSSBtn->getState());
00300 
00301     theme.drawMenuDecorations();
00302 
00303     setWidgetPositionsAndDrawDecorations();
00304 
00305     UIMgr.draw();
00306 
00307     reshape( getparam_x_resolution(), getparam_y_resolution() );
00308 
00309     winsys_swap_buffers();
00310 }
00311 
00312 void
00313 RaceSelect::setWidgetPositionsAndDrawDecorations()
00314 {
00315     int w = getparam_x_resolution();
00316     int h = getparam_y_resolution();
00317     int box_width, box_height, box_max_y;
00318     int x_org, y_org;
00319 //    GLuint texobj;
00320 
00321     // set the dimensions of the box in which all widgets should fit
00322     box_width = 460;
00323     box_height = 310;
00324     box_max_y = h - 128;
00325 
00326     x_org = w/2 - box_width/2;
00327     y_org = h/2 - box_height/2;
00328     if ( y_org + box_height > box_max_y ) {
00329               y_org = box_max_y - box_height;
00330     }
00331 
00332     mp_backBtn->setPosition(pp::Vec2d( x_org + 131 - mp_backBtn->getWidth()/2.0,
00333                     42 ) );
00334 
00335     mp_startBtn->setPosition(pp::Vec2d( x_org + 343 - mp_startBtn->getWidth()/2.0,
00336                     42 ) );
00337 
00338        mp_nameLbl->setPosition(pp::Vec2d( x_org,
00339                     y_org-40) );
00340        mp_nameEnt->setPosition(pp::Vec2d( x_org+120,
00341                     y_org-48) );
00342 
00343        mp_modelEnt->setPosition(pp::Vec2d( x_org+120,
00344                     y_org) );
00345     mp_modelSSBtn->setPosition(pp::Vec2d( x_org+320,
00346                     y_org-60) );
00347 
00348        mp_raceListbox->setPosition(pp::Vec2d( x_org,y_org + 221 ) );
00349 
00350        mp_descTa->setPosition(pp::Vec2d( x_org,y_org + 66 ) );
00351     
00352        mp_conditionsSSBtn->setPosition(
00353            pp::Vec2d( x_org + box_width - 4*36 + 4,
00354                        y_org + 181 ) );
00355 
00356        mp_windSSBtn->setPosition(
00357            pp::Vec2d( x_org + box_width - 3*36 + 4 ,
00358                        y_org + 181 ) );
00359 
00360        mp_snowSSBtn->setPosition(
00361            pp::Vec2d( x_org + box_width - 2*36 + 4,
00362                        y_org + 181 ) );
00363 
00364        mp_mirrorSSBtn->setPosition(
00365            pp::Vec2d( x_org + box_width - 1*36 + 4,
00366                        y_org + 181 ) );
00367     
00368        mp_titleLbl->setPosition(pp::Vec2d(
00369                             x_org + box_width/2.0,
00370                             y_org + 310));
00371        
00372     // Draw text indicating race requirements (if race not completed), 
00373     //   or results in race if race completed.
00374     drawStatusMsg( x_org, y_org );
00375 
00376     // Draw preview
00377 
00378        mp_previewSSBtn->setPosition(pp::Vec2d( x_org+box_width-136, y_org+70 ));
00379        
00380        //std::list<CourseData>::iterator elem;
00381        //elem = mp_raceListbox->getCurrentItem();
00382 
00383     glDisable( GL_TEXTURE_2D );
00384 
00385     glColor4f( 1.0, 1.0, 1.0, 1.0 );
00386     glBegin( GL_QUADS );
00387     {
00388        glVertex2f( x_org+box_width-140, y_org+66 );
00389        glVertex2f( x_org+box_width, y_org+66 );
00390        glVertex2f( x_org+box_width, y_org+66+107 );
00391        glVertex2f( x_org+box_width-140, y_org+66+107 );
00392     }
00393     glEnd();
00394 
00395     glEnable( GL_TEXTURE_2D );
00396 
00397 /* Old preview system
00398 
00399        //current_course = (*elem).course;
00400        //if ( !get_texture_binding( current_course, &texobj ) ) {
00401     if ( !get_texture_binding( (*elem).course.c_str(), &texobj ) ) {
00402        if ( !get_texture_binding( "no_preview", &texobj ) ) {
00403            texobj = 0;
00404        }
00405     }
00406 
00407     glBindTexture( GL_TEXTURE_2D, texobj );
00408 
00409     glBegin( GL_QUADS );
00410     {
00411        glTexCoord2d( 0, 0);
00412        glVertex2f( x_org+box_width-136, y_org+70 );
00413 
00414        glTexCoord2d( 1, 0);
00415        glVertex2f( x_org+box_width-4, y_org+70 );
00416 
00417        glTexCoord2d( 1, 1);
00418        glVertex2f( x_org+box_width-4, y_org+70+99 );
00419 
00420        glTexCoord2d( 0, 1);
00421        glVertex2f( x_org+box_width-136, y_org+70+99 );
00422            }
00423     glEnd();
00424 */
00425 }
00426 
00427 
00428 void
00429 RaceSelect::updateRaceData()
00430 {
00431        players[0].name = mp_nameEnt->getContent();
00432        gameMgr->getCurrentRace().course = (*curElem).course;
00433        gameMgr->getCurrentRace().name = (*curElem).name;
00434        gameMgr->getCurrentRace().description = (*curElem).description;
00435        gameMgr->getCurrentRace().mirrored = (bool) mp_mirrorSSBtn->getState();
00436        gameMgr->getCurrentRace().condition = (race_conditions_t) mp_conditionsSSBtn->getState();
00437        
00438     int snowtype = (int) mp_snowSSBtn->getState();
00439     gameMgr->getCurrentRace().snowing = (snowtype > 0);
00440     gameMgr->getCurrentRace().snowtype = gameMgr->getCurrentRace().snowing ? snowtype-1:-1;
00441     int windtype = (int) mp_windSSBtn->getState();
00442     gameMgr->getCurrentRace().windy = (windtype > 0);
00443     gameMgr->getCurrentRace().windtype = gameMgr->getCurrentRace().windy ? windtype-1:-1;
00444 }
00445 
00446 void
00447 RaceSelect::drawStatusMsg( int x_org, int y_org )
00448 {
00449        
00450        PlayerCourseData data;
00451        
00452        pp::Font *font = pp::Font::get("race_requirements");
00453        pp::Font *labelfont = pp::Font::get("race_requirements_label");
00454        
00455        if(players[0].getOpenCourseData((*curElem).name,data)){
00456               
00457               char buff[BUFF_LEN];
00458               int minutes;
00459               int seconds;
00460               int hundredths;
00461 
00462               pp::Vec2d pos(x_org,y_org + 184);
00463               
00464               getTimeComponents( data.time, minutes, seconds, hundredths );
00465 
00466               const char* string = _("Time:");
00467               labelfont->draw(string, pos);
00468               pos.x+=labelfont->advance(string) + 5;
00469               
00470               sprintf( buff, _("%02d:%02d.%02d"),minutes, seconds, hundredths);
00471               font->draw(buff, pos);
00472               
00473               pos.x+=75;
00474               string = _("Herring:");
00475               labelfont->draw(string, pos);
00476               pos.x+=labelfont->advance(string) + 5;
00477 
00478               sprintf( buff, "%03d", data.herring ); 
00479               font->draw(buff, pos);
00480               
00481               pos.x+=40;    
00482               string = _("Score:");
00483               labelfont->draw(string, pos);
00484               pos.x+=labelfont->advance(string) + 5;
00485        
00486               sprintf( buff, "%06d", data.score );
00487               font->draw(buff, pos);
00488        }
00489               
00490        const char* string = _("Contributed by:");
00491        pp::Vec2d pos(x_org,y_org+50);
00492        labelfont->draw(string,pos);
00493        
00494        pos.x += labelfont->advance(string) + 5;
00495               
00496        if(!(*curElem).contributed.empty()){
00497               font->draw((*curElem).contributed.c_str(),pos);         
00498        }else{
00499               font->draw(_("Unknown"),pos);
00500        }      
00501 }
00502 
00503 
00504 void
00505 RaceSelect::updateButtonEnabledStates()
00506 {
00507        mp_startBtn->setSensitive( true );
00508        mp_previewSSBtn->setSensitive( true );
00509 }
00510 
00511 void
00512 RaceSelect::back()
00513 {
00514        set_game_mode( GAME_TYPE_SELECT );
00515     UIMgr.setDirty();
00516 }
00517 
00518 void
00519 RaceSelect::start()
00520 {
00521     mp_startBtn->setHighlight( true );
00522        updateRaceData();    
00523        loop( 0 );
00524     set_game_mode( LOADING );
00525        std::list<model_t>::iterator modelit = mp_modelEnt->getCurrentItem();
00526        ModelHndl->load_model((*modelit).id);     
00527 }
00528 
00529 void
00530 RaceSelect::handlePreview(const char* preview)
00531 {
00532        GLuint texobj;
00533        if ( get_texture_binding( preview, &texobj ) ) 
00534               mp_previewSSBtn->setStateImage(0, preview, pp::Vec2d(0.0, 0.0), pp::Vec2d(1.0, 1.0), pp::Color::white);  
00535        else
00536               mp_previewSSBtn->setStateImage(0, "no_preview", pp::Vec2d(0.0, 0.0), pp::Vec2d(1.0, 1.0), pp::Color::white);
00537        
00538 }
00539 
00540 void
00541 RaceSelect::listboxItemChange()
00542 {
00543        curElem=mp_raceListbox->getCurrentItem();
00544        gameMgr->setCurrentRace(curElem);  
00545        updateRaceData();
00546        mp_descTa->setText( (*curElem).description.c_str() );
00547        handlePreview( (*curElem).course.c_str() );
00548        updateButtonEnabledStates();
00549        UIMgr.setDirty();
00550 }
00551 
00552 void
00553 RaceSelect::listboxModelChange()
00554 {
00555     std::list<model_t>::iterator modelit = mp_modelEnt->getCurrentItem();
00556     mp_modelSSBtn->setState((*modelit).id);
00557 }
00558 
00559 void
00560 RaceSelect::buttonModelChange()
00561 {
00562     std::list<model_t>::iterator modelit = mp_modelEnt->getCurrentItem();
00563     modelit++;
00564     if(modelit!=mp_modelEnt->getItemList().end()) {
00565         mp_modelEnt->setCurrentItem(modelit);
00566     } else {
00567         mp_modelEnt->setCurrentItem(mp_modelEnt->getItemList().begin());
00568     }
00569 }
00570 
00571 bool
00572 RaceSelect::keyPressEvent(SDLKey key)
00573 {
00574        switch (key){
00575               case SDLK_UP:
00576               case SDLK_LEFT:
00577                      mp_raceListbox->gotoPrevItem();
00578               return true;
00579               case SDLK_RIGHT:
00580               case SDLK_DOWN:
00581                      mp_raceListbox->gotoNextItem();
00582               return true;
00583               case SDLK_RETURN: 
00584               mp_startBtn->simulateMouseClick();
00585                      UIMgr.setDirty();
00586                      return true;
00587               case SDLK_ESCAPE: 
00588               mp_backBtn->simulateMouseClick();
00589                      UIMgr.setDirty();
00590                      return true;
00591 /* We cant use only letters since that makes them imposible to type in the name input
00592               case 'c': 
00593               mp_conditionsSSBtn->simulateMouseClick();
00594               return true;
00595               case 'w': 
00596               mp_windSSBtn->simulateMouseClick();
00597               return true;
00598               case 'm':
00599               mp_mirrorSSBtn->simulateMouseClick();
00600               return true;
00601            */
00602               default:
00603                      return false;
00604        }      
00605 }