Fixed AI kart count widgets to provide correct in game

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3794 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-08-02 19:08:11 +00:00
parent 1653ae14d7
commit 432b1598c3
4 changed files with 2 additions and 8 deletions

View File

@ -130,8 +130,6 @@ void SpinnerWidget::add()
m_children[2].m_event_handler = this; m_children[2].m_event_handler = this;
m_children[2].m_properties[PROP_ID] = "right"; m_children[2].m_properties[PROP_ID] = "right";
m_children[2].id = m_children[2].m_element->getID(); m_children[2].id = m_children[2].m_element->getID();
std::cout << "Adding spinner with m_event_handler=" << m_event_handler << std::endl;
} }
void SpinnerWidget::move(const int x, const int y, const int w, const int h) void SpinnerWidget::move(const int x, const int y, const int w, const int h)

View File

@ -167,6 +167,7 @@ void RaceManager::setTrack(const std::string& track)
void RaceManager::computeRandomKartList() void RaceManager::computeRandomKartList()
{ {
int n = m_num_karts - m_player_karts.size(); int n = m_num_karts - m_player_karts.size();
std::cout << "AI karts count = " << n << " for m_num_karts=" << m_num_karts << " and m_player_karts.size()=" << m_player_karts.size() << std::endl;
// If less kart selected than there are player karts, adjust the number of // If less kart selected than there are player karts, adjust the number of
// karts to the minimum // karts to the minimum
if(n<0) if(n<0)

View File

@ -630,11 +630,6 @@ void menuEventKarts(Widget* widget, const std::string& name)
} }
std::cout << "==========\n"; std::cout << "==========\n";
std::cout << "Calling setNumKarts(" << race_manager->getNumKarts() << " AIs + " << players.size() << " players = " <<
race_manager->getNumKarts() + players.size() << ")\n";
race_manager->setNumKarts( race_manager->getNumKarts() + players.size() ); // FIXME : doesn't work. add AI karts
std::cout << "Calling setNumPlayers(" << players.size() << ")\n";
race_manager->setNumPlayers( players.size() ); race_manager->setNumPlayers( players.size() );
race_manager->setNumLocalPlayers( players.size() ); race_manager->setNumLocalPlayers( players.size() );

View File

@ -193,7 +193,7 @@ void StateManager::menuEventRaceSetup(Widget* widget, const std::string& name)
{ {
SpinnerWidget* w = dynamic_cast<SpinnerWidget*>(widget); SpinnerWidget* w = dynamic_cast<SpinnerWidget*>(widget);
race_manager->setNumKarts( w->getValue() ); race_manager->setNumKarts( race_manager->getNumPlayers() + w->getValue() );
} }
/* /*
289 race_manager->setDifficulty((RaceManager::Difficulty)m_difficulty); 289 race_manager->setDifficulty((RaceManager::Difficulty)m_difficulty);