More work to communicate the points system to the player

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11196 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-05-07 02:03:03 +00:00
parent 60f26bde9f
commit 85ba896d04
3 changed files with 13 additions and 7 deletions

View File

@ -67,17 +67,17 @@ void GameSlot::computeActive()
if (i->second->isSolved(RaceManager::RD_HARD))
{
m_points += 10;
m_points += CHALLENGE_POINTS[RaceManager::RD_HARD];
m_hard_challenges++;
}
else if (i->second->isSolved(RaceManager::RD_MEDIUM))
{
m_points += 9;
m_points += CHALLENGE_POINTS[RaceManager::RD_MEDIUM];
m_medium_challenges++;
}
else if (i->second->isSolved(RaceManager::RD_EASY))
{
m_points += 8;
m_points += CHALLENGE_POINTS[RaceManager::RD_EASY];
m_easy_challenges;
}
}

View File

@ -31,6 +31,8 @@ class ChallengeData;
class Challenge;
class XMLWriter;
const int CHALLENGE_POINTS[] = { 8, 9, 10 };
/**
* \ingroup challenges
* This class contains the progression through challenges for one game slot

View File

@ -21,6 +21,7 @@
#include <SColor.h>
#include "challenges/challenge_data.hpp"
#include "challenges/game_slot.hpp"
#include "challenges/unlock_manager.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/scalable_font.hpp"
@ -146,13 +147,16 @@ void FeatureUnlockedCutScene::addTrophy(RaceManager::Difficulty difficulty)
switch (difficulty)
{
case RaceManager::RD_EASY:
msg = _("You completed the easy challenge!");
msg = _("You completed the easy challenge! This trophy is worth %i points",
CHALLENGE_POINTS[RaceManager::RD_EASY]);
break;
case RaceManager::RD_MEDIUM:
msg = _("You completed the intermediate challenge!");
msg = _("You completed the intermediate challenge! This trophy is worth %i points",
CHALLENGE_POINTS[RaceManager::RD_MEDIUM]);
break;
case RaceManager::RD_HARD:
msg = _("You completed the difficult challenge!");
msg = _("You completed the difficult challenge! This trophy is worth %i points",
CHALLENGE_POINTS[RaceManager::RD_HARD]);
break;
default:
assert(false);
@ -541,7 +545,7 @@ void FeatureUnlockedCutScene::onUpdate(float dt,
static const int h = irr_driver->getFrameSize().Height;
const irr::video::SColor color(255, 255, 255, 255);
GUIEngine::getTitleFont()->draw(_("Feature Unlocked"),
GUIEngine::getTitleFont()->draw(_("Challenge Completed"),
core::rect< s32 >( 0, 0, w, h/10 ),
color,
true/* center h */, true /* center v */ );