summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--data/graphics/gui/Makefile.am12
-rw-r--r--src/gui/char_select.cpp16
-rw-r--r--src/net/accountserver/account.cpp2
-rw-r--r--src/net/accountserver/account.h2
-rw-r--r--src/player.cpp12
6 files changed, 32 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 2770bfca..c89749ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-01-11 Rogier Polak <rogier.l.a.polak@gmail.com>
+
+ * src/gui/char_select.cpp, src/net/accountserver/account.h,
+ src/net/accountserver/account.cpp, src/player.cpp: Fixedd issues
+ with out of range hair style and color, as well as their ordering.
+ * data/graphics/gui/Makefile.am,
+ data/graphics/images/ambient/Makefile.am,
+ data/graphics/sprites/Makefile.am: Some corrections to installed
+ files.
+
2007-01-07 Bjørn Lindeijer <bjorn@lindeijer.nl>
* src/gui/status.h, src/gui/status.cpp, src/localplayer.h:
diff --git a/data/graphics/gui/Makefile.am b/data/graphics/gui/Makefile.am
index 50c9dfe7..c0e0655b 100644
--- a/data/graphics/gui/Makefile.am
+++ b/data/graphics/gui/Makefile.am
@@ -10,6 +10,7 @@ gui_DATA = \
buttonhi.png \
buttonpress.png \
checkbox.png \
+ deepbox.png \
fixedfont.png \
hits_blue.png \
hits_red.png \
@@ -20,17 +21,18 @@ gui_DATA = \
hscroll_right_default.png \
hscroll_right_highlight.png \
hscroll_right_pressed.png \
- mouse.png \
menuitemD.png \
menuitemF.png \
menuitemN.png \
menuitemP.png \
+ mouse.png \
radioin.png \
radioout.png \
- selection.png \
+ resize.png \
+ rpgfont_wider.png \
sansserif8.png \
+ selection.png \
slider.png \
- deepbox.png \
thickborder.png \
vscroll_blue.png \
vscroll_down_default.png \
@@ -40,9 +42,7 @@ gui_DATA = \
vscroll_red.png \
vscroll_up_default.png \
vscroll_up_highlight.png \
- vscroll_up_pressed.png \
- rpgfont_wider.png \
- resize.png
+ vscroll_up_pressed.png
EXTRA_DIST = \
$(gui_DATA)
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 3cb42078..ec4dad2e 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -238,8 +238,8 @@ CharCreateDialog::CharCreateDialog(Window *parent, int slot):
Window("Create Character", true, parent), mSlot(slot)
{
mPlayer = new Player(0, 0, NULL);
- mPlayer->setHairStyle(rand() % NR_HAIR_STYLES + 1);
- mPlayer->setHairColor(rand() % NR_HAIR_COLORS + 1);
+ mPlayer->setHairStyle(rand() % NR_HAIR_STYLES);
+ mPlayer->setHairColor(rand() % NR_HAIR_COLORS);
mNameField = new TextField("");
mNameLabel = new gcn::Label("Name:");
@@ -326,18 +326,18 @@ void CharCreateDialog::action(const std::string &eventId, gcn::Widget *widget)
scheduleDelete();
}
else if (eventId == "nextcolor") {
- mPlayer->setHairColor(mPlayer->getHairColor() % NR_HAIR_COLORS + 1);
+ mPlayer->setHairColor((mPlayer->getHairColor() + 1) % NR_HAIR_COLORS);
}
else if (eventId == "prevcolor") {
- int prevColor = mPlayer->getHairColor() + NR_HAIR_COLORS - 2;
- mPlayer->setHairColor(prevColor % NR_HAIR_COLORS + 1);
+ int prevColor = mPlayer->getHairColor() + NR_HAIR_COLORS - 1;
+ mPlayer->setHairColor(prevColor % NR_HAIR_COLORS);
}
else if (eventId == "nextstyle") {
- mPlayer->setHairStyle(mPlayer->getHairStyle() % NR_HAIR_STYLES + 1);
+ mPlayer->setHairStyle((mPlayer->getHairStyle() + 1) % NR_HAIR_STYLES);
}
else if (eventId == "prevstyle") {
- int prevStyle = mPlayer->getHairStyle() + NR_HAIR_STYLES - 2;
- mPlayer->setHairStyle(prevStyle % NR_HAIR_STYLES + 1);
+ int prevStyle = mPlayer->getHairStyle() + NR_HAIR_STYLES - 1;
+ mPlayer->setHairStyle(prevStyle % NR_HAIR_STYLES);
}
}
diff --git a/src/net/accountserver/account.cpp b/src/net/accountserver/account.cpp
index 7275cacc..daf94a65 100644
--- a/src/net/accountserver/account.cpp
+++ b/src/net/accountserver/account.cpp
@@ -30,7 +30,7 @@
#include "../protocol.h"
void Net::AccountServer::Account::createCharacter(
- const std::string &name, char hairColor, char hairStyle, char gender,
+ const std::string &name, char hairStyle, char hairColor, char gender,
short strength, short agility, short vitality,
short intelligence, short dexterity, short luck)
{
diff --git a/src/net/accountserver/account.h b/src/net/accountserver/account.h
index 368623e6..aaf3afe0 100644
--- a/src/net/accountserver/account.h
+++ b/src/net/accountserver/account.h
@@ -33,7 +33,7 @@ namespace Net
namespace Account
{
void createCharacter(const std::string &name,
- char hairColor, char hairStyle, char gender,
+ char hairStyle, char hairColor, char gender,
short strength, short agility, short vitality,
short intelligence, short dexterity, short luck);
diff --git a/src/player.cpp b/src/player.cpp
index 63ed5455..288401e4 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -140,9 +140,11 @@ Player::setHairColor(Uint16 color)
{
if (color != mHairColor)
{
+ Being::setHairColor(color);
+
AnimatedSprite *newHairSprite = new AnimatedSprite(
"graphics/sprites/hairstyle" + toString(mHairStyle) + ".xml",
- color);
+ mHairColor);
newHairSprite->setDirection(getSpriteDirection());
delete mSprites[HAIR_SPRITE];
@@ -150,8 +152,6 @@ Player::setHairColor(Uint16 color)
setAction(mAction);
}
-
- Being::setHairColor(color);
}
void
@@ -159,8 +159,10 @@ Player::setHairStyle(Uint16 style)
{
if (style != mHairStyle)
{
+ Being::setHairStyle(style);
+
AnimatedSprite *newHairSprite = new AnimatedSprite(
- "graphics/sprites/hairstyle" + toString(style) + ".xml",
+ "graphics/sprites/hairstyle" + toString(mHairStyle) + ".xml",
mHairColor);
newHairSprite->setDirection(getSpriteDirection());
@@ -169,8 +171,6 @@ Player::setHairStyle(Uint16 style)
setAction(mAction);
}
-
- Being::setHairStyle(style);
}
void