You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.2 KiB
50 lines
1.2 KiB
#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 );
|
|
};
|
|
|