From 2b54cd13579abe2b277e305b7c5cd2eff78d82cd Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 24 Dec 2012 00:04:28 +0000 Subject: Added blinking effect to thrust indiciater if state is ImpulseInitiate or JumpInitiate. --- src/client/hudenginestatus.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/client/hudenginestatus.cc') diff --git a/src/client/hudenginestatus.cc b/src/client/hudenginestatus.cc index 04b6f63..6b55344 100644 --- a/src/client/hudenginestatus.cc +++ b/src/client/hudenginestatus.cc @@ -33,13 +33,24 @@ void HUDEngineStatus::draw() s[1] -= 2.0f * padding; // thrust + const float blink_t = core::application()->time() * 2.0f; std::ostringstream thruststr; - if (core::localcontrol()->state() == core::Entity::Normal) { - thruststr << "^B" << roundf(core::localcontrol()->thrust() * 100.0f) << "%"; - } else { - thruststr << "^B--"; + switch(core::localcontrol()->state()) { + case core::Entity::Normal: + thruststr << "^B" << roundf(core::localcontrol()->thrust() * 100.0f) << "%"; + break; + case core::Entity::ImpulseInitiate: + case core::Entity::JumpInitiate: + + if ((blink_t - floorf(blink_t)) < 0.5f) { + thruststr << "^B--"; + } + break; + default: + thruststr << "^B--"; + break; } - + // speed std::ostringstream speedstr; speedstr << "^B" << roundf(core::localcontrol()->speed() * 100.0f); -- cgit v1.2.3