summaryrefslogtreecommitdiff
path: root/Menu.cpp
blob: 85c36ae2a5ad5be4533b2d85c8f2e52e9384167f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* **************************************
 * 	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;
	}

}