Files
itgmania212121/stepmania/src/ScreenEditCoursesMenu.cpp
T

123 lines
3.4 KiB
C++
Raw Normal View History

2003-08-10 23:48:10 +00:00
#include "global.h"
#include "ScreenEditCoursesMenu.h"
#include "SongManager.h"
#include "ScreenManager.h"
#include "GameConstantsAndTypes.h"
#include "RageUtil.h"
#include "GameManager.h"
#include "RageLog.h"
#include "GameState.h"
#include "RageSounds.h"
#include "ThemeManager.h"
#include "Steps.h"
2004-05-22 00:03:35 +00:00
#define EXPLANATION_TEXT THEME->GetMetric (m_sName,"ExplanationText")
#define HELP_TEXT THEME->GetMetric (m_sName,"HelpText")
2003-08-10 23:48:10 +00:00
const ScreenMessage SM_RefreshSelector = (ScreenMessage)(SM_User+1);
ScreenEditCoursesMenu::ScreenEditCoursesMenu( CString sName ) : ScreenWithMenuElements( sName )
2003-08-10 23:48:10 +00:00
{
LOG->Trace( "ScreenEditCoursesMenu::ScreenEditCoursesMenu()" );
2004-02-24 23:00:52 +00:00
/* Enable all players. */
2004-05-22 00:03:35 +00:00
FOREACH_PlayerNumber( pn )
2004-02-24 23:00:52 +00:00
GAMESTATE->m_bSideIsJoined[pn] = true;
2003-08-10 23:48:10 +00:00
GAMESTATE->m_CurStyle = STYLE_INVALID;
m_Selector.SetXY( 0, 0 );
// m_Selector.AllowNewNotes();
this->AddChild( &m_Selector );
2004-05-22 00:03:35 +00:00
m_textExplanation.SetName( "Explanation" );
2003-08-10 23:48:10 +00:00
m_textExplanation.LoadFromFont( THEME->GetPathToF("Common normal") );
2004-05-22 00:03:35 +00:00
SET_XY_AND_ON_COMMAND( m_textExplanation );
2003-08-10 23:48:10 +00:00
m_textExplanation.SetText( EXPLANATION_TEXT );
this->AddChild( &m_textExplanation );
2004-05-22 00:03:35 +00:00
this->SortByDrawOrder();
2003-08-10 23:48:10 +00:00
2004-05-22 00:03:35 +00:00
SOUND->PlayMusic( THEME->GetPathToS("ScreenEditCoursesMenu music") );
2003-08-10 23:48:10 +00:00
}
void ScreenEditCoursesMenu::DrawPrimitives()
{
Screen::DrawPrimitives();
}
void ScreenEditCoursesMenu::HandleScreenMessage( const ScreenMessage SM )
{
2003-08-11 06:09:57 +00:00
m_Selector.HandleScreenMessage( SM );
2003-08-10 23:48:10 +00:00
switch( SM )
{
case SM_GoToPrevScreen:
case SM_GoToNextScreen:
2003-08-12 06:51:03 +00:00
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
2003-08-10 23:48:10 +00:00
break;
}
}
void ScreenEditCoursesMenu::MenuUp( PlayerNumber pn )
{
m_Selector.Up();
}
void ScreenEditCoursesMenu::MenuDown( PlayerNumber pn )
{
m_Selector.Down();
}
void ScreenEditCoursesMenu::MenuLeft( PlayerNumber pn, const InputEventType type )
{
m_Selector.Left();
}
void ScreenEditCoursesMenu::MenuRight( PlayerNumber pn, const InputEventType type )
{
m_Selector.Right();
}
void ScreenEditCoursesMenu::MenuStart( PlayerNumber pn )
{
if( IsTransitioning() )
2003-08-10 23:48:10 +00:00
return;
2003-08-11 02:18:13 +00:00
m_Selector.Start();
2003-08-10 23:48:10 +00:00
}
void ScreenEditCoursesMenu::MenuBack( PlayerNumber pn )
{
Back( SM_GoToPrevScreen );
2003-08-10 23:48:10 +00:00
SOUND->StopMusic();
}
2004-05-22 00:03:35 +00:00
/*
* (c) 2003-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.
*/