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>2008-11-09 17:44:24 +0000
committerStijn Buys <ingar@osirion.org>2008-11-09 17:44:24 +0000
commit06212c7d8dc20b11f49d54e42f8299740f90a231 (patch)
treeaf179e6015cb86be61ee640154fde1d70967d919 /src/client
parentf0ba130494173d01c6e800c95e19dc1826ddc68e (diff)
improved client notifications, minor bugfixes
Diffstat (limited to 'src/client')
-rw-r--r--src/client/input.cc2
-rw-r--r--src/client/notifications.cc5
-rw-r--r--src/client/targets.cc2
-rw-r--r--src/client/view.cc8
4 files changed, 10 insertions, 7 deletions
diff --git a/src/client/input.cc b/src/client/input.cc
index dcddea3..f8c756f 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -111,7 +111,7 @@ void func_screenshot(std::string const & args)
void func_ui_control(std::string const &args)
{
- if (!core::localcontrol())
+ if (!core::localcontrol() || core::localplayer()->view())
return;
if (input_mousecontrol->value() > 0) {
diff --git a/src/client/notifications.cc b/src/client/notifications.cc
index 256f110..25cbe0b 100644
--- a/src/client/notifications.cc
+++ b/src/client/notifications.cc
@@ -6,6 +6,7 @@
#include "client/notifications.h"
#include "core/application.h"
+#include "ui/ui.h"
namespace client
{
@@ -20,6 +21,7 @@ Notifications::Notifications(ui::Widget *parent) : ui::Widget(parent)
notify_scrollpane = new ui::ScrollPane(this, notify_log);
notify_scrollpane->set_border(false);
+ notify_scrollpane->set_alignment(ui::AlignTop);
}
Notifications::~Notifications()
@@ -54,13 +56,14 @@ void Notifications::draw()
t = notify_timestamp.begin();
}
- const float margin = 8.0f;
+ const float margin = ui::UI::elementmargin;
math::Vector2f s(size());
s.x -= margin*2;
s.y -= margin*2;
notify_scrollpane->set_location(margin, margin);
notify_scrollpane->set_size(s.x, s.y );
+
}
diff --git a/src/client/targets.cc b/src/client/targets.cc
index c7fcf9e..04a4463 100644
--- a/src/client/targets.cc
+++ b/src/client/targets.cc
@@ -430,7 +430,7 @@ void draw()
render_entity_sound(static_cast<core::EntityControlable *>(entity));
}
// find the current target
- if (core::localcontrol() && is_legal_target(entity)) {
+ if (!core::localplayer()->view() && core::localcontrol() && is_legal_target(entity)) {
if (entity->id() == current_target_id) {
current_target = entity;
diff --git a/src/client/view.cc b/src/client/view.cc
index 304d2a5..42ace02 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -208,10 +208,6 @@ void View::resize()
view_devinfo->set_size(font()->width()*32, font()->height()*5);
view_devinfo->set_location(font()->width() * 0.5f, font()->height() * 0.5f);
- // reposition notifications widget
- view_notify->set_location(font()->width(), view_devinfo->top() + view_devinfo->height() + font()->height());
- view_notify->set_size(width() - font()->width() * 2, height() * 0.5f - view_notify->top());
-
// reposition stats widget
view_stats->set_size(font()->width()*12, font()->height()*5);
view_stats->set_location(width() - view_stats->width() - font()->width() * 0.5, font()->height() * 0.5f);
@@ -225,6 +221,10 @@ void View::resize()
view_center->set_size(ui::pointer_size, ui::pointer_size);
view_center->set_location((size() - view_center->size()) * 0.5f);
view_center->set_color(palette()->pointer());
+
+ // reposition notifications
+ view_notify->set_location(ui::UI::elementsize.width()*2.0f+ font()->width(), view_devinfo->top() + view_devinfo->height() + font()->height());
+ view_notify->set_size(width() - ui::UI::elementsize.width()*2.0f - font()->width() * 2, height() * 0.5f - view_notify->top());
}
void View::draw()