Merge branch 'laps' of https://github.com/konstin/stk-code into konstin-laps

This commit is contained in:
hiker 2014-08-13 16:01:22 +10:00
commit 7111eb55ee
3 changed files with 16 additions and 5 deletions

View File

@ -99,7 +99,7 @@ TrackInfoDialog::TrackInfoDialog(const std::string& ribbonItem, const std::strin
if (UserConfigParams::m_artist_debug_mode)
m_spinner->setMin(0);
m_spinner->setValue(track->getDefaultNumberOfLaps());
m_spinner->setValue(track->getActualNumberOfLap());
race_manager->setNumLaps(m_spinner->getValue());
}
else
@ -236,6 +236,7 @@ void TrackInfoDialog::onEnterPressedInternal()
const int num_laps = (m_spinner == NULL ? -1 : m_spinner->getValue());
const bool reverse_track = m_checkbox == NULL ? false
: m_checkbox->getState();
track_manager->getTrack(m_track_ident)->setActualNumberOfLaps(num_laps);
race_manager->setReverseTrack(reverse_track);
std::string track_ident = m_track_ident;
// Disable accidentally unlocking of a challenge

View File

@ -488,10 +488,14 @@ void Track::loadTrackInfo()
root->get("color-level-in", &m_color_inlevel);
root->get("color-level-out", &m_color_outlevel);
if (m_default_number_of_laps <= 0)
m_default_number_of_laps = 3;
m_actual_number_of_laps = m_default_number_of_laps;
// Make the default for auto-rescue in battle mode and soccer mode to be false
if(m_is_arena || m_is_soccer)
m_enable_auto_rescue = false;
root->get("auto-rescue", & m_enable_auto_rescue);
root->get("auto-rescue", &m_enable_auto_rescue);
root->get("smooth-normals", &m_smooth_normals);
// Reverse is meaningless in arena
if(m_is_arena || m_is_soccer)

View File

@ -398,8 +398,11 @@ private:
/** List of all bezier curves in the track - for e.g. camera, ... */
std::vector<BezierCurve*> m_all_curves;
/** The number of laps the track will be raced if no other value is given.*/
/** The number of laps the track will be raced in a random GP.
* m_actual_number_of_laps is initialised with this value.*/
int m_default_number_of_laps;
/** The number of laps that is predefined in a track info dialog. */
int m_actual_number_of_laps;
void loadTrackInfo();
void loadQuadGraph(unsigned int mode_id, const bool reverse);
@ -614,9 +617,12 @@ public:
void addNode(scene::ISceneNode* node) { m_all_nodes.push_back(node); }
float getDisplacementSpeed() const { return m_displacement_speed; }
float getCausticsSpeed() const { return m_caustics_speed; }
float getDisplacementSpeed() const { return m_displacement_speed; }
float getCausticsSpeed() const { return m_caustics_speed; }
const int getDefaultNumberOfLaps() const { return m_default_number_of_laps;}
const int getActualNumberOfLap() const { return m_actual_number_of_laps; }
void setActualNumberOfLaps(unsigned int laps)
{ m_actual_number_of_laps = laps; }
bool operator<(const Track &other) const;
}; // class Track