updated menus for battle mode. 1) don't add AI karts 2) don't show useless screens like kart amount or AI difficulty
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2357 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
96ff469173
commit
fc5bce275a
@ -75,6 +75,11 @@ RaceOptions::RaceOptions()
|
||||
|
||||
// Difficulty
|
||||
// ==========
|
||||
// if there is no AI, no point asking for its difficulty...
|
||||
// There's also no point asking the player for the amount of karts
|
||||
// since tt will always be the same as the number of human players
|
||||
if(!RaceManager::isBattleMode( race_manager->getMinorMode() ))
|
||||
{
|
||||
widget_manager->addTextWgt( WTOK_DIFFICULTY_TITLE, DESC_WIDTH, 7, _("Difficulty") );
|
||||
widget_manager->hideWgtRect(WTOK_DIFFICULTY_TITLE);
|
||||
widget_manager->setWgtTextSize(WTOK_DIFFICULTY_TITLE, WGT_FNT_LRG);
|
||||
@ -106,6 +111,7 @@ RaceOptions::RaceOptions()
|
||||
widget_manager->addTextButtonWgt( WTOK_KARTS_UP, 3, 7, " > " );
|
||||
|
||||
widget_manager->breakLine();
|
||||
}
|
||||
|
||||
// Number of laps
|
||||
// ==============
|
||||
@ -146,6 +152,11 @@ RaceOptions::RaceOptions()
|
||||
|
||||
// Select 'start' by default.
|
||||
widget_manager->setSelectedWgt( WTOK_START );
|
||||
|
||||
// hack. in battle mode this screen is totally useless. so I'm calling 'select'
|
||||
// to select the start button, so the screen is entirely skipped (FIXME - find cleaner way)
|
||||
if(RaceManager::isBattleMode( race_manager->getMinorMode() )) select();
|
||||
|
||||
} // RaceOptions
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -268,8 +279,14 @@ void RaceOptions::select()
|
||||
race_manager->setDifficulty( RaceManager::RD_EASY );
|
||||
}
|
||||
|
||||
// if there is no AI, there's no point asking the player for the amount of karts.
|
||||
// It will always be the same as the number of human players
|
||||
if(RaceManager::isBattleMode( race_manager->getMinorMode() ))
|
||||
race_manager->setNumKarts(race_manager->getNumLocalPlayers());
|
||||
else
|
||||
race_manager->setNumKarts(m_num_karts);
|
||||
|
||||
|
||||
if( race_manager->getMajorMode() != RaceManager::MAJOR_MODE_GRAND_PRIX &&
|
||||
RaceManager::modeHasLaps( race_manager->getMinorMode() ) )
|
||||
{
|
||||
|
@ -28,6 +28,7 @@ RandomGenerator::RandomGenerator()
|
||||
m_a = 1103515245;
|
||||
m_c = 12345;
|
||||
m_all_random_generators.push_back(this);
|
||||
m_random_value = 3141591;
|
||||
} // RandomGenerator
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -62,7 +63,7 @@ void RandomGenerator::seed(int s)
|
||||
int RandomGenerator::get(int n)
|
||||
{
|
||||
m_random_value = m_random_value*m_a+m_c;
|
||||
return m_random_value % n;
|
||||
return (m_random_value >> 8) % n;
|
||||
} // get
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user