summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-07 13:15:22 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-07 13:15:22 +0300
commit6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02 (patch)
tree2d1923e799a43754b15728c8e6a23f9c283bd825 /src
parentd9732855666b402c0a492d6618ce9ab930089219 (diff)
downloadplus-6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02.tar.gz
plus-6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02.tar.bz2
plus-6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02.tar.xz
plus-6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02.zip
Add into mobs and foring pets context menu item for timing pet.
Diffstat (limited to 'src')
-rw-r--r--src/actions/pets.cpp16
-rw-r--r--src/gui/popups/popupmenu.cpp16
-rw-r--r--src/gui/popups/popupmenu.h2
-rw-r--r--src/input/inputactionmap.h2
4 files changed, 33 insertions, 3 deletions
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp
index 84b3d412d..f0e9cbb15 100644
--- a/src/actions/pets.cpp
+++ b/src/actions/pets.cpp
@@ -143,8 +143,20 @@ impHandler(catchPet)
return false;
Being *target = nullptr;
- if (!event.args.empty())
- target = actorManager->findNearestByName(event.args);
+ const std::string args = event.args;
+ if (!args.empty())
+ {
+ if (args[0] == ':')
+ {
+ target = actorManager->findBeing(fromInt(atoi(
+ args.substr(1).c_str()), BeingId));
+ }
+ else
+ {
+ target = actorManager->findNearestByName(args);
+ }
+ }
+
if (!target)
target = localPlayer->getTarget();
else
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index e87407260..9c80415f6 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -299,6 +299,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
// TRANSLATORS: popup menu item
// TRANSLATORS: attack monster
mBrowserBox->addRow("/attack :'BEINGID'", _("Attack"));
+ addCatchPetCommands();
addGmCommands();
mBrowserBox->addRow("##3---");
@@ -394,6 +395,10 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
mBrowserBox->addRow("pet to egg", _("Return to egg"));
mBrowserBox->addRow("##3---");
}
+ else
+ {
+ addCatchPetCommands();
+ }
break;
case ActorType::SkillUnit:
// +++ need impliment menu
@@ -3154,6 +3159,17 @@ void PopupMenu::addMailCommands()
#endif
}
+void PopupMenu::addCatchPetCommands()
+{
+#ifdef EATHENA_SUPPORT
+ if (!serverFeatures->haveServerPets())
+ return;
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: catch pet command
+ mBrowserBox->addRow("/catchpet :'BEINGID'", _("Taming pet"));
+#endif
+}
+
void PopupMenu::moveUp()
{
mBrowserBox->moveSelectionUp();
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index 2bf253a29..5f4f6be70 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -231,6 +231,8 @@ class PopupMenu final : public Popup, public LinkHandler
void addMailCommands();
+ void addCatchPetCommands();
+
void showGMPopup(const std::string &name);
void showPlayerGMCommands(const std::string &name);
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 40eff9e7c..16869cbd0 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -4099,7 +4099,7 @@ static const InputActionData inputActionData
{"keyCatchPet",
defaultAction(&Actions::catchPet),
InputCondition::INGAME,
- "catchpet|catch",
+ "catchpet|catch|taming",
UseArgs_true,
Protected_false},
{"keyChatServerIgnoreWhisper",