From b07ce1520960a9b0faabab2396c568bd38b5b0b1 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 16 Sep 2010 03:24:26 +0000 Subject: [PATCH] Maximum number of karts is now set from the value in stk_config (this limit is already enforced for command line options). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6022 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- data/gui/racesetup.stkgui | 3 ++- src/guiengine/widgets/spinner_widget.hpp | 5 ++++- src/states_screens/race_setup_screen.cpp | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/data/gui/racesetup.stkgui b/data/gui/racesetup.stkgui index 9f8286079..5ce51d026 100644 --- a/data/gui/racesetup.stkgui +++ b/data/gui/racesetup.stkgui @@ -12,7 +12,8 @@ - + + diff --git a/src/guiengine/widgets/spinner_widget.hpp b/src/guiengine/widgets/spinner_widget.hpp index e38cb2225..739ebc2ec 100644 --- a/src/guiengine/widgets/spinner_widget.hpp +++ b/src/guiengine/widgets/spinner_widget.hpp @@ -116,7 +116,10 @@ namespace GUIEngine * \return the maximum value the spinner can take */ int getMax() const { return m_max; } - + /** + * \brief Sets the maximum value for a spinner. + */ + void setMax(int n) {m_max = n; } /** * \return the minimum value the spinner can take */ diff --git a/src/states_screens/race_setup_screen.cpp b/src/states_screens/race_setup_screen.cpp index a004c67d0..212aaf403 100644 --- a/src/states_screens/race_setup_screen.cpp +++ b/src/states_screens/race_setup_screen.cpp @@ -171,6 +171,7 @@ void RaceSetupScreen::init() kartamount->setActivated(); kartamount->setText(L""); // FIXME: dirty trick (see below) kartamount->setValue( race_manager->getNumberOfKarts() - race_manager->getNumPlayers() ); + kartamount->setMax(stk_config->m_max_karts - race_manager->getNumPlayers() ); DynamicRibbonWidget* w2 = getWidget("gamemode"); assert( w2 != NULL );