diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/gui/ok_dialog.cpp | 31 | ||||
-rw-r--r-- | src/net/loginhandler.cpp | 6 |
3 files changed, 24 insertions, 17 deletions
@@ -1,3 +1,7 @@ +2008-10-22 David Athay <ko2fan@gmail.com> + + * src/gui/ok_dialog.cpp, src/net/loginhandler.cpp: Now shows ban time. + 2008-10-07 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/gui/updatewindow.cpp, src/particleemitter.cpp, diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp index ca9d2a7b..90407d31 100644 --- a/src/gui/ok_dialog.cpp +++ b/src/gui/ok_dialog.cpp @@ -22,32 +22,33 @@ */ #include "ok_dialog.h" - -#include <guichan/widgets/label.hpp> - +#include "textbox.h" #include "button.h" - +#include "scrollarea.h" OkDialog::OkDialog(const std::string &title, const std::string &msg, Window *parent): Window(title, true, parent) { - gcn::Label *textLabel = new gcn::Label(msg); + TextBox *textBox = new TextBox(); + textBox->setEditable(false); + + gcn::ScrollArea *scrollArea = new ScrollArea(textBox); gcn::Button *okButton = new Button("Ok", "ok", this); - int w = textLabel->getWidth() + 20; - int h = textLabel->getHeight() + 25 + okButton->getHeight(); + setContentSize(260, 175); + scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); + scrollArea->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); + scrollArea->setDimension(gcn::Rectangle( + 5, 5, 250, 160 - okButton->getHeight())); - if (okButton->getWidth() + 10 > w) { - w = okButton->getWidth() + 10; - } + textBox->setTextWrapped(msg); - setContentSize(w, h); - textLabel->setPosition(10, 10); - okButton->setPosition((w - okButton->getWidth()) / 2, - h - 5 - okButton->getHeight()); + okButton->setPosition( + 260 - 5 - okButton->getWidth(), + 175 - 5 - okButton->getHeight()); - add(textLabel); + add(scrollArea); add(okButton); setLocationRelativeTo(getParent()); diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index fa74f489..19893a8e 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -110,10 +110,12 @@ void LoginHandler::handleMessage(MessageIn *msg) errorMessage = "Rejected from server"; break; case 4: - errorMessage = "You have been banned from the game. Please contact the GM Team"; + + errorMessage = "You have been permanently banned from the game. Please contact the GM Team"; break; case 6: - errorMessage = "You have been temporarily banned from the game. Please contact the GM team"; + errorMessage = "You have been temporarily banned from the game until " + + msg->readString(20) + ".\n Please contact the GM team via the forums"; break; case 9: errorMessage = "This user name is already taken"; |