From b90214b9878246ec45e68c0c6c309337d8e15ef2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 2 Nov 2011 04:40:58 +0300 Subject: Add option to yellow bar to change player attack in pvp mode. Modes: attack all, attack not friends, attack bad relations, dont attack players. --- src/gui/ministatuswindow.cpp | 2 +- src/gui/statuspopup.cpp | 46 +++++++++++++++++++++++++++++++++++++------- src/gui/statuspopup.h | 1 + src/gui/statuswindow.cpp | 19 ++++++++++++++++++ 4 files changed, 60 insertions(+), 8 deletions(-) (limited to 'src/gui') diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp index 3e66f42cb..d307dfed0 100644 --- a/src/gui/ministatuswindow.cpp +++ b/src/gui/ministatuswindow.cpp @@ -100,7 +100,7 @@ MiniStatusWindow::MiniStatusWindow(): mArrowsBar = createBar(0, 50, 20, Theme::PROG_INVY_SLOTS, "arrows bar", _("arrows bar")); - mStatusBar = createBar(100, 150, 20, Theme::PROG_EXP, + mStatusBar = createBar(100, 165, 20, Theme::PROG_EXP, "status bar", _("status bar")); loadBars(); 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: diff --git a/src/gui/statuspopup.h b/src/gui/statuspopup.h index 802b077a6..2af8064c5 100644 --- a/src/gui/statuspopup.h +++ b/src/gui/statuspopup.h @@ -72,6 +72,7 @@ class StatusPopup : public Popup gcn::Label *mPickUpType; gcn::Label *mMapType; gcn::Label *mMagicAttackType; + gcn::Label *mPvpAttackType; gcn::Label *mDisableGameModifiers; gcn::Label *mImitationMode; gcn::Label *mAwayMode; diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 92e69b394..bd88fad7e 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -787,6 +787,25 @@ void StatusWindow::updateStatusBar(ProgressBar *bar, bool percent A_UNUSED) break; } + switch (player_node->getPvpAttackType()) + { + case 0: + str += translateLetter(N_("(a)")); + break; + case 1: + str += translateLetter(N_("(f)")); + break; + case 2: + str += translateLetter(N_("(b)")); + break; + case 3: + str += translateLetter(N_("(d)")); + break; + default: + str += translateLetter(N_("(?)")); + break; + } + str += " " + toString(player_node->getQuickDropCounter()); switch (player_node->getPickUpType()) -- cgit v1.2.3-60-g2f50