diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-11-02 04:40:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-11-02 04:41:47 +0300 |
commit | b90214b9878246ec45e68c0c6c309337d8e15ef2 (patch) | |
tree | ea977f4aaf1bc2ab8cd86f77103d1bc9cee9e1d9 /src/gui/statuspopup.cpp | |
parent | 17631dacf2cb8ebc3acc1dae9df0729a80a150d9 (diff) | |
download | plus-b90214b9878246ec45e68c0c6c309337d8e15ef2.tar.gz plus-b90214b9878246ec45e68c0c6c309337d8e15ef2.tar.bz2 plus-b90214b9878246ec45e68c0c6c309337d8e15ef2.tar.xz plus-b90214b9878246ec45e68c0c6c309337d8e15ef2.zip |
Add option to yellow bar to change player attack in pvp mode.
Modes: attack all, attack not friends, attack bad relations,
dont attack players.
Diffstat (limited to 'src/gui/statuspopup.cpp')
-rw-r--r-- | src/gui/statuspopup.cpp | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/src/gui/statuspopup.cpp b/src/gui/statuspopup.cpp index 9807fac47..5f2ec71e3 100644 --- a/src/gui/statuspopup.cpp +++ b/src/gui/statuspopup.cpp @@ -75,29 +75,33 @@ StatusPopup::StatusPopup(): mMagicAttackType->setPosition(getPadding(), 4 + 6 * fontHeight + getPadding()); + mPvpAttackType = new Label; + mPvpAttackType->setPosition(getPadding(), + 4 + 7 * fontHeight + getPadding()); + mDropCounter = new Label; - mDropCounter->setPosition(getPadding(), 8 + 7 * fontHeight + getPadding()); + mDropCounter->setPosition(getPadding(), 8 + 8 * fontHeight + getPadding()); mPickUpType = new Label; - mPickUpType->setPosition(getPadding(), 8 + 8 * fontHeight + getPadding()); + mPickUpType->setPosition(getPadding(), 8 + 9 * fontHeight + getPadding()); mMapType = new Label; - mMapType->setPosition(getPadding(), 12 + 9 * fontHeight + getPadding()); + mMapType->setPosition(getPadding(), 12 + 10 * fontHeight + getPadding()); mImitationMode = new Label; mImitationMode->setPosition(getPadding(), - 16 + 10 * fontHeight + getPadding()); + 16 + 11 * fontHeight + getPadding()); mAwayMode = new Label; - mAwayMode->setPosition(getPadding(), 16 + 11 * fontHeight + getPadding()); + mAwayMode->setPosition(getPadding(), 16 + 12 * fontHeight + getPadding()); mCameraMode = new Label; mCameraMode->setPosition(getPadding(), - 16 + 12 * fontHeight + getPadding()); + 16 + 13 * fontHeight + getPadding()); mDisableGameModifiers = new Label; mDisableGameModifiers->setPosition(getPadding(), - 20 + 13 * fontHeight + getPadding()); + 20 + 14 * fontHeight + getPadding()); add(mMoveType); add(mCrazyMoveType); @@ -109,6 +113,7 @@ StatusPopup::StatusPopup(): add(mPickUpType); add(mMapType); add(mMagicAttackType); + add(mPvpAttackType); add(mDisableGameModifiers); add(mImitationMode); add(mAwayMode); @@ -145,6 +150,8 @@ void StatusPopup::update() minWidth = mMapType->getWidth(); if (mMagicAttackType->getWidth() > minWidth) minWidth = mMagicAttackType->getWidth(); + if (mPvpAttackType->getWidth() > minWidth) + minWidth = mPvpAttackType->getWidth(); if (mDisableGameModifiers->getWidth() > minWidth) minWidth = mDisableGameModifiers->getWidth(); if (mAwayMode->getWidth() > minWidth) @@ -476,6 +483,31 @@ void StatusPopup::updateLabels() } mMagicAttackType->adjustSize(); + switch (player_node->getPvpAttackType()) + { + case 0: + setLabelText(mPvpAttackType, _("(a) attack all players"), + keyboard.KEY_SWITCH_PVP_ATTACK); + break; + case 1: + setLabelText(mPvpAttackType, _("(f) attack not friends"), + keyboard.KEY_SWITCH_PVP_ATTACK); + break; + case 2: + setLabelText(mPvpAttackType, _("(b) attack bad relations"), + keyboard.KEY_SWITCH_PVP_ATTACK); + break; + case 3: + setLabelText(mPvpAttackType, _("(d) dont attack players"), + keyboard.KEY_SWITCH_PVP_ATTACK); + break; + default: + setLabelText(mMagicAttackType, _("(?) pvp attack"), + keyboard.KEY_SWITCH_MAGIC_ATTACK); + break; + } + mPvpAttackType->adjustSize(); + switch (player_node->getImitationMode()) { case 0: |