Files
itgmania212121/stepmania/src/ScreenWithMenuElements.h
T
Glenn Maynard d42559a5cd I'm still slowly wrangling out just how Cancel should work.
Screens typically have two general simple models of transitioning;
either the menu elements transition out, or we drop a fade on top
of everything.  The former leaves the background in place, the
latter doesn't.  Transitioning is usually used when we're going
to a screen with the same background; fading is used otherwise.
(There are combinations of these, and more complex modes, but
these are the basics.)

Traditionally, cancelling has always wiped.  It usually goes back
to the title menu, which rarely has the same background; and it's
an uncommon path, so it's not worth setting up a full transition
for.  However, for cases where we don't go all the way back, this
is incorrect; it looks very strange to press escape in the options
submenu or the player options menu, and to have it wipe the screen.

I've dealt with this in the past by setting up a "cancel" transition
that simply runs "Off" and waits.  That works, but it's a pain, since
the wait duration needs to line up with the length of the transition.
Instead, add a transition mode "CancelTransitionsOut" that causes
Cancel to run the Out transition directly.  (This also plays the
start sound, due to a discrepency right now: with Out, it's the
screen's job to play the sound, but with Cancel, it's the transition's
job.  Figure that out later ...)

Ultimately, we should be able to have full CancelCommand transitions
if we want, but the SWME TweenOnScreen/TweenOffScreen code transition
needs to be completed first (replacing individual transitions with a
single "On"/"Off" command).
2006-02-24 03:01:28 +00:00

96 lines
2.8 KiB
C++

#ifndef ScreenWithMenuElements_H
#define ScreenWithMenuElements_H
#include "Screen.h"
#include "Sprite.h"
#include "Transition.h"
#include "ActorUtil.h"
//#include "RageSound.h"
#include "ThemeMetric.h"
class MenuTimer;
class HelpDisplay;
class MemoryCardDisplay;
class ScreenWithMenuElements : public Screen
{
public:
ScreenWithMenuElements();
virtual void Init();
virtual void BeginScreen();
virtual ~ScreenWithMenuElements();
void Update( float fDeltaTime );
void StartTransitioningScreen( ScreenMessage smSendWhenDone );
virtual void Cancel( ScreenMessage smSendWhenDone );
bool IsTransitioning();
void StopTimer();
void ResetTimer();
virtual void TweenOnScreen();
virtual void TweenOffScreen();
//
// Lua
//
virtual void PushSelf( lua_State *L );
protected:
virtual void StartPlayingMusic();
virtual void LoadHelpText();
/* If true, BeginScreen() will run OnCommand on the whole screen, and
* TweenOnScreen will not be called. (Eventually, all screens should
* use this, and this will be removed.) */
virtual bool GenericTweenOn() const { return false; }
AutoActor m_sprUnderlay;
AutoActor m_autoHeader;
Sprite m_sprStyleIcon;
AutoActor m_sprStage;
MemoryCardDisplay *m_MemoryCardDisplay[NUM_PLAYERS];
MenuTimer *m_MenuTimer;
AutoActor m_autoFooter;
HelpDisplay *m_textHelp;
AutoActor m_sprOverlay;
Transition m_In;
Transition m_Out;
Transition m_Cancel;
ThemeMetric<bool> PLAY_MUSIC;
ThemeMetric<bool> CANCEL_TRANSITIONS_OUT;
ThemeMetric<float> TIMER_SECONDS;
private:
RString m_sPathToMusic;
};
#endif
/*
* (c) 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.
*/