#ifndef ScreenSelectMaster_H #define ScreenSelectMaster_H #include "ScreenSelect.h" #include "RageSound.h" #include "RandomSample.h" #include "ActorUtil.h" #include "ActorScroller.h" enum MenuDir { MenuDir_Up, MenuDir_Down, MenuDir_Left, MenuDir_Right, MenuDir_Auto, // when players join and the selection becomes invalid NUM_MenuDir, }; /** @brief A special foreach loop through the different menu directions. */ #define FOREACH_MenuDir( md ) FOREACH_ENUM( MenuDir, md ) const RString& MenuDirToString( MenuDir md ); /** @brief The master Screen for many children Screens. */ class ScreenSelectMaster : public ScreenSelect { public: ScreenSelectMaster(); //~ScreenSelectMaster(); virtual void Init(); virtual RString GetDefaultChoice(); virtual void BeginScreen(); virtual void MenuLeft( const InputEventPlus &input ); virtual void MenuRight( const InputEventPlus &input ); virtual void MenuUp( const InputEventPlus &input ); virtual void MenuDown( const InputEventPlus &input ); virtual void MenuStart( const InputEventPlus &input ); virtual void TweenOnScreen(); virtual void TweenOffScreen(); virtual void HandleScreenMessage( const ScreenMessage SM ); virtual bool AllowLateJoin() const { return true; } // sm-ssc additions: int GetPlayerSelectionIndex(PlayerNumber pn){ return GetSelectionIndex(pn); } // Lua virtual void PushSelf( lua_State *L ); protected: enum Page { PAGE_1, PAGE_2, NUM_Page }; // on PAGE_2, cursors are locked together static PlayerNumber GetSharedPlayer(); Page GetPage( int iChoiceIndex ) const; Page GetCurrentPage() const; ThemeMetric USE_TWO_SCROLLERS; ThemeMetric DO_SWITCH_ANYWAYS; ThemeMetric DOUBLE_PRESS_TO_SELECT; ThemeMetric SHOW_ICON; ThemeMetric SHOW_SCROLLER; ThemeMetric SHOW_CURSOR; ThemeMetric SHARED_SELECTION; ThemeMetric USE_ICON_METRICS; ThemeMetric NUM_CHOICES_ON_PAGE_1; ThemeMetric1D CURSOR_OFFSET_X_FROM_ICON; ThemeMetric1D CURSOR_OFFSET_Y_FROM_ICON; ThemeMetric PER_CHOICE_ICON_ELEMENT; ThemeMetric PRE_SWITCH_PAGE_SECONDS; ThemeMetric POST_SWITCH_PAGE_SECONDS; ThemeMetric1D OPTION_ORDER; ThemeMetric1D OPTION_ORDER2; ThemeMetric WRAP_CURSOR; ThemeMetric WRAP_SCROLLER; ThemeMetric LOOP_SCROLLER; ThemeMetric PER_CHOICE_SCROLL_ELEMENT; ThemeMetric ALLOW_REPEATING_INPUT; ThemeMetric SCROLLER_SECONDS_PER_ITEM; ThemeMetric SCROLLER_NUM_ITEMS_TO_DRAW; ThemeMetric SCROLLER_TRANSFORM; //ThemeMetric SCROLLER_TWEEN; ThemeMetric SCROLLER_SUBDIVISIONS; ThemeMetric DEFAULT_CHOICE; map m_mapCurrentChoiceToNextChoice[NUM_MenuDir]; virtual int GetSelectionIndex( PlayerNumber pn ); virtual void UpdateSelectableChoices(); bool AnyOptionsArePlayable() const; bool Move( PlayerNumber pn, MenuDir dir ); bool ChangePage( int iNewChoice ); bool ChangeSelection( PlayerNumber pn, MenuDir dir, int iNewChoice ); float DoMenuStart( PlayerNumber pn ); virtual bool ProcessMenuStart( PlayerNumber pn ) { return true; } float GetCursorX( PlayerNumber pn ); float GetCursorY( PlayerNumber pn ); AutoActor m_sprExplanation[NUM_Page]; AutoActor m_sprMore[NUM_Page]; // icon is the shared, per-choice piece vector m_vsprIcon; // preview is per-player, per-choice piece vector m_vsprScroll[NUM_PLAYERS]; ActorScroller m_Scroller[NUM_PLAYERS]; // cursor is the per-player, shared by all choices AutoActor m_sprCursor[NUM_PLAYERS]; RageSound m_soundChange; RandomSample m_soundDifficult; RageSound m_soundStart; int m_iChoice[NUM_PLAYERS]; bool m_bChosen[NUM_PLAYERS]; bool m_bDoubleChoice[NUM_PLAYERS]; bool m_bDoubleChoiceNoSound; GameButton m_TrackingRepeatingInput; }; #endif /* * (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. */