diff options
Diffstat (limited to 'gui.cpp')
-rw-r--r-- | gui.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -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 */ |