Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-08-13 16:41:39 +0000
committerStijn Buys <ingar@osirion.org>2009-08-13 16:41:39 +0000
commit9f8804390d9ad183a05dc5f4d8f99627e71a791e (patch)
tree41940079081663b86018ebf56d7f91b6f39fd567 /src/client/playerview.cc
parenta320e55dc1a17cef3923643277f1112f74251d70 (diff)
improved menu ESC handling
Diffstat (limited to 'src/client/playerview.cc')
-rw-r--r--src/client/playerview.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/client/playerview.cc b/src/client/playerview.cc
index e75cd47..889e4d4 100644
--- a/src/client/playerview.cc
+++ b/src/client/playerview.cc
@@ -19,8 +19,6 @@ PlayerView::PlayerView(ui::Widget *parent) : ui::Widget(parent)
set_border(false);
set_background(false);
- view_lastentity = 0;
-
view_notify = new Notifications(this);
view_hud = new HUD(this);
@@ -52,8 +50,6 @@ void PlayerView::clear()
view_chat->hide();
view_map->hide();
view_entitymenu->hide();
-
- view_lastentity = 0;
}
void PlayerView::event_text(const std::string & text)
@@ -198,19 +194,18 @@ void PlayerView::draw()
label_viewname->show();
- if (view_lastentity != core::localplayer()->view()) {
+ if (view_entitymenu->generated_entity() != core::localplayer()->view()) {
// initially show the menu
show_menu("main");
map()->hide();
chat()->hide();
audio::play("ui/menu");
- view_lastentity = core::localplayer()->view();
} else if (!view_entitymenu->visible() && !view_buymenu->visible() &&
!map()->visible() && (!chat()->visible() || chat()->small_view()) ) {
// show the menu if there's no other window open
- menu()->show();
+ view_entitymenu->show();
audio::play("ui/menu");
}
@@ -219,8 +214,6 @@ void PlayerView::draw()
} else {
// entity without menus, plain view
- view_lastentity = 0;
-
this->hide();
return;
}
@@ -231,6 +224,11 @@ void PlayerView::draw()
if (view_entitymenu->visible()) {
view_entitymenu->hide();
}
+
+ if (view_entitymenu->generated_entity()) {
+ view_entitymenu->generate(0,0);
+ }
+
if (view_buymenu->visible()) {
view_buymenu->hide();
}
@@ -247,7 +245,6 @@ void PlayerView::draw()
}
view_hud->show();
- view_lastentity = 0;
}
// reposition chat widget