summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-10-22 10:37:08 +0000
committerDavid Athay <ko2fan@gmail.com>2008-10-22 10:37:08 +0000
commitd242b7ebd7927e8eb447ee866777cf48db15ae0c (patch)
tree4d2d5f9f9374f0036cda6e45665ccfedc9567756
parent93b9bfd3bde24a76bf7ef58b71f0d8757d3b38e5 (diff)
downloadmana-client-d242b7ebd7927e8eb447ee866777cf48db15ae0c.tar.gz
mana-client-d242b7ebd7927e8eb447ee866777cf48db15ae0c.tar.bz2
mana-client-d242b7ebd7927e8eb447ee866777cf48db15ae0c.tar.xz
mana-client-d242b7ebd7927e8eb447ee866777cf48db15ae0c.zip
Now displays ban time, if banned
-rw-r--r--ChangeLog4
-rw-r--r--src/gui/ok_dialog.cpp31
-rw-r--r--src/net/loginhandler.cpp6
3 files changed, 24 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index d1337e47..490bd5b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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";