diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-02 00:22:05 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-02 00:22:05 +0200 |
commit | 6304a3afdcf747468dc125991b3313887c2af941 (patch) | |
tree | 807358c0483ef3ea284872ef6f5e7eb77a2e74a2 /scene.cpp | |
parent | 1d106a249648b2c39c1256c80325b18ffe91f7f3 (diff) |
Added a new transparent scheme based on Vanilla and a simple chat window, which displays text strings received from the server.
Diffstat (limited to 'scene.cpp')
-rw-r--r-- | scene.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -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; } |