summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-27 19:05:24 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-27 21:01:39 +0300
commit8150191686759b13a239c25970924c3c186140ff (patch)
tree6004551128df40dcf178ca639fe42490f80d2c01 /src/gui
parent18d8872333e2e433ce7b9e7be71706de37933097 (diff)
downloadmanaverse-8150191686759b13a239c25970924c3c186140ff.tar.gz
manaverse-8150191686759b13a239c25970924c3c186140ff.tar.bz2
manaverse-8150191686759b13a239c25970924c3c186140ff.tar.xz
manaverse-8150191686759b13a239c25970924c3c186140ff.zip
improve charserverhandler class.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/charcreatedialog.cpp6
-rw-r--r--src/gui/charselectdialog.cpp18
-rw-r--r--src/gui/charselectdialog.h8
-rw-r--r--src/gui/logindialog.cpp4
-rw-r--r--src/gui/quitdialog.cpp4
5 files changed, 20 insertions, 20 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index 7ed2f0703..9ff4b038e 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -252,7 +252,7 @@ CharCreateDialog::~CharCreateDialog()
mPlayer = nullptr;
// Make sure the char server handler knows that we're gone
- Net::getCharHandler()->setCharCreateDialog(nullptr);
+ Net::getCharServerHandler()->setCharCreateDialog(nullptr);
}
void CharCreateDialog::action(const gcn::ActionEvent &event)
@@ -285,7 +285,7 @@ void CharCreateDialog::action(const gcn::ActionEvent &event)
const int characterSlot = mSlot;
#endif
- Net::getCharHandler()->newCharacter(getName(), characterSlot,
+ Net::getCharServerHandler()->newCharacter(getName(), characterSlot,
mFemale->isSelected(), mHairStyle, mHairColor,
static_cast<unsigned char>(mRace), atts);
}
@@ -524,7 +524,7 @@ void CharCreateDialog::updateHair()
mHairColorNameLabel->setCaption(ColorDB::getHairColorName(mHairColor));
mHairColorNameLabel->adjustSize();
- mPlayer->setSprite(Net::getCharHandler()->hairSprite(),
+ mPlayer->setSprite(Net::getCharServerHandler()->hairSprite(),
mHairStyle * -1, item.getDyeColorsString(mHairColor));
}
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp
index bc2c42dc7..712870ad8 100644
--- a/src/gui/charselectdialog.cpp
+++ b/src/gui/charselectdialog.cpp
@@ -244,7 +244,7 @@ CharSelectDialog::CharSelectDialog(LoginData *const data):
mChangeEmailButton(nullptr),
mCharacterScroller(nullptr),
mCharacterEntries(0),
- mCharHandler(Net::getCharHandler()),
+ mCharServerHandler(Net::getCharServerHandler()),
mDeleteDialog(nullptr),
mDeleteIndex(-1),
mSmallScreen(mainGraphics->getWidth() < 485
@@ -313,7 +313,7 @@ CharSelectDialog::CharSelectDialog(LoginData *const data):
center();
setVisible(true);
- Net::getCharHandler()->setCharSelectDialog(this);
+ Net::getCharServerHandler()->setCharSelectDialog(this);
focusCharacter(0);
}
@@ -350,7 +350,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
if (eventId == "use" && mCharacterEntries[selected]->getCharacter())
{
attemptCharacterSelect(selected);
-// Net::getCharHandler()->clear();
+// Net::getCharServerHandler()->clear();
return;
}
else if (eventId == "new" &&
@@ -359,7 +359,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
// Start new character dialog
CharCreateDialog *const charCreateDialog =
new CharCreateDialog(this, selected);
- mCharHandler->setCharCreateDialog(charCreateDialog);
+ mCharServerHandler->setCharCreateDialog(charCreateDialog);
return;
}
else if (eventId == "delete"
@@ -371,7 +371,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
}
if (eventId == "switch")
{
- Net::getCharHandler()->clear();
+ Net::getCharServerHandler()->clear();
close();
}
else if (eventId == "change_password")
@@ -384,7 +384,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
}
else if (eventId == "unregister")
{
- Net::getCharHandler()->clear();
+ Net::getCharServerHandler()->clear();
Client::setState(STATE_UNREGISTER);
}
else if (eventId == "try delete character")
@@ -558,7 +558,7 @@ void CharSelectDialog::attemptCharacterDelete(const int index)
if (mLocked)
return;
- mCharHandler->deleteCharacter(mCharacterEntries[index]->getCharacter());
+ mCharServerHandler->deleteCharacter(mCharacterEntries[index]->getCharacter());
lock();
}
@@ -581,9 +581,9 @@ void CharSelectDialog::attemptCharacterSelect(const int index)
return;
setVisible(false);
- if (mCharHandler && mCharacterEntries[index])
+ if (mCharServerHandler && mCharacterEntries[index])
{
- mCharHandler->chooseCharacter(
+ mCharServerHandler->chooseCharacter(
mCharacterEntries[index]->getCharacter());
}
lock();
diff --git a/src/gui/charselectdialog.h b/src/gui/charselectdialog.h
index f9030d561..8c1b92522 100644
--- a/src/gui/charselectdialog.h
+++ b/src/gui/charselectdialog.h
@@ -28,7 +28,7 @@
#include "gui/widgets/window.h"
-#include "net/charhandler.h"
+#include "net/charserverhandler.h"
#include <guichan/actionlistener.hpp>
#include <guichan/keylistener.hpp>
@@ -44,7 +44,7 @@ class TextDialog;
namespace Net
{
- class CharHandler;
+ class CharServerHandler;
}
/**
@@ -58,7 +58,7 @@ class CharSelectDialog final : public Window,
{
public:
friend class CharDeleteConfirm;
- friend class Net::CharHandler;
+ friend class Net::CharServerHandler;
/**
* Constructor.
@@ -129,7 +129,7 @@ class CharSelectDialog final : public Window,
/** The player boxes */
std::vector<CharacterDisplay*> mCharacterEntries;
- Net::CharHandler *mCharHandler;
+ Net::CharServerHandler *mCharServerHandler;
TextDialog *mDeleteDialog;
int mDeleteIndex;
bool mSmallScreen;
diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp
index 5767390c7..c69560c38 100644
--- a/src/gui/logindialog.cpp
+++ b/src/gui/logindialog.cpp
@@ -38,7 +38,7 @@
#include "gui/widgets/layout.h"
#include "gui/widgets/passwordfield.h"
-#include "net/charhandler.h"
+#include "net/charserverhandler.h"
#include "net/logindata.h"
#include "net/loginhandler.h"
#include "net/net.h"
@@ -155,7 +155,7 @@ LoginDialog::LoginDialog(LoginData *const data, std::string serverName,
{
setCloseButton(true);
- Net::getCharHandler()->clear();
+ Net::getCharServerHandler()->clear();
Label *const serverLabel1 = new Label(this, _("Server:"));
Label *const serverLabel2 = new Label(this, serverName);
diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp
index 4ded1450f..3bf63c9a1 100644
--- a/src/gui/quitdialog.cpp
+++ b/src/gui/quitdialog.cpp
@@ -39,7 +39,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/radiobutton.h"
-#include "net/charhandler.h"
+#include "net/charserverhandler.h"
#include "net/gamehandler.h"
#include "net/npchandler.h"
#include "net/net.h"
@@ -188,7 +188,7 @@ void QuitDialog::action(const gcn::ActionEvent &event)
{
if (Client::getState() == STATE_GAME)
{
- Net::getCharHandler()->switchCharacter();
+ Net::getCharServerHandler()->switchCharacter();
Game::closeDialogs();
}
}