diff options
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; } |