[ScreenNetEvaluation]

* Replace hardcoded rainbow effect with UserTier02OrBetterCommand.
 * Added Difficulty and Steps param to UpdateNetEvalStats message. The
   beginning of custom-themable online stuff begins.

[ScreenNetSelectMusic]
 * Started to port SampleMusicPreviewMode from ScreenSelectMusic.
 * Changed MusicWheel metrics to read from OnlineMusicWheel instead.
 * Added section, roulette, and random music (not used yet).
 * Stop the music when reaching a section.

[others]
* some theme file additions
This commit is contained in:
AJ Kelly
2010-08-10 23:36:04 -05:00
parent 98fb951798
commit 1fdb204eb2
14 changed files with 89 additions and 24 deletions
@@ -0,0 +1 @@
Common Normal
@@ -0,0 +1 @@
_blank
@@ -0,0 +1 @@
_blank
@@ -0,0 +1 @@
_blank
@@ -0,0 +1 @@
ScreenSelectMusic random music
@@ -0,0 +1 @@
ScreenSelectMusic roulette music
@@ -0,0 +1 @@
ScreenSelectMusic section music
+12
View File
@@ -793,6 +793,14 @@ ChoiceNonstop="sort,Nonstop;playmode,nonstop;mod,bar"
ChoiceOni="sort,Oni;playmode,oni;mod,battery"
ChoiceEndless="sort,Endless;playmode,endless;mod,bar"
ChoiceSurvival="sort,Oni;playmode,oni;mod,lifetime"
[OnlineMusicWheel]
Fallback="MusicWheel"
# roulette + online causes a sorting issue that should be hammered out first. -aj
ShowRoulette=false
ShowRandom=false
ShowPortal=false
[MusicWheelItem]
WheelNotifyIconX=106
WheelNotifyIconY=0
@@ -3594,6 +3602,8 @@ ShowStyleIcon=false
TimerSeconds=
TimerStealth=true
SampleMusicPreviewMode='SampleMusicPreviewMode_Normal'
# huh? (probably leftovers from the old NetSelectBase)
NumStylesShow=1
NumSongsShow=4
@@ -3780,6 +3790,8 @@ UsersBG2OffCommand=
UserDeSelCommand=finishtweening;linear,0.1;zoom,0.75
UserSelCommand=finishtweening;linear,0.1;zoom,1.0
UserTier02OrBetterCommand=rainbowscroll,true
UserDX=0
UserDY=24
UserOnCommand=
@@ -78,8 +78,13 @@ end
if ShowStandardDecoration("StepsDisplay") then
for pn in ivalues(PlayerNumber) do
local t2 = Def.StepsDisplay {
InitCommand=cmd(Load,"StepsDisplayEvaluation",pn;SetFromGameState,pn;);
};
InitCommand=cmd(Load,"StepsDisplayEvaluation",pn;SetFromGameState,pn;);
UpdateNetEvalStatsMessageCommand=function(self,param)
if GAMESTATE:IsPlayerEnabled(pn) then
self:SetFromSteps(param.Steps)
end;
end;
};
t[#t+1] = StandardDecorationFromTable( "StepsDisplay" .. ToEnumShortString(pn), t2 );
t[#t+1] = StandardDecorationFromTable( "PercentScore" .. ToEnumShortString(pn), PercentScore(pn) );
end
+6
View File
@@ -1820,6 +1820,10 @@ SmallBanner6X=SCREEN_CENTER_X+72
SmallBanner6Y=SCREEN_TOP+100+24
SmallBanner6OnCommand=zoom,0.5
SmallBanner6OffCommand=
[ScreenNetEvaluation]
UserTier02OrBetterCommand=diffuseshift;effectperiod,0.75;effectcolor1,color("1,0.95,0.8,1");effectcolor2,color("0.8,0.95,1,1")
# arcade stuff
[ScreenLogo]
TimerSeconds=10
@@ -1860,6 +1864,7 @@ VersionInfoOnCommand=settext,ProductVersion();horizalign,right;vertalign,bottom;
ScrollerOnCommand=visible,false;
ArcadeOverlay.TextY=SCREEN_BOTTOM-128
[ScreenDemonstration]
SongMeterDisplayOnCommand=visible,false
SongMeterDisplayP1OnCommand=visible,false
@@ -1873,6 +1878,7 @@ StepsDisplayP2OnCommand=zoomy,0;linear,0.3;zoomy,1;sleep,3;smooth,0.5;y,SCREEN_B
ShowBPMDisplay=false
#
PlayMusic=false
# sm-ssc helper screens
[ScreenHowToInstallSongs]
Class="ScreenSelectMaster"
+16 -2
View File
@@ -5,6 +5,8 @@
#include "ThemeManager.h"
#include "GameState.h"
#include "RageLog.h"
#include "Style.h"
#include "SongUtil.h"
static const int NUM_SCORE_DIGITS = 9;
@@ -147,12 +149,15 @@ void ScreenNetEvaluation::HandleScreenMessage( const ScreenMessage SM )
break;
m_textUsers[i].SetText( NSMAN->m_PlayerNames[NSMAN->m_EvalPlayerData[i].name] );
// Yes, hardcoded (I'd like to leave it that way) -CNLohr (in reference to Grade_Tier03)
// Themes can read this differently. The correct solution depends...
// TODO: make this a server-side variable, or just find out
// the data from the theme? If we find out from the theme, people
// will be using different themes so it means nothing. -aj
m_textUsers[i].SetRainbowScroll( NSMAN->m_EvalPlayerData[i].grade < Grade_Tier03 );
if( NSMAN->m_EvalPlayerData[i].grade < Grade_Tier03 )
m_textUsers[i].PlayCommand("Tier02OrBetter");
ON_COMMAND( m_textUsers[i] );
LOG->Trace( "SMNETCheckpoint%d", i );
}
@@ -186,11 +191,13 @@ void ScreenNetEvaluation::UpdateStats()
m_textScore[m_pActivePlayer].SetTargetNumber( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].score );
//Values greater than 6 will cause a crash
if ( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty < 6 )
/*
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; j<NETNUMTAPSCORES; ++j )
{
@@ -204,9 +211,16 @@ void ScreenNetEvaluation::UpdateStats()
m_textPlayerOptions[m_pActivePlayer].SetText( NSMAN->m_EvalPlayerData[m_iCurrentPlayer].playerOptions );
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
Difficulty dc = NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty;
Steps *pSteps = SongUtil::GetOneSteps( GAMESTATE->m_pCurSong, st, dc );
// broadcast a message so themes know that the active player has changed. -aj
Message msg("UpdateNetEvalStats");
msg.SetParam( "ActivePlayerIndex", m_pActivePlayer );
msg.SetParam( "Difficulty", NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty );
if( pSteps )
msg.SetParam( "Steps", pSteps );
MESSAGEMAN->Broadcast(msg);
}
+4 -1
View File
@@ -4,6 +4,7 @@
#include "BitmapText.h"
#include "ScreenMessage.h"
#include "DifficultyIcon.h"
#include "StepsDisplay.h"
class ScreenNetEvaluation: public ScreenEvaluation
{
@@ -28,8 +29,10 @@ protected:
private:
// todo: Make this an AutoActor -aj
Quad m_rectUsersBG;
// todo: Make this a DifficultyDisplay -aj
// todo: Make this a StepsDisplay -aj
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
//StepsDisplay m_StepsDisplays[NUM_PLAYERS];
vector<BitmapText> m_textUsers;
int m_iCurrentPlayer;
+31 -19
View File
@@ -49,6 +49,8 @@ void ScreenNetSelectMusic::Init()
ScreenNetSelectBase::Init();
SAMPLE_MUSIC_PREVIEW_MODE.Load( m_sName, "SampleMusicPreviewMode" );
FOREACH_EnabledPlayer (p)
{
/*
@@ -69,7 +71,7 @@ void ScreenNetSelectMusic::Init()
}
m_MusicWheel.SetName( "MusicWheel" );
m_MusicWheel.Load( "MusicWheel" );
m_MusicWheel.Load( "OnlineMusicWheel" );
LOAD_ALL_COMMANDS_AND_SET_XY( m_MusicWheel );
m_MusicWheel.BeginScreen();
ON_COMMAND( m_MusicWheel );
@@ -93,9 +95,12 @@ void ScreenNetSelectMusic::Init()
this->AddChild( &m_ModIconRow[p] );
}
//Load SFX next
// Load SFX and music
m_soundChangeOpt.Load( THEME->GetPathS(m_sName,"change opt") );
m_soundChangeSel.Load( THEME->GetPathS(m_sName,"change sel") );
m_sSectionMusicPath = THEME->GetPathS(m_sName,"section music");
m_sRouletteMusicPath = THEME->GetPathS(m_sName,"roulette music");
m_sRandomMusicPath = THEME->GetPathS(m_sName,"random music");
NSMAN->ReportNSSOnOff(1);
NSMAN->ReportPlayerOptions();
@@ -268,12 +273,12 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
}
else if( SM == SM_BackFromPlayerOptions )
{
//XXX: HACK: This will causes ScreenSelectOptions to go back here.
// XXX HACK: This will cause ScreenSelectOptions to go back here.
NSMAN->ReportNSSOnOff(1);
GAMESTATE->m_EditMode = EditMode_Invalid;
NSMAN->ReportPlayerOptions();
//Update changes
// Update changes
FOREACH_EnabledPlayer(p)
m_ModIconRow[p].SetFromGameState();
}
@@ -288,7 +293,7 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
{
switch ( NSMAN->m_SMOnlinePacket.Read1() )
{
case 0: //Room title Change
case 0: // Room title Change
{
RString titleSub;
titleSub = NSMAN->m_SMOnlinePacket.ReadNT() + "\n";
@@ -304,8 +309,8 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
}
done:
//Must be at end, as so it is last resort for SMOnline packets.
//If it doens't know what to do, then it'll just remove them.
// Must be at end, as so it is last resort for SMOnline packets.
// If it doesn't know what to do, then it'll just remove them.
ScreenNetSelectBase::HandleScreenMessage( SM );
}
@@ -318,7 +323,7 @@ void ScreenNetSelectMusic::MenuLeft( const InputEventPlus &input )
bool bLeftAndRightPressed = bLeftPressed && bRightPressed;
if ( bLeftAndRightPressed )
m_MusicWheel.ChangeSort( SORT_MODE_MENU );
m_MusicWheel.ChangeSort( SORT_MODE_MENU );
else
m_MusicWheel.Move( -1 );
}
@@ -346,11 +351,10 @@ void ScreenNetSelectMusic::MenuUp( const InputEventPlus &input )
void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
{
/*Tricky: If we have a player on player 2, and there is only
player 2, allow them to use player 1's controls to change
their difficulty. */
/* Why? Nothing else allows that. */
// I agree that's a fucking stupid idea -aj
/* Tricky: If we have a player on player 2, and there is only player 2,
* allow them to use player 1's controls to change their difficulty. */
/* Why? Nothing else allows that. (-who?) */
// I agree, that's a stupid idea -aj
PlayerNumber pn = input.pn;
if ( GAMESTATE->IsPlayerEnabled( PLAYER_2 ) &&
@@ -384,14 +388,18 @@ void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
break;
}
}
//If failed to go up, loop
// If failed to go up, loop
if ( i == NUM_Difficulty )
{
for (i = 0;i<NUM_Difficulty;i++)
if (dcs[i])
{
m_DC[pn] = (Difficulty)i;
break;
if (dcs[i])
{
m_DC[pn] = (Difficulty)i;
break;
}
}
}
}
UpdateDifficulties( pn );
@@ -518,6 +526,9 @@ void ScreenNetSelectMusic::MusicChanged()
m_BPMDisplay.NoBPM();
FOREACH_EnabledPlayer (pn)
UpdateDifficulties( pn );
SOUND->StopMusic();
// xxx: it should play the menu music instead. -aj
return;
}
m_BPMDisplay.SetBpmFromSong( GAMESTATE->m_pCurSong );
@@ -559,13 +570,14 @@ void ScreenNetSelectMusic::MusicChanged()
}
UpdateDifficulties( pn );
}
//Copied from ScreenSelectMusic
// Copied from ScreenSelectMusic
// TODO: Update me! -aj
SOUND->StopMusic();
if( GAMESTATE->m_pCurSong->HasMusic() )
{
if(SOUND->GetMusicPath().CompareNoCase(GAMESTATE->m_pCurSong->GetMusicPath())) // dont play the same sound over and over
{
SOUND->StopMusic();
SOUND->PlayMusic(
GAMESTATE->m_pCurSong->GetMusicPath(),
+6
View File
@@ -58,6 +58,12 @@ protected:
void MusicChanged();
void TweenOffScreen();
ThemeMetric<SampleMusicPreviewMode> SAMPLE_MUSIC_PREVIEW_MODE;
RString m_sSectionMusicPath;
RString m_sRouletteMusicPath;
RString m_sRandomMusicPath;
private:
MusicWheel m_MusicWheel;