diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-10-04 12:27:07 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-10-04 12:27:07 -0600 |
commit | cff9f1947bac8fa49aaf6f846a6e4335a439ac2e (patch) | |
tree | a1b2272c9541bb1ee40323948970787459187ae6 /src/gui/charselectdialog.cpp | |
parent | 95b54aee1b20e6fd2bf8f99766d810e0ab2e5477 (diff) | |
download | mana-cff9f1947bac8fa49aaf6f846a6e4335a439ac2e.tar.gz mana-cff9f1947bac8fa49aaf6f846a6e4335a439ac2e.tar.bz2 mana-cff9f1947bac8fa49aaf6f846a6e4335a439ac2e.tar.xz mana-cff9f1947bac8fa49aaf6f846a6e4335a439ac2e.zip |
Add ability to delect characters from account
Diffstat (limited to 'src/gui/charselectdialog.cpp')
-rw-r--r-- | src/gui/charselectdialog.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index 2fe83849..43748765 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -115,6 +115,7 @@ class CharEntry : public Container Label *mName; Label *mMoney; Button *mButton; + Button *mDelete; }; CharSelectDialog::CharSelectDialog(LockedArray<LocalPlayer*> *charInfo, @@ -169,6 +170,8 @@ CharSelectDialog::CharSelectDialog(LockedArray<LocalPlayer*> *charInfo, center(); mCharEntries[0]->requestFocus(); setVisible(true); + + Net::getCharHandler()->setCharSelectDialog(this); } void CharSelectDialog::action(const gcn::ActionEvent &event) @@ -295,6 +298,8 @@ CharEntry::CharEntry(CharSelectDialog *m, char slot, LocalPlayer *chr): mName = new Label("wwwwwwwwwwwwwwwwwwwwwwww (888)"); mMoney = new Label("wwwwwwwww"); + mDelete = new Button(_("Delete"), "delete", m); + LayoutHelper h(this); ContainerPlacer place = h.getPlacer(0, 0); @@ -302,9 +307,10 @@ CharEntry::CharEntry(CharSelectDialog *m, char slot, LocalPlayer *chr): place(0, 5, mName, 3); place(0, 6, mMoney, 3); place(0, 7, mButton, 3); + place(0, 8, mDelete, 3); - h.reflowLayout(65, 120 + mName->getHeight() + mMoney->getHeight() + - mButton->getHeight()); + h.reflowLayout(74, 123 + mName->getHeight() + mMoney->getHeight() + + mButton->getHeight() + mDelete->getHeight()); update(); } @@ -313,8 +319,7 @@ void CharEntry::setChar(LocalPlayer *chr) { mCharacter = chr; - if (chr) - mPlayerBox->setPlayer(chr); + mPlayerBox->setPlayer(chr); update(); } @@ -333,6 +338,8 @@ void CharEntry::update() mName->setCaption(strprintf("%s (%d)", mCharacter->getName().c_str(), mCharacter->getLevel())); mMoney->setCaption(Units::formatCurrency(mCharacter->getMoney())); + + mDelete->setVisible(true); } else { @@ -340,6 +347,8 @@ void CharEntry::update() mButton->setActionEventId("new"); mName->setCaption(_("(empty)")); mMoney->setCaption(Units::formatCurrency(0)); + + mDelete->setVisible(false); } // Recompute layout |