summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-22 21:26:32 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-22 21:26:32 +0300
commit70f7db29f291ea22e6dca7c03540beded7ec7bf8 (patch)
treef8acd516a552ad34fcf8f4d84169d90e001f55ad /src
parent1e7d0d8e9873283a0ec09a62e579b718c3c06e51 (diff)
downloadmanaverse-70f7db29f291ea22e6dca7c03540beded7ec7bf8.tar.gz
manaverse-70f7db29f291ea22e6dca7c03540beded7ec7bf8.tar.bz2
manaverse-70f7db29f291ea22e6dca7c03540beded7ec7bf8.tar.xz
manaverse-70f7db29f291ea22e6dca7c03540beded7ec7bf8.zip
Add chat command for feed homunculus.
Diffstat (limited to 'src')
-rw-r--r--src/actions/actions.cpp7
-rw-r--r--src/actions/actions.h1
-rw-r--r--src/dyetool/actions/actions.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/actions.cpp b/src/actions/actions.cpp
index 65de77689..afd774b79 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -1609,6 +1609,13 @@ impHandler0(homunculusToMaster)
return true;
}
+impHandler0(homunculusFeed)
+{
+ if (homunculusHandler != nullptr)
+ homunculusHandler->feed();
+ return true;
+}
+
impHandler(useItem)
{
const int itemId = atoi(event.args.c_str());
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 107f978aa..83072680c 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -103,6 +103,7 @@ namespace Actions
decHandler(mercenaryFire);
decHandler(mercenaryToMaster);
decHandler(homunculusToMaster);
+ decHandler(homunculusFeed);
decHandler(useItem);
decHandler(useItemInv);
decHandler(invToStorage);
diff --git a/src/dyetool/actions/actions.cpp b/src/dyetool/actions/actions.cpp
index 7dc23fe38..58353b699 100644
--- a/src/dyetool/actions/actions.cpp
+++ b/src/dyetool/actions/actions.cpp
@@ -99,6 +99,7 @@ impHandlerVoid(uploadLog)
impHandlerVoid(mercenaryFire)
impHandlerVoid(mercenaryToMaster)
impHandlerVoid(homunculusToMaster)
+impHandlerVoid(homunculusFeed)
impHandlerVoid(useItem)
impHandlerVoid(useItemInv)
impHandlerVoid(invToStorage)
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index 6f423207e..0962bf34f 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -703,6 +703,7 @@ enumStart(InputAction)
WINDOW_SERVER_INFO,
MERCENARY_TO_MASTER,
HOMUNCULUS_TO_MASTER,
+ HOMUNCULUS_FEED,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 15fcc34cb..b13a2c374 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -358,7 +358,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
_("Move to master"));
// TRANSLATORS: popup menu item
// TRANSLATORS: feed homunculus
- mBrowserBox->addRow("homunculus feed", _("Feed"));
+ mBrowserBox->addRow("/homunculusfeed", _("Feed"));
mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: pet rename item
@@ -1297,10 +1297,6 @@ void PopupMenu::handleLink(const std::string &link,
if (chat != nullptr)
chatHandler->joinChat(chat, "");
}
- else if (link == "homunculus feed")
- {
- homunculusHandler->feed();
- }
else if (link == "homunculus delete")
{
homunculusHandler->fire();
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index dc2a38e7d..95a3b8d3e 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5708,6 +5708,12 @@ static const InputActionData inputActionData
"homunculustomaster|homunmaster",
UseArgs_false,
Protected_false},
+ {"keyHomunculusFeed",
+ defaultAction(&Actions::homunculusFeed),
+ InputCondition::INGAME,
+ "homunculusfeed|homunfeed|feedhomun|feedhomunculus",
+ UseArgs_false,
+ Protected_false},
};
#undef defaultAction
diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp
index 47312c3c5..3d37bd982 100644
--- a/src/input/pages/other.cpp
+++ b/src/input/pages/other.cpp
@@ -428,6 +428,12 @@ SetupActionData setupActionDataOther[] =
"",
},
{
+ // TRANSLATORS: input action name
+ N_("Feed homunculus"),
+ InputAction::HOMUNCULUS_FEED,
+ "",
+ },
+ {
"",
InputAction::NO_VALUE,
""