2003-06-20 23:07:45 +00:00
|
|
|
#ifndef ScreenSelectMaster_H
|
|
|
|
|
#define ScreenSelectMaster_H
|
|
|
|
|
|
|
|
|
|
#include "ScreenSelect.h"
|
|
|
|
|
#include "RageSound.h"
|
|
|
|
|
#include "RandomSample.h"
|
2003-11-05 04:09:10 +00:00
|
|
|
#include "ActorUtil.h"
|
2004-01-17 23:14:56 +00:00
|
|
|
#include "ActorScroller.h"
|
2003-06-20 23:07:45 +00:00
|
|
|
|
2006-07-11 06:51:46 +00:00
|
|
|
enum MenuDir
|
|
|
|
|
{
|
|
|
|
|
MenuDir_Up,
|
|
|
|
|
MenuDir_Down,
|
|
|
|
|
MenuDir_Left,
|
|
|
|
|
MenuDir_Right,
|
|
|
|
|
MenuDir_Auto, // when players join and the selection becomes invalid
|
|
|
|
|
NUM_MenuDir,
|
|
|
|
|
};
|
2006-10-07 08:56:58 +00:00
|
|
|
#define FOREACH_MenuDir( md ) FOREACH_ENUM( MenuDir, md )
|
2006-07-11 06:51:46 +00:00
|
|
|
const RString& MenuDirToString( MenuDir md );
|
|
|
|
|
|
2003-06-20 23:07:45 +00:00
|
|
|
class ScreenSelectMaster : public ScreenSelect
|
|
|
|
|
{
|
|
|
|
|
public:
|
2006-03-23 00:16:18 +00:00
|
|
|
ScreenSelectMaster();
|
2009-05-02 15:30:04 +00:00
|
|
|
//~ScreenSelectMaster();
|
2005-02-23 06:29:05 +00:00
|
|
|
virtual void Init();
|
2006-05-07 09:25:48 +00:00
|
|
|
virtual RString GetDefaultChoice();
|
2005-09-21 17:23:11 +00:00
|
|
|
virtual void BeginScreen();
|
2003-06-20 23:07:45 +00:00
|
|
|
|
2005-09-23 00:44:52 +00:00
|
|
|
virtual void MenuLeft( const InputEventPlus &input );
|
|
|
|
|
virtual void MenuRight( const InputEventPlus &input );
|
|
|
|
|
virtual void MenuUp( const InputEventPlus &input );
|
|
|
|
|
virtual void MenuDown( const InputEventPlus &input );
|
2006-09-15 01:13:39 +00:00
|
|
|
virtual void MenuStart( const InputEventPlus &input );
|
2005-10-14 03:11:50 +00:00
|
|
|
virtual void TweenOnScreen();
|
2005-10-14 02:04:13 +00:00
|
|
|
virtual void TweenOffScreen();
|
2003-06-20 23:07:45 +00:00
|
|
|
|
|
|
|
|
virtual void HandleScreenMessage( const ScreenMessage SM );
|
2007-03-04 08:52:06 +00:00
|
|
|
virtual bool AllowLateJoin() const { return true; }
|
2003-06-20 23:07:45 +00:00
|
|
|
|
|
|
|
|
protected:
|
2007-06-09 20:54:28 +00:00
|
|
|
enum Page { PAGE_1, PAGE_2, NUM_Page }; // on PAGE_2, cursors are locked together
|
2005-06-23 01:21:13 +00:00
|
|
|
static PlayerNumber GetSharedPlayer();
|
2003-11-10 21:18:26 +00:00
|
|
|
Page GetPage( int iChoiceIndex ) const;
|
|
|
|
|
Page GetCurrentPage() const;
|
2003-06-20 23:07:45 +00:00
|
|
|
|
2009-05-02 15:30:04 +00:00
|
|
|
ThemeMetric<bool> USE_TWO_SCROLLERS;
|
2009-04-27 18:26:24 +00:00
|
|
|
ThemeMetric<bool> DOUBLE_PRESS_TO_SELECT;
|
2006-01-29 00:27:39 +00:00
|
|
|
ThemeMetric<bool> SHOW_ICON;
|
|
|
|
|
ThemeMetric<bool> SHOW_SCROLLER;
|
|
|
|
|
ThemeMetric<bool> SHOW_CURSOR;
|
|
|
|
|
ThemeMetric<bool> SHARED_SELECTION;
|
2006-01-30 08:12:24 +00:00
|
|
|
ThemeMetric<bool> USE_ICON_METRICS;
|
2006-01-29 00:27:39 +00:00
|
|
|
ThemeMetric<int> NUM_CHOICES_ON_PAGE_1;
|
2005-07-14 08:47:12 +00:00
|
|
|
ThemeMetric1D<float> CURSOR_OFFSET_X_FROM_ICON;
|
|
|
|
|
ThemeMetric1D<float> CURSOR_OFFSET_Y_FROM_ICON;
|
2006-01-29 22:18:28 +00:00
|
|
|
ThemeMetric<bool> PER_CHOICE_ICON_ELEMENT;
|
2006-01-29 00:27:39 +00:00
|
|
|
ThemeMetric<float> PRE_SWITCH_PAGE_SECONDS;
|
|
|
|
|
ThemeMetric<float> POST_SWITCH_PAGE_SECONDS;
|
2006-01-22 01:00:06 +00:00
|
|
|
ThemeMetric1D<RString> OPTION_ORDER;
|
2009-05-02 15:30:04 +00:00
|
|
|
ThemeMetric1D<RString> OPTION_ORDER2;
|
2006-01-29 00:27:39 +00:00
|
|
|
ThemeMetric<bool> WRAP_CURSOR;
|
|
|
|
|
ThemeMetric<bool> WRAP_SCROLLER;
|
|
|
|
|
ThemeMetric<bool> LOOP_SCROLLER;
|
|
|
|
|
ThemeMetric<bool> PER_CHOICE_SCROLL_ELEMENT;
|
|
|
|
|
ThemeMetric<bool> ALLOW_REPEATING_INPUT;
|
|
|
|
|
ThemeMetric<float> SCROLLER_SECONDS_PER_ITEM;
|
|
|
|
|
ThemeMetric<float> SCROLLER_NUM_ITEMS_TO_DRAW;
|
2006-09-22 03:32:50 +00:00
|
|
|
ThemeMetric<LuaReference> SCROLLER_TRANSFORM;
|
2006-01-29 00:27:39 +00:00
|
|
|
ThemeMetric<int> SCROLLER_SUBDIVISIONS;
|
2006-01-22 01:00:06 +00:00
|
|
|
ThemeMetric<RString> DEFAULT_CHOICE;
|
2005-02-02 01:38:20 +00:00
|
|
|
|
2006-07-11 06:51:46 +00:00
|
|
|
map<int,int> m_mapCurrentChoiceToNextChoice[NUM_MenuDir];
|
2009-05-02 15:30:04 +00:00
|
|
|
map<int,int> m_mapCurrentChoiceToNextChoiceB[NUM_MenuDir]; // if using two lists
|
|
|
|
|
|
2003-11-12 02:53:28 +00:00
|
|
|
|
2003-06-20 23:07:45 +00:00
|
|
|
virtual int GetSelectionIndex( PlayerNumber pn );
|
|
|
|
|
virtual void UpdateSelectableChoices();
|
2005-03-10 03:53:00 +00:00
|
|
|
bool AnyOptionsArePlayable() const;
|
2003-06-20 23:07:45 +00:00
|
|
|
|
2005-02-06 05:15:57 +00:00
|
|
|
bool Move( PlayerNumber pn, MenuDir dir );
|
2003-11-10 16:58:04 +00:00
|
|
|
bool ChangePage( int iNewChoice );
|
2005-05-03 23:12:29 +00:00
|
|
|
bool ChangeSelection( PlayerNumber pn, MenuDir dir, int iNewChoice );
|
2004-02-01 05:03:45 +00:00
|
|
|
float DoMenuStart( PlayerNumber pn );
|
2005-07-13 19:22:23 +00:00
|
|
|
virtual bool ProcessMenuStart( PlayerNumber pn ) { return true; }
|
2003-06-20 23:07:45 +00:00
|
|
|
|
2005-07-14 08:47:12 +00:00
|
|
|
float GetCursorX( PlayerNumber pn );
|
|
|
|
|
float GetCursorY( PlayerNumber pn );
|
2003-06-20 23:07:45 +00:00
|
|
|
|
2007-06-09 20:54:28 +00:00
|
|
|
AutoActor m_sprExplanation[NUM_Page];
|
|
|
|
|
AutoActor m_sprMore[NUM_Page];
|
2005-07-14 20:15:37 +00:00
|
|
|
// icon is the shared, per-choice piece
|
2005-10-04 02:48:33 +00:00
|
|
|
vector<AutoActor> m_vsprIcon;
|
2009-05-02 15:30:04 +00:00
|
|
|
vector<AutoActor> m_vsprIconB; // used if the user wants two lists
|
|
|
|
|
|
2005-07-14 20:15:37 +00:00
|
|
|
// preview is per-player, per-choice piece
|
2005-10-04 02:48:33 +00:00
|
|
|
vector<AutoActor> m_vsprScroll[NUM_PLAYERS];
|
2009-05-02 15:30:04 +00:00
|
|
|
vector<AutoActor> m_vsprScrollB[NUM_PLAYERS]; // used if the user wants two lists
|
|
|
|
|
|
|
|
|
|
|
2004-01-17 23:14:56 +00:00
|
|
|
ActorScroller m_Scroller[NUM_PLAYERS];
|
2009-05-02 15:30:04 +00:00
|
|
|
ActorScroller m_ScrollerB[NUM_PLAYERS]; // used if the user wants two lists
|
|
|
|
|
|
|
|
|
|
|
2005-07-14 20:15:37 +00:00
|
|
|
// cursor is the per-player, shared by all choices
|
|
|
|
|
AutoActor m_sprCursor[NUM_PLAYERS];
|
2003-06-20 23:07:45 +00:00
|
|
|
|
|
|
|
|
RageSound m_soundChange;
|
|
|
|
|
RandomSample m_soundDifficult;
|
2004-12-04 21:16:00 +00:00
|
|
|
RageSound m_soundStart;
|
2003-06-20 23:07:45 +00:00
|
|
|
|
|
|
|
|
int m_iChoice[NUM_PLAYERS];
|
|
|
|
|
bool m_bChosen[NUM_PLAYERS];
|
2009-04-27 18:26:24 +00:00
|
|
|
bool m_bDoubleChoice[NUM_PLAYERS];
|
2009-04-29 20:59:03 +00:00
|
|
|
bool m_bDoubleChoiceNoSound;
|
2003-06-20 23:07:45 +00:00
|
|
|
|
2007-01-13 03:44:16 +00:00
|
|
|
GameButton m_TrackingRepeatingInput;
|
2003-06-20 23:07:45 +00:00
|
|
|
};
|
|
|
|
|
|
2003-09-21 02:36:28 +00:00
|
|
|
|
2003-06-20 23:07:45 +00:00
|
|
|
#endif
|
2004-06-08 05:22:33 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* (c) 2003-2004 Chris Danford
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
|
|
|
* whom the Software is furnished to do so, provided that the above
|
|
|
|
|
* copyright notice(s) and this permission notice appear in all copies of
|
|
|
|
|
* the Software and that both the above copyright notice(s) and this
|
|
|
|
|
* permission notice appear in supporting documentation.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
|
|
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
|
|
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
|
|
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
|
|
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|