Add some Lua bindings for the music wheel and items.
This commit is contained in:
+31
-31
@@ -500,7 +500,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
split( MODE_MENU_CHOICE_NAMES, ",", vsNames );
|
||||
for( unsigned i=0; i<vsNames.size(); ++i )
|
||||
{
|
||||
MusicWheelItemData wid( TYPE_SORT, NULL, "", NULL, SORT_MENU_COLOR, 0 );
|
||||
MusicWheelItemData wid( WheelItemDataType_Sort, NULL, "", NULL, SORT_MENU_COLOR, 0 );
|
||||
wid.m_pAction = HiddenPtr<GameCommand>( new GameCommand );
|
||||
wid.m_pAction->m_sName = vsNames[i];
|
||||
wid.m_pAction->Load( i, ParseCommands(CHOICE.GetValue(vsNames[i])) );
|
||||
@@ -674,38 +674,38 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
// In certain situations (e.g. simulating Pump it Up), themes may
|
||||
// want to only show one group at a time.
|
||||
if( !HIDE_INACTIVE_SECTIONS )
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(TYPE_SECTION, NULL, sThisSection, NULL, colorSection, iSectionCount) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, NULL, sThisSection, NULL, colorSection, iSectionCount) );
|
||||
sLastSection = sThisSection;
|
||||
}
|
||||
}
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(TYPE_SONG, pSong, sLastSection, NULL, SONGMAN->GetSongColor(pSong), 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Song, pSong, sLastSection, NULL, SONGMAN->GetSongColor(pSong), 0) );
|
||||
}
|
||||
|
||||
if( so != SORT_ROULETTE )
|
||||
{
|
||||
// todo: allow themers to change the order of the items. -aj
|
||||
if( SHOW_ROULETTE )
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(TYPE_ROULETTE, NULL, "", NULL, ROULETTE_COLOR, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Roulette, NULL, "", NULL, ROULETTE_COLOR, 0) );
|
||||
|
||||
// Only add TYPE_RANDOM and TYPE_PORTAL if there's at least
|
||||
// Only add WheelItemDataType_Random and WheelItemDataType_Portal if there's at least
|
||||
// one song on the list.
|
||||
bool bFoundAnySong = false;
|
||||
for( unsigned i=0; !bFoundAnySong && i < arrayWheelItemDatas.size(); i++ )
|
||||
if( arrayWheelItemDatas[i]->m_Type == TYPE_SONG )
|
||||
if( arrayWheelItemDatas[i]->m_Type == WheelItemDataType_Song )
|
||||
bFoundAnySong = true;
|
||||
|
||||
if( SHOW_RANDOM && bFoundAnySong )
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(TYPE_RANDOM, NULL, "", NULL, RANDOM_COLOR, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Random, NULL, "", NULL, RANDOM_COLOR, 0) );
|
||||
|
||||
if( SHOW_PORTAL && bFoundAnySong )
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(TYPE_PORTAL, NULL, "", NULL, PORTAL_COLOR, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Portal, NULL, "", NULL, PORTAL_COLOR, 0) );
|
||||
|
||||
// add custom wheel items
|
||||
vector<RString> vsNames;
|
||||
split( CUSTOM_WHEEL_ITEM_NAMES, ",", vsNames );
|
||||
for( unsigned i=0; i<vsNames.size(); ++i )
|
||||
{
|
||||
MusicWheelItemData wid( TYPE_CUSTOM, NULL, "", NULL, CUSTOM_CHOICE_COLORS.GetValue(vsNames[i]), 0 );
|
||||
MusicWheelItemData wid( WheelItemDataType_Custom, NULL, "", NULL, CUSTOM_CHOICE_COLORS.GetValue(vsNames[i]), 0 );
|
||||
wid.m_pAction = HiddenPtr<GameCommand>( new GameCommand );
|
||||
wid.m_pAction->m_sName = vsNames[i];
|
||||
wid.m_pAction->Load( i, ParseCommands(CUSTOM_CHOICES.GetValue(vsNames[i])) );
|
||||
@@ -830,12 +830,12 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
{
|
||||
RageColor c = SECTION_COLORS.GetValue(iSectionColorIndex);
|
||||
iSectionColorIndex = (iSectionColorIndex+1) % NUM_SECTION_COLORS;
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(TYPE_SECTION, NULL, sThisSection, NULL, c, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, NULL, sThisSection, NULL, c, 0) );
|
||||
sLastSection = sThisSection;
|
||||
}
|
||||
|
||||
RageColor c = ( pCourse->m_sGroupName.size() == 0 ) ? pCourse->GetColor() : SONGMAN->GetCourseColor(pCourse);
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(TYPE_COURSE, NULL, sThisSection, pCourse, c, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Course, NULL, sThisSection, pCourse, c, 0) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -894,10 +894,10 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
|
||||
unsigned unfilteredSize=aUnFilteredDatas.size();
|
||||
|
||||
/* Only add TYPE_PORTAL if there's at least one song on the list. */
|
||||
/* Only add WheelItemDataType_Portal if there's at least one song on the list. */
|
||||
bool bFoundAnySong = false;
|
||||
for( unsigned i=0; i < unfilteredSize; i++ ) {
|
||||
if( aUnFilteredDatas[i]->m_Type == TYPE_SONG ) {
|
||||
if( aUnFilteredDatas[i]->m_Type == WheelItemDataType_Song ) {
|
||||
bFoundAnySong = true;
|
||||
break;
|
||||
}
|
||||
@@ -922,7 +922,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
MusicWheelItemData& WID = *aUnFilteredDatas[i];
|
||||
|
||||
/* If we have no songs, remove Random and Portal. */
|
||||
if( WID.m_Type == TYPE_RANDOM || WID.m_Type == TYPE_PORTAL )
|
||||
if( WID.m_Type == WheelItemDataType_Random || WID.m_Type == WheelItemDataType_Portal )
|
||||
{
|
||||
if( !bFoundAnySong )
|
||||
aiRemove[i] = true;
|
||||
@@ -930,7 +930,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
}
|
||||
|
||||
/* Filter songs that we don't have enough stages to play. */
|
||||
if( WID.m_Type == TYPE_SONG )
|
||||
if( WID.m_Type == WheelItemDataType_Song )
|
||||
{
|
||||
Song* pSong = WID.m_pSong;
|
||||
|
||||
@@ -984,7 +984,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
}
|
||||
}
|
||||
|
||||
if( WID.m_Type == TYPE_COURSE )
|
||||
if( WID.m_Type == WheelItemDataType_Course )
|
||||
{
|
||||
if( !WID.m_pCourse->IsPlayableIn(GAMESTATE->GetCurrentStyle()->m_StepsType) )
|
||||
aiRemove[i] = true;
|
||||
@@ -1007,7 +1007,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
{
|
||||
MusicWheelItemData& WID = *aFilteredData[i];
|
||||
++i;
|
||||
if( WID.m_Type != TYPE_SECTION )
|
||||
if( WID.m_Type != WheelItemDataType_Section )
|
||||
continue;
|
||||
|
||||
// Count songs in this section
|
||||
@@ -1021,7 +1021,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
for( unsigned i=0; i < filteredSize; ++i )
|
||||
{
|
||||
MusicWheelItemData& WID = *aFilteredData[i];
|
||||
if( WID.m_Type != TYPE_SECTION )
|
||||
if( WID.m_Type != WheelItemDataType_Section )
|
||||
continue;
|
||||
if( WID.m_iSectionCount > 0 )
|
||||
continue;
|
||||
@@ -1042,7 +1042,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
|
||||
// If we've filtered all items, insert a dummy.
|
||||
if( aFilteredData.empty() )
|
||||
aFilteredData.push_back( new MusicWheelItemData(TYPE_SECTION, NULL, EMPTY_STRING, NULL, RageColor(1,0,0,1), 0) );
|
||||
aFilteredData.push_back( new MusicWheelItemData(WheelItemDataType_Section, NULL, EMPTY_STRING, NULL, RageColor(1,0,0,1), 0) );
|
||||
}
|
||||
|
||||
void MusicWheel::UpdateSwitch()
|
||||
@@ -1260,18 +1260,18 @@ bool MusicWheel::Select() // return true if this selection ends the screen
|
||||
|
||||
switch( m_CurWheelItemData[m_iSelection]->m_Type )
|
||||
{
|
||||
case TYPE_ROULETTE:
|
||||
case WheelItemDataType_Roulette:
|
||||
StartRoulette();
|
||||
return false;
|
||||
case TYPE_RANDOM:
|
||||
case WheelItemDataType_Random:
|
||||
StartRandom();
|
||||
return false;
|
||||
case TYPE_SORT:
|
||||
case WheelItemDataType_Sort:
|
||||
GetCurWheelItemData(m_iSelection)->m_pAction->ApplyToAllPlayers();
|
||||
ChangeSort( GAMESTATE->m_PreferredSortOrder );
|
||||
m_sLastModeMenuItem = GetCurWheelItemData(m_iSelection)->m_pAction->m_sName;
|
||||
return false;
|
||||
case TYPE_CUSTOM:
|
||||
case WheelItemDataType_Custom:
|
||||
GetCurWheelItemData(m_iSelection)->m_pAction->ApplyToAllPlayers();
|
||||
if( GetCurWheelItemData(m_iSelection)->m_pAction->m_sScreen != "" )
|
||||
return true;
|
||||
@@ -1347,12 +1347,12 @@ void MusicWheel::SetOpenSection( RString group )
|
||||
for( unsigned i = 0; i < from.size(); ++i )
|
||||
{
|
||||
MusicWheelItemData &d = *from[i];
|
||||
if( (d.m_Type == TYPE_SONG || d.m_Type == TYPE_COURSE) && !d.m_sText.empty() &&
|
||||
if( (d.m_Type == WheelItemDataType_Song || d.m_Type == WheelItemDataType_Course) && !d.m_sText.empty() &&
|
||||
d.m_sText != group )
|
||||
continue;
|
||||
|
||||
// If AUTO_SET_STYLE, hide courses that prefer a style that isn't available.
|
||||
if( d.m_Type == TYPE_COURSE && CommonMetrics::AUTO_SET_STYLE )
|
||||
if( d.m_Type == WheelItemDataType_Course && CommonMetrics::AUTO_SET_STYLE )
|
||||
{
|
||||
const Style *pStyle = d.m_pCourse->GetCourseStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined() );
|
||||
if( pStyle )
|
||||
@@ -1428,7 +1428,7 @@ RString MusicWheel::JumpToNextGroup()
|
||||
unsigned int iLastSelection = m_iSelection;
|
||||
for( unsigned int i = m_iSelection; i < m_CurWheelItemData.size(); ++i )
|
||||
{
|
||||
if( m_CurWheelItemData[i]->m_Type == TYPE_SECTION && i != (unsigned int)m_iSelection )
|
||||
if( m_CurWheelItemData[i]->m_Type == WheelItemDataType_Section && i != (unsigned int)m_iSelection )
|
||||
{
|
||||
m_iSelection = i;
|
||||
return m_CurWheelItemData[i]->m_sText;
|
||||
@@ -1438,7 +1438,7 @@ RString MusicWheel::JumpToNextGroup()
|
||||
// the previous selection.
|
||||
for( unsigned int i = 0; i < iLastSelection; ++i )
|
||||
{
|
||||
if( m_CurWheelItemData[i]->m_Type == TYPE_SECTION && i != (unsigned int)m_iSelection )
|
||||
if( m_CurWheelItemData[i]->m_Type == WheelItemDataType_Section && i != (unsigned int)m_iSelection )
|
||||
{
|
||||
m_iSelection = i;
|
||||
return m_CurWheelItemData[i]->m_sText;
|
||||
@@ -1473,7 +1473,7 @@ RString MusicWheel::JumpToPrevGroup()
|
||||
{
|
||||
for( unsigned int i = m_iSelection; i > 0; --i )
|
||||
{
|
||||
if( m_CurWheelItemData[i]->m_Type == TYPE_SECTION && i != (unsigned int)m_iSelection )
|
||||
if( m_CurWheelItemData[i]->m_Type == WheelItemDataType_Section && i != (unsigned int)m_iSelection )
|
||||
{
|
||||
m_iSelection = i;
|
||||
return m_CurWheelItemData[i]->m_sText;
|
||||
@@ -1483,7 +1483,7 @@ RString MusicWheel::JumpToPrevGroup()
|
||||
for( unsigned int i = m_CurWheelItemData.size()-1; i > 0; --i )
|
||||
{
|
||||
LOG->Trace( "JumpToPrevGroup iteration 2 | i = %u",i );
|
||||
if( m_CurWheelItemData[i]->m_Type == TYPE_SECTION )
|
||||
if( m_CurWheelItemData[i]->m_Type == WheelItemDataType_Section )
|
||||
{
|
||||
m_iSelection = i;
|
||||
LOG->Trace( "finding it in #2 | i = %u | text = %s",i, m_CurWheelItemData[i]->m_sText.c_str() );
|
||||
@@ -1523,7 +1523,7 @@ Song* MusicWheel::GetSelectedSong()
|
||||
{
|
||||
switch( m_CurWheelItemData[m_iSelection]->m_Type )
|
||||
{
|
||||
case TYPE_PORTAL:
|
||||
case WheelItemDataType_Portal:
|
||||
return GetPreferredSelectionForRandomOrPortal();
|
||||
default:
|
||||
return GetCurWheelItemData(m_iSelection)->m_pSong;
|
||||
@@ -1572,7 +1572,7 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal()
|
||||
vDifficultiesToRequire.clear();
|
||||
|
||||
int iSelection = RandomInt( wid.size() );
|
||||
if( wid[iSelection]->m_Type != TYPE_SONG )
|
||||
if( wid[iSelection]->m_Type != WheelItemDataType_Song )
|
||||
continue;
|
||||
|
||||
const Song *pSong = wid[iSelection]->m_pSong;
|
||||
|
||||
@@ -207,7 +207,7 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int
|
||||
switch( pWID->m_Type )
|
||||
{
|
||||
DEFAULT_FAIL( pWID->m_Type );
|
||||
case TYPE_SONG:
|
||||
case WheelItemDataType_Song:
|
||||
type = MusicWheelItemType_Song;
|
||||
|
||||
m_TextBanner.SetFromSong( pWID->m_pSong );
|
||||
@@ -219,7 +219,7 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int
|
||||
m_WheelNotifyIcon.SetVisible( true );
|
||||
RefreshGrades();
|
||||
break;
|
||||
case TYPE_SECTION:
|
||||
case WheelItemDataType_Section:
|
||||
{
|
||||
sDisplayName = SONGMAN->ShortenGroupName(pWID->m_sText);
|
||||
|
||||
@@ -232,14 +232,14 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int
|
||||
m_pTextSectionCount->SetVisible( true );
|
||||
}
|
||||
break;
|
||||
case TYPE_COURSE:
|
||||
case WheelItemDataType_Course:
|
||||
sDisplayName = pWID->m_pCourse->GetDisplayFullTitle();
|
||||
sTranslitName = pWID->m_pCourse->GetTranslitFullTitle();
|
||||
type = MusicWheelItemType_Course;
|
||||
m_WheelNotifyIcon.SetFlags( pWID->m_Flags );
|
||||
m_WheelNotifyIcon.SetVisible( true );
|
||||
break;
|
||||
case TYPE_SORT:
|
||||
case WheelItemDataType_Sort:
|
||||
sDisplayName = pWID->m_sLabel;
|
||||
// hack to get mode items working. -freem
|
||||
if( pWID->m_pAction->m_pm != PlayMode_Invalid )
|
||||
@@ -247,19 +247,19 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int
|
||||
else
|
||||
type = MusicWheelItemType_Sort;
|
||||
break;
|
||||
case TYPE_ROULETTE:
|
||||
case WheelItemDataType_Roulette:
|
||||
sDisplayName = THEME->GetString("MusicWheel","Roulette");
|
||||
type = MusicWheelItemType_Roulette;
|
||||
break;
|
||||
case TYPE_RANDOM:
|
||||
case WheelItemDataType_Random:
|
||||
sDisplayName = THEME->GetString("MusicWheel","Random");
|
||||
type = MusicWheelItemType_Random;
|
||||
break;
|
||||
case TYPE_PORTAL:
|
||||
case WheelItemDataType_Portal:
|
||||
sDisplayName = THEME->GetString("MusicWheel","Portal");
|
||||
type = MusicWheelItemType_Portal;
|
||||
break;
|
||||
case TYPE_CUSTOM:
|
||||
case WheelItemDataType_Custom:
|
||||
sDisplayName = pWID->m_sLabel;
|
||||
type = MusicWheelItemType_Custom;
|
||||
break;
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@ void RoomWheel::Load( RString sType )
|
||||
m_offset = 0;
|
||||
LOG->Trace( "RoomWheel::Load('%s')", sType.c_str() );
|
||||
|
||||
AddPermanentItem( new RoomWheelItemData(TYPE_GENERIC, "Create Room", "Create a new game room", THEME->GetMetricC( m_sName, "CreateRoomColor")) );
|
||||
AddPermanentItem( new RoomWheelItemData(WheelItemDataType_Generic, "Create Room", "Create a new game room", THEME->GetMetricC( m_sName, "CreateRoomColor")) );
|
||||
|
||||
BuildWheelItemsData( m_CurWheelItemData );
|
||||
RebuildWheelItems();
|
||||
@@ -90,7 +90,7 @@ void RoomWheelItem::Load( RString sType )
|
||||
void RoomWheel::BuildWheelItemsData( vector<WheelItemBaseData*> &arrayWheelItemDatas )
|
||||
{
|
||||
if( arrayWheelItemDatas.empty() )
|
||||
arrayWheelItemDatas.push_back( new RoomWheelItemData(TYPE_GENERIC, EMPTY_STRING, "", RageColor(1,0,0,1)) );
|
||||
arrayWheelItemDatas.push_back( new RoomWheelItemData(WheelItemDataType_Generic, EMPTY_STRING, "", RageColor(1,0,0,1)) );
|
||||
}
|
||||
|
||||
void RoomWheel::AddPermanentItem( RoomWheelItemData *itemdata )
|
||||
@@ -137,7 +137,7 @@ void RoomWheel::RemoveItem( int index )
|
||||
if( m_CurWheelItemData.size() < 1 )
|
||||
{
|
||||
m_bEmpty = true;
|
||||
m_CurWheelItemData.push_back( new WheelItemBaseData(TYPE_GENERIC, "- EMPTY -", RageColor(1,0,0,1)) );
|
||||
m_CurWheelItemData.push_back( new WheelItemBaseData(WheelItemDataType_Generic, "- EMPTY -", RageColor(1,0,0,1)) );
|
||||
}
|
||||
|
||||
RebuildWheelItems();
|
||||
|
||||
@@ -255,13 +255,13 @@ void ScreenNetRoom::UpdateRoomsList()
|
||||
{
|
||||
difference = abs( difference );
|
||||
for( int x = 0; x < difference; ++x )
|
||||
m_RoomWheel.AddItem( new RoomWheelItemData(TYPE_GENERIC, "", "", RageColor(1,1,1,1)) );
|
||||
m_RoomWheel.AddItem( new RoomWheelItemData(WheelItemDataType_Generic, "", "", RageColor(1,1,1,1)) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( unsigned int x = 0; x < m_Rooms.size(); ++x)
|
||||
m_RoomWheel.AddItem( new RoomWheelItemData(TYPE_GENERIC, "", "", RageColor(1,1,1,1)) );
|
||||
m_RoomWheel.AddItem( new RoomWheelItemData(WheelItemDataType_Generic, "", "", RageColor(1,1,1,1)) );
|
||||
}
|
||||
|
||||
for( unsigned int i = 0; i < m_Rooms.size(); ++i )
|
||||
|
||||
@@ -392,7 +392,7 @@ void ScreenNetSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
if( !bResult )
|
||||
return;
|
||||
|
||||
if( m_MusicWheel.GetSelectedType() != TYPE_SONG )
|
||||
if( m_MusicWheel.GetSelectedType() != WheelItemDataType_Song )
|
||||
return;
|
||||
|
||||
Song * pSong = m_MusicWheel.GetSelectedSong();
|
||||
|
||||
+13
-13
@@ -1695,11 +1695,11 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
|
||||
switch( m_MusicWheel.GetSelectedType() )
|
||||
{
|
||||
case TYPE_SECTION:
|
||||
case TYPE_SORT:
|
||||
case TYPE_ROULETTE:
|
||||
case TYPE_RANDOM:
|
||||
case TYPE_CUSTOM:
|
||||
case WheelItemDataType_Section:
|
||||
case WheelItemDataType_Sort:
|
||||
case WheelItemDataType_Roulette:
|
||||
case WheelItemDataType_Random:
|
||||
case WheelItemDataType_Custom:
|
||||
FOREACH_PlayerNumber( p )
|
||||
m_iSelection[p] = -1;
|
||||
|
||||
@@ -1722,7 +1722,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
|
||||
switch( m_MusicWheel.GetSelectedType() )
|
||||
{
|
||||
case TYPE_SECTION:
|
||||
case WheelItemDataType_Section:
|
||||
// reduce scope
|
||||
{
|
||||
SortOrder curSort = GAMESTATE->m_SortOrder;
|
||||
@@ -1740,25 +1740,25 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
m_sSampleMusicToPlay = m_sSectionMusicPath;
|
||||
}
|
||||
break;
|
||||
case TYPE_SORT:
|
||||
case WheelItemDataType_Sort:
|
||||
bWantBanner = false; // we load it ourself
|
||||
m_Banner.LoadMode();
|
||||
if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong )
|
||||
m_sSampleMusicToPlay = m_sSortMusicPath;
|
||||
break;
|
||||
case TYPE_ROULETTE:
|
||||
case WheelItemDataType_Roulette:
|
||||
bWantBanner = false; // we load it ourself
|
||||
m_Banner.LoadRoulette();
|
||||
if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong )
|
||||
m_sSampleMusicToPlay = m_sRouletteMusicPath;
|
||||
break;
|
||||
case TYPE_RANDOM:
|
||||
case WheelItemDataType_Random:
|
||||
bWantBanner = false; // we load it ourself
|
||||
m_Banner.LoadRandom();
|
||||
//if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong )
|
||||
m_sSampleMusicToPlay = m_sRandomMusicPath;
|
||||
break;
|
||||
case TYPE_CUSTOM:
|
||||
case WheelItemDataType_Custom:
|
||||
{
|
||||
bWantBanner = false; // we load it ourself
|
||||
RString sBannerName = GetMusicWheel()->GetCurWheelItemData( GetMusicWheel()->GetCurrentIndex() )->m_pAction->m_sName.c_str();
|
||||
@@ -1781,8 +1781,8 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case TYPE_SONG:
|
||||
case TYPE_PORTAL:
|
||||
case WheelItemDataType_Song:
|
||||
case WheelItemDataType_Portal:
|
||||
// check SampleMusicPreviewMode here.
|
||||
switch( SAMPLE_MUSIC_PREVIEW_MODE )
|
||||
{
|
||||
@@ -1818,7 +1818,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
SwitchToPreferredDifficulty();
|
||||
break;
|
||||
|
||||
case TYPE_COURSE:
|
||||
case WheelItemDataType_Course:
|
||||
{
|
||||
const Course *lCourse = m_MusicWheel.GetSelectedCourse();
|
||||
const Style *pStyle = NULL;
|
||||
|
||||
+9
-3
@@ -276,10 +276,10 @@ bool WheelBase::Select() // return true if this selection can end the screen
|
||||
|
||||
switch( m_CurWheelItemData[m_iSelection]->m_Type )
|
||||
{
|
||||
case TYPE_GENERIC:
|
||||
case WheelItemDataType_Generic:
|
||||
m_LastSelection = m_CurWheelItemData[m_iSelection];
|
||||
break;
|
||||
case TYPE_SECTION:
|
||||
case WheelItemDataType_Section:
|
||||
{
|
||||
RString sThisItemSectionName = m_CurWheelItemData[m_iSelection]->m_sText;
|
||||
if( m_sExpandedSectionName == sThisItemSectionName ) // already expanded
|
||||
@@ -468,7 +468,7 @@ void WheelBase::RebuildWheelItems( int iDist )
|
||||
const WheelItemBaseData *pData = data[iIndex];
|
||||
WheelItemBase *pDisplay = items[i];
|
||||
|
||||
pDisplay->SetExpanded( pData->m_Type == TYPE_SECTION && pData->m_sText == m_sExpandedSectionName );
|
||||
pDisplay->SetExpanded( pData->m_Type == WheelItemDataType_Section && pData->m_sText == m_sExpandedSectionName );
|
||||
}
|
||||
|
||||
for( int i=0; i<(int)items.size(); i++ )
|
||||
@@ -530,6 +530,11 @@ public:
|
||||
//static int Move( T* p, lua_State *L ){ p->Move( IArg(1) ); return 0; }
|
||||
//static int ChangeMusic( T* p, lua_State *L ){ p->ChangeMusicUnlessLocked( IArg(1) ); return 0; }
|
||||
|
||||
static int GetSelectedType( T* p, lua_State *L ) {
|
||||
lua_pushnumber( L, p->GetSelectedType() );
|
||||
return 1;
|
||||
}
|
||||
|
||||
LunaWheelBase()
|
||||
{
|
||||
ADD_METHOD( GetWheelItem );
|
||||
@@ -538,6 +543,7 @@ public:
|
||||
ADD_METHOD( SetOpenSection );
|
||||
ADD_METHOD( GetCurrentIndex );
|
||||
ADD_METHOD( GetNumItems );
|
||||
ADD_METHOD( GetSelectedType );
|
||||
// evil shit
|
||||
//ADD_METHOD( Move );
|
||||
//ADD_METHOD( ChangeMusic );
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
RString GetExpandedSectionName() { return m_sExpandedSectionName; }
|
||||
int GetCurrentIndex() { return m_iSelection; }
|
||||
|
||||
WheelItemDataType GetSelectedType() { return m_CurWheelItemData[m_iSelection]->m_Type; }
|
||||
|
||||
// Lua
|
||||
void PushSelf( lua_State *L );
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ WheelItemBase::WheelItemBase(RString sType)
|
||||
|
||||
void WheelItemBase::Load( RString sType )
|
||||
{
|
||||
m_colorLocked = RageColor(0,0,0,0.25);
|
||||
m_colorLocked = RageColor(0,0,0,0.25f);
|
||||
}
|
||||
|
||||
void WheelItemBase::LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus, int iDrawIndex )
|
||||
@@ -73,13 +73,17 @@ class LunaWheelItemBase: public Luna<WheelItemBase>
|
||||
public:
|
||||
DEFINE_METHOD( GetColor, GetColor() )
|
||||
DEFINE_METHOD( GetText, GetText() )
|
||||
//DEFINE_METHOD( GetType, GetType() )
|
||||
|
||||
static int GetType( T* p, lua_State *L ) {
|
||||
lua_pushnumber( L, p->GetType() );
|
||||
return 1;
|
||||
}
|
||||
|
||||
LunaWheelItemBase()
|
||||
{
|
||||
ADD_METHOD( GetColor );
|
||||
ADD_METHOD( GetText );
|
||||
//ADD_METHOD( GetType );
|
||||
ADD_METHOD( GetType );
|
||||
}
|
||||
};
|
||||
LUA_REGISTER_DERIVED_CLASS( WheelItemBase, ActorFrame )
|
||||
|
||||
+10
-9
@@ -11,16 +11,17 @@ struct WheelItemBaseData;
|
||||
/** @brief The different types of Wheel Items. */
|
||||
enum WheelItemDataType
|
||||
{
|
||||
TYPE_GENERIC, /**< A generic item on the Wheel. */
|
||||
TYPE_SECTION, /**< A general section on the Wheel. */
|
||||
TYPE_SONG, /**< A Song on the Wheel. */
|
||||
TYPE_ROULETTE, /**< The roulette section on the Wheel. */
|
||||
TYPE_RANDOM, /**< The random section on the Wheel. */
|
||||
TYPE_PORTAL, /**< The portal section on the Wheel. */
|
||||
TYPE_COURSE, /**< A Course on the Wheel. */
|
||||
TYPE_SORT, /**< A generic sorting item on the Wheel. */
|
||||
TYPE_CUSTOM /**< A custom item on the Wheel. */
|
||||
WheelItemDataType_Generic, /**< A generic item on the Wheel. */
|
||||
WheelItemDataType_Section, /**< A general section on the Wheel. */
|
||||
WheelItemDataType_Song, /**< A Song on the Wheel. */
|
||||
WheelItemDataType_Roulette, /**< The roulette section on the Wheel. */
|
||||
WheelItemDataType_Random, /**< The random section on the Wheel. */
|
||||
WheelItemDataType_Portal, /**< The portal section on the Wheel. */
|
||||
WheelItemDataType_Course, /**< A Course on the Wheel. */
|
||||
WheelItemDataType_Sort, /**< A generic sorting item on the Wheel. */
|
||||
WheelItemDataType_Custom /**< A custom item on the Wheel. */
|
||||
};
|
||||
LuaDeclareType( WheelItemDataType );
|
||||
|
||||
struct WheelItemBaseData
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user