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-02-23 17:10:35 +0000
committerStijn Buys <ingar@osirion.org>2008-02-23 17:10:35 +0000
commit5c734fe66e9ace93c03937adc2fc56336fb474fb (patch)
treed4d4ffebd4215b0f1f42d6a4ac9275ec8cd686ea /src/client/view.cc
parent82c06412ef39522c4deab457ce7a3e78160d8a19 (diff)
client chatbox and message notifications
Diffstat (limited to 'src/client/view.cc')
-rw-r--r--src/client/view.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/client/view.cc b/src/client/view.cc
index 1a40c4a..3a9a8fb 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -6,6 +6,7 @@
#include "client/client.h"
#include "client/camera.h"
+#include "client/chat.h"
#include "client/console.h"
#include "client/video.h"
#include "client/draw.h"
@@ -121,6 +122,27 @@ void draw_status()
version.append(core::version());
draw_text(video::width-(version.size()+1)*CHARWIDTH, 4, version);
+ // draw notifications
+ gl::color(1.0f, 1.0f, 1.0f, 1.0f);
+ size_t n = console::notify_pos % MAXNOTIFYLINES;
+ float now = sys::time();
+ int h = 4 + CHARHEIGHT;
+ for (size_t l = 0; l < MAXNOTIFYLINES; l++) {
+ if (console::notify_text[n].size() > 2 && console::notify_time[n] + 5 > now) {
+ if (console::notify_text[n][0] == '?')
+ gl::color(0.7f,0.7f,0.7f, 1.0f);
+ else if (console::notify_text[n][0] == '*')
+ gl::color(1.0f,1.0f,0.0f, 1.0f);
+ else if (console::notify_text[n][0] == '!')
+ gl::color(1.0f,0.0f,0.0f, 1.0f);
+ else
+ gl::color(1.0f,1.0f,1.0f, 1.0f);
+ draw_text(CHARWIDTH, h, console::notify_text[n].substr(2));
+ h += CHARHEIGHT;
+ }
+ n = (n+1) % MAXNOTIFYLINES;
+ }
+
gl::disable(GL_TEXTURE_2D);
}
@@ -134,6 +156,9 @@ void frame(float seconds)
else
fps = 9999;
+ // flush console messages
+ console::flush();
+
// Clear the color and depth buffers.
gl::clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -179,6 +204,7 @@ void frame(float seconds)
// draw the console
console::draw();
+ chat::draw();
// draw the status line
draw_status();