summaryrefslogtreecommitdiff
path: root/src/gui/char_select.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-26 17:24:43 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-26 17:24:43 +0000
commit07b6070c25faedd78c2e26825bd700dc294f00cf (patch)
tree6a3053ad2a88ee6f0091fafba6607bc82231f7f6 /src/gui/char_select.cpp
parent00d7badb647b4293c444c0374985b7f1ea8a1ed1 (diff)
downloadmana-07b6070c25faedd78c2e26825bd700dc294f00cf.tar.gz
mana-07b6070c25faedd78c2e26825bd700dc294f00cf.tar.bz2
mana-07b6070c25faedd78c2e26825bd700dc294f00cf.tar.xz
mana-07b6070c25faedd78c2e26825bd700dc294f00cf.zip
Made the Network class a purely static interface, as there is only one instance.
Diffstat (limited to 'src/gui/char_select.cpp')
-rw-r--r--src/gui/char_select.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 3db82287..7e0a1a29 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -71,9 +71,8 @@ void CharDeleteConfirm::action(const std::string &eventId, gcn::Widget *widget)
ConfirmDialog::action(eventId, widget);
}
-CharSelectDialog::CharSelectDialog(Network *network,
- LockedArray<LocalPlayer*> *charInfo):
- Window("Select Character"), mNetwork(network),
+CharSelectDialog::CharSelectDialog(LockedArray<LocalPlayer*> *charInfo):
+ Window("Select Character"),
mCharInfo(charInfo), mCharSelected(false)
{
mSelectButton = new Button("Ok", "ok", this);
@@ -147,7 +146,7 @@ void CharSelectDialog::action(const std::string &eventId, gcn::Widget *widget)
{
// Start new character dialog
mCharInfo->lock();
- new CharCreateDialog(this, mCharInfo->getPos(), mNetwork);
+ new CharCreateDialog(this, mCharInfo->getPos());
mCharInfo->unlock();
}
}
@@ -208,7 +207,7 @@ void CharSelectDialog::attemptCharDelete()
msg.writeShort(PAMSG_CHAR_DELETE);
// TODO: Send the selected slot
msg.writeByte(0);
- network->send(Network::ACCOUNT, msg);
+ Network::send(Network::ACCOUNT, msg);
mCharInfo->lock();
}
@@ -218,7 +217,7 @@ void CharSelectDialog::attemptCharSelect()
MessageOut msg;
msg.writeShort(PAMSG_CHAR_SELECT);
msg.writeByte(mCharInfo->getPos());
- network->send(Network::ACCOUNT, msg);
+ Network::send(Network::ACCOUNT, msg);
mCharInfo->lock();
}
@@ -227,8 +226,8 @@ void CharSelectDialog::logic()
updatePlayerInfo();
}
-CharCreateDialog::CharCreateDialog(Window *parent, int slot, Network *network):
- Window("Create Character", true, parent), mNetwork(network), mSlot(slot)
+CharCreateDialog::CharCreateDialog(Window *parent, int slot):
+ Window("Create Character", true, parent), mSlot(slot)
{
mNameField = new TextField("");
mNameLabel = new gcn::Label("Name:");
@@ -336,5 +335,5 @@ void CharCreateDialog::attemptCharCreate()
outMsg.writeShort(10); // INT
outMsg.writeShort(10); // DEX
outMsg.writeShort(10); // LUK
- network->send(Network::ACCOUNT, outMsg);
+ Network::send(Network::ACCOUNT, outMsg);
}