Show required points near each force field. Feedback welcome, I'm somewhat dubious

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10697 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-01-20 02:21:19 +00:00
parent 792aac1e68
commit c3e3c38817
3 changed files with 20 additions and 3 deletions

View File

@ -46,6 +46,9 @@ using namespace irr;
#include "utils/string_utils.hpp"
#include "utils/translation.hpp"
#include <ISceneCollisionManager.h>
#include <ISceneManager.h>
const int LOCKED = 0;
const int OPEN = 1;
const int COMPLETED = 2;
@ -379,7 +382,19 @@ void RaceGUIOverworld::drawGlobalMiniMap()
GUIEngine::getFont()->draw(_("Press fire to start the challenge"), pos2,
video::SColor(255,255,150,60),
true, true /* vcenter */, NULL);
break;
}
// force field points
if ((kart_xyz - Vec3(challenges[n].m_force_field.m_position)).length2_2d() < 60*60)
{
int pts = challenges[n].m_force_field.m_required_points;
scene::ISceneCollisionManager* scm = irr_driver->getSceneManager()->getSceneCollisionManager();
core::vector2di pos = scm->getScreenCoordinatesFrom3DPosition(challenges[n].m_force_field.m_position);
GUIEngine::getTitleFont()->draw(core::stringw(StringUtils::toString(pts).c_str()),
core::rect<s32>(pos, pos + core::vector2di(100, 100)),
video::SColor(255,255,150,60),
false, false /* vcenter */, NULL);
}
}

View File

@ -750,7 +750,7 @@ bool Track::loadMainTrack(const XMLNode &root)
bool shown = (unlock_manager->getCurrentSlot()->getPoints() < val);
m_force_fields.push_back(OverworldForceField(xyz, shown));
m_force_fields.push_back(OverworldForceField(xyz, shown, val));
if (!shown) continue;
}

View File

@ -68,15 +68,17 @@ struct OverworldForceField
{
core::vector3df m_position;
bool m_is_locked;
int m_required_points;
OverworldForceField()
{
}
OverworldForceField(core::vector3df position, bool is_locked)
OverworldForceField(core::vector3df position, bool is_locked, int required_points)
{
m_position = position;
m_is_locked = is_locked;
m_required_points = required_points;
}
};
struct OverworldChallenge