//
// mainmenu.h
//
// program's main menu
//
//
// Author: Tomi Belan <tomi.belan@gmail.com>, (C) 2006
//
// Copyright: See COPYING file that comes with this distribution
//
//

#ifndef _mainmenu_h_
#define _mainmenu_h_

#include <vector>

#include "main.h"
#include "programmode.h"
#include "mainmenubutton.h"

class MainMenu : public ProgramMode {
private:
  SDL_Surface *menuImage;
  int focusedButton;
  
  bool waitingToReleaseReturn;
  
  std::vector<MainMenuButton*> buttons;
  
  int getButtonId(int i) { return buttonTypes[i]; }
  void redraw();
  
  void up();
  void down();
  void select();
  
public:
  MainMenu();
  virtual ~MainMenu();
  
  virtual void event(SDL_Event *);
  virtual void update();
  virtual void cleanUp();
  virtual void activate();
  
  int getFocusedButton() const { return focusedButton; }
  
//  static int getLogoYOffset();
//  static int getMenuYOffset();
  
//  static int getLogoYOffset() { return (screen->h-imagePool["logo.png"]->h-imagePool["menu.png"]->h)/3; }
//  static int getMenuYOffset() { return (screen->h-imagePool["logo.png"]->h-imagePool["menu.png"]->h)/3; }
  static int getLogoYOffset() { return 0; }
  static int getMenuYOffset() { return 0; }
  static int getLogoHeight() { return imagePool["logo.png"]->h; }
  static int getMenuHeight() { return imagePool["menu.png"]->h; }
  static int getAbsoluteMenuYOffset() { return getLogoYOffset() + getLogoHeight() + getMenuYOffset(); }
  
  // constants
  static const SDL_Rect firstButton;
  static const SDL_Rect focusModifier;
//  static const int logoYOffset;
  static const int numButtons;
  static const int buttonTypes[8];
};

#endif
