summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLloyd Bryant <lloyd_bryant@netzero.net>2008-07-23 17:24:18 +0000
committerLloyd Bryant <lloyd_bryant@netzero.net>2008-07-23 17:24:18 +0000
commitc9b01f907d3720ad96b2435d00a47d31e1955f53 (patch)
tree102a19400d9e3beb3e555c6521ee359b0bc52a47 /src
parenta73a655f398ae9fae01253dec1cc1f9bb1d44ea7 (diff)
downloadmana-client-c9b01f907d3720ad96b2435d00a47d31e1955f53.tar.gz
mana-client-c9b01f907d3720ad96b2435d00a47d31e1955f53.tar.bz2
mana-client-c9b01f907d3720ad96b2435d00a47d31e1955f53.tar.xz
mana-client-c9b01f907d3720ad96b2435d00a47d31e1955f53.zip
Added viewable cape/misc1/misc2, Chat button in GUI
Diffstat (limited to 'src')
-rw-r--r--src/being.h3
-rw-r--r--src/gui/menuwindow.cpp8
-rw-r--r--src/net/beinghandler.cpp31
3 files changed, 33 insertions, 9 deletions
diff --git a/src/being.h b/src/being.h
index 3ddff097..90bab9ac 100644
--- a/src/being.h
+++ b/src/being.h
@@ -94,8 +94,11 @@ class Being : public Sprite
SHOE_SPRITE,
BOTTOMCLOTHES_SPRITE,
TOPCLOTHES_SPRITE,
+ MISC1_SPRITE,
+ MISC2_SPRITE,
HAIR_SPRITE,
HAT_SPRITE,
+ CAPE_SPRITE,
GLOVES_SPRITE,
WEAPON_SPRITE,
SHIELD_SPRITE,
diff --git a/src/gui/menuwindow.cpp b/src/gui/menuwindow.cpp
index c3af6896..2d07e632 100644
--- a/src/gui/menuwindow.cpp
+++ b/src/gui/menuwindow.cpp
@@ -36,6 +36,7 @@ extern Window *equipmentWindow;
extern Window *skillDialog;
extern Window *statusWindow;
extern Window *itemShortcutWindow;
+extern Window *chatWindow;
namespace {
struct MenuWindowListener : public gcn::ActionListener
@@ -58,6 +59,7 @@ MenuWindow::MenuWindow():
// Buttons
const char *buttonNames[] =
{
+ "Chat",
"Status",
"Equipment",
"Inventory",
@@ -91,7 +93,11 @@ void MenuWindowListener::action(const gcn::ActionEvent &event)
{
Window *window = NULL;
- if (event.getId() == "Status")
+ if (event.getId() == "Chat")
+ {
+ window = chatWindow;
+ }
+ else if (event.getId() == "Status")
{
window = statusWindow;
}
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index 778c8cfe..048b7428 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -69,7 +69,8 @@ void BeingHandler::handleMessage(MessageIn *msg)
Uint32 id;
Uint16 job, speed;
Uint16 headTop, headMid, headBottom;
- Uint16 shoes, gloves;
+ Uint16 shoes, gloves, cape, misc1, misc2;
+ Uint16 weapon, shield;
Sint16 param1;
Sint8 type;
Being *srcBeing, *dstBeing;
@@ -82,8 +83,8 @@ void BeingHandler::handleMessage(MessageIn *msg)
// Information about a being in range
id = msg->readInt32();
speed = msg->readInt16();
- msg->readInt16(); // unknown
- msg->readInt16(); // unknown
+ msg->readInt16(); // opt1
+ msg->readInt16(); // opt2
msg->readInt16(); // option
job = msg->readInt16(); // class
@@ -346,6 +347,15 @@ void BeingHandler::handleMessage(MessageIn *msg)
case 10: // LOOK_GLOVES
dstBeing->setSprite(Being::GLOVES_SPRITE, id);
break;
+ case 11: // LOOK_CAPE
+ dstBeing->setSprite(Being::CAPE_SPRITE, id);
+ break;
+ case 12:
+ dstBeing->setSprite(Being::MISC1_SPRITE, id);
+ break;
+ case 13:
+ dstBeing->setSprite(Being::MISC2_SPRITE, id);
+ break;
default:
logger->log("SMSG_BEING_CHANGE_LOOKS: unsupported type: "
"%d, id: %d", type, id);
@@ -367,9 +377,9 @@ void BeingHandler::handleMessage(MessageIn *msg)
// An update about a player, potentially including movement.
id = msg->readInt32();
speed = msg->readInt16();
- msg->readInt16(); // option 1
- msg->readInt16(); // option 2
- msg->readInt16(); // option
+ cape = msg->readInt16();
+ misc1 = msg->readInt16();
+ misc2 = msg->readInt16();
job = msg->readInt16();
dstBeing = beingManager->findBeing(id);
@@ -382,8 +392,8 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->setWalkSpeed(speed);
dstBeing->mJob = job;
hairStyle = msg->readInt16();
- dstBeing->setSprite(Being::WEAPON_SPRITE, msg->readInt16());
- dstBeing->setSprite(Being::SHIELD_SPRITE, msg->readInt16());
+ weapon = msg->readInt16();
+ shield = msg->readInt16();
headBottom = msg->readInt16();
if (msg->getId() == SMSG_PLAYER_MOVE)
@@ -403,11 +413,16 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->setGender(1 - msg->readInt8()); // gender
// Set these after the gender, as the sprites may be gender-specific
+ dstBeing->setSprite(Being::WEAPON_SPRITE, weapon);
+ dstBeing->setSprite(Being::SHIELD_SPRITE, shield);
dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom);
dstBeing->setSprite(Being::TOPCLOTHES_SPRITE, headMid);
dstBeing->setSprite(Being::HAT_SPRITE, headTop);
dstBeing->setSprite(Being::SHOE_SPRITE, shoes);
dstBeing->setSprite(Being::GLOVES_SPRITE, gloves);
+ dstBeing->setSprite(Being::CAPE_SPRITE, cape);
+ dstBeing->setSprite(Being::MISC1_SPRITE, misc1);
+ dstBeing->setSprite(Being::MISC2_SPRITE, misc2);
dstBeing->setHairStyle(hairStyle, hairColor);
if (msg->getId() == SMSG_PLAYER_MOVE)