2002-11-16 08:07:38 +00:00
|
|
|
#ifndef MENUINPUT_H
|
|
|
|
|
#define MENUINPUT_H
|
2002-04-16 17:31:00 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: MenuInput
|
|
|
|
|
|
|
|
|
|
Desc: An input event specific to a menu navigation. This is generated based
|
|
|
|
|
on a GameDef.
|
|
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-04-16 17:31:00 +00:00
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
2003-02-26 00:20:00 +00:00
|
|
|
#include "PlayerNumber.h"
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
enum MenuButton
|
|
|
|
|
{
|
|
|
|
|
MENU_BUTTON_LEFT = 0,
|
|
|
|
|
MENU_BUTTON_RIGHT,
|
|
|
|
|
MENU_BUTTON_UP,
|
|
|
|
|
MENU_BUTTON_DOWN,
|
2002-05-19 01:59:48 +00:00
|
|
|
MENU_BUTTON_START,
|
2002-04-16 17:31:00 +00:00
|
|
|
MENU_BUTTON_BACK,
|
2003-01-19 04:44:22 +00:00
|
|
|
MENU_BUTTON_COIN,
|
2003-02-12 11:43:08 +00:00
|
|
|
MENU_BUTTON_OPERATOR,
|
2002-04-16 17:31:00 +00:00
|
|
|
NUM_MENU_BUTTONS, // leave this at the end
|
2002-06-24 22:04:31 +00:00
|
|
|
MENU_BUTTON_INVALID
|
2002-04-16 17:31:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct MenuInput
|
|
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
MenuInput() { MakeInvalid(); };
|
2002-09-04 03:49:08 +00:00
|
|
|
MenuInput( PlayerNumber pn, MenuButton b ) { player = pn; button = b; };
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
PlayerNumber player;
|
|
|
|
|
MenuButton button;
|
|
|
|
|
|
2002-07-31 19:40:40 +00:00
|
|
|
// bool operator==( const MenuInput &other ) { return player == other.player && button == other.button; };
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2002-07-31 19:40:40 +00:00
|
|
|
inline bool IsValid() const { return player != PLAYER_INVALID; };
|
|
|
|
|
inline void MakeInvalid() { player = PLAYER_INVALID; button = MENU_BUTTON_INVALID; };
|
2002-04-16 17:31:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2002-07-31 19:40:40 +00:00
|
|
|
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|