summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-29 05:45:10 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-29 05:45:10 +0300
commitcc3d90c515331acab2f888fe9c3e72ed321f7f1a (patch)
treefa0079b4404b81ef279569312ce8fd319f31af84
parent1400abb6cfd9596e2b9430385d68e6527f6b0d2b (diff)
downloadmanaplus-cc3d90c515331acab2f888fe9c3e72ed321f7f1a.tar.gz
manaplus-cc3d90c515331acab2f888fe9c3e72ed321f7f1a.tar.bz2
manaplus-cc3d90c515331acab2f888fe9c3e72ed321f7f1a.tar.xz
manaplus-cc3d90c515331acab2f888fe9c3e72ed321f7f1a.zip
Show race name in char creation dialog.
-rw-r--r--src/gui/charcreatedialog.cpp8
-rw-r--r--src/gui/charcreatedialog.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index a1233fdcc..641e07db6 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -47,6 +47,7 @@
#include "resources/chardb.h"
#include "resources/colordb.h"
#include "resources/itemdb.h"
+#include "resources/iteminfo.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -99,6 +100,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *parent, int slot):
mNextRaceButton = new Button(_(">"), "nextrace", this);
mPrevRaceButton = new Button(_("<"), "prevrace", this);
mRaceLabel = new Label(_("Race:"));
+ mRaceNameLabel = new Label("qwerty");
}
mCreateButton = new Button(_("Create"), "create", this);
@@ -143,6 +145,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *parent, int slot):
mPrevRaceButton->setPosition(155, 93);
mNextRaceButton->setPosition(230, 93);
mRaceLabel->setPosition(5, 100);
+ mRaceNameLabel->setPosition(5, 118);
}
mAttributesLeft->setPosition(15, 280);
@@ -172,6 +175,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *parent, int slot):
add(mNextRaceButton);
add(mPrevRaceButton);
add(mRaceLabel);
+ add(mRaceNameLabel);
}
add(mAttributesLeft);
@@ -184,6 +188,8 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *parent, int slot):
center();
setVisible(true);
mNameField->requestFocus();
+ if (serverVersion >= 2)
+ updateRace();
}
CharCreateDialog::~CharCreateDialog()
@@ -448,4 +454,6 @@ void CharCreateDialog::updateRace()
}
mPlayer->setSubtype(mRace);
+ const ItemInfo &item = ItemDB::get(id);
+ mRaceNameLabel->setCaption(item.getName());
}
diff --git a/src/gui/charcreatedialog.h b/src/gui/charcreatedialog.h
index e369f1777..065b532c4 100644
--- a/src/gui/charcreatedialog.h
+++ b/src/gui/charcreatedialog.h
@@ -101,6 +101,7 @@ class CharCreateDialog : public Window, public gcn::ActionListener
gcn::Button *mNextRaceButton;
gcn::Button *mPrevRaceButton;
gcn::Label *mRaceLabel;
+ gcn::Label *mRaceNameLabel;
gcn::RadioButton *mMale;
gcn::RadioButton *mFemale;