summaryrefslogtreecommitdiff
path: root/gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui.cpp')
-rw-r--r--gui.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/gui.cpp b/gui.cpp
index ed53cb4..4d4a723 100644
--- a/gui.cpp
+++ b/gui.cpp
@@ -29,6 +29,7 @@ void GUI::init() {
WindowManager::setDefaultResourceGroup("layouts");
SchemeManager::getSingleton().create( "VanillaSkin.scheme" );
+ SchemeManager::getSingleton().create( "Transparent.scheme" );
FontManager::getSingleton().create("VeraMono.font");
@@ -154,6 +155,33 @@ void ConsoleWindow::update() {
WindowManager::getSingleton().getWindow("console_editbox")->activate();
}
+/* ChatWindow */
+
+ChatWindow::ChatWindow() {
+ WindowManager& wmgr(WindowManager::getSingleton());
+
+ wnd = wmgr.loadWindowLayout("chat.layout");
+ root->addChildWindow(wnd);
+
+ listbox = static_cast<Listbox*>(wmgr.getWindow("chat_listbox"));
+}
+
+ChatWindow::~ChatWindow() {
+ WindowManager& wmgr(WindowManager::getSingleton());
+ wmgr.destroyWindow(wnd);
+ wmgr.cleanDeadPool();
+}
+
+void ChatWindow::add_line(const std::string& line) {
+ add_line(line.c_str());
+}
+
+void ChatWindow::add_line(const char *line) {
+ FormattedListboxTextItem *item = new FormattedListboxTextItem(String((utf8*)line), HTF_WORDWRAP_LEFT_ALIGNED);
+ listbox->addItem(item);
+ listbox->ensureItemIsVisible(item);
+}
+
/* RaiseWindow */
/* default values */