From 000fa2cf73d432000045727c1e08a205bfa6511b Mon Sep 17 00:00:00 2001 From: Bart Cools Date: Thu, 26 Jun 2014 13:43:53 +0200 Subject: [PATCH] Fixed skill bars to return correct values. Also minor fix in kart properties --- data/stk_config.xml | 6 +++--- src/guiengine/widgets/kart_stats_widget.cpp | 8 ++++---- src/states_screens/kart_selection.cpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/data/stk_config.xml b/data/stk_config.xml index eb329f6ce..48ae0c06e 100644 --- a/data/stk_config.xml +++ b/data/stk_config.xml @@ -574,8 +574,8 @@ - - @@ -677,7 +677,7 @@ time-full-steer ="0:0.23 0.5:0.23 0.5:0.41 1.0:0.41" time-reset-steer="0.1"/> - diff --git a/src/guiengine/widgets/kart_stats_widget.cpp b/src/guiengine/widgets/kart_stats_widget.cpp index 2db661fe5..a6e25985a 100644 --- a/src/guiengine/widgets/kart_stats_widget.cpp +++ b/src/guiengine/widgets/kart_stats_widget.cpp @@ -91,16 +91,16 @@ KartStatsWidget::KartStatsWidget(core::recti area, const int player_id, m_children.push_back(skill_bar); } - m_skills[SKILL_MASS]->setValue(props->getMass()/10); + m_skills[SKILL_MASS]->setValue((int)(props->getMass()/5)); m_skills[SKILL_MASS]->setLabel("WEIGHT"); m_skills[SKILL_MASS]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_mass", m_player_id); - m_skills[SKILL_ACCEL]->setValue(props->getTrackConnectionAccel()/10); + m_skills[SKILL_ACCEL]->setValue((int)((props->getMaxSpeed()-20)*20)); m_skills[SKILL_ACCEL]->setLabel("ACCEL"); m_skills[SKILL_ACCEL]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_accel", m_player_id); - m_skills[SKILL_SPEED]->setValue(props->getMaxSpeed()/10); - m_skills[SKILL_SPEED]->setLabel("SPEED"); + m_skills[SKILL_SPEED]->setValue((int)(props->getMaxPower()/10)); + m_skills[SKILL_SPEED]->setLabel("POWER"); m_skills[SKILL_SPEED]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_speed", m_player_id); } // KartStatsWidget diff --git a/src/states_screens/kart_selection.cpp b/src/states_screens/kart_selection.cpp index baa8e1dbe..1cdd91364 100644 --- a/src/states_screens/kart_selection.cpp +++ b/src/states_screens/kart_selection.cpp @@ -1526,9 +1526,9 @@ void KartSelectionScreen::updateKartStats(uint8_t widget_id, kart_properties_manager->getKart(selection); if (kp != NULL) { - w->setValue(KartStatsWidget::SKILL_MASS, (int)kp->getMass()/10); - w->setValue(KartStatsWidget::SKILL_SPEED, (int)kp->getMaxSpeed()/10); - w->setValue(KartStatsWidget::SKILL_ACCEL, (int)kp->getTrackConnectionAccel()/10); + w->setValue(KartStatsWidget::SKILL_MASS, (int)(kp->getMass()/5)); + w->setValue(KartStatsWidget::SKILL_SPEED, (int)(kp->getMaxPower()/10)); + w->setValue(KartStatsWidget::SKILL_ACCEL, (int)((kp->getMaxSpeed()-20)*20)); w->update(0); } }