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
This commit is contained in:
hikerstk 2010-09-16 03:24:26 +00:00
parent 92d18a7a25
commit b07ce15209
3 changed files with 7 additions and 2 deletions

View File

@ -12,7 +12,8 @@
<spacer width="50" height="25"/>
<!--
<spinner id="aikartamount" proportion="3" height="100%" min_value="0" max_value="8" icon="gui/karts%i.png"/> -->
<spinner id="aikartamount" proportion="1" height="100%" min_value="0" max_value="20"/>
<!-- The maximum is set by stk from data/stk_config.xml. -->
<spinner id="aikartamount" proportion="1" height="100%" min_value="0"/>
</div>
<spacer proportion="2" width="25"/>

View File

@ -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
*/

View File

@ -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<DynamicRibbonWidget>("gamemode");
assert( w2 != NULL );