Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/playerview.cc29
-rw-r--r--src/client/playerview.h1
2 files changed, 27 insertions, 3 deletions
diff --git a/src/client/playerview.cc b/src/client/playerview.cc
index 5cbd408..90d33f7 100644
--- a/src/client/playerview.cc
+++ b/src/client/playerview.cc
@@ -46,7 +46,8 @@ PlayerView::PlayerView(ui::Widget *parent) : ui::Widget(parent)
view_launchbutton = new ui::IconButton(this, "bitmaps/icons/button_launch", "launch");
view_dockbutton = new TargetIconButton(this, "bitmaps/icons/button_dock", "dock", core::Entity::Dockable);
-
+
+ view_homebutton = new ui::IconButton(this, "bitmaps/icons/button_home", "view main");
view_chatbutton = new ui::IconButton(this, "bitmaps/icons/button_chat", "ui_chat");
view_mapbutton = new ui::IconButton(this, "bitmaps/icons/button_map", "ui_map");
view_inventorybutton = new ui::IconButton(this, "bitmaps/icons/button_inventory", "ui_inventory");
@@ -63,6 +64,7 @@ void PlayerView::clear()
view_chat->hide();
view_map->hide();
+ view_inventory->hide();
view_entitymenu->hide();
view_buymenu->hide();
view_trademenu->hide();
@@ -208,7 +210,10 @@ void PlayerView::show_menu(const std::string & args)
// hide other menus
view_entitymenu->hide();
view_trademenu->hide();
-
+ // hide other windows
+ view_chat->hide();
+ view_map->hide();
+ view_inventory->hide();
// requesting the info through game makes sure it is retreived from the server
view_buymenu->set_item( core::game()->request_info(id));
// show buy menu
@@ -227,6 +232,10 @@ void PlayerView::show_menu(const std::string & args)
// hide other menus
view_buymenu->hide();
view_entitymenu->hide();
+ // hide other windows
+ view_chat->hide();
+ view_map->hide();
+ view_inventory->hide();
// show trade menu
view_trademenu->set_itemtype(core::InfoType::find(typestr));
view_trademenu->show();
@@ -234,6 +243,7 @@ void PlayerView::show_menu(const std::string & args)
con_print << "usage: view trade [string] show the trade menu for this type of items" << std::endl;
}
+
} else if (label.compare("hide") == 0) {
// hide all menus
view_buymenu->hide();
@@ -243,6 +253,10 @@ void PlayerView::show_menu(const std::string & args)
// hide other menus
view_buymenu->hide();
view_trademenu->hide();
+ // hide other windows
+ view_chat->hide();
+ view_map->hide();
+ view_inventory->hide();
// show other menus
view_entitymenu->generate(core::localplayer()->view(), label.c_str());
view_entitymenu->show();
@@ -269,7 +283,7 @@ void PlayerView::resize()
// spacer
view_dockbutton->set_geometry(l + 2.0f *(icon_margin + icon_size), icon_margin, icon_size, icon_size);
view_launchbutton->set_geometry(l + 2.0f *(icon_margin + icon_size), icon_margin, icon_size, icon_size);
- // spacer
+ view_homebutton->set_geometry(l + 3.0f *(icon_margin + icon_size), icon_margin, icon_size, icon_size);
view_inventorybutton->set_geometry(l + 4.0f *(icon_margin + icon_size), icon_margin, icon_size, icon_size);
view_chatbutton->set_geometry(l + 5.0f *(icon_margin + icon_size), icon_margin, icon_size, icon_size);
view_mapbutton->set_geometry(l + 6.0f *(icon_margin + icon_size), icon_margin, icon_size, icon_size);
@@ -335,6 +349,11 @@ void PlayerView::draw()
map()->hide();
chat()->hide();
audio::play("ui/menu");
+
+ // hide other windows
+ view_chat->hide();
+ view_map->hide();
+ view_inventory->hide();
} else if (!view_entitymenu->visible() && !view_buymenu->visible() && !view_trademenu->visible() &&
!inventory()->visible() && !map()->visible() && (!chat()->visible() || chat()->small_view())) {
@@ -346,6 +365,8 @@ void PlayerView::draw()
view_notify->set_size(width() - smallmargin * 3.0f - ui::UI::elementsize.width() * 1.5f, height() - smallmargin * 4.0f);
view_notify->set_location(smallmargin * 2.0f + ui::UI::elementsize.width() * 1.5f, smallmargin * 2.0f);
+
+ view_homebutton->enable();
} else {
// entity without menus, plain view
@@ -354,6 +375,8 @@ void PlayerView::draw()
}
} else {
+ view_homebutton->disable();
+
view_notify->set_geometry(view_map->location(), view_map->size());
if (view_entitymenu->visible()) {
diff --git a/src/client/playerview.h b/src/client/playerview.h
index 5e82be5..e457ef1 100644
--- a/src/client/playerview.h
+++ b/src/client/playerview.h
@@ -87,6 +87,7 @@ private:
ui::IconButton *view_menubutton;
ui::IconButton *view_dockbutton;
ui::IconButton *view_launchbutton;
+ ui::IconButton *view_homebutton;
ui::IconButton *view_chatbutton;
ui::IconButton *view_mapbutton;
ui::IconButton *view_inventorybutton;