Refactor prepared screens. This can handle:
- preparing and reusing screens used in a loop (eg. attract), a conceptual stack (eg. options menu), or a real stack (ScreenPrompt) - automatic cleanup once you load a screen that isn't preloaded; this gracefully handles unusual or forgotten exit paths (eg. pressing the system menu button) - reusing some screens in a group and loading others on demand
This commit is contained in:
@@ -32,6 +32,7 @@ public:
|
||||
void SetNewScreen( const CString &sName );
|
||||
void AddNewScreenToTop( const CString &sName, ScreenMessage SendOnPop=SM_None );
|
||||
void PrepareScreen( const CString &sScreenName ); // creates and caches screen so that the next call to SetNewScreen for the prep'd screen will be very quick.
|
||||
void GroupScreen( const CString &sScreenName );
|
||||
bool ConcurrentlyPrepareScreen( const CString &sScreenName, ScreenMessage send_when_done = SM_None );
|
||||
bool IsConcurrentlyLoading() const;
|
||||
void DeletePreparedScreens();
|
||||
@@ -65,6 +66,8 @@ public:
|
||||
void PlaySharedBackgroundOffCommand();
|
||||
void ZeroNextUpdate();
|
||||
private:
|
||||
void AboutToLoadScreen( const CString &sScreenName );
|
||||
|
||||
Screen *m_pInputFocus; // NULL = top of m_ScreenStack
|
||||
|
||||
CString m_sSystemMessage;
|
||||
@@ -79,8 +82,9 @@ private:
|
||||
// operations take a long time, and will cause a skip on the next update.
|
||||
bool m_bZeroNextUpdate;
|
||||
|
||||
void ClearScreenStack();
|
||||
void LoadDelayedScreen();
|
||||
void PrepareScreenInternal( const CString &sScreenName );
|
||||
ScreenMessage PopTopScreenInternal();
|
||||
|
||||
// Keep these sounds always loaded, because they could be
|
||||
// played at any time. We want to eliminate SOUND->PlayOnce
|
||||
|
||||
Reference in New Issue
Block a user