diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-22 23:26:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-22 23:26:55 +0300 |
commit | de28a261768f008dd93827a4c684f2724b3b697f (patch) | |
tree | 7b3303740e04e32197e113f648eebf745bf6f981 /src/actions/pets.cpp | |
parent | 05099e035729878893845b0598e20109f0c734fe (diff) | |
download | mv-de28a261768f008dd93827a4c684f2724b3b697f.tar.gz mv-de28a261768f008dd93827a4c684f2724b3b697f.tar.bz2 mv-de28a261768f008dd93827a4c684f2724b3b697f.tar.xz mv-de28a261768f008dd93827a4c684f2724b3b697f.zip |
Allow send rename pet chat command without new pet name.
This name will be asked from player.
Diffstat (limited to 'src/actions/pets.cpp')
-rw-r--r-- | src/actions/pets.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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; |