57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
/* **************************************
|
|
* Includes *
|
|
* **************************************/
|
|
|
|
#include "Menu.h"
|
|
#include "Player.h"
|
|
#include "Gameplay.h"
|
|
|
|
/* **************************************
|
|
* Defines *
|
|
* **************************************/
|
|
|
|
/* **************************************
|
|
* Local variables *
|
|
* **************************************/
|
|
|
|
static const char MainMenuOption_0[] PROGMEM = "Single player game";
|
|
static const char MainMenuOption_1[] PROGMEM = "Multiplayer game";
|
|
static const char MainMenuOption_2[] PROGMEM = "Options";
|
|
static const char MainMenuOption_3[] PROGMEM = "Quit";
|
|
|
|
static const char* const MainMenuOptions[] PROGMEM = { MainMenuOption_0,
|
|
MainMenuOption_1,
|
|
MainMenuOption_2,
|
|
MainMenuOption_3 };
|
|
|
|
void MenuGetPlayerName(Player * ptrPlayer)
|
|
{
|
|
memset(ptrPlayer->getName(), 0, PLAYER_NAME_LENGTH);
|
|
gb.getDefaultName(ptrPlayer->getName());
|
|
}
|
|
|
|
void MainMenu(void)
|
|
{
|
|
//int8_t menu(const char* const* items, uint8_t length);
|
|
|
|
uint8_t choice = gb.menu(MainMenuOptions, 3);
|
|
|
|
switch(choice)
|
|
{
|
|
case 0:
|
|
MenuGetPlayerName(&GamePlayers[0]);
|
|
GameInit();
|
|
break;
|
|
case 1:
|
|
break;
|
|
break;
|
|
case 2:
|
|
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|