summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-02 04:40:58 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-02 04:41:47 +0300
commitb90214b9878246ec45e68c0c6c309337d8e15ef2 (patch)
treeea977f4aaf1bc2ab8cd86f77103d1bc9cee9e1d9 /src/gui
parent17631dacf2cb8ebc3acc1dae9df0729a80a150d9 (diff)
downloadplus-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')
-rw-r--r--src/gui/ministatuswindow.cpp2
-rw-r--r--src/gui/statuspopup.cpp46
-rw-r--r--src/gui/statuspopup.h1
-rw-r--r--src/gui/statuswindow.cpp19
4 files changed, 60 insertions, 8 deletions
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())