summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-05 03:41:13 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-05 03:41:13 +0300
commitd0571ca16bb4ef11a718cfa78dc29b57080fcc72 (patch)
treeadd362fa6b01bb83c608a78b3a56bf8b52136767 /src/gui
parent0202b0b4cdac57a04a3765f6bca893bd3b5c9812 (diff)
downloadplus-d0571ca16bb4ef11a718cfa78dc29b57080fcc72.tar.gz
plus-d0571ca16bb4ef11a718cfa78dc29b57080fcc72.tar.bz2
plus-d0571ca16bb4ef11a718cfa78dc29b57080fcc72.tar.xz
plus-d0571ca16bb4ef11a718cfa78dc29b57080fcc72.zip
Add ability to send client states to other clients.
Using for this emotes.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/beingpopup.cpp10
-rw-r--r--src/gui/popupmenu.cpp41
-rw-r--r--src/gui/setup_other.cpp3
-rw-r--r--src/gui/theme.cpp3
-rw-r--r--src/gui/theme.h1
5 files changed, 51 insertions, 7 deletions
diff --git a/src/gui/beingpopup.cpp b/src/gui/beingpopup.cpp
index 2ba79d1a1..e5dc602a0 100644
--- a/src/gui/beingpopup.cpp
+++ b/src/gui/beingpopup.cpp
@@ -28,6 +28,7 @@
#include "gui/gui.h"
#include "gui/palette.h"
+#include "gui/theme.h"
#include "gui/widgets/label.h"
@@ -96,6 +97,15 @@ void BeingPopup::show(int x, int y, Being *b)
else
mBeingName->setFont(gui->getSecureFont());
}
+ if (b->isAdvanced())
+ {
+ mBeingName->setForegroundColor(Theme::getThemeColor(
+ Theme::PLAYER_ADVANCED));
+ }
+ else
+ {
+ mBeingName->setForegroundColor(Theme::getThemeColor(Theme::TEXT));
+ }
mBeingName->adjustSize();
label1->setCaption("");
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 0ede3d122..ad62f79a8 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -248,8 +248,23 @@ void PopupMenu::showPopup(int x, int y, Being *being)
if (player_relations.getDefault() & PlayerRelation::TRADE)
{
mBrowserBox->addRow("##3---");
- mBrowserBox->addRow(strprintf("@@buy|%s@@", _("Buy")));
- mBrowserBox->addRow(strprintf("@@sell|%s@@", _("Sell")));
+ if (being->isAdvanced())
+ {
+ if (being->isShopEnabled())
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@buy|%s@@", _("Buy")));
+ mBrowserBox->addRow(strprintf(
+ "@@sell|%s@@", _("Sell")));
+ }
+ }
+ else
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@buy|%s@@", _("Buy (?)")));
+ mBrowserBox->addRow(strprintf(
+ "@@sell|%s@@", _("Sell (?)")));
+ }
}
}
break;
@@ -428,8 +443,8 @@ void PopupMenu::showPlayerPopup(int x, int y, std::string nick)
mBrowserBox->addRow("##3---");
if (player_relations.getDefault() & PlayerRelation::TRADE)
{
- mBrowserBox->addRow(strprintf("@@buy|%s@@", _("Buy")));
- mBrowserBox->addRow(strprintf("@@sell|%s@@", _("Sell")));
+ mBrowserBox->addRow(strprintf("@@buy|%s@@", _("Buy (?)")));
+ mBrowserBox->addRow(strprintf("@@sell|%s@@", _("Sell (?)")));
}
mBrowserBox->addRow(strprintf("@@name|%s@@", _("Add name to chat")));
@@ -652,8 +667,22 @@ void PopupMenu::showChatPopup(int x, int y, ChatTab *tab)
if (player_relations.getDefault() & PlayerRelation::TRADE)
{
mBrowserBox->addRow("##3---");
- mBrowserBox->addRow(strprintf("@@buy|%s@@", _("Buy")));
- mBrowserBox->addRow(strprintf("@@sell|%s@@", _("Sell")));
+ if (being->isAdvanced())
+ {
+ if (being->isShopEnabled())
+ {
+ mBrowserBox->addRow(strprintf(
+ "@@buy|%s@@", _("Buy")));
+ mBrowserBox->addRow(strprintf(
+ "@@sell|%s@@", _("Sell")));
+ }
+ }
+ else
+ {
+ mBrowserBox->addRow(strprintf("@@buy|%s@@", _("Buy (?)")));
+ mBrowserBox->addRow(strprintf(
+ "@@sell|%s@@", _("Sell (?)")));
+ }
}
mBrowserBox->addRow("##3---");
diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp
index 0cad07bc1..ca70133a2 100644
--- a/src/gui/setup_other.cpp
+++ b/src/gui/setup_other.cpp
@@ -127,6 +127,9 @@ Setup_Other::Setup_Other()
new SetupItemCheckBox(_("Enable attack filter"), "",
"enableAttackFilter", this, "enableAttackFilterEvent");
+ new SetupItemCheckBox(_("Enable advert protocol"), "",
+ "enableAdvert", this, "enableAdvertEvent");
+
new SetupItemLabel(_("Shop"), "", this);
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 0817df564..92613a3b3 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -638,7 +638,8 @@ static int readColorType(const std::string &type)
"AMMO",
"SERVER_VERSION_NOT_SUPPORTED",
"WARNING",
- "CHARM"
+ "CHARM",
+ "PLAYER_ADVANCED"
};
if (type.empty())
diff --git a/src/gui/theme.h b/src/gui/theme.h
index e483bff69..120214232 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -183,6 +183,7 @@ class Theme : public Palette, public ConfigListener
SERVER_VERSION_NOT_SUPPORTED,
WARNING,
CHARM,
+ PLAYER_ADVANCED,
THEME_COLORS_END
};