Improve display of requirements on force fields
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10723 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
7db25a654b
commit
5bdca7e90f
@ -385,19 +385,6 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
video::SColor(255,255,150,60),
|
||||
true, true /* vcenter */, NULL);
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
} // drawGlobalMiniMap
|
||||
|
@ -40,6 +40,7 @@ using namespace irr;
|
||||
#include "graphics/particle_emitter.hpp"
|
||||
#include "graphics/particle_kind.hpp"
|
||||
#include "graphics/particle_kind_manager.hpp"
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "io/xml_node.hpp"
|
||||
#include "items/item.hpp"
|
||||
@ -752,6 +753,19 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
|
||||
m_force_fields.push_back(OverworldForceField(xyz, shown, val));
|
||||
|
||||
core::stringw msg = StringUtils::toWString(val);
|
||||
core::dimension2d<u32> textsize = GUIEngine::getFont()->getDimension(msg.c_str());
|
||||
scene::ISceneManager* sm = irr_driver->getSceneManager();
|
||||
sm->addBillboardTextSceneNode(GUIEngine::getFont(),
|
||||
msg.c_str(),
|
||||
NULL,
|
||||
core::dimension2df(textsize.Width/10.0f,
|
||||
textsize.Height/10.0f),
|
||||
xyz,
|
||||
-1 /* id */,
|
||||
video::SColor(255, 255, 225, 0),
|
||||
video::SColor(255, 255, 89, 0));
|
||||
|
||||
if (!shown) continue;
|
||||
}
|
||||
else
|
||||
|
@ -46,6 +46,14 @@ namespace StringUtils
|
||||
oss << any ;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
irr::core::stringw toWString (const T& any)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << any ;
|
||||
return oss.str().c_str();
|
||||
}
|
||||
|
||||
/** Converts a time in seconds into a string of the form mm:ss:hh (minutes,
|
||||
* seconds, 1/100 seconds.
|
||||
|
Loading…
x
Reference in New Issue
Block a user