Files
itgmania212121/stepmania/src/ScreenWithMenuElements.h
T
Glenn Maynard 8a04a3eeeb Add ScreenWithMenuElements::FirstUpdateCommand, a Lua expression
that gets called on first update.  Note the difference between
using ThemeMetric<LuaExpression> and ThemeMetric<ActorCommands>:
with ActorCommands, you get the special, backwards-compatible
parsing; with LuaExpression, only a regular expression is parsed.

You can still only (cleanly) call one function, since "return"
is prepended: if you say "f() g()", it'll try to run "return f() g()".
I tried having a separate type for "expression" and "script", but
it seems confusing to have some metrics parsed as scripts and
some as expressions, allowing multiple functions in only specific
metrics.  If you want to do that much, it's cleaner to create
a function and call it, anyway.  If you just want to add diagnostics
quickly, you can say "Foo=(function() x() y() z() end)()".  (I might
revisit this later.)
2005-02-17 06:13:23 +00:00

72 lines
2.3 KiB
C++

#ifndef ScreenWithMenuElements_H
#define ScreenWithMenuElements_H
#include "Screen.h"
#include "Sprite.h"
#include "Transition.h"
#include "ActorUtil.h"
#include "RageSound.h"
#include "MemoryCardDisplay.h"
#include "ThemeMetric.h"
class MenuTimer;
class HelpDisplay;
class ScreenWithMenuElements : public Screen
{
public:
ScreenWithMenuElements( CString sName );
virtual ~ScreenWithMenuElements();
void Update( float fDeltaTime );
void StartTransitioning( ScreenMessage smSendWhenDone );
void Back( ScreenMessage smSendWhenDone );
bool IsTransitioning();
bool m_bTimerEnabled;
void StopTimer();
void ResetTimer();
protected:
AutoActor m_sprUnderlay;
AutoActor m_autoHeader;
Sprite m_sprStyleIcon;
MemoryCardDisplay m_MemoryCardDisplay[NUM_PLAYERS];
MenuTimer *m_MenuTimer;
AutoActor m_autoFooter;
HelpDisplay *m_textHelp;
AutoActor m_sprOverlay;
ThemeMetric<LuaExpression> m_FirstUpdateCommand;
Transition m_In;
Transition m_Out;
Transition m_Back;
};
#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.
*/