2004-06-08 01:24:17 +00:00
|
|
|
/* ScreenManager - Manager/container for Screens. */
|
|
|
|
|
|
2002-11-16 08:07:38 +00:00
|
|
|
#ifndef SCREENMANAGER_H
|
|
|
|
|
#define SCREENMANAGER_H
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-02-16 20:16:07 +00:00
|
|
|
#include "RageInputDevice.h"
|
2003-02-22 01:58:56 +00:00
|
|
|
#include "ScreenMessage.h"
|
|
|
|
|
#include "InputFilter.h"
|
|
|
|
|
#include "GameInput.h"
|
|
|
|
|
#include "MenuInput.h"
|
|
|
|
|
#include "StyleInput.h"
|
2003-11-17 00:59:25 +00:00
|
|
|
#include "BitmapText.h"
|
2004-03-23 23:56:38 +00:00
|
|
|
#include "RageSound.h"
|
2003-11-17 00:59:25 +00:00
|
|
|
|
2003-02-22 01:58:56 +00:00
|
|
|
class Screen;
|
2003-03-15 19:25:37 +00:00
|
|
|
struct Menu;
|
2003-03-15 00:02:54 +00:00
|
|
|
class ScreenSystemLayer;
|
2003-02-18 23:15:38 +00:00
|
|
|
|
2003-02-22 01:58:56 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
class ScreenManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ScreenManager();
|
|
|
|
|
~ScreenManager();
|
|
|
|
|
|
|
|
|
|
// pass these messages along to the current state
|
|
|
|
|
void Update( float fDeltaTime );
|
|
|
|
|
void Draw();
|
|
|
|
|
void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
|
|
|
|
|
|
2002-09-04 00:25:30 +00:00
|
|
|
void PrepNewScreen( CString sClassName );
|
2002-09-04 23:40:01 +00:00
|
|
|
void LoadPreppedScreen();
|
2003-03-10 02:29:01 +00:00
|
|
|
void DeletePreppedScreen();
|
2002-08-27 03:59:22 +00:00
|
|
|
void SetNewScreen( CString sClassName );
|
2003-11-12 08:13:02 +00:00
|
|
|
void AddNewScreenToTop( CString sClassName, ScreenMessage messageSendOnPop );
|
2003-08-23 18:33:49 +00:00
|
|
|
void Prompt( ScreenMessage SM_SendWhenDone, CString sText, bool bYesNo = false, bool bDefaultAnswer = false, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL );
|
2002-08-27 03:59:22 +00:00
|
|
|
void TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer) = NULL, void(*OnCanel)() = NULL );
|
2003-03-15 19:25:37 +00:00
|
|
|
void MiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel = SM_None );
|
2003-11-12 08:13:02 +00:00
|
|
|
void PopTopScreen( ScreenMessage SM = SM_None );
|
2002-05-20 08:59:37 +00:00
|
|
|
void SystemMessage( CString sMessage );
|
2003-11-20 11:55:45 +00:00
|
|
|
void SystemMessageNoAnimate( CString sMessage );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-03-25 21:17:29 +00:00
|
|
|
void PostMessageToTopScreen( ScreenMessage SM, float fDelay );
|
|
|
|
|
void SendMessageToTopScreen( ScreenMessage SM );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2004-01-03 20:34:16 +00:00
|
|
|
void ReloadCreditsText();
|
2002-08-13 23:26:46 +00:00
|
|
|
void RefreshCreditsMessages();
|
2004-08-21 17:20:30 +00:00
|
|
|
void ReloadCommonSounds();
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2003-04-03 22:34:22 +00:00
|
|
|
void EmptyDeleteQueue();
|
|
|
|
|
|
2003-04-25 03:41:38 +00:00
|
|
|
void LoadDelayedScreen();
|
|
|
|
|
|
2004-02-16 05:30:31 +00:00
|
|
|
Screen *GetTopScreen();
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
private:
|
2003-01-10 02:22:07 +00:00
|
|
|
vector<Screen*> m_ScreenStack; // bottommost to topmost
|
2003-11-12 08:13:02 +00:00
|
|
|
ScreenMessage m_MessageSendOnPop;
|
2003-01-03 05:56:28 +00:00
|
|
|
vector<Screen*> m_ScreensToDelete;
|
2002-09-04 00:25:30 +00:00
|
|
|
Screen *m_ScreenBuffered;
|
2003-03-15 00:02:54 +00:00
|
|
|
ScreenSystemLayer *m_SystemLayer;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-09-03 05:43:58 +00:00
|
|
|
Screen* MakeNewScreen( CString sClassName );
|
2004-01-30 05:07:26 +00:00
|
|
|
void SetFromNewScreen( Screen *pNewScreen, bool Stack );
|
2003-04-25 03:41:38 +00:00
|
|
|
CString m_DelayedScreen;
|
2004-03-25 22:13:51 +00:00
|
|
|
void ClearScreenStack();
|
2004-03-23 23:56:38 +00:00
|
|
|
|
|
|
|
|
// Keep these sounds always loaded, because they could be
|
|
|
|
|
// played at any time. We want to eliminate SOUND->PlayOnce
|
|
|
|
|
public:
|
2004-03-25 21:41:11 +00:00
|
|
|
void PlayStartSound();
|
|
|
|
|
void PlayCoinSound();
|
|
|
|
|
void PlayInvalidSound();
|
|
|
|
|
void PlayScreenshotSound();
|
2004-05-01 23:19:33 +00:00
|
|
|
void PlayBackSound();
|
2004-03-23 23:56:38 +00:00
|
|
|
private:
|
|
|
|
|
RageSound m_soundStart;
|
|
|
|
|
RageSound m_soundCoin;
|
|
|
|
|
RageSound m_soundInvalid;
|
|
|
|
|
RageSound m_soundScreenshot;
|
2004-05-01 23:19:33 +00:00
|
|
|
RageSound m_soundBack;
|
2002-05-20 08:59:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern ScreenManager* SCREENMAN; // global and accessable from anywhere in our program
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|
2004-06-08 01:24:17 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* (c) 2001-2003 Chris Danford, Glenn Maynard
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|