diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 25bbfc906f..2c1cd0334d 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -13,6 +13,10 @@ _____________________________________________________________________________ sm-ssc v1.2.2 | 201102?? -------------------------------------------------------------------------------- +20110218 +-------- +* [WheelBase] Added SetOpenSection Lua binding [AJ] + 20110217 -------- * Allowed refreshing of Fonts again. [AJ] diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index ec0a1b4b7f..9c81215790 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -1048,11 +1048,6 @@ bool MusicWheel::Select() // return true if this selection ends the screen case TYPE_PORTAL: break; case TYPE_SORT: - /* - LOG->Trace("New sort order selected: %s - %s", - GetCurWheelItemData(m_iSelection)->m_sLabel.c_str(), - SortOrderToString(GetCurWheelItemData(m_iSelection)->m_pAction->m_SortOrder).c_str() ); - */ GetCurWheelItemData(m_iSelection)->m_pAction->ApplyToAllPlayers(); ChangeSort( GAMESTATE->m_PreferredSortOrder ); m_sLastModeMenuItem = GetCurWheelItemData(m_iSelection)->m_pAction->m_sName; diff --git a/src/ScreenNetEvaluation.cpp b/src/ScreenNetEvaluation.cpp index 7a75a0f09a..ce321ec1ad 100644 --- a/src/ScreenNetEvaluation.cpp +++ b/src/ScreenNetEvaluation.cpp @@ -190,14 +190,12 @@ void ScreenNetEvaluation::UpdateStats() if( THEME->GetMetricB(m_sName,"ShowScoreArea") ) m_textScore[m_pActivePlayer].SetTargetNumber( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].score ); - //Values greater than 6 will cause a crash - /* + //Values greater than 6 will cause a crash/* if( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty < 6 ) { m_DifficultyIcon[m_pActivePlayer].SetPlayer( m_pActivePlayer ); m_DifficultyIcon[m_pActivePlayer].SetFromDifficulty( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty ); } - */ for( int j=0; jGetMetricR(sType,"ItemTransformFunction") ); - NUM_WHEEL_ITEMS_TO_DRAW .Load(sType,"NumWheelItems"); - WHEEL_ITEM_LOCKED_COLOR .Load(sType,"WheelItemLockedColor"); + NUM_WHEEL_ITEMS_TO_DRAW.Load(sType,"NumWheelItems"); + WHEEL_ITEM_LOCKED_COLOR.Load(sType,"WheelItemLockedColor"); - m_soundChangeMusic.Load( THEME->GetPathS(sType,"change"), true ); - m_soundLocked.Load( THEME->GetPathS(sType,"locked"), true ); + m_soundChangeMusic.Load(THEME->GetPathS(sType,"change"), true); + m_soundLocked.Load(THEME->GetPathS(sType,"locked"), true); WheelItemBase *pTempl = MakeItem(); ActorUtil::LoadAllCommands( *pTempl, m_sName ); @@ -88,7 +87,7 @@ void WheelBase::BeginScreen() void WheelBase::SetItemPosition( Actor &item, float fPosOffsetsFromMiddle ) { - /* Don't supply and item index or num items. The number of items can be so + /* Don't supply and item index or num items. The number of items can be so * large that transforms that depend on such large numbers are likely to break. */ int iItemIndex = 0; // dummy int iNumItems = 1; // dummy @@ -161,8 +160,8 @@ void WheelBase::Update( float fDeltaTime ) pDisplay->m_colorLocked = RageColor(0,0,0,0); } - //Moved to CommonUpdateProcedure, seems to work fine - //Revert if it happens to break something + // Moved to CommonUpdateProcedure, seems to work fine. Revert if it happens + // to break something. UpdateScrollbar(); if( m_Moving ) @@ -178,9 +177,8 @@ void WheelBase::Update( float fDeltaTime ) if( m_WheelState == STATE_LOCKED ) { - /* Do this in at most .1 sec chunks, so we don't get weird if we - * stop for some reason (and so it behaves the same when being - * single stepped). */ + /* Do this in at most .1 sec chunks, so we don't get weird if we stop + * for some reason (and so it behaves the same when being single stepped). */ float fTime = fDeltaTime; while( fTime > 0 ) { @@ -207,13 +205,12 @@ void WheelBase::Update( float fDeltaTime ) if( IsMoving() ) { - /* We're automatically moving. Move linearly, and don't clamp - * to the selection. */ + // We're automatically moving. Move linearly, and don't clamp to the selection. float fSpinSpeed = m_SpinSpeed*m_Moving; m_fPositionOffsetFromSelection -= fSpinSpeed*fDeltaTime; - /* Make sure that we don't go further than 1 away, in case the - * speed is very high or we miss a lot of frames. */ + /* Make sure that we don't go further than 1 away, in case the speed is + * very high or we miss a lot of frames. */ m_fPositionOffsetFromSelection = clamp(m_fPositionOffsetFromSelection, -1.0f, 1.0f); // If it passed the selection, move again. @@ -285,10 +282,10 @@ bool WheelBase::Select() // return true if this selection can end the screen case TYPE_SECTION: { RString sThisItemSectionName = m_CurWheelItemData[m_iSelection]->m_sText; - if( m_sExpandedSectionName == sThisItemSectionName ) // already expanded - SetOpenSection( "" ); // collapse it - else // already collapsed - SetOpenSection( sThisItemSectionName ); // expand it + if( m_sExpandedSectionName == sThisItemSectionName ) // already expanded + SetOpenSection( "" ); // collapse it + else // already collapsed + SetOpenSection( sThisItemSectionName ); // expand it m_soundExpand.Play(); } @@ -375,7 +372,7 @@ void WheelBase::Move(int n) m_TimeBeforeMovingBegins = 1/4.0f; m_SpinSpeed = float(PREFSMAN->m_iMusicWheelSwitchSpeed); m_Moving = n; - + if( m_Moving ) ChangeMusic(m_Moving); } @@ -525,22 +522,20 @@ public: } static int IsSettled( T* p, lua_State *L ){ lua_pushboolean( L, p->IsSettled() ); return 1; } static int IsLocked( T* p, lua_State *L ){ lua_pushboolean( L, p->WheelIsLocked() ); return 1; } + static int SetOpenSection( T* p, lua_State *L ){ p->SetOpenSection( SArg(1) ); return 0; } // evil shit //static int Move( T* p, lua_State *L ){ p->Move( IArg(1) ); return 0; } - //static int ChangeMusic( T* p, lua_State *L ){ p->ChangeMusic( IArg(1) ); return 0; } - //static int ChangeMusicUnlessLocked( T* p, lua_State *L ){ p->ChangeMusicUnlessLocked( IArg(1) ); return 0; } - //static int SetOpenSection( T* p, lua_State *L ){ p->SetOpenSection( SArg(1) ); return 0; } + //static int ChangeMusic( T* p, lua_State *L ){ p->ChangeMusicUnlessLocked( IArg(1) ); return 0; } LunaWheelBase() { ADD_METHOD( GetWheelItem ); ADD_METHOD( IsSettled ); ADD_METHOD( IsLocked ); + ADD_METHOD( SetOpenSection ); // evil shit //ADD_METHOD( Move ); //ADD_METHOD( ChangeMusic ); - //ADD_METHOD( ChangeMusicUnlessLocked ); - //ADD_METHOD( SetOpenSection ); } }; diff --git a/src/WheelItemBase.h b/src/WheelItemBase.h index 7021b18614..9e51f95d5a 100644 --- a/src/WheelItemBase.h +++ b/src/WheelItemBase.h @@ -20,7 +20,8 @@ enum WheelItemDataType TYPE_RANDOM, TYPE_PORTAL, TYPE_COURSE, - TYPE_SORT + TYPE_SORT/*, + TYPE_CUSTOM*/ }; struct WheelItemBaseData