Ability to enable/disable scoreboard
This commit is contained in:
@@ -311,6 +311,12 @@ PrefsManager::PrefsManager() :
|
||||
m_iPageThreshold ( "PageThreshold", 8 ),
|
||||
m_bLogVirtualMemory ( "LogVirtualMemory", false )
|
||||
#endif
|
||||
|
||||
#if !defined(WITHOUT_NETWORKING)
|
||||
,
|
||||
m_bEnableScoreboard ( "EnableScoreboard", true )
|
||||
#endif
|
||||
|
||||
{
|
||||
Init();
|
||||
ReadGlobalPrefsFromDisk();
|
||||
|
||||
@@ -328,6 +328,10 @@ public:
|
||||
Preference<bool> m_bLogVirtualMemory; // (under debug) log the virtual memory allocation, etc.
|
||||
#endif
|
||||
|
||||
#if !defined(WITHOUT_NETWORKING)
|
||||
Preference<bool> m_bEnableScoreboard; //Alows disabling of scoreboard in network play
|
||||
#endif
|
||||
|
||||
|
||||
// wrappers
|
||||
CString GetVideoRenderers();
|
||||
|
||||
@@ -354,14 +354,13 @@ void ScreenGameplay::Init()
|
||||
break;
|
||||
}
|
||||
|
||||
m_ShowScoreboard=false;
|
||||
|
||||
#if !defined(WITHOUT_NETWORKING)
|
||||
//the following is only used in SMLAN/SMOnline
|
||||
if( NSMAN->useSMserver && ( !GAMESTATE->PlayerUsingBothSides() ) )
|
||||
{
|
||||
m_ShowScoreboard = PREFSMAN->m_bEnableScoreboard;
|
||||
PlayerNumber pn = GAMESTATE->GetFirstDisabledPlayer();
|
||||
if( pn != PLAYER_INVALID )
|
||||
{
|
||||
FOREACH_NSScoreBoardColumn( col )
|
||||
{
|
||||
m_Scoreboard[col].LoadFromFont( THEME->GetPathF(m_sName,"scoreboard") );
|
||||
@@ -371,10 +370,13 @@ void ScreenGameplay::Init()
|
||||
this->AddChild( &m_Scoreboard[col] );
|
||||
m_Scoreboard[col].SetText( NSMAN->m_Scoreboard[col] );
|
||||
m_Scoreboard[col].SetVertAlign( align_top );
|
||||
m_ShowScoreboard = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
m_ShowScoreboard = false;
|
||||
#else
|
||||
m_ShowScoreboard = false;
|
||||
#endif
|
||||
|
||||
m_MaxCombo.LoadFromFont( THEME->GetPathF(m_sName,"max combo") );
|
||||
m_MaxCombo.SetName( "MaxCombo" );
|
||||
@@ -1619,9 +1621,10 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
if( m_pLifeMeter[pn2] )
|
||||
NSMAN->m_playerLife[pn2] = int(m_pLifeMeter[pn2]->GetLife()*10000);
|
||||
|
||||
FOREACH_NSScoreBoardColumn(cn)
|
||||
if( m_ShowScoreboard && NSMAN->ChangedScoreboard(cn) )
|
||||
m_Scoreboard[cn].SetText( NSMAN->m_Scoreboard[cn] );
|
||||
if (m_ShowScoreboard)
|
||||
FOREACH_NSScoreBoardColumn(cn)
|
||||
if( m_ShowScoreboard && NSMAN->ChangedScoreboard(cn) )
|
||||
m_Scoreboard[cn].SetText( NSMAN->m_Scoreboard[cn] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
enum {
|
||||
PO_CONNECTION,
|
||||
PO_SERVER,
|
||||
PO_SCOREBOARD,
|
||||
NUM_NETWORK_OPTIONS_LINES
|
||||
};
|
||||
|
||||
@@ -23,9 +24,16 @@ enum {
|
||||
NO_START_SERVER
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
NO_SCOREBOARD_OFF=0,
|
||||
NO_SCOREBOARD_ON
|
||||
};
|
||||
|
||||
OptionRowDefinition g_NetworkOptionsLines[NUM_NETWORK_OPTIONS_LINES] = {
|
||||
OptionRowDefinition( "Connection", true, "PRESS START" ),
|
||||
OptionRowDefinition( "Server", true, "PRESS START" )
|
||||
OptionRowDefinition( "Server", true, "PRESS START" ),
|
||||
OptionRowDefinition( "Scoreboard", true, "PRESS START" )
|
||||
};
|
||||
|
||||
AutoScreenMessage( SM_DoneConnecting )
|
||||
@@ -54,6 +62,10 @@ void ScreenNetworkOptions::Init()
|
||||
g_NetworkOptionsLines[PO_SERVER].m_vsChoices.clear();
|
||||
g_NetworkOptionsLines[PO_SERVER].m_vsChoices.push_back("Stop");
|
||||
g_NetworkOptionsLines[PO_SERVER].m_vsChoices.push_back("Start...");
|
||||
|
||||
g_NetworkOptionsLines[PO_SCOREBOARD].m_vsChoices.clear();
|
||||
g_NetworkOptionsLines[PO_SCOREBOARD].m_vsChoices.push_back("Off");
|
||||
g_NetworkOptionsLines[PO_SCOREBOARD].m_vsChoices.push_back("On");
|
||||
|
||||
//Enable all lines for all players
|
||||
for ( unsigned int i = 0; i < NUM_NETWORK_OPTIONS_LINES; i++ )
|
||||
@@ -65,6 +77,8 @@ void ScreenNetworkOptions::Init()
|
||||
|
||||
InitMenu( vDefs, vHands );
|
||||
|
||||
m_pRows[PO_SCOREBOARD]->SetOneSharedSelection(PREFSMAN->m_bEnableScoreboard);
|
||||
|
||||
SOUND->PlayMusic( THEME->GetPathS("ScreenMachineOptions","music") );
|
||||
}
|
||||
|
||||
@@ -138,6 +152,12 @@ void ScreenNetworkOptions::MenuStart( PlayerNumber pn, const InputEventType type
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PO_SCOREBOARD:
|
||||
if (m_pRows[PO_SCOREBOARD]->GetOneSharedSelection() == NO_SCOREBOARD_ON)
|
||||
PREFSMAN->m_bEnableScoreboard.Set(true);
|
||||
else
|
||||
PREFSMAN->m_bEnableScoreboard.Set(false);
|
||||
break;
|
||||
default:
|
||||
ScreenOptions::MenuStart( pn, type );
|
||||
}
|
||||
@@ -154,7 +174,7 @@ void ScreenNetworkOptions::UpdateConnectStatus( )
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (c) 2004 Charles Lohr
|
||||
* (c) 2004 Charles Lohr, Josh Allen
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
|
||||
Reference in New Issue
Block a user