2004-06-07 21:14:03 +00:00
|
|
|
/* DifficultyMeter - A meter represention of how hard a Steps is. */
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2004-06-07 21:14:03 +00:00
|
|
|
#ifndef DIFFICULTY_METER_H
|
|
|
|
|
#define DIFFICULTY_METER_H
|
2002-01-16 10:01:32 +00:00
|
|
|
|
|
|
|
|
#include "BitmapText.h"
|
2003-07-21 22:38:41 +00:00
|
|
|
#include "PlayerNumber.h"
|
2005-02-09 05:27:51 +00:00
|
|
|
#include "AutoActor.h"
|
2003-11-15 00:26:30 +00:00
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "ActorUtil.h"
|
2005-01-22 19:36:39 +00:00
|
|
|
#include "Difficulty.h"
|
2005-02-09 05:27:51 +00:00
|
|
|
#include "ActorFrame.h"
|
2003-11-13 23:50:52 +00:00
|
|
|
|
2003-08-03 00:13:55 +00:00
|
|
|
class Steps;
|
2004-06-02 08:17:27 +00:00
|
|
|
class Trail;
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2005-02-23 20:40:46 +00:00
|
|
|
template<class T>
|
|
|
|
|
class LunaDifficultyMeter : public LunaActorFrame<T>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
LunaDifficultyMeter() { LUA->Register( Register ); }
|
|
|
|
|
|
|
|
|
|
static int Load( T* p, lua_State *L ) { p->Load( SArg(1) ); return 0; }
|
|
|
|
|
static int SetFromSteps( T* p, lua_State *L )
|
|
|
|
|
{
|
|
|
|
|
if( lua_isnil(L,1) ) { p->SetFromSteps( NULL ); }
|
|
|
|
|
else { Steps *pS = Luna<Steps>::check(L,1); p->SetFromSteps( pS ); }
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void Register(lua_State *L)
|
|
|
|
|
{
|
|
|
|
|
ADD_METHOD( Load )
|
|
|
|
|
ADD_METHOD( SetFromSteps )
|
|
|
|
|
LunaActor<T>::Register( L );
|
|
|
|
|
}
|
|
|
|
|
};
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2003-11-14 23:05:03 +00:00
|
|
|
class DifficultyMeter: public ActorFrame
|
2002-01-16 10:01:32 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2003-03-09 00:55:49 +00:00
|
|
|
DifficultyMeter();
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2005-02-23 20:40:46 +00:00
|
|
|
void Load( const CString &sType );
|
2003-07-21 22:38:41 +00:00
|
|
|
void SetFromGameState( PlayerNumber pn );
|
2004-05-29 04:55:00 +00:00
|
|
|
void SetFromMeterAndDifficulty( int iMeter, Difficulty dc );
|
2004-05-29 04:50:47 +00:00
|
|
|
void SetFromSteps( const Steps* pSteps );
|
2004-06-02 08:17:27 +00:00
|
|
|
void SetFromTrail( const Trail* pTrail );
|
2003-07-21 22:38:41 +00:00
|
|
|
void Unset();
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2005-02-23 20:40:46 +00:00
|
|
|
// Lua
|
|
|
|
|
void PushSelf( lua_State *L );
|
|
|
|
|
|
2002-01-16 10:01:32 +00:00
|
|
|
private:
|
2004-05-29 04:55:00 +00:00
|
|
|
void SetFromDifficulty( Difficulty dc );
|
|
|
|
|
void SetFromCourseDifficulty( CourseDifficulty cd );
|
|
|
|
|
|
2003-11-15 00:26:30 +00:00
|
|
|
void SetDifficulty( CString diff );
|
|
|
|
|
BitmapText m_textFeet;
|
|
|
|
|
|
|
|
|
|
CString m_CurDifficulty;
|
|
|
|
|
AutoActor m_Difficulty;
|
|
|
|
|
|
|
|
|
|
BitmapText m_textMeter;
|
2004-10-03 13:52:07 +00:00
|
|
|
|
|
|
|
|
int m_iNumFeetInMeter, m_iMaxFeetInMeter, m_iGlowIfMeterGreaterThan;
|
|
|
|
|
bool m_bShowFeet, m_bShowDifficulty, m_bShowMeter, m_bFeetIsDifficultyColor, m_bFeetPerDifficulty;
|
2002-01-16 10:01:32 +00:00
|
|
|
};
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|
2004-06-07 21:14:03 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* (c) 2001-2004 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.
|
|
|
|
|
*/
|