

Definition at line 16 of file MenuOptions.h.
Public Member Functions | |
| MenuOptions () | |
| virtual | ~MenuOptions () | 
| virtual const char * | getName () const | 
| virtual bool | allowBg () const | 
| void | mouseButton (const MouseStroke &stroke) | 
| Start level under pressed button.   | |
| virtual void | drawOn (SDL_Surface *screen) | 
| void | receiveString (const StringMsg *msg) | 
| Handle incoming message.   | |
Protected Member Functions | |
| virtual void | own_initState () | 
| Display menu.   | |
| virtual void | own_updateState () | 
| Update statusbar.   | |
| virtual void | own_pauseState () | 
| virtual void | own_resumeState () | 
| Display options menu.   | |
| virtual void | own_cleanState () | 
      
  | 
  
| 
 
 Definition at line 32 of file MenuOptions.cpp. 00033 {
00034     m_container = NULL;
00035     m_statusBar = NULL;
00036     m_needRefresh = false;
00037     registerDrawable(this);
00038     prepareMenu();
00039 
00040     takeHandler(new OptionsInput(this));
00041 }
  | 
  
      
  | 
  
| 
 
 Definition at line 43 of file MenuOptions.cpp. 00044 {
00045     delete m_container;
00046 }
  | 
  
      
  | 
  
| 
 
 Reimplemented from GameState. Definition at line 40 of file MenuOptions.h. 00040 { return true; }
  | 
  
      
  | 
  
| 
 
 Implements Drawable. Definition at line 224 of file MenuOptions.cpp. 00225 {
00226     SDL_Color gray = {0xf0, 0xf0, 0xf0, 128};
00227     SurfaceTool::alphaFill(screen, NULL, gray);
00228 }
  | 
  
      
  | 
  
| 
 
 Implements INamed. Definition at line 39 of file MenuOptions.h. 00039 { return "state_options"; };
  | 
  
      
  | 
  
| 
 Start level under pressed button. Start pedometer when level is solved already. Definition at line 218 of file MenuOptions.cpp. 00219 {
00220     m_container->mouseButton(stroke);
00221 }
  | 
  
      
  | 
  
| 
 
 Implements GameState. Definition at line 35 of file MenuOptions.h. 00035 {}
  | 
  
      
  | 
  
| 
 Display menu. 
 Implements GameState. Definition at line 52 of file MenuOptions.cpp. 00053 {
00054     registerWatcher("lang");
00055     own_resumeState();
00056 }
  | 
  
      
  | 
  
| 
 
 Implements GameState. Definition at line 33 of file MenuOptions.h. 00033 {}
  | 
  
      
  | 
  
| 
 Display options menu. Menu will be centred on screen. Implements GameState. Definition at line 63 of file MenuOptions.cpp. 00064 {
00065     int contentW = m_container->getW();
00066     int contentH = m_container->getH();
00067     OptionAgent *options = OptionAgent::agent();
00068     int screenW = options->getAsInt("screen_width");
00069     int screenH = options->getAsInt("screen_height");
00070 
00071     m_container->setShift(
00072             V2((screenW - contentW) / 2, (screenH - contentH) / 2));
00073 }
  | 
  
      
  | 
  
| 
 Update statusbar. 
 Implements GameState. Definition at line 79 of file MenuOptions.cpp. 00080 {
00081     if (m_needRefresh) {
00082         m_needRefresh = false;
00083         prepareMenu();
00084         own_resumeState();
00085     }
00086     std::string tooltip = m_container->getTip(getInput()->getMouseLoc());
00087     m_statusBar->setLabel(tooltip);
00088 }
  | 
  
      
  | 
  
| 
 Handle incoming message. Messages: 
 
 
 Reimplemented from BaseListener. Definition at line 238 of file MenuOptions.cpp. 00239 {
00240     if (msg->equalsName("param_changed")) {
00241         std::string param = msg->getValue();
00242         if ("lang" == param) {
00243             m_needRefresh = true;
00244         }
00245         else {
00246             throw UnknownMsgException(msg);
00247         }
00248     }
00249     else {
00250         throw UnknownMsgException(msg);
00251     }
00252 }
  | 
  
 1.4.2