Fix tabs added in previous commit, used spaces instead...

This commit is contained in:
auria.mg 2016-12-11 20:19:58 -05:00
parent ab7ded308a
commit 044e8c52e1
4 changed files with 33 additions and 35 deletions

View File

@ -90,36 +90,34 @@ KartStatsWidget::KartStatsWidget(core::recti area, const int player_id,
void KartStatsWidget::setValues(const KartProperties* props)
{
// Use kart properties computed for "hard" difficulty to show the user, so
// that properties don't change according to the the last used difficulty
// (And because this code uses arbitrary scaling factors to make them look
// nice and the arbitrary factors were optimised for hard difficulty)
RaceManager::Difficulty previous_difficulty = race_manager->getDifficulty();
race_manager->setDifficulty(RaceManager::DIFFICULTY_HARD);
//KartProperties* kp_computed = new KartProperties();
KartProperties kp_computed;
kp_computed.copyForPlayer(props);
// Scale the values so they look better
// The scaling factor and offset were found by trial and error.
// It should look nice and you should be able to see the difference between
// different masses or velocities.
m_skills[SKILL_MASS]->setValue((int)
((kp_computed.getCombinedCharacteristic()->getMass() - 20) / 4));
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_SPEED]->setValue((int)
((kp_computed.getCombinedCharacteristic()->getEngineMaxSpeed() - 15) * 6));
m_skills[SKILL_SPEED]->setLabel(_("SPEED"));
m_skills[SKILL_SPEED]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_speed", m_player_id);
m_skills[SKILL_POWER]->setValue((int)((kp_computed.getAvgPower() - 30) / 20));
m_skills[SKILL_POWER]->setLabel(_("POWER"));
m_skills[SKILL_POWER]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_power", m_player_id);
race_manager->setDifficulty(previous_difficulty);
// Use kart properties computed for "hard" difficulty to show the user, so
// that properties don't change according to the the last used difficulty
// (And because this code uses arbitrary scaling factors to make them look
// nice and the arbitrary factors were optimised for hard difficulty)
RaceManager::Difficulty previous_difficulty = race_manager->getDifficulty();
race_manager->setDifficulty(RaceManager::DIFFICULTY_HARD);
KartProperties kp_computed;
kp_computed.copyForPlayer(props);
// Scale the values so they look better
// The scaling factor and offset were found by trial and error.
// It should look nice and you should be able to see the difference between
// different masses or velocities.
m_skills[SKILL_MASS]->setValue((int)
((kp_computed.getCombinedCharacteristic()->getMass() - 20) / 4));
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_SPEED]->setValue((int)
((kp_computed.getCombinedCharacteristic()->getEngineMaxSpeed() - 15) * 6));
m_skills[SKILL_SPEED]->setLabel(_("SPEED"));
m_skills[SKILL_SPEED]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_speed", m_player_id);
m_skills[SKILL_POWER]->setValue((int)((kp_computed.getAvgPower() - 30) / 20));
m_skills[SKILL_POWER]->setLabel(_("POWER"));
m_skills[SKILL_POWER]->m_properties[PROP_ID] = StringUtils::insertValues("@p%i_power", m_player_id);
race_manager->setDifficulty(previous_difficulty);
}
// -----------------------------------------------------------------------------

View File

@ -92,7 +92,7 @@ namespace GUIEngine
* inside itself */
void setSize(const int x, const int y, const int w, const int h);
void setValues(const KartProperties* props);
void setValues(const KartProperties* props);
/** Change the value of the widget, it must be a percent. */
void setValue(Stats type, int value);

View File

@ -544,9 +544,9 @@ public:
float getSkidReduceTurnMax() const;
bool getSkidEnabled() const;
/* <characteristics-end kpdefs> */
LEAK_CHECK()
/* <characteristics-end kpdefs> */
LEAK_CHECK()
}; // KartProperties
#endif

View File

@ -812,7 +812,7 @@ void KartSelectionScreen::updateKartStats(uint8_t widget_id,
if (kp != NULL)
{
w->setValues(kp);
w->setValues(kp);
w->update(0);
}
}