2017-01-21 17:27:46 +01:00
|
|
|
// Menu.h
|
|
|
|
|
2017-01-21 23:44:30 +01:00
|
|
|
#pragma once
|
2017-01-21 17:27:46 +01:00
|
|
|
|
2017-02-09 18:28:00 +01:00
|
|
|
#include <unordered_map>
|
2017-02-04 17:59:07 +01:00
|
|
|
#include "def.h"
|
|
|
|
|
2017-01-21 17:27:46 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class CMenu
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMenu();
|
|
|
|
~CMenu();
|
|
|
|
|
2017-02-05 09:15:08 +01:00
|
|
|
bool Create(CPixmap *pPixmap, CSound *pSound,
|
2017-02-12 00:51:38 +01:00
|
|
|
POINT pos, Sint32 nb, Sint32 *pButtons, Sint32 *pErrors,
|
|
|
|
std::unordered_map<Sint32, const char *> &texts,
|
|
|
|
Sint32 perso);
|
|
|
|
void Update(Sint32 nb, Sint32 *pButtons, Sint32 *pErrors,
|
|
|
|
std::unordered_map<Sint32, const char *> &texts);
|
2017-01-21 17:27:46 +01:00
|
|
|
void Delete();
|
|
|
|
void Draw();
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 GetSel();
|
|
|
|
Sint32 GetRank();
|
2017-01-22 00:10:12 +01:00
|
|
|
bool IsError();
|
|
|
|
bool IsExist();
|
2017-01-21 17:27:46 +01:00
|
|
|
void Message();
|
|
|
|
|
2017-01-28 23:34:02 +01:00
|
|
|
bool TreatEvent(const SDL_Event &event);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
protected:
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 Detect(POINT pos);
|
2017-01-22 00:10:12 +01:00
|
|
|
bool MouseDown(POINT pos);
|
|
|
|
bool MouseMove(POINT pos);
|
|
|
|
bool MouseUp(POINT pos);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
CPixmap* m_pPixmap;
|
|
|
|
CDecor* m_pDecor;
|
|
|
|
CSound* m_pSound;
|
|
|
|
POINT m_pos; // coin sup/gauche
|
|
|
|
POINT m_dim; // dimensions
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_nbButtons;
|
2017-01-21 17:27:46 +01:00
|
|
|
POINT m_nbCel;
|
2017-02-12 00:51:38 +01:00
|
|
|
Sint32 m_perso;
|
|
|
|
Sint32 m_buttons[MAXBUTTON];
|
|
|
|
Sint32 m_errors[MAXBUTTON];
|
|
|
|
std::unordered_map<Sint32, const char *> m_texts;
|
|
|
|
Uint32 m_messages[MAXBUTTON];
|
|
|
|
Sint32 m_selRank;
|
2017-01-21 17:27:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|