diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-25 19:47:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-25 19:47:29 +0300 |
commit | a02e2ba72702226cc25b245cc0e2615ead279cee (patch) | |
tree | f4bbc296e42ac0543aecba573123bb1f45ccb0f8 /src | |
parent | cd8ef301f4796f15390d02d866ad88423b2d8d16 (diff) | |
download | plus-a02e2ba72702226cc25b245cc0e2615ead279cee.tar.gz plus-a02e2ba72702226cc25b245cc0e2615ead279cee.tar.bz2 plus-a02e2ba72702226cc25b245cc0e2615ead279cee.tar.xz plus-a02e2ba72702226cc25b245cc0e2615ead279cee.zip |
Add chat command for clear current outfit.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/commands.cpp | 9 | ||||
-rw-r--r-- | src/actions/commands.h | 1 | ||||
-rw-r--r-- | src/dyetool/actions/commands.cpp | 1 | ||||
-rw-r--r-- | src/enums/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 7 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 6 | ||||
-rw-r--r-- | src/input/pages/outfits.cpp | 6 |
7 files changed, 25 insertions, 6 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 71dd2e7b4..ae50680fb 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -1895,6 +1895,15 @@ impHandler0(outfitToChat) return true; } +impHandler0(outfitClear) +{ + if (!outfitWindow) + return false; + + outfitWindow->clearCurrentOutfit(); + return true; +} + impHandler(moveAttackUp) { if (!actorManager) diff --git a/src/actions/commands.h b/src/actions/commands.h index 6c2c6cc9d..0b6f0cf30 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -153,6 +153,7 @@ namespace Actions decHandler(partyExpShare); decHandler(partyAutoItemShare); decHandler(outfitToChat); + decHandler(outfitClear); decHandler(moveAttackUp); decHandler(moveAttackDown); decHandler(movePriorityAttackUp); diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp index 956c5e0ed..a8e882a8c 100644 --- a/src/dyetool/actions/commands.cpp +++ b/src/dyetool/actions/commands.cpp @@ -153,6 +153,7 @@ impHandlerVoid(partyItemShare) impHandlerVoid(partyExpShare) impHandlerVoid(partyAutoItemShare) impHandlerVoid(outfitToChat) +impHandlerVoid(outfitClear) impHandlerVoid(moveAttackUp) impHandlerVoid(moveAttackDown) impHandlerVoid(movePriorityAttackUp) diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h index f838bf092..94b37066b 100644 --- a/src/enums/input/inputaction.h +++ b/src/enums/input/inputaction.h @@ -695,6 +695,7 @@ enumStart(InputAction) SHOW_ITEMS, COMMAND_SEND_MOUSE_KEY, COMMAND_SEND_CHARS, + CLEAR_OUTFIT, TOTAL } enumEnd(InputAction); diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 4218a1101..35c459953 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -792,7 +792,7 @@ void PopupMenu::showOutfitsWindowPopup(const int x, const int y) mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item // TRANSLATORS: clear selected outfit - mBrowserBox->addRow("clear outfit", _("Clear outfit")); + mBrowserBox->addRow("/clearoutfit", _("Clear outfit")); mBrowserBox->addRow("##3---"); addWindowMenu(outfitWindow); @@ -1243,11 +1243,6 @@ void PopupMenu::handleLink(const std::string &link, showChangePos(getX(), getY()); return; } - else if (link == "clear outfit") - { - if (outfitWindow) - outfitWindow->clearCurrentOutfit(); - } else if (link == "clipboard copy") { if (mTextField) diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index b49b36904..a21cc42c1 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -5660,6 +5660,12 @@ static const InputActionData inputActionData "sendchar|sendchars|charsend", UseArgs_true, Protected_true}, + {"keyClearOutfit", + defaultAction(&Actions::outfitClear), + InputCondition::DEFAULT | InputCondition::INGAME, + "clearoutfit|outfitclear", + UseArgs_false, + Protected_true}, }; #undef defaultAction diff --git a/src/input/pages/outfits.cpp b/src/input/pages/outfits.cpp index 5a938217d..0b9beabd3 100644 --- a/src/input/pages/outfits.cpp +++ b/src/input/pages/outfits.cpp @@ -44,6 +44,12 @@ SetupActionData setupActionDataOutfits[] = }, { // TRANSLATORS: input action name + N_("Clear outfit"), + InputAction::CLEAR_OUTFIT, + "", + }, + { + // TRANSLATORS: input action name N_("Copy Outfit to other outfit"), InputAction::COPY_OUTFIT, "", |