From 827f91446c550fdf066cb9bec1d6b15ae8662b78 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Jan 2011 04:52:43 +0200 Subject: Add gettext to missing strings. Update POTFILES.in and update russian translation. --- src/being.cpp | 3 ++- src/gui/charselectdialog.cpp | 2 +- src/gui/login.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 08893c2f4..3a9285750 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -71,6 +71,7 @@ #include "gui/widgets/chattab.h" #include "utils/dtor.h" +#include "utils/gettext.h" #include "utils/stringutils.h" #include "utils/xml.h" @@ -476,7 +477,7 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) gcn::Font *font = 0; std::string damage = amount ? toString(amount) : type == FLEE ? - "dodge" : "miss"; + _("dodge") : _("miss"); const gcn::Color *color; if (gui) diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index d95930108..da1f59e46 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -433,7 +433,7 @@ void CharacterDisplay::update() mButton->setCaption(_("Choose")); mButton->setActionEventId("use"); mName->setCaption(strprintf("%s", character->getName().c_str())); - mLevel->setCaption(strprintf("Level %d", + mLevel->setCaption(strprintf(_("Level %d"), mCharacter->data.mAttributes[LEVEL])); mMoney->setCaption(Units::formatCurrency( mCharacter->data.mAttributes[MONEY])); diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 997895c95..b6139c6d0 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -53,9 +53,9 @@ std::string LoginDialog::savedPasswordKey = ""; const char *UPDATE_TYPE_TEXT[3] = { - _("Normal"), - _("Auto Close"), - _("Skip"), + N_("Normal"), + N_("Auto Close"), + N_("Skip"), }; class UpdateTypeModel : public gcn::ListModel @@ -74,7 +74,7 @@ public: if (i >= getNumberOfElements() || i < 0) return _("???"); - return UPDATE_TYPE_TEXT[i]; + return gettext(UPDATE_TYPE_TEXT[i]); } }; -- cgit v1.2.3-70-g09d2 From 2c0421a336789347664078383fad45c29b0a9d10 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Jan 2011 21:18:01 +0200 Subject: Fix log errors about missing xml attributes. --- src/resources/itemdb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index cc70e33b7..33978192f 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -67,7 +67,7 @@ void ItemDB::setStatsList(const std::list &stats) static ItemType itemTypeFromString(const std::string &name) { - if (name == "generic") + if (name == "generic" || name == "other") { return ITEM_UNUSABLE; } @@ -298,7 +298,7 @@ void ItemDB::load() logger->log("ItemDB: Missing " #param " attribute for item %i!", \ id) - if (id >= 0) + if (id >= 0 && typeStr != "other") { CHECK_PARAM(name, ""); CHECK_PARAM(description, ""); -- cgit v1.2.3-70-g09d2 From 6941cbc58099ee54ba326382eaf4de805d933e0e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Jan 2011 21:23:53 +0200 Subject: Add missing default value for wallpaperFile to branding defaults. --- src/defaults.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/defaults.cpp b/src/defaults.cpp index 0628aa72c..916c20398 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -219,6 +219,8 @@ DefaultsData* getBrandingDefaults() AddDEF(brandingData, "guiPath", "graphics/gui/"); AddDEF(brandingData, "guiThemePath", "themes/"); AddDEF(brandingData, "fontsPath", "fonts/"); + + AddDEF(brandingData, "wallpaperFile", ""); return brandingData; } -- cgit v1.2.3-70-g09d2 From 1c49a83df05dbf6837687e1bfc5b142a680144ed Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Jan 2011 22:56:42 +0200 Subject: Add hp bar to local player. --- src/being.cpp | 46 ++++++++++++++++++++++++++-------------------- src/being.h | 3 ++- src/defaults.cpp | 1 + src/gui/setup_colors.cpp | 2 ++ src/gui/setup_other.cpp | 17 ++++++++++++++++- src/gui/setup_other.h | 3 +++ src/gui/userpalette.cpp | 5 +++++ src/gui/userpalette.h | 2 ++ 8 files changed, 57 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 3a9285750..2372cfe1b 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -169,6 +169,7 @@ bool Being::mLowTraffic = true; bool Being::mDrawHotKeys = true; bool Being::mShowBattleEvents = false; bool Being::mShowMobHP = false; +bool Being::mShowOwnHP = false; std::list beingInfoCache; @@ -1551,6 +1552,7 @@ void Being::reReadConfig() mDrawHotKeys = config.getBoolValue("drawHotKeys"); mShowBattleEvents = config.getBoolValue("showBattleEvents"); mShowMobHP = config.getBoolValue("showMobHP"); + mShowOwnHP = config.getBoolValue("showOwnHP"); mUpdateConfigTime = cur_time; } @@ -1745,42 +1747,48 @@ bool Being::drawSpriteAt(Graphics *graphics, int x, int y) const 2 * attackRange + 32, 2 * attackRange + 32)); } - if (mShowMobHP && player_node && player_node->getTarget() == this + if (mShowMobHP && mInfo && player_node && player_node->getTarget() == this && getType() == MONSTER) { // show hp bar here - drawHpBar(graphics, x - 50 + 16, y + 32 - 6, 2 * 50, 4); + int maxHP = mMaxHP; + if (!maxHP) + maxHP = mInfo->getMaxHP(); + + drawHpBar(graphics, maxHP, mHP, mDamageTaken, + UserPalette::MONSTER_HP, UserPalette::MONSTER_HP2, + x - 50 + 16, y + 32 - 6, 2 * 50, 4); + } + if (mShowOwnHP && player_node == this) + { + drawHpBar(graphics, PlayerInfo::getAttribute(MAX_HP), + PlayerInfo::getAttribute(HP), 0, + UserPalette::PLAYER_HP, UserPalette::PLAYER_HP2, + x - 50 + 16, y + 32 - 6, 2 * 50, 4); } return res; } -void Being::drawHpBar(Graphics *graphics, int x, int y, +void Being::drawHpBar(Graphics *graphics, int maxHP, int hp, int damage, + int color1, int color2, int x, int y, int width, int height) const { - if (!mInfo) - return; - - int maxHP = mMaxHP; - - if (!maxHP) - maxHP = mInfo->getMaxHP(); - if (maxHP <= 0) return; - if (!mHP && maxHP < mHP) + if (!hp && maxHP < hp) return; float p; - if (mHP) + if (hp) { - p = static_cast(maxHP) / static_cast(mHP); + p = static_cast(maxHP) / static_cast(hp); } - else if (maxHP != mDamageTaken) + else if (maxHP != damage) { p = static_cast(maxHP) - / static_cast(maxHP - mDamageTaken); + / static_cast(maxHP - damage); } else { @@ -1792,8 +1800,7 @@ void Being::drawHpBar(Graphics *graphics, int x, int y, int dx = width / p; - graphics->setColor(userPalette->getColorWithAlpha( - UserPalette::MONSTER_HP)); + graphics->setColor(userPalette->getColorWithAlpha(color1)); graphics->fillRectangle(gcn::Rectangle( x, y, dx, height)); @@ -1801,8 +1808,7 @@ void Being::drawHpBar(Graphics *graphics, int x, int y, if (width - dx <= 0) return; - graphics->setColor(userPalette->getColorWithAlpha( - UserPalette::MONSTER_HP2)); + graphics->setColor(userPalette->getColorWithAlpha(color2)); graphics->fillRectangle(gcn::Rectangle( x + dx, y, width - dx, height)); diff --git a/src/being.h b/src/being.h index 09466f5af..f9731366a 100644 --- a/src/being.h +++ b/src/being.h @@ -520,6 +520,7 @@ class Being : public ActorSprite, public ConfigListener int posX, int posY) const; void drawHpBar(Graphics *graphics, int x, int y, + int maxHP, int hp, int damage, int color1, int color2, int width, int height) const; static void load(); @@ -751,7 +752,7 @@ class Being : public ActorSprite, public ConfigListener static bool mDrawHotKeys; static bool mShowBattleEvents; static bool mShowMobHP; -// std::string mDisplayName; + static bool mShowOwnHP; unsigned int mMoveTime; unsigned int mAttackTime; diff --git a/src/defaults.cpp b/src/defaults.cpp index 916c20398..190c1816c 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -189,6 +189,7 @@ DefaultsData* getConfigDefaults() AddDEF(configData, "enableBattleTab", false); AddDEF(configData, "showBattleEvents", false); AddDEF(configData, "showMobHP", true); + AddDEF(configData, "showOwnHP", true); return configData; } diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp index 76510a283..68d517cae 100644 --- a/src/gui/setup_colors.cpp +++ b/src/gui/setup_colors.cpp @@ -302,6 +302,8 @@ void Setup_Colors::valueChanged(const gcn::SelectionEvent &event _UNUSED_) case UserPalette::ROAD_POINT: case UserPalette::MONSTER_HP: case UserPalette::MONSTER_HP2: + case UserPalette::PLAYER_HP: + case UserPalette::PLAYER_HP2: mGradDelayLabel->setCaption(_("Alpha:")); mGradDelayText->setRange(0, 255); mGradDelaySlider->setScale(0, 255); diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp index 54ec1c65d..5a2b77a81 100644 --- a/src/gui/setup_other.cpp +++ b/src/gui/setup_other.cpp @@ -63,6 +63,7 @@ #define ACTION_WARP_PARTICLE "warp particle" #define ACTION_AUTO_SHOP "auto shop" #define ACTION_SHOW_MOB_HP "show mob hp" +#define ACTION_SHOW_OWN_HP "show own hp" Setup_Other::Setup_Other(): mShowMonstersTakedDamage(config.getBoolValue("showMonstersTakedDamage")), @@ -87,7 +88,8 @@ Setup_Other::Setup_Other(): mQuickStats(config.getBoolValue("quickStats")), mWarpParticle(config.getBoolValue("warpParticle")), mAutoShop(config.getBoolValue("autoShop")), - mShowMobHP(config.getBoolValue("showMobHP")) + mShowMobHP(config.getBoolValue("showMobHP")), + mShowOwnHP(config.getBoolValue("showOwnHP")) { setName(_("Misc")); @@ -178,6 +180,10 @@ Setup_Other::Setup_Other(): mShowMobHP, this, ACTION_SHOW_MOB_HP); + mShowOwnHPCheckBox = new CheckBox(_("Show own hp bar"), + mShowOwnHP, + this, ACTION_SHOW_OWN_HP); + // Do the layout LayoutHelper h(this); ContainerPlacer place = h.getPlacer(0, 0); @@ -192,6 +198,7 @@ Setup_Other::Setup_Other(): place(12, 4, mWarpParticleCheckBox, 10); place(12, 5, mAutoShopCheckBox, 10); place(12, 6, mShowMobHPCheckBox, 10); + place(12, 7, mShowOwnHPCheckBox, 10); place(0, 3, mFloorItemsHighlightCheckBox, 12); place(0, 4, mHighlightAttackRangeCheckBox, 12); place(0, 5, mHighlightMonsterAttackRangeCheckBox, 12); @@ -320,6 +327,10 @@ void Setup_Other::action(const gcn::ActionEvent &event) { mShowMobHP = mShowMobHPCheckBox->isSelected(); } + else if (event.getId() == ACTION_SHOW_OWN_HP) + { + mShowOwnHP = mShowOwnHPCheckBox->isSelected(); + } } void Setup_Other::cancel() @@ -389,6 +400,9 @@ void Setup_Other::cancel() mShowMobHP = config.getBoolValue("showMobHP"); mShowMobHPCheckBox->setSelected(mShowMobHP); + + mShowOwnHP = config.getBoolValue("showOwnHP"); + mShowOwnHPCheckBox->setSelected(mShowOwnHP); } void Setup_Other::apply() @@ -416,6 +430,7 @@ void Setup_Other::apply() config.setValue("warpParticle", mWarpParticle); config.setValue("autoShop", mAutoShop); config.setValue("showMobHP", mShowMobHP); + config.setValue("showOwnHP", mShowOwnHP); logger->setDebugLog(mDebugLog); } diff --git a/src/gui/setup_other.h b/src/gui/setup_other.h index b20401be5..6a092e93f 100644 --- a/src/gui/setup_other.h +++ b/src/gui/setup_other.h @@ -119,6 +119,9 @@ class Setup_Other : public SetupTab, public gcn::ActionListener gcn::CheckBox *mShowMobHPCheckBox; bool mShowMobHP; + gcn::CheckBox *mShowOwnHPCheckBox; + bool mShowOwnHP; + EditDialog *mEditDialog; }; diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp index 03e5c1eed..46f1b72b3 100644 --- a/src/gui/userpalette.cpp +++ b/src/gui/userpalette.cpp @@ -52,6 +52,8 @@ const std::string ColorTypeNames[] = "ColorParticle", "ColorPickupInfo", "ColorExpInfo", + "ColorPlayerHp", + "ColorPlayerHp2", "ColorHitPlayerMonster", "ColorHitMonsterPlayer", "ColorHitPlayerPlayer", @@ -124,6 +126,9 @@ UserPalette::UserPalette(): addColor(PARTICLE, 0xffffff, STATIC, _("Particle Effects")); addColor(PICKUP_INFO, 0x28dc28, STATIC, _("Pickup Notification")); addColor(EXP_INFO, 0xffff00, STATIC, _("Exp Notification")); + addColor(PLAYER_HP, 0x00ff00, STATIC, _("Player HP bar"), 50); + addColor(PLAYER_HP2, 0xff0000, STATIC, + _("Player HP bar (second color)"), 50); addColor(HIT_PLAYER_MONSTER, 0x0064ff, STATIC, _("Player Hits Monster")); addColor(HIT_MONSTER_PLAYER, 0xff3232, STATIC, _("Monster Hits Player")); addColor(HIT_PLAYER_PLAYER, 0xff5050, STATIC, diff --git a/src/gui/userpalette.h b/src/gui/userpalette.h index 057d47113..db2463e20 100644 --- a/src/gui/userpalette.h +++ b/src/gui/userpalette.h @@ -53,6 +53,8 @@ class UserPalette : public Palette, public gcn::ListModel PARTICLE, PICKUP_INFO, EXP_INFO, + PLAYER_HP, + PLAYER_HP2, HIT_PLAYER_MONSTER, HIT_MONSTER_PLAYER, HIT_PLAYER_PLAYER, -- cgit v1.2.3-70-g09d2 From ef7f53e43ce4306080efae3b86443a6016a3e66a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 6 Jan 2011 21:25:25 +0200 Subject: Set sound volume depends on distance to object. --- src/being.cpp | 14 +++++++++++--- src/sound.cpp | 32 ++++++++++++++++++++++++++++++++ src/sound.h | 2 ++ 3 files changed, 45 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 2372cfe1b..1d8178670 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -568,7 +568,15 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) mDamageTaken += amount; if (mInfo) { - sound.playSfx(mInfo->getSound(SOUND_EVENT_HURT)); + if (attacker) + { + sound.playSfx(mInfo->getSound(SOUND_EVENT_HURT), + attacker->getTileX(), attacker->getTileY()); + } + else + { + sound.playSfx(mInfo->getSound(SOUND_EVENT_HURT)); + } if (!mInfo->isStaticMaxHP()) { if (!mHP && mInfo->getMaxHP() < mDamageTaken) @@ -618,7 +626,7 @@ void Being::handleAttack(Being *victim, int damage, } sound.playSfx(mInfo->getSound((damage > 0) ? - SOUND_EVENT_HIT : SOUND_EVENT_MISS)); + SOUND_EVENT_HIT : SOUND_EVENT_MISS), mX, mY); } void Being::setName(const std::string &name) @@ -904,7 +912,7 @@ void Being::setAction(Action action, int attackType _UNUSED_) case DEAD: currentAction = SpriteAction::DEAD; if (mInfo) - sound.playSfx(mInfo->getSound(SOUND_EVENT_DIE)); + sound.playSfx(mInfo->getSound(SOUND_EVENT_DIE), mX, mY); break; case STAND: currentAction = SpriteAction::STAND; diff --git a/src/sound.cpp b/src/sound.cpp index 8742ce361..080426a39 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -22,6 +22,7 @@ #include #include "configuration.h" +#include "localplayer.h" #include "log.h" #include "sound.h" @@ -280,6 +281,37 @@ void Sound::playSfx(const std::string &path) } } +void Sound::playSfx(const std::string &path, int x, int y) +{ + if (!mInstalled || path.empty() || !mPlayBattle) + return; + + std::string tmpPath; + if (!path.find("sfx/")) + tmpPath = path; + else + tmpPath = paths.getValue("sfx", "sfx/") + path; + ResourceManager *resman = ResourceManager::getInstance(); + SoundEffect *sample = resman->getSoundEffect(tmpPath); + if (sample) + { + logger->log("Sound::playSfx() Playing: %s", path.c_str()); + int vol = 120; + if (player_node) + { + int dx = player_node->getTileX() - x; + int dy = player_node->getTileY() - y; + if (dx < 0) + dx = -dx; + if (dy < 0) + dy = -dy; + int dist = dx > dy ? dx : dy; + vol -= dist * 8; + } + sample->play(0, vol); + } +} + void Sound::playGuiSfx(const std::string &path) { if (!mInstalled || path.empty() || !mPlayGui) diff --git a/src/sound.h b/src/sound.h index 100c228c1..92c0ab41a 100644 --- a/src/sound.h +++ b/src/sound.h @@ -93,6 +93,8 @@ class Sound : public ConfigListener */ void playSfx(const std::string &path); + void playSfx(const std::string &path, int x, int y); + /** * Plays an item for gui. * -- cgit v1.2.3-70-g09d2 From 871fb6eee49c142be78315cc97c1c8e29daf7d61 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 8 Jan 2011 05:35:20 +0200 Subject: Add support for drawing new slots as sprites. --- src/localplayer.cpp | 3 ++- src/net/tmwa/beinghandler.cpp | 8 ++++++++ src/net/tmwa/inventoryhandler.cpp | 4 ++-- src/net/tmwa/protocol.h | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index edff2ce67..207e71bf5 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -3344,6 +3344,7 @@ void LocalPlayer::imitateOutfit(Being *player, int sprite) if (mImitationMode == 1 && !player_imitated.empty() && player->getName() == player_imitated) { +// logger->log("have equip %d", sprite); // std::string filename = ItemDB::get( // player->getId()).getSprite(mGender); // logger->log("LocalPlayer::imitateOutfit sprite: " + toString(sprite)); @@ -3383,7 +3384,7 @@ void LocalPlayer::imitateOutfit(Being *player, int sprite) } else { -// logger->log("have unequip"); +// logger->log("have unequip %d", sprite); int equipmentSlot = Net::getInventoryHandler() ->convertFromServerSlot(sprite); diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index ea4978a20..9c75689a4 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -674,6 +674,14 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) dstBeing->setSprite(SPRITE_MISC2, id); player_node->imitateOutfit(dstBeing, SPRITE_MISC2); break; + case 14: + dstBeing->setSprite(SPRITE_EVOL1, id); + player_node->imitateOutfit(dstBeing, SPRITE_EVOL1); + break; + case 15: + dstBeing->setSprite(SPRITE_EVOL2, id); + player_node->imitateOutfit(dstBeing, SPRITE_EVOL2); + break; default: logger->log("QQQ3 CHANGE_LOOKS: unsupported type: " "%d, id: %d", type, id); diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index b4b38e623..3cc0e9ce0 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -77,8 +77,8 @@ const Equipment::Slot EQUIP_CONVERT[] = Equipment::EQUIP_GLOVES_SLOT, // SPRITE_GLOVES Equipment::EQUIP_FIGHT1_SLOT, // SPRITE_WEAPON Equipment::EQUIP_FIGHT2_SLOT, // SPRITE_SHIELD - Equipment::EQUIP_PROJECTILE_SLOT, // 0 - Equipment::EQUIP_PROJECTILE_SLOT, // 0 + Equipment::EQUIP_EVOL_RING1_SLOT, // SPRITE_EVOL1 + Equipment::EQUIP_EVOL_RING2_SLOT, // SPRITE_EVOL2 Equipment::EQUIP_PROJECTILE_SLOT, // 0 }; diff --git a/src/net/tmwa/protocol.h b/src/net/tmwa/protocol.h index 6001fae3b..83854c4c6 100644 --- a/src/net/tmwa/protocol.h +++ b/src/net/tmwa/protocol.h @@ -59,6 +59,8 @@ enum SPRITE_GLOVES, SPRITE_WEAPON, SPRITE_SHIELD, + SPRITE_EVOL1, + SPRITE_EVOL2, SPRITE_VECTOREND }; -- cgit v1.2.3-70-g09d2 From 56fab7f1b449aa4b90e238c93bc8a24d8b14f568 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 8 Jan 2011 19:00:11 +0200 Subject: Change version to 1.1.1.9. --- data/help/header.txt | 2 +- packwin | 2 +- src/main.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/data/help/header.txt b/data/help/header.txt index 3e60eebd4..1eec0df3c 100644 --- a/data/help/header.txt +++ b/data/help/header.txt @@ -2,7 +2,7 @@ ##1 M A N A P L U S ##1 ================================ - ##2Version:##6 1.0.12.26 ##2Date:##3 26 December 2010 + ##2Version:##6 1.1.1.9 ##2Date:##3 09 January 2011 ##2 Website: http://tmw.cetki.com/ ##2 http://mana.cetki.com/ diff --git a/packwin b/packwin index a5e2307eb..4b3139242 100755 --- a/packwin +++ b/packwin @@ -5,7 +5,7 @@ dir=`pwd` cd packaging/windows ./make-translations.sh makensis -DDLLDIR=$dir/../mana_win/libs/dll/ \ - -DPRODUCT_VERSION="4144-1.0.12.26" \ + -DPRODUCT_VERSION="4144-1.1.1.9" \ -DEXESUFFIX=/src \ -DUPX=true \ setup.nsi diff --git a/src/main.h b/src/main.h index 480c9d374..e9dd8abb2 100644 --- a/src/main.h +++ b/src/main.h @@ -86,8 +86,8 @@ //define DEBUG_FONT_COUNTERS 1 //define DEBUG_ALPHA_CACHE 1 -#define SMALL_VERSION "1.0.12.26" -#define CHECK_VERSION "01.00.12.26" +#define SMALL_VERSION "1.1.1.9" +#define CHECK_VERSION "01.01.01.09" #define PACKAGE_EXTENDED_VERSION "ManaPlus (" PACKAGE_OS \ -- cgit v1.2.3-70-g09d2 From c674793a8657aa099c9637c92f8696f230c327ca Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 10 Jan 2011 00:07:12 +0200 Subject: Add persistent ip as connection option. Usefull is player using some kind of port mapping. --- src/defaults.cpp | 1 + src/gui/serverdialog.cpp | 18 ++++++++++++------ src/gui/serverdialog.h | 2 ++ src/net/tmwa/charserverhandler.cpp | 10 +++++++++- src/net/tmwa/loginhandler.cpp | 5 ++++- 5 files changed, 28 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/defaults.cpp b/src/defaults.cpp index 190c1816c..da5aa4e84 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -190,6 +190,7 @@ DefaultsData* getConfigDefaults() AddDEF(configData, "showBattleEvents", false); AddDEF(configData, "showMobHP", true); AddDEF(configData, "showOwnHP", true); + AddDEF(configData, "usePersistentIP", false); return configData; } diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index c7e1d0f94..3556efc35 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -211,7 +211,8 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): mDownload(0), mDownloadProgress(-1.0f), mServers(ServerInfos()), - mServerInfo(serverInfo) + mServerInfo(serverInfo), + mPersistentIPCheckBox(false) { if (isSafeMode) setCaption("Choose Your Server *** SAFE MODE ***"); @@ -223,6 +224,9 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): Label *typeLabel = new Label(_("Server type:")); mServerNameField = new TextField(mServerInfo->hostname); mPortField = new TextField(toString(mServerInfo->port)); + mPersistentIPCheckBox = new CheckBox(_("Use same ip for game sub servers"), + config.getBoolValue("usePersistentIP"), + this, "persitent ip"); loadCustomServers(); @@ -264,11 +268,12 @@ ServerDialog::ServerDialog(ServerInfo *serverInfo, const std::string &dir): place(1, 2, mTypeField, 5).setPadding(3); place(0, 3, usedScroll, 6, 5).setPadding(3); place(0, 8, mDescription, 6); - place(0, 9, mManualEntryButton); - place(1, 9, mDeleteButton); - place(2, 9, mLoadButton); - place(4, 9, mQuitButton); - place(5, 9, mConnectButton); + place(0, 9, mPersistentIPCheckBox, 6); + place(0, 10, mManualEntryButton); + place(1, 10, mDeleteButton); + place(2, 10, mLoadButton); + place(4, 10, mQuitButton); + place(5, 10, mConnectButton); // Make sure the list has enough height getLayout().setRowHeight(3, 80); @@ -390,6 +395,7 @@ void ServerDialog::action(const gcn::ActionEvent &event) LoginDialog::savedPassword = ""; } + config.setValue("usePersistentIP", mPersistentIPCheckBox->isSelected()); Client::setState(STATE_CONNECT_SERVER); } } diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index b9a67e246..e16dd09b5 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -23,6 +23,7 @@ #define SERVERDIALOG_H #include "gui/widgets/window.h" +#include "gui/widgets/checkbox.h" #include "net/download.h" #include "net/serverinfo.h" @@ -199,6 +200,7 @@ class ServerDialog : public Window, ServerInfos mServers; ServerInfo *mServerInfo; + CheckBox *mPersistentIPCheckBox; }; #endif diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index e500f667b..4bf9df8b3 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -160,7 +160,15 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) PlayerInfo::setCharId(msg.readInt32()); GameHandler *gh = static_cast(Net::getGameHandler()); gh->setMap(msg.readString(16)); - mapServer.hostname = ipToString(msg.readInt32()); + if (config.getBoolValue("usePersistentIP")) + { + msg.readInt32(); + mapServer.hostname = Client::getServerName(); + } + else + { + mapServer.hostname = ipToString(msg.readInt32()); + } mapServer.port = msg.readInt16(); // Prevent the selected local player from being deleted diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index 73fec1322..05a28513c 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -288,7 +288,10 @@ void LoginHandler::chooseServer(unsigned int server) return; charServer.clear(); - charServer.hostname = ipToString(mWorlds[server]->address); + if (config.getBoolValue("usePersistentIP")) + charServer.hostname = Client::getServerName(); + else + charServer.hostname = ipToString(mWorlds[server]->address); charServer.port = mWorlds[server]->port; Client::setState(STATE_UPDATE); -- cgit v1.2.3-70-g09d2 From f5a4406eaa3574ba7661b8282afcb2f10ec538c0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 10 Jan 2011 03:39:04 +0200 Subject: Fix skill points updating. --- src/net/tmwa/playerhandler.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 1d0d3e67d..8ef19c373 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -35,6 +35,7 @@ #include "gui/npcdialog.h" #include "gui/okdialog.h" #include "gui/sell.h" +#include "gui/skilldialog.h" #include "gui/statuswindow.h" #include "gui/viewport.h" @@ -314,6 +315,8 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) break; case 0x000c: PlayerInfo::setAttribute(SKILL_POINTS, value); + if (skillDialog) + skillDialog->update(); break; case 0x0018: if (!weightNotice) -- cgit v1.2.3-70-g09d2 From 5992d792bc8dffc92251cea4d292635943801520 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 10 Jan 2011 19:55:38 +0200 Subject: Hide own hp bar if player dead. --- src/being.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 1d8178670..4f31e402c 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -1767,7 +1767,7 @@ bool Being::drawSpriteAt(Graphics *graphics, int x, int y) const UserPalette::MONSTER_HP, UserPalette::MONSTER_HP2, x - 50 + 16, y + 32 - 6, 2 * 50, 4); } - if (mShowOwnHP && player_node == this) + if (mShowOwnHP && player_node == this && mAction != DEAD) { drawHpBar(graphics, PlayerInfo::getAttribute(MAX_HP), PlayerInfo::getAttribute(HP), 0, -- cgit v1.2.3-70-g09d2 From ef1b9856c86512fe73154c17da3ea98a7cd5f896 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 10 Jan 2011 22:04:25 +0200 Subject: Add more selling error messages. --- src/net/tmwa/buysellhandler.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index bdc372238..84a02e92a 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -139,12 +139,22 @@ void BuySellHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_NPC_SELL_RESPONSE: - if (msg.readInt8() == 0) - SERVER_NOTICE(_("Thanks for selling.")) - else - SERVER_NOTICE(_("Unable to sell.")) - - break; + switch (msg.readInt8()) + { + case 0: + SERVER_NOTICE(_("Thanks for selling.")) + break; + case 1: + default: + SERVER_NOTICE(_("Unable to sell.")) + break; + case 2: + SERVER_NOTICE(_("Unable to sell while trading.")) + break; + case 3: + SERVER_NOTICE(_("Unable to sell unsellable item.")) + break; + } default: break; } -- cgit v1.2.3-70-g09d2