From 4c53365c16362156529c7669079e31845384589f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 7 Mar 2009 13:57:09 +0000 Subject: renamed Entity::eventstate() to Entity::state(), introduced Destroyed state --- src/client/hud.cc | 8 ++++---- src/client/input.cc | 2 +- src/client/map.cc | 5 ++++- src/client/playerview.cc | 12 ++++++++---- src/client/soundext.cc | 6 +++--- 5 files changed, 20 insertions(+), 13 deletions(-) (limited to 'src/client') diff --git a/src/client/hud.cc b/src/client/hud.cc index 014f4df..c1cd8c1 100644 --- a/src/client/hud.cc +++ b/src/client/hud.cc @@ -246,7 +246,7 @@ void HUD::draw() } } - unsigned int state = core::localcontrol()->eventstate(); + unsigned int state = core::localcontrol()->state(); if (state) { std::stringstream statestr; statestr.clear(); @@ -322,13 +322,13 @@ void HUD::draw() gl::end(); float u = core::localcontrol()->thrust(); - if (core::localcontrol()->eventstate() == core::Entity::Impulse) { + if (core::localcontrol()->state() == core::Entity::Impulse) { u = 1.0; } - if (( u > 0) || (core::localcontrol()->eventstate() == core::Entity::Impulse)) { + if (( u > 0) || (core::localcontrol()->state() == core::Entity::Impulse)) { - if (core::localcontrol()->eventstate() == core::Entity::Impulse) { + if (core::localcontrol()->state() == core::Entity::Impulse) { gl::color(0, .8, 0); } else { float d = math::absf(input::local_thrust - u); diff --git a/src/client/input.cc b/src/client/input.cc index 9293404..3ccf15c 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -670,7 +670,7 @@ void frame() reset(); } - if (core::localcontrol() && (core::localcontrol()->eventstate() != core::Entity::Normal)) { + if (core::localcontrol() && (core::localcontrol()->state() != core::Entity::Normal)) { local_thrust = core::localcontrol()->thrust(); } diff --git a/src/client/map.cc b/src/client/map.cc index e433d40..35a1be7 100644 --- a/src/client/map.cc +++ b/src/client/map.cc @@ -61,7 +61,7 @@ void Map::draw() if (h > s ) { v.y += (h-s) * 0.5f; } else { - v.x += (w-s) * 0.5f; + //v.x += (w-s) * 0.5f; } gl::color(0,0,blue); @@ -121,6 +121,9 @@ void Map::draw() if (entity == core::localcontrol()) { draw_icon = true; + l.x -= s / scale * entity->location().y; + l.y -= s / scale * entity->location().x; + if (core::application()->time() - floorf(core::application()->time()) < 0.5f) { draw_icon = false; } diff --git a/src/client/playerview.cc b/src/client/playerview.cc index f129a1e..54d444d 100644 --- a/src/client/playerview.cc +++ b/src/client/playerview.cc @@ -144,6 +144,9 @@ void PlayerView::draw() { if (core::localplayer()->view()) { + // hide hide when a view is set + view_hud->hide(); + // docking view if (core::localplayer()->view()->menus().size()) { @@ -154,11 +157,13 @@ void PlayerView::draw() label_zonename->show(); if (view_lastentity != core::localplayer()->view()) { - // initialy show the menu + // initially show the menu show_menu("main"); map()->hide(); chat()->hide(); audio::play("ui/menu"); + + view_lastentity = core::localplayer()->view(); } else if (!view_menu->visible() && !map()->visible() && (!chat()->visible() || chat()->small_view()) ) { // show the menu if there's no other window open menu()->show(); @@ -167,13 +172,12 @@ void PlayerView::draw() } else { // entity without menus, plain view + view_lastentity = 0; + this->hide(); return; } - view_hud->hide(); - view_lastentity = core::localplayer()->view(); - } else { if (view_menu->visible()) { view_menu->hide(); diff --git a/src/client/soundext.cc b/src/client/soundext.cc index 02613e1..dda3a98 100644 --- a/src/client/soundext.cc +++ b/src/client/soundext.cc @@ -100,7 +100,7 @@ void SoundExt::frame(float elapsed) float gain = 0.0; float r = ( entity->model() ? entity->model()->maxbbox().x : entity->radius()); - if (entity->eventstate() == core::Entity::Impulse) { + if (entity->state() == core::Entity::Impulse) { pitch = 1.0f; gain = 1.0f; } else if (entity->thrust() > 0 ) { @@ -108,7 +108,7 @@ void SoundExt::frame(float elapsed) gain = 0.8f; } - if (entity->eventstate() == core::Entity::ImpulseInitiate ) { + if (entity->state() == core::Entity::ImpulseInitiate ) { if (state_engineeventbuffer != state_impulsestartbuffer) { audio::update_source(state_engineeventsource, @@ -117,7 +117,7 @@ void SoundExt::frame(float elapsed) state_engineeventbuffer = audio::play(state_engineeventsource, state_impulsestartbuffer); } - } else if (entity->eventstate() == core::Entity::Impulse) { + } else if (entity->state() == core::Entity::Impulse) { state_engineeventbuffer = state_impulseloopbuffer; -- cgit v1.2.3