summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-27 18:55:52 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-27 18:55:52 +0300
commiteb0c8a2a08a7b55eb80667b106657aeee4023dd9 (patch)
tree72aacba357f61d997baec2819195595772a5da70
parentdd73b250eb8390a87e09eeefc054202835b29a43 (diff)
downloadManaVerse-eb0c8a2a08a7b55eb80667b106657aeee4023dd9.tar.gz
ManaVerse-eb0c8a2a08a7b55eb80667b106657aeee4023dd9.tar.bz2
ManaVerse-eb0c8a2a08a7b55eb80667b106657aeee4023dd9.tar.xz
ManaVerse-eb0c8a2a08a7b55eb80667b106657aeee4023dd9.zip
remove removepickup action from social window popup menu.
-rw-r--r--src/actions/commands.cpp20
-rw-r--r--src/actormanager.cpp5
-rw-r--r--src/actormanager.h2
-rw-r--r--src/gui/popups/popupmenu.cpp27
4 files changed, 27 insertions, 27 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index b57883841..9f38844ee 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -1158,6 +1158,7 @@ impHandler(addPickup)
{
if (actorManager)
{
+ actorManager->removePickupItem(event.args);
actorManager->addPickupItem(event.args);
if (socialWindow)
socialWindow->updatePickupFilter();
@@ -1170,7 +1171,23 @@ impHandler(removePickup)
{
if (actorManager)
{
- actorManager->removePickupItem(event.args);
+ if (event.args.empty())
+ { // default pickup manipulation
+ if (actorManager->checkDefaultPickup())
+ {
+ actorManager->removePickupItem(event.args);
+ actorManager->addIgnorePickupItem(event.args);
+ }
+ else
+ {
+ actorManager->removePickupItem(event.args);
+ actorManager->addPickupItem(event.args);
+ }
+ }
+ else
+ { // any other pickups
+ actorManager->removePickupItem(event.args);
+ }
if (socialWindow)
socialWindow->updatePickupFilter();
return true;
@@ -1182,6 +1199,7 @@ impHandler(ignorePickup)
{
if (actorManager)
{
+ actorManager->removePickupItem(event.args);
actorManager->addIgnorePickupItem(event.args);
if (socialWindow)
socialWindow->updatePickupFilter();
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index 70dcd8c30..ba8822bf0 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -1879,6 +1879,11 @@ bool ActorManager::checkForPickup(const FloorItem *const item) const
return false;
}
+bool ActorManager::checkDefaultPickup() const
+{
+ return mPickupItemsSet.find("") != mPickupItemsSet.end();
+}
+
void ActorManager::updateEffects(const std::map<BeingTypeId, int> &addEffects,
const std::set<BeingTypeId> &removeEffects)
const
diff --git a/src/actormanager.h b/src/actormanager.h
index add1a4e54..536c70b63 100644
--- a/src/actormanager.h
+++ b/src/actormanager.h
@@ -347,6 +347,8 @@ class ActorManager final: public ConfigListener
bool checkForPickup(const FloorItem *const item) const A_WARN_UNUSED;
+ bool checkDefaultPickup() const A_WARN_UNUSED;
+
void updateEffects(const std::map<BeingTypeId, int> &addEffects,
const std::set<BeingTypeId> &removeEffects) const;
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index e792b2bb4..d2e4a100d 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1289,31 +1289,6 @@ void PopupMenu::handleLink(const std::string &link,
socialWindow->updateAttackFilter();
}
}
- else if (link == "pickup remove")
- {
- if (actorManager)
- {
- if (mNick.empty())
- {
- if (actorManager->isInPickupList(mNick))
- {
- actorManager->removePickupItem(mNick);
- actorManager->addIgnorePickupItem(mNick);
- }
- else
- {
- actorManager->removePickupItem(mNick);
- actorManager->addPickupItem(mNick);
- }
- }
- else
- {
- actorManager->removePickupItem(mNick);
- }
- if (socialWindow)
- socialWindow->updatePickupFilter();
- }
- }
else if (link == "reset yellow")
{
GameModifiers::resetModifiers();
@@ -2129,7 +2104,7 @@ void PopupMenu::showPickupItemPopup(const int x, const int y,
// TRANSLATORS: popup menu item
// TRANSLATORS: remove item from pickup filter
- mBrowserBox->addRow("pickup remove", _("Remove"));
+ mBrowserBox->addRow("/removepickup 'NAME'", _("Remove"));
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: close menu