From 6304a3afdcf747468dc125991b3313887c2af941 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 2 Jun 2011 00:22:05 +0200 Subject: Added a new transparent scheme based on Vanilla and a simple chat window, which displays text strings received from the server. --- scene.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'scene.cpp') diff --git a/scene.cpp b/scene.cpp index 20692d8..fa012a3 100644 --- a/scene.cpp +++ b/scene.cpp @@ -67,6 +67,8 @@ Scene::Scene() { console = new ConsoleWindow(lua); console->hide(); + chat = new ChatWindow(); + void (ConsoleWindow::*add_line)(const char*) = &ConsoleWindow::add_line; lua->set_log_func(boost::bind(add_line, console, _1)); } @@ -79,6 +81,7 @@ Scene::~Scene() { delete terrain; delete font; delete console; + delete chat; } void Scene::lookat() { @@ -223,11 +226,11 @@ void Scene::events() { case SDL_MOUSEBUTTONDOWN: switch(event.button.button) { case SDL_BUTTON_LEFT: - if(dialog) + if(dialog || console->showing()) CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::LeftButton); break; case SDL_BUTTON_RIGHT: - if(dialog) + if(dialog || console->showing()) CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::RightButton); break; } @@ -235,7 +238,7 @@ void Scene::events() { case SDL_MOUSEBUTTONUP: switch(event.button.button) { case SDL_BUTTON_LEFT: - if(dialog) + if(dialog || console->showing()) CEGUI::System::getSingleton().injectMouseButtonUp(CEGUI::LeftButton); else { sx = event.button.x; @@ -244,23 +247,23 @@ void Scene::events() { } break; case SDL_BUTTON_RIGHT: - if(dialog) + if(dialog || console->showing()) CEGUI::System::getSingleton().injectMouseButtonUp(CEGUI::RightButton); else show_selection = false; break; case SDL_BUTTON_WHEELUP: - if(dialog) + if(dialog || console->showing()) CEGUI::System::getSingleton().injectMouseWheelChange(1); break; case SDL_BUTTON_WHEELDOWN: - if(dialog) + if(dialog || console->showing()) CEGUI::System::getSingleton().injectMouseWheelChange(-1); break; } break; case SDL_MOUSEMOTION: - if(dialog) { + if(dialog || console->showing()) { CEGUI::System::getSingleton().injectMousePosition(event.motion.x, event.motion.y); break; } -- cgit v1.2.3