summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-08 03:25:29 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-08 03:25:29 +0300
commita88d005220997d4c66d3a97ae8fd857a7dd3c307 (patch)
treecebc4b8388f33da27f24b727d2fe531e0f4acf2d /src/gui
parent27c3646d10e0c5d25905d7afc7a43289159f711b (diff)
downloadplus-a88d005220997d4c66d3a97ae8fd857a7dd3c307.tar.gz
plus-a88d005220997d4c66d3a97ae8fd857a7dd3c307.tar.bz2
plus-a88d005220997d4c66d3a97ae8fd857a7dd3c307.tar.xz
plus-a88d005220997d4c66d3a97ae8fd857a7dd3c307.zip
Show players statuses near nicks.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/setup_players.cpp14
-rw-r--r--src/gui/setup_players.h5
2 files changed, 18 insertions, 1 deletions
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp
index 407eca42a..67ec053ea 100644
--- a/src/gui/setup_players.cpp
+++ b/src/gui/setup_players.cpp
@@ -261,6 +261,7 @@ Setup_Players::Setup_Players():
mSecureTrades(config.getBoolValue("securetrades")),
mUnsecureChars(config.getStringValue("unsecureChars")),
mVisibleNamesEnabled(config.getBoolValue("visiblenames")),
+ mShowPlayersStatus(config.getBoolValue("showPlayersStatus")),
mEditDialog(0)
{
setName(_("Players"));
@@ -337,6 +338,11 @@ Setup_Players::Setup_Players():
mVisibleNamesCheckBox->setActionEventId("visiblenames");
mVisibleNamesCheckBox->addActionListener(this);
+ mShowPlayersStatusCheckBox = new CheckBox(_("Show statuses"),
+ mShowPlayersStatus);
+ mShowPlayersStatusCheckBox->setActionEventId("showPlayersStatus");
+ mShowPlayersStatusCheckBox->addActionListener(this);
+
reset();
// Do the layout
@@ -357,6 +363,7 @@ Setup_Players::Setup_Players():
place(3, 8, mSecureTradesCheckBox, 3);
place(3, 9, mUnsecureCharsLabel, 3);
place(3, 10, mUnsecureCharsField, 2);
+ place(3, 11, mShowPlayersStatusCheckBox, 2);
place(5, 10, mUnsecureCharsButton, 1);
place(0, 9, mWhisperTabCheckBox, 3).setPadding(4);
place(0, 10, mTargetDeadCheckBox, 3).setPadding(4);
@@ -415,6 +422,7 @@ void Setup_Players::apply()
config.setValue("securetrades", mSecureTrades);
config.setValue("unsecureChars", mUnsecureCharsField->getText());
config.setValue("visiblenames", mVisibleNamesEnabled);
+ config.setValue("showPlayersStatus", mShowPlayersStatus);
if (actorSpriteManager)
actorSpriteManager->updatePlayerNames();
@@ -441,6 +449,8 @@ void Setup_Players::cancel()
mUnsecureCharsField->setText(mUnsecureChars);
mVisibleNamesEnabled = config.getBoolValue("visiblenames");
mVisibleNamesCheckBox->setSelected(mVisibleNamesEnabled);
+ mShowPlayersStatus = config.getBoolValue("showPlayersStatus");
+ mShowPlayersStatusCheckBox->setSelected(mShowPlayersStatus);
}
void Setup_Players::action(const gcn::ActionEvent &event)
@@ -526,6 +536,10 @@ void Setup_Players::action(const gcn::ActionEvent &event)
{
mVisibleNamesEnabled = mVisibleNamesCheckBox->isSelected();
}
+ else if (event.getId() == "showPlayersStatus")
+ {
+ mShowPlayersStatus = mShowPlayersStatusCheckBox->isSelected();
+ }
}
void Setup_Players::updatedPlayer(const std::string &name A_UNUSED)
diff --git a/src/gui/setup_players.h b/src/gui/setup_players.h
index 83709d7bd..9f35d1600 100644
--- a/src/gui/setup_players.h
+++ b/src/gui/setup_players.h
@@ -99,10 +99,13 @@ private:
gcn::TextField *mUnsecureCharsField;
gcn::Button *mUnsecureCharsButton;
std::string mUnsecureChars;
- bool mVisibleNamesEnabled;
+ bool mVisibleNamesEnabled;
gcn::CheckBox *mVisibleNamesCheckBox;
+ bool mShowPlayersStatus;
+ gcn::CheckBox *mShowPlayersStatusCheckBox;
+
EditDialog *mEditDialog;
};