forked from DragonMinded/ACIOLauncher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenu.h
50 lines (41 loc) · 1.18 KB
/
Menu.h
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
#pragma once
#include <tchar.h>
#include <sys/timeb.h>
/* Seconds to wait for a selection before booting the default option */
#define TIMEOUT_SECONDS 60
/* Constants for limitations on how long INI file pieces can be */
#define MAX_GAME_NAME_LENGTH 63
#define MAX_GAME_LOCATION_LENGTH 511
/* Number of games to display on one screen */
#define GAMES_PER_PAGE 9
typedef struct
{
char location[MAX_GAME_LOCATION_LENGTH + 1];
char name[MAX_GAME_NAME_LENGTH + 1];
} launcher_program_t;
class Menu
{
public:
Menu(_TCHAR *inifile);
~Menu(void);
unsigned int NumberOfEntries() { return num_programs; }
char *GetSelectedName() { return settings[selected].name; }
char *GetSelectedPath() { return settings[selected].location; }
void DisplayPrompt();
void DisplayGames();
bool SelectGame(unsigned int game);
void PageUp();
void PageDown();
void Tick();
void ResetTimeout();
bool ShouldBootDefault();
private:
unsigned int num_programs;
unsigned int start;
unsigned int end;
unsigned int selected;
launcher_program_t *settings;
struct timeb beginning;
struct timeb current;
launcher_program_t *LoadSettings( _TCHAR *ini_file, unsigned int *final_length );
};