Added ScreenJukeboxMenu, and UI cleanup.

This commit is contained in:
Chris Danford
2003-02-11 02:20:38 +00:00
parent 043b8d45f0
commit 7b644e834a
21 changed files with 650 additions and 132 deletions
+20 -1
View File
@@ -462,6 +462,12 @@ ExplanationY=410
ExplanationText=In this mode, you can edit existing notes patterns,::create note patterns, or synchronize notes with the music.
HelpText=&UP; &DOWN; change line &LEFT; &RIGHT; change value START to continue
[ScreenJukeboxMenu]
ExplanationX=320
ExplanationY=410
ExplanationText=In this mode, you can edit existing notes patterns,::create note patterns, or synchronize notes with the music.
HelpText=&UP; &DOWN; change line &LEFT; &RIGHT; change value START to continue
[ScreenManager]
StatsX=632
StatsY=10
@@ -845,7 +851,7 @@ NumCharsToDrawTotal=10
FakeBeatsPerSec=2.5
TimerSeconds=24
[SongSelector]
[EditMenu]
Arrows1X=190
Arrows2X=590
SongBannerX=490
@@ -878,6 +884,19 @@ Row5Y=260
Row6Y=300
Row7Y=340
[JukeboxMenu]
Arrows1X=190
Arrows2X=590
RowLabelsX=20
RowValue1X=380
RowValue2X=380
RowValue3X=380
RowValue4X=380
Row1Y=80
Row2Y=130
Row3Y=180
Row4Y=230
[ScreenOptionsMenu]
InputOptions=
MachineOptions=
@@ -1,7 +1,7 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: SongSelector
Class: EditMenu
Desc: See header.
@@ -10,7 +10,7 @@
-----------------------------------------------------------------------------
*/
#include "SongSelector.h"
#include "EditMenu.h"
#include "RageLog.h"
#include "SongManager.h"
#include "GameState.h"
@@ -18,34 +18,32 @@
#include "GameManager.h"
//
// Defines specific to SongSelector
// Defines specific to EditMenu
//
#define ARROWS_X( i ) THEME->GetMetricF("SongSelector",ssprintf("Arrows%dX",i+1))
#define SONG_BANNER_X THEME->GetMetricF("SongSelector","SongBannerX")
#define SONG_BANNER_Y THEME->GetMetricF("SongSelector","SongBannerY")
#define SONG_BANNER_WIDTH THEME->GetMetricF("SongSelector","SongBannerWidth")
#define SONG_BANNER_HEIGHT THEME->GetMetricF("SongSelector","SongBannerHeight")
#define SONG_TEXT_BANNER_X THEME->GetMetricF("SongSelector","SongTextBannerX")
#define SONG_TEXT_BANNER_Y THEME->GetMetricF("SongSelector","SongTextBannerY")
#define GROUP_BANNER_X THEME->GetMetricF("SongSelector","GroupBannerX")
#define GROUP_BANNER_Y THEME->GetMetricF("SongSelector","GroupBannerY")
#define GROUP_BANNER_WIDTH THEME->GetMetricF("SongSelector","GroupBannerWidth")
#define GROUP_BANNER_HEIGHT THEME->GetMetricF("SongSelector","GroupBannerHeight")
#define METER_X THEME->GetMetricF("SongSelector","MeterX")
#define METER_Y THEME->GetMetricF("SongSelector","MeterY")
#define SOURCE_METER_X THEME->GetMetricF("SongSelector","SourceMeterX")
#define SOURCE_METER_Y THEME->GetMetricF("SongSelector","SourceMeterY")
#define ROW_LABELS_X THEME->GetMetricF("SongSelector","RowLabelsX")
#define ROW_VALUE_X( i ) THEME->GetMetricF("SongSelector",ssprintf("RowValue%dX",i+1))
#define ROW_Y( i ) THEME->GetMetricF("SongSelector",ssprintf("Row%dY",i+1))
#define ARROWS_X( i ) THEME->GetMetricF("EditMenu",ssprintf("Arrows%dX",i+1))
#define SONG_BANNER_X THEME->GetMetricF("EditMenu","SongBannerX")
#define SONG_BANNER_Y THEME->GetMetricF("EditMenu","SongBannerY")
#define SONG_BANNER_WIDTH THEME->GetMetricF("EditMenu","SongBannerWidth")
#define SONG_BANNER_HEIGHT THEME->GetMetricF("EditMenu","SongBannerHeight")
#define SONG_TEXT_BANNER_X THEME->GetMetricF("EditMenu","SongTextBannerX")
#define SONG_TEXT_BANNER_Y THEME->GetMetricF("EditMenu","SongTextBannerY")
#define GROUP_BANNER_X THEME->GetMetricF("EditMenu","GroupBannerX")
#define GROUP_BANNER_Y THEME->GetMetricF("EditMenu","GroupBannerY")
#define GROUP_BANNER_WIDTH THEME->GetMetricF("EditMenu","GroupBannerWidth")
#define GROUP_BANNER_HEIGHT THEME->GetMetricF("EditMenu","GroupBannerHeight")
#define METER_X THEME->GetMetricF("EditMenu","MeterX")
#define METER_Y THEME->GetMetricF("EditMenu","MeterY")
#define SOURCE_METER_X THEME->GetMetricF("EditMenu","SourceMeterX")
#define SOURCE_METER_Y THEME->GetMetricF("EditMenu","SourceMeterY")
#define ROW_LABELS_X THEME->GetMetricF("EditMenu","RowLabelsX")
#define ROW_VALUE_X( i ) THEME->GetMetricF("EditMenu",ssprintf("RowValue%dX",i+1))
#define ROW_Y( i ) THEME->GetMetricF("EditMenu",ssprintf("Row%dY",i+1))
SongSelector::SongSelector()
EditMenu::EditMenu()
{
LOG->Trace( "ScreenEditMenu::ScreenEditMenu()" );
m_bAllowNewNotes = true;
int i;
for( i=0; i<2; i++ )
@@ -59,6 +57,13 @@ SongSelector::SongSelector()
ZERO( m_iSelection );
// start out on easy, not beginner
m_iSelection[ROW_DIFFICULTY] = DIFFICULTY_EASY;
m_iSelection[ROW_SOURCE_DIFFICULTY] = DIFFICULTY_EASY;
for( i=0; i<NUM_ROWS; i++ )
{
m_textLabel[i].LoadFromFont( THEME->GetPathTo("Fonts","header2") );
@@ -121,38 +126,38 @@ SongSelector::SongSelector()
OnRowValueChanged( (Row)0 );
}
SongSelector::~SongSelector()
EditMenu::~EditMenu()
{
}
void SongSelector::Refresh()
void EditMenu::Refresh()
{
ChangeToRow( (Row)0 );
OnRowValueChanged( (Row)0 );
}
void SongSelector::DrawPrimitives()
void EditMenu::DrawPrimitives()
{
ActorFrame::DrawPrimitives();
}
bool SongSelector::CanGoUp()
bool EditMenu::CanGoUp()
{
return m_SelectedRow != 0;
}
bool SongSelector::CanGoDown()
bool EditMenu::CanGoDown()
{
return m_SelectedRow != NUM_ROWS-1;
}
bool SongSelector::CanGoLeft()
bool EditMenu::CanGoLeft()
{
return m_iSelection[m_SelectedRow] != 0;
}
bool SongSelector::CanGoRight()
bool EditMenu::CanGoRight()
{
int num_values[NUM_ROWS] =
{
@@ -168,7 +173,7 @@ bool SongSelector::CanGoRight()
return m_iSelection[m_SelectedRow] != (num_values[m_SelectedRow]-1);
}
void SongSelector::Up()
void EditMenu::Up()
{
if( CanGoUp() )
{
@@ -180,7 +185,7 @@ void SongSelector::Up()
}
}
void SongSelector::Down()
void EditMenu::Down()
{
if( CanGoDown() )
{
@@ -192,7 +197,7 @@ void SongSelector::Down()
}
}
void SongSelector::Left()
void EditMenu::Left()
{
if( CanGoLeft() )
{
@@ -202,7 +207,7 @@ void SongSelector::Left()
}
}
void SongSelector::Right()
void EditMenu::Right()
{
if( CanGoRight() )
{
@@ -213,7 +218,7 @@ void SongSelector::Right()
}
void SongSelector::ChangeToRow( Row newRow )
void EditMenu::ChangeToRow( Row newRow )
{
m_SelectedRow = newRow;
@@ -223,7 +228,7 @@ void SongSelector::ChangeToRow( Row newRow )
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
}
void SongSelector::OnRowValueChanged( Row row )
void EditMenu::OnRowValueChanged( Row row )
{
m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
@@ -287,12 +292,12 @@ void SongSelector::OnRowValueChanged( Row row )
}
}
Notes* SongSelector::GetSelectedNotes()
Notes* EditMenu::GetSelectedNotes()
{
return GetSelectedSong()->GetNotes(GetSelectedNotesType(),GetSelectedDifficulty(), false);
}
Notes* SongSelector::GetSelectedSourceNotes()
Notes* EditMenu::GetSelectedSourceNotes()
{
return GetSelectedSong()->GetNotes(GetSelectedSourceNotesType(),GetSelectedSourceDifficulty(), false);
}
@@ -1,29 +1,30 @@
#ifndef SONG_SELECTOR_H
#define SONG_SELECTOR_H
#ifndef EDITMENU_H
#define EDITMENU_H
/*
-----------------------------------------------------------------------------
Class: SongSelector
Class: EditMenu
Desc: Choose a game, style, song and notes on one screen.
Desc: UI on Edit Menu screen. Create Notes, delete Notes, or launch Notes
in editor.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ActorFrame.h"
#include "MenuElements.h"
#include "Banner.h"
#include "TextBanner.h"
#include "GameConstantsAndTypes.h"
#include "FootMeter.h"
#include "RandomSample.h"
class SongSelector: public ActorFrame
class EditMenu: public ActorFrame
{
public:
SongSelector();
~SongSelector();
EditMenu();
~EditMenu();
virtual void DrawPrimitives();
bool CanGoUp();
@@ -98,10 +99,6 @@ public:
Notes* GetSelectedNotes();
Notes* GetSelectedSourceNotes();
/* not used yet */
bool m_bAllowNewNotes;
void AllowNewNotes(bool b) { m_bAllowNewNotes = b; }
private:
Sprite m_sprArrows[2];
+1
View File
@@ -70,6 +70,7 @@ void GameState::Reset()
m_PlayMode = PLAY_MODE_INVALID;
m_bEditing = false;
m_bDemonstration = false;
m_bJukeboxUsesModifiers = false;
m_iCurrentStageIndex = 0;
m_bAllow2ndExtraStage = true;
+1
View File
@@ -67,6 +67,7 @@ public:
PlayMode m_PlayMode; // many screen display different info depending on this value
bool m_bEditing; // NoteField does special stuff when this is true
bool m_bDemonstration; // ScreenGameplay does special stuff when this is true
bool m_bJukeboxUsesModifiers;
int m_iCurrentStageIndex; // incremented on Eval screen
int GetStageIndex();
+190
View File
@@ -0,0 +1,190 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: JukeboxMenu
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "JukeboxMenu.h"
#include "RageLog.h"
#include "SongManager.h"
#include "GameState.h"
#include "ThemeManager.h"
#include "GameManager.h"
//
// Defines specific to JukeboxMenu
//
#define ARROWS_X( i ) THEME->GetMetricF("JukeboxMenu",ssprintf("Arrows%dX",i+1))
#define ROW_LABELS_X THEME->GetMetricF("JukeboxMenu","RowLabelsX")
#define ROW_VALUE_X( i ) THEME->GetMetricF("JukeboxMenu",ssprintf("RowValue%dX",i+1))
#define ROW_Y( i ) THEME->GetMetricF("JukeboxMenu",ssprintf("Row%dY",i+1))
JukeboxMenu::JukeboxMenu()
{
LOG->Trace( "ScreenJukeboxMenu::ScreenJukeboxMenu()" );
int i;
for( i=0; i<2; i++ )
{
m_sprArrows[i].Load( THEME->GetPathTo("Graphics",ssprintf("jukebox menu %s",(i==0?"left":"right"))) );
m_sprArrows[i].SetX( ARROWS_X(i) );
this->AddChild( &m_sprArrows[i] );
}
m_SelectedRow = (Row)0;
ZERO( m_iSelection );
for( i=0; i<NUM_ROWS; i++ )
{
m_textLabel[i].LoadFromFont( THEME->GetPathTo("Fonts","header2") );
m_textLabel[i].SetXY( ROW_LABELS_X, ROW_Y(i) );
m_textLabel[i].SetText( RowToString((Row)i) );
m_textLabel[i].SetZoom( 0.8f );
m_textLabel[i].SetHorizAlign( Actor::align_left );
this->AddChild( &m_textLabel[i] );
m_textValue[i].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
m_textValue[i].SetXY( ROW_VALUE_X(i), ROW_Y(i) );
m_textValue[i].SetText( "blah" );
m_textValue[i].SetZoom( 0.8f );
this->AddChild( &m_textValue[i] );
}
m_soundChangeRow.Load( THEME->GetPathTo("sounds","jukebox menu row") );
m_soundChangeValue.Load( THEME->GetPathTo("sounds","jukebox menu value") );
// fill in data structures
GAMEMAN->GetStylesForGame( GAMESTATE->m_CurGame, m_Styles );
SONGMAN->GetGroupNames( m_sGroups );
m_sGroups.insert( m_sGroups.begin(), "All Music" );
m_sDifficulties.push_back( "all difficulties" );
for( int d=0; d<NUM_DIFFICULTIES; d++ )
m_sDifficulties.push_back( DifficultyToString( (Difficulty)d ) );
m_sModifiers.push_back( "no modifiers" );
m_sModifiers.push_back( "random modifiers" );
ChangeToRow( (Row)0 );
OnRowValueChanged( (Row)0 );
}
JukeboxMenu::~JukeboxMenu()
{
}
void JukeboxMenu::DrawPrimitives()
{
ActorFrame::DrawPrimitives();
}
bool JukeboxMenu::CanGoUp()
{
return m_SelectedRow != 0;
}
bool JukeboxMenu::CanGoDown()
{
return m_SelectedRow != NUM_ROWS-1;
}
bool JukeboxMenu::CanGoLeft()
{
return m_iSelection[m_SelectedRow] != 0;
}
bool JukeboxMenu::CanGoRight()
{
int num_values[NUM_ROWS] =
{
m_Styles.size(),
m_sGroups.size(),
m_sDifficulties.size(),
m_sModifiers.size()
};
return m_iSelection[m_SelectedRow] != (num_values[m_SelectedRow]-1);
}
void JukeboxMenu::Up()
{
if( CanGoUp() )
{
ChangeToRow( Row(m_SelectedRow-1) );
m_soundChangeRow.PlayRandom();
}
}
void JukeboxMenu::Down()
{
if( CanGoDown() )
{
ChangeToRow( Row(m_SelectedRow+1) );
m_soundChangeRow.PlayRandom();
}
}
void JukeboxMenu::Left()
{
if( CanGoLeft() )
{
m_iSelection[m_SelectedRow]--;
OnRowValueChanged( m_SelectedRow );
m_soundChangeValue.PlayRandom();
}
}
void JukeboxMenu::Right()
{
if( CanGoRight() )
{
m_iSelection[m_SelectedRow]++;
OnRowValueChanged( m_SelectedRow );
m_soundChangeValue.PlayRandom();
}
}
void JukeboxMenu::ChangeToRow( Row newRow )
{
m_SelectedRow = newRow;
for( int i=0; i<2; i++ )
m_sprArrows[i].SetY( ROW_Y(newRow) );
m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
}
void JukeboxMenu::OnRowValueChanged( Row row )
{
m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
switch( row )
{
case ROW_STYLE:
m_textValue[ROW_STYLE].SetText( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle())->m_szName );
// fall through
case ROW_GROUP:
m_textValue[ROW_GROUP].SetText( SONGMAN->ShortenGroupName(GetSelectedGroup()) );
// fall through
case ROW_DIFFICULTY:
m_textValue[ROW_DIFFICULTY].SetText( GetSelectedDifficultyString() );
// fall through
case ROW_MODIFIERS:
m_textValue[ROW_MODIFIERS].SetText( m_sModifiers[GetSelectedModifiers()] );
break;
default:
ASSERT(0); // invalid row
}
}
+86
View File
@@ -0,0 +1,86 @@
#ifndef JukeboxMenu_H
#define JukeboxMenu_H
/*
-----------------------------------------------------------------------------
Class: JukeboxMenu
Desc: UI on ScreenJukeboxMenu.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ActorFrame.h"
#include "Banner.h"
#include "TextBanner.h"
#include "GameConstantsAndTypes.h"
#include "FootMeter.h"
#include "RandomSample.h"
#include "Style.h"
class JukeboxMenu: public ActorFrame
{
public:
JukeboxMenu();
~JukeboxMenu();
virtual void DrawPrimitives();
bool CanGoUp();
bool CanGoDown();
bool CanGoLeft();
bool CanGoRight();
void Up();
void Down();
void Left();
void Right();
enum Row
{
ROW_STYLE,
ROW_GROUP,
ROW_DIFFICULTY,
ROW_MODIFIERS,
NUM_ROWS
} m_SelectedRow;
CString RowToString( Row r )
{
const CString s[NUM_ROWS] =
{
"Style",
"Group",
"Difficulty",
"Modifiers",
};
return s[r];
}
Style GetSelectedStyle() { return m_Styles[m_iSelection[ROW_STYLE]]; }
CString GetSelectedGroup() { return m_sGroups[m_iSelection[ROW_GROUP]]; }
CString GetSelectedDifficultyString() { return m_sDifficulties[m_iSelection[ROW_DIFFICULTY]]; }
Difficulty GetSelectedDifficulty() { return StringToDifficulty( GetSelectedDifficultyString() ); }
bool GetSelectedModifiers() { return m_iSelection[ROW_MODIFIERS] != 0; }
private:
Sprite m_sprArrows[2];
int m_iSelection[NUM_ROWS];
BitmapText m_textLabel[NUM_ROWS];
BitmapText m_textValue[NUM_ROWS];
vector<Style> m_Styles;
CStringArray m_sGroups;
vector<string> m_sDifficulties;
CStringArray m_sModifiers;
void OnRowValueChanged( Row row );
void ChangeToRow( Row newRow );
RandomSample m_soundChangeRow;
RandomSample m_soundChangeValue;
};
#endif
+21
View File
@@ -206,3 +206,24 @@ void PlayerOptions::NextTurn()
{
m_TurnType = (TurnType) ((m_TurnType+1)%NUM_TURN_TYPES);
}
void PlayerOptions::ChooseRandomMofifiers()
{
if( RandomFloat(0,1)>0.8f )
m_fScrollSpeed = 1.5f;
if( RandomFloat(0,1)>0.8f )
m_bReverseScroll = true;
if( RandomFloat(0,1)>0.9f )
m_bDark = true;
float f;
f = RandomFloat(0,1);
if( f>0.66f )
m_AccelType = (AccelType)(rand()%NUM_ACCEL_TYPES);
else if( f>0.33f )
m_bEffects[ rand()%NUM_EFFECT_TYPES ] = true;
f = RandomFloat(0,1);
if( f>0.95f )
m_AppearanceType = APPEARANCE_HIDDEN;
else if( f>0.9f )
m_AppearanceType = APPEARANCE_SUDDEN;
}
+1
View File
@@ -70,6 +70,7 @@ struct PlayerOptions
void Init();
CString GetString();
void FromString( CString sOptions );
void ChooseRandomMofifiers();
};
#endif
+1 -12
View File
@@ -109,18 +109,7 @@ bool SetUpSongOptions() // always return true.
continue;
GAMESTATE->m_PlayerOptions[p] = PlayerOptions();
if( RandomFloat(0,1)>0.8f )
GAMESTATE->m_PlayerOptions[p].m_fScrollSpeed = 1.5f;
GAMESTATE->m_PlayerOptions[p].m_bEffects[ rand()%PlayerOptions::NUM_EFFECT_TYPES ] = true;
if( RandomFloat(0,1)>0.9f )
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::APPEARANCE_HIDDEN;
if( RandomFloat(0,1)>0.9f )
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::APPEARANCE_SUDDEN;
if( RandomFloat(0,1)>0.7f )
GAMESTATE->m_PlayerOptions[p].m_bReverseScroll = true;
if( RandomFloat(0,1)>0.8f )
GAMESTATE->m_PlayerOptions[p].m_bDark = true;
GAMESTATE->m_PlayerOptions[p].ChooseRandomMofifiers();
}
GAMESTATE->m_SongOptions = SongOptions();
+6 -6
View File
@@ -146,7 +146,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
// NotesType soureNT = m_Selector.GetSelectedSourceNotesType();
// Difficulty sourceDiff = m_Selector.GetSelectedSourceDifficulty();
Notes* pSourceNotes = m_Selector.GetSelectedSourceNotes();
SongSelector::Action action = m_Selector.GetSelectedAction();
EditMenu::Action action = m_Selector.GetSelectedAction();
GAMESTATE->m_pCurSong = pSong;
GAMESTATE->m_CurStyle = GAMEMAN->GetEditorStyleForNotesType( nt );
@@ -164,7 +164,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
switch( action )
{
case SongSelector::ACTION_EDIT:
case EditMenu::ACTION_EDIT:
// Prepare prepare for ScreenEdit
ASSERT( pNotes );
SOUNDMAN->StopMusic();
@@ -172,12 +172,12 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
m_Menu.TweenOffScreenToBlack( SM_GoToNextScreen, false );
m_Fade.CloseWipingRight( SM_None );
break;
case SongSelector::ACTION_DELETE:
case EditMenu::ACTION_DELETE:
ASSERT( pNotes );
SCREENMAN->Prompt( SM_RefreshSelector, "These notes will be lost permanently.\nContinue with delete?", true, false, DeleteCurNotes );
m_Selector.Refresh();
return;
case SongSelector::ACTION_COPY:
case EditMenu::ACTION_COPY:
ASSERT( !pNotes );
ASSERT( pSourceNotes );
{
@@ -194,7 +194,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
pSong->Save();
}
return;
case SongSelector::ACTION_AUTOGEN:
case EditMenu::ACTION_AUTOGEN:
ASSERT( !pNotes );
ASSERT( pSourceNotes );
{
@@ -212,7 +212,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
pSong->Save();
}
return;
case SongSelector::ACTION_BLANK:
case EditMenu::ACTION_BLANK:
ASSERT( !pNotes );
{
// Yuck. Doing the memory allocation doesn't seem right since
+4 -2
View File
@@ -10,10 +10,12 @@
*/
#include "Screen.h"
#include "SongSelector.h"
#include "EditMenu.h"
#include "BitmapText.h"
#include "TransitionFade.h"
#include "RandomSample.h"
#include "MenuElements.h"
class ScreenEditMenu : public Screen
{
@@ -34,7 +36,7 @@ private:
void MenuBack( PlayerNumber pn );
void MenuStart( PlayerNumber pn );
SongSelector m_Selector;
EditMenu m_Selector;
BitmapText m_textExplanation;
+2 -1
View File
@@ -739,7 +739,8 @@ void ScreenGameplay::Update( float fDeltaTime )
Screen::Update( fDeltaTime );
m_MaxCombo.SetText( ssprintf("%d", m_Player[GAMESTATE->m_MasterPlayerNumber].GetPlayersMaxCombo()) ); /* MAKE THIS WORK FOR BOTH PLAYERS! */
if( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID )
m_MaxCombo.SetText( ssprintf("%d", m_Player[GAMESTATE->m_MasterPlayerNumber].GetPlayersMaxCombo()) ); /* MAKE THIS WORK FOR BOTH PLAYERS! */
//LOG->Trace( "m_fOffsetInBeats = %f, m_fBeatsPerSecond = %f, m_Music.GetPositionSeconds = %f", m_fOffsetInBeats, m_fBeatsPerSecond, m_Music.GetPositionSeconds() );
+27 -39
View File
@@ -24,48 +24,45 @@ const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+101); // MUST be sa
bool PrepareForJukebox() // always return true.
{
//
// Set the current song to prepare for a demonstration
//
switch( GAMESTATE->m_CurGame )
{
case GAME_DANCE: GAMESTATE->m_CurStyle = STYLE_DANCE_VERSUS; break;
case GAME_PUMP: GAMESTATE->m_CurStyle = STYLE_PUMP_VERSUS; break;
case GAME_EZ2: GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE_VERSUS; break;
case GAME_PARA: GAMESTATE->m_CurStyle = STYLE_PARA_SINGLE; break;
case GAME_DS3DDX: GAMESTATE->m_CurStyle = STYLE_DS3DDX_SINGLE; break;
case GAME_BM: GAMESTATE->m_CurStyle = STYLE_BM_SINGLE; break;
default: ASSERT(0);
}
// ScreeJukeboxMenu must set this
ASSERT( GAMESTATE->m_CurStyle != STYLE_INVALID );
GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE;
vector<Song*> vSongs;
if( GAMESTATE->m_sPreferredGroup.CompareNoCase("all music") == 0 )
SONGMAN->GetSongs( vSongs );
else
SONGMAN->GetSongs( vSongs, GAMESTATE->m_sPreferredGroup );
//
// Search for a Song and Steps to play during the demo
// Search for a Song and Notes to play during the demo
//
for( int i=0; i<600; i++ ) // try 600 times
for( int i=0; i<600; i++ )
{
Song* pSong = SONGMAN->GetRandomSong();
if( pSong == NULL ) // returns NULL there are no songs
return true; // we need to detect this and abort demonstration later
if( vSongs.size() == 0 )
return true;
Song* pSong = vSongs[rand()%vSongs.size()];
if( pSong->m_apNotes.empty() )
continue; // skip
if( !pSong->HasMusic() )
continue; // skip
vector<Notes*> apNotes;
pSong->GetNotes( apNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
Difficulty dc = GAMESTATE->m_PreferredDifficulty[PLAYER_1];
Notes* pNotes = NULL;
if( dc != DIFFICULTY_INVALID )
pNotes = pSong->GetNotes( GAMESTATE->GetCurrentStyleDef()->m_NotesType, GAMESTATE->m_PreferredDifficulty[PLAYER_1] );
else // "all difficulties"
{
vector<Notes*> vNotes;
pSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
if( vNotes.size() > 0 )
pNotes = vNotes[rand()%vNotes.size()];
}
if( apNotes.empty() )
if( pNotes == NULL )
continue; // skip
// Found something we can use!
Notes* pNotes = apNotes[ rand()%apNotes.size() ];
GAMESTATE->m_pCurSong = pSong;
for( int p=0; p<NUM_PLAYERS; p++ )
GAMESTATE->m_pCurNotes[p] = pNotes;
@@ -106,17 +103,8 @@ bool PrepareForJukebox() // always return true.
GAMESTATE->m_PlayerOptions[p] = PlayerOptions();
if( RandomFloat(0,1)>0.8f )
GAMESTATE->m_PlayerOptions[p].m_fScrollSpeed = 1.5f;
GAMESTATE->m_PlayerOptions[p].m_bEffects[ rand()%PlayerOptions::NUM_EFFECT_TYPES ] = true;
if( RandomFloat(0,1)>0.9f )
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::APPEARANCE_HIDDEN;
if( RandomFloat(0,1)>0.9f )
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::APPEARANCE_SUDDEN;
if( RandomFloat(0,1)>0.7f )
GAMESTATE->m_PlayerOptions[p].m_bReverseScroll = true;
if( RandomFloat(0,1)>0.8f )
GAMESTATE->m_PlayerOptions[p].m_bDark = true;
if( GAMESTATE->m_bJukeboxUsesModifiers )
GAMESTATE->m_PlayerOptions[p].ChooseRandomMofifiers();
}
GAMESTATE->m_SongOptions = SongOptions();
+152
View File
@@ -0,0 +1,152 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: ScreenJukeboxMenu
Desc: The main title screen and menu.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ScreenJukeboxMenu.h"
#include "SongManager.h"
#include "ScreenManager.h"
#include "GameConstantsAndTypes.h"
#include "RageUtil.h"
#include "PrefsManager.h"
#include "GameManager.h"
#include "RageLog.h"
#include "GameState.h"
#include "RageSoundManager.h"
#include "ThemeManager.h"
//
// Defines specific to ScreenJukeboxMenu
//
#define EXPLANATION_X THEME->GetMetricF("ScreenJukeboxMenu","ExplanationX")
#define EXPLANATION_Y THEME->GetMetricF("ScreenJukeboxMenu","ExplanationY")
#define EXPLANATION_TEXT THEME->GetMetric("ScreenJukeboxMenu","ExplanationText")
#define HELP_TEXT THEME->GetMetric("ScreenJukeboxMenu","HelpText")
ScreenJukeboxMenu::ScreenJukeboxMenu()
{
LOG->Trace( "ScreenJukeboxMenu::ScreenJukeboxMenu()" );
GAMESTATE->m_CurStyle = STYLE_INVALID;
m_Selector.SetXY( 0, 0 );
// m_Selector.AllowNewNotes();
this->AddChild( &m_Selector );
m_Menu.Load(
THEME->GetPathTo("BGAnimations","jukebox menu"),
THEME->GetPathTo("Graphics","jukebox menu top edge"),
HELP_TEXT, false, false, 99
);
this->AddChild( &m_Menu );
m_textExplanation.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
m_textExplanation.SetXY( EXPLANATION_X, EXPLANATION_Y );
m_textExplanation.SetText( EXPLANATION_TEXT );
m_textExplanation.SetZoom( 0.7f );
this->AddChild( &m_textExplanation );
m_Fade.SetOpened();
this->AddChild( &m_Fade);
SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","jukebox menu music") );
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
m_Menu.TweenOnScreenFromBlack( SM_None );
}
ScreenJukeboxMenu::~ScreenJukeboxMenu()
{
LOG->Trace( "ScreenJukeboxMenu::~ScreenJukeboxMenu()" );
}
void ScreenJukeboxMenu::DrawPrimitives()
{
m_Menu.DrawBottomLayer();
Screen::DrawPrimitives();
m_Menu.DrawTopLayer();
}
void ScreenJukeboxMenu::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->Trace( "ScreenJukeboxMenu::Input()" );
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
}
void ScreenJukeboxMenu::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
{
case SM_GoToPrevScreen:
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
break;
case SM_GoToNextScreen:
SCREENMAN->SetNewScreen( "ScreenJukebox" );
break;
}
}
void ScreenJukeboxMenu::MenuUp( PlayerNumber pn )
{
m_Selector.Up();
}
void ScreenJukeboxMenu::MenuDown( PlayerNumber pn )
{
m_Selector.Down();
}
void ScreenJukeboxMenu::MenuLeft( PlayerNumber pn, const InputEventType type )
{
m_Selector.Left();
}
void ScreenJukeboxMenu::MenuRight( PlayerNumber pn, const InputEventType type )
{
m_Selector.Right();
}
void ScreenJukeboxMenu::MenuStart( PlayerNumber pn )
{
if( m_Fade.IsClosing() || m_Fade.IsClosed() )
return;
Style style = m_Selector.GetSelectedStyle();
string sGroup = m_Selector.GetSelectedGroup();
Difficulty dc = m_Selector.GetSelectedDifficulty();
bool bModifiers = m_Selector.GetSelectedModifiers();
GAMESTATE->m_CurStyle = style;
GAMESTATE->m_sPreferredGroup = sGroup;
for( int p=0; p<NUM_PLAYERS; p++ )
GAMESTATE->m_PreferredDifficulty[p] = dc;
GAMESTATE->m_bJukeboxUsesModifiers = bModifiers;
SOUNDMAN->StopMusic();
m_soundSelect.PlayRandom();
m_Menu.TweenOffScreenToBlack( SM_GoToNextScreen, false );
m_Fade.CloseWipingRight( SM_None );
}
void ScreenJukeboxMenu::MenuBack( PlayerNumber pn )
{
m_Menu.TweenOffScreenToBlack( SM_None, true );
SOUNDMAN->StopMusic();
m_Fade.CloseWipingLeft( SM_GoToPrevScreen );
}
+52
View File
@@ -0,0 +1,52 @@
/*
-----------------------------------------------------------------------------
Class: ScreenJukeboxMenu
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Screen.h"
#include "JukeboxMenu.h"
#include "BitmapText.h"
#include "TransitionFade.h"
#include "RandomSample.h"
#include "MenuElements.h"
class ScreenJukeboxMenu : public Screen
{
public:
ScreenJukeboxMenu();
virtual ~ScreenJukeboxMenu();
virtual void DrawPrimitives();
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
private:
void MenuUp( PlayerNumber pn );
void MenuDown( PlayerNumber pn );
void MenuLeft( PlayerNumber pn, const InputEventType type );
void MenuRight( PlayerNumber pn, const InputEventType type );
void MenuBack( PlayerNumber pn );
void MenuStart( PlayerNumber pn );
JukeboxMenu m_Selector;
BitmapText m_textExplanation;
MenuElements m_Menu;
TransitionFade m_Fade;
RandomSample m_soundSelect;
RandomSample m_soundCreate;
};
+2
View File
@@ -202,6 +202,7 @@ void ScreenManager::Input( const DeviceInput& DeviceI, const InputEventType type
#include "ScreenInstructions.h"
#include "ScreenNameEntry.h"
#include "ScreenJukebox.h"
#include "ScreenJukeboxMenu.h"
#include "ScreenOptionsMenu.h"
#include "ScreenGameplayOptions.h"
#include "ScreenStyleSplash.h"
@@ -257,6 +258,7 @@ Screen* ScreenManager::MakeNewScreen( CString sClassName )
else if( 0==stricmp(sClassName, "ScreenInstructions") ) ret = new ScreenInstructions;
else if( 0==stricmp(sClassName, "ScreenNameEntry") ) ret = new ScreenNameEntry;
else if( 0==stricmp(sClassName, "ScreenJukebox") ) ret = new ScreenJukebox;
else if( 0==stricmp(sClassName, "ScreenJukeboxMenu") ) ret = new ScreenJukeboxMenu;
else if( 0==stricmp(sClassName, "ScreenOptionsMenu") ) ret = new ScreenOptionsMenu;
else if( 0==stricmp(sClassName, "ScreenGameplayOptions") ) ret = new ScreenGameplayOptions;
else if( 0==stricmp(sClassName, "ScreenStyleSplash") ) ret = new ScreenStyleSplash;
+2 -1
View File
@@ -10,11 +10,12 @@
*/
#include "Screen.h"
#include "SongSelector.h"
#include "BitmapText.h"
#include "TransitionFade.h"
#include "RandomSample.h"
#include "GrayArrowRow.h"
#include "BGAnimation.h"
#include "MenuTimer.h"
class ScreenNameEntry : public Screen
+1 -1
View File
@@ -287,7 +287,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SetNewScreen( "ScreenOptionsMenu" );
break;
case CHOICE_JUKEBOX:
SCREENMAN->SetNewScreen( "ScreenJukebox" );
SCREENMAN->SetNewScreen( "ScreenJukeboxMenu" );
break;
#ifdef _DEBUG
case CHOICE_SANDBOX:
+9 -11
View File
@@ -827,17 +827,15 @@ bool Song::IsNew() const
bool Song::IsEasy( NotesType nt ) const
{
for( unsigned i=0; i<m_apNotes.size(); i++ )
{
Notes* pNotes = m_apNotes[i];
if( pNotes->m_NotesType != nt )
continue;
if( pNotes->GetDifficulty() == DIFFICULTY_BEGINNER )
continue; // ignore beginner steps for marking songs easy; very bizarre to see the beginner mark by Legend of MAX
if( pNotes->GetMeter() <= 2 )
return true;
}
return false;
Notes* pBeginnerNotes = GetNotes( nt, DIFFICULTY_BEGINNER );
Notes* pEasyNotes = GetNotes( nt, DIFFICULTY_EASY );
Notes* pHardNotes = GetNotes( nt, DIFFICULTY_HARD );
// HACK: Looks bizarre to see the easy mark by Legend of MAX.
if( pHardNotes->GetMeter() <= 9 )
return false;
return pBeginnerNotes->GetMeter() == 1 || pEasyNotes->GetMeter() == 1;
}
bool Song::HasEdits( NotesType nt ) const
+18 -6
View File
@@ -279,6 +279,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File
RelativePath="ScreenJukebox.h">
</File>
<File
RelativePath="ScreenJukeboxMenu.cpp">
</File>
<File
RelativePath="ScreenJukeboxMenu.h">
</File>
<File
RelativePath="ScreenLogo.cpp">
</File>
@@ -954,6 +960,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File
RelativePath="DifficultyRating.h">
</File>
<File
RelativePath="EditMenu.cpp">
</File>
<File
RelativePath="EditMenu.h">
</File>
<File
RelativePath="FadingBanner.cpp">
</File>
@@ -984,6 +996,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File
RelativePath="GroupList.h">
</File>
<File
RelativePath="JukeboxMenu.cpp">
</File>
<File
RelativePath="JukeboxMenu.h">
</File>
<File
RelativePath="MenuElements.cpp">
</File>
@@ -1080,12 +1098,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File
RelativePath="SnapDisplay.h">
</File>
<File
RelativePath="SongSelector.cpp">
</File>
<File
RelativePath="SongSelector.h">
</File>
<File
RelativePath="StageDisplay.cpp">
</File>