From de28a261768f008dd93827a4c684f2724b3b697f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 Feb 2015 23:26:55 +0300 Subject: Allow send rename pet chat command without new pet name. This name will be asked from player. --- src/actions/pets.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/actions/pets.cpp') diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp index 061a7dd6d..7e2c849ac 100644 --- a/src/actions/pets.cpp +++ b/src/actions/pets.cpp @@ -31,12 +31,15 @@ #include "gui/chatconsts.h" +#include "listeners/inputactionreplaylistener.h" + #include "net/chathandler.h" #include "net/net.h" #include "net/pethandler.h" #include "net/serverfeatures.h" #include "utils/chatutils.h" +#include "utils/gettext.h" #include "utils/stringutils.h" #include "debug.h" @@ -85,7 +88,15 @@ impHandler(setPetName) { const std::string args = event.args; if (args.empty()) + { + const Being *const pet = getPet(); + if (!pet) + return false; + inputActionReplayListener.openDialog(_("Rename your pet"), + pet->getName(), + InputAction::PET_SET_NAME); return false; + } petHandler->setName(args); return true; -- cgit v1.2.3-70-g09d2