Skip to content

Commit

Permalink
Update ScreenNetSelectMusic.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram authored Jan 29, 2017
1 parent 5ac9cd4 commit e3e0917
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/ScreenNetSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,34 +491,38 @@ bool ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )

bool ScreenNetSelectMusic::MenuStart( const InputEventPlus &input )
{
return SelectCurrent();
}
bool ScreenNetSelectMusic::SelectCurrent()
{

bool bResult = m_MusicWheel.Select();

if( !bResult )
if (!bResult)
return true;

if( m_MusicWheel.GetSelectedType() != WheelItemDataType_Song )
if (m_MusicWheel.GetSelectedType() != WheelItemDataType_Song)
return true;

Song * pSong = m_MusicWheel.GetSelectedSong();

if( pSong == NULL )
if (pSong == NULL)
return false;

GAMESTATE->m_pCurSong.Set( pSong );
GAMESTATE->m_pCurSong.Set(pSong);

if( NSMAN->useSMserver )
if (NSMAN->useSMserver)
{
NSMAN->m_sArtist = pSong->GetTranslitArtist();
NSMAN->m_sMainTitle = pSong->GetTranslitMainTitle();
NSMAN->m_sSubTitle = pSong->GetTranslitSubTitle();
NSMAN->m_iSelectMode = 2; // Command for user selecting song
NSMAN->SelectUserSong ();
NSMAN->SelectUserSong();
}
else
StartSelectedSong();
return true;
}

bool ScreenNetSelectMusic::MenuBack( const InputEventPlus &input )
{
SOUND->StopMusic();
Expand Down Expand Up @@ -690,10 +694,14 @@ class LunaScreenNetSelectMusic : public Luna<ScreenNetSelectMusic>
p->GetMusicWheel()->PushSelf(L);
return 1;
}
static int SelectCurrent(T* p, lua_State *L) {
p->SelectCurrent();
return 1;
}
LunaScreenNetSelectMusic()
{
ADD_METHOD(GetMusicWheel);
}
ADD_METHOD(SelectCurrent);
};

LUA_REGISTER_DERIVED_CLASS(ScreenNetSelectMusic, ScreenNetSelectBase)
Expand Down

0 comments on commit e3e0917

Please sign in to comment.