summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-22 23:45:17 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-22 23:45:17 +0300
commit90fbaa6e372c6ae64b218dfd927c18c6f5ab941d (patch)
tree91fd1322563093dd4f111d109066fe7caa3c228f /src
parent3c51082082397b0564a224214249a096750b56c6 (diff)
downloadplus-90fbaa6e372c6ae64b218dfd927c18c6f5ab941d.tar.gz
plus-90fbaa6e372c6ae64b218dfd927c18c6f5ab941d.tar.bz2
plus-90fbaa6e372c6ae64b218dfd927c18c6f5ab941d.tar.xz
plus-90fbaa6e372c6ae64b218dfd927c18c6f5ab941d.zip
Add chat command for unequip pet equipment.
Diffstat (limited to 'src')
-rw-r--r--src/actions/pets.cpp7
-rw-r--r--src/actions/pets.h1
-rw-r--r--src/dyetool/actions/pets.cpp1
-rw-r--r--src/enums/input/inputaction.h1
-rw-r--r--src/gui/popups/popupmenu.cpp6
-rw-r--r--src/input/inputactionmap.h6
-rw-r--r--src/input/pages/other.cpp6
7 files changed, 23 insertions, 5 deletions
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp
index b989cfc5c..25c5f1411 100644
--- a/src/actions/pets.cpp
+++ b/src/actions/pets.cpp
@@ -238,4 +238,11 @@ impHandler0(petReturnToEgg)
return true;
}
+impHandler0(petUnequip)
+{
+ if (petHandler != nullptr)
+ petHandler->unequip();
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/pets.h b/src/actions/pets.h
index f607f474c..5bc3bd5a9 100644
--- a/src/actions/pets.h
+++ b/src/actions/pets.h
@@ -44,6 +44,7 @@ namespace Actions
decHandler(petFeed);
decHandler(petDropLoot);
decHandler(petReturnToEgg);
+ decHandler(petUnequip);
} // namespace Actions
#undef decHandler
diff --git a/src/dyetool/actions/pets.cpp b/src/dyetool/actions/pets.cpp
index b52c17020..96a7e5393 100644
--- a/src/dyetool/actions/pets.cpp
+++ b/src/dyetool/actions/pets.cpp
@@ -44,5 +44,6 @@ impHandlerVoid(petMove)
impHandlerVoid(petFeed)
impHandlerVoid(petDropLoot)
impHandlerVoid(petReturnToEgg)
+impHandlerVoid(petUnequip)
} // namespace Actions
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index 3ec122683..f3259b823 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -707,6 +707,7 @@ enumStart(InputAction)
PET_FEED,
PET_DROP_LOOT,
PET_RETURN_TO_EGG,
+ PET_UNEQUIP,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index d610182e6..e3ab6d81f 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -383,7 +383,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
mBrowserBox->addRow("/petdroploot", _("Drop loot"));
// TRANSLATORS: popup menu item
// TRANSLATORS: pet unequip item
- mBrowserBox->addRow("pet unequip", _("Unequip"));
+ mBrowserBox->addRow("/petunequip", _("Unequip"));
addGmCommands();
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
@@ -1303,10 +1303,6 @@ void PopupMenu::handleLink(const std::string &link,
showCraftPopup();
return;
}
- else if (link == "pet unequip")
- {
- petHandler->unequip();
- }
else if (link.compare(0, 10, "guild-pos-") == 0)
{
if (localPlayer != nullptr)
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index e30e50ae3..a87c0cada 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5732,6 +5732,12 @@ static const InputActionData inputActionData
"pettoegg|petegg|petreturn|returnpet|petreturnegg",
UseArgs_false,
Protected_false},
+ {"keyPetUnequip",
+ defaultAction(&Actions::petUnequip),
+ InputCondition::INGAME,
+ "petunequip|unequippet",
+ UseArgs_false,
+ Protected_false},
};
#undef defaultAction
diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp
index a33ede552..88677c576 100644
--- a/src/input/pages/other.cpp
+++ b/src/input/pages/other.cpp
@@ -452,6 +452,12 @@ SetupActionData setupActionDataOther[] =
"",
},
{
+ // TRANSLATORS: input action name
+ N_("Unequip pet"),
+ InputAction::PET_UNEQUIP,
+ "",
+ },
+ {
"",
InputAction::NO_VALUE,
""