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/mapwindow.cc')
-rw-r--r--src/client/mapwindow.cc38
1 files changed, 28 insertions, 10 deletions
diff --git a/src/client/mapwindow.cc b/src/client/mapwindow.cc
index 19cf687..925f938 100644
--- a/src/client/mapwindow.cc
+++ b/src/client/mapwindow.cc
@@ -27,6 +27,12 @@ MapWindow::MapWindow(ui::Widget *parent) : ui::Window(parent)
set_background(true);
set_font(ui::root()->font_small());
+ // modelview, add it first so it gets rendered before anything else
+ mapwindow_modelview = new ui::ModelView(this);
+ mapwindow_modelview->set_label("modelview");
+ mapwindow_modelview->set_background(false);
+ mapwindow_modelview->set_border(false);
+
// window title
mapwindow_titlelabel = new ui::Label(this);
mapwindow_titlelabel->set_label("title");
@@ -60,20 +66,24 @@ MapWindow::MapWindow(ui::Widget *parent) : ui::Window(parent)
// map buttons
mapwindow_zonebutton = new ui::IconButton(this, "bitmaps/icons/button_map");
mapwindow_galaxybutton = new ui::IconButton(this, "bitmaps/icons/button_galaxy");
+
- // modelview
- mapwindow_modelview = new ui::ModelView(this);
- mapwindow_modelview->set_label("modelview");
- mapwindow_modelview->set_background(false);
- mapwindow_modelview->set_border(false);
-
- // target title (modelview child)
+ // target title
mapwindow_targetlabel = new ui::Label(this);
mapwindow_targetlabel->set_label("targetlabel");
mapwindow_targetlabel->set_background(false);
mapwindow_targetlabel->set_border(false);
mapwindow_targetlabel->set_alignment(ui::AlignCenter);
+
+
+ // info label (modelview child)
+ mapwindow_infolabel = new ui::Label(mapwindow_modelview);
+ mapwindow_infolabel ->set_label("infolabel");
+ mapwindow_infolabel->set_background(false);
+ mapwindow_infolabel->set_border(false);
+ mapwindow_infolabel->set_alignment(ui::AlignCenter);
+
// target text
mapwindow_scrollpane = new ui::ScrollPane(this, mapwindow_infotext);
mapwindow_scrollpane->set_background(false);
@@ -168,6 +178,10 @@ void MapWindow::resize()
// resize target modelview
mapwindow_modelview->set_size(mapwindow_targetlabel->width(), (height() - mapwindow_targetlabel->bottom() - padding * 3.0f) * 0.5f);
mapwindow_modelview->set_location(mapwindow_mapwidget->right() + padding, mapwindow_targetlabel->bottom() + padding);
+
+ // resize info label (modelview child)
+ mapwindow_infolabel->set_size(mapwindow_modelview->width(), mapwindow_infolabel->font()->height());
+ mapwindow_infolabel->set_location(0.0f, mapwindow_modelview->height() - mapwindow_infolabel->height());
// resize target infopane text
mapwindow_scrollpane->set_size(mapwindow_modelview->size());
@@ -201,16 +215,18 @@ void MapWindow::set_info(const core::Info *info)
mapwindow_inforecord = 0;
mapwindow_infotimestamp = 0;
mapwindow_infotext.clear();
+ mapwindow_infolabel->clear();
if (info) {
mapwindow_inforecord = core::game()->request_info(info->id());
}
if (mapwindow_inforecord) {
+ mapwindow_infolabel->set_text(mapwindow_inforecord->name());
for (core::Info::Text::const_iterator it = mapwindow_inforecord->text().begin(); it != mapwindow_inforecord->text().end(); it++) {
mapwindow_infotext.push_back((*it));
}
- mapwindow_infotimestamp = mapwindow_inforecord->timestamp();
+ mapwindow_infotimestamp = mapwindow_inforecord->timestamp();
} else {
mapwindow_infotext.push_back("Information is not available");
mapwindow_infotimestamp = 0;
@@ -260,9 +276,11 @@ void MapWindow::show_entity_info(const core::Entity *entity)
} else {
set_info(0);
- mapwindow_infotext.clear();
- mapwindow_targetlabel->clear();
+ mapwindow_infotext.clear();
mapwindow_modelview->clear();
+
+ mapwindow_targetlabel->clear();
+ mapwindow_infolabel->clear();
}
}