diff options
-rw-r--r-- | src/actions/actions.cpp | 10 | ||||
-rw-r--r-- | src/actions/actions.h | 1 | ||||
-rw-r--r-- | src/dyetool/actions/actions.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 |
6 files changed, 20 insertions, 6 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index a8a6e3c95..169727b2a 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1709,4 +1709,14 @@ impHandler0(resetGameModifiers) return true; } +impHandler(barToChat) +{ + if (chatWindow) + { + chatWindow->addInputText(event.args); + return true; + } + return false; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index a19b4964e..5581fee52 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -111,6 +111,7 @@ namespace Actions decHandler(testInfo); decHandler(craftKey); decHandler(resetGameModifiers); + decHandler(barToChat); } // namespace Actions #undef decHandler diff --git a/src/dyetool/actions/actions.cpp b/src/dyetool/actions/actions.cpp index f5db2686a..834f7d2f9 100644 --- a/src/dyetool/actions/actions.cpp +++ b/src/dyetool/actions/actions.cpp @@ -108,5 +108,6 @@ impHandlerVoid(clearDrop) impHandlerVoid(testInfo) impHandlerVoid(craftKey) impHandlerVoid(resetGameModifiers) +impHandlerVoid(barToChat) } // namespace Actions diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h index 7c88a9b93..f6837109e 100644 --- a/src/enums/input/inputaction.h +++ b/src/enums/input/inputaction.h @@ -623,6 +623,7 @@ enumStart(InputAction) REMOVE_PICKUP, IGNORE_PICKUP, RESET_MODIFIERS, + BAR_TO_CHAT, TOTAL } enumEnd(InputAction); diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index d5b122ffd..bead76de5 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1264,11 +1264,6 @@ void PopupMenu::handleLink(const std::string &link, } } } - else if (link == "bar to chat" && !mNick.empty()) - { - if (chatWindow) - chatWindow->addInputText(mNick); - } else if (link == "items" && being) { if (being == localPlayer) @@ -1964,7 +1959,7 @@ void PopupMenu::showPopup(const int x, const int y, const ProgressBar *const b) mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item // TRANSLATORS: copy status to chat - mBrowserBox->addRow("bar to chat", _("Copy to chat")); + mBrowserBox->addRow("/bartochat 'NAME'", _("Copy to chat")); // TRANSLATORS: popup menu item // TRANSLATORS: close menu mBrowserBox->addRow("cancel", _("Cancel")); diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index f18a0af2f..b8f89c7cd 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -5227,6 +5227,12 @@ static const InputActionData inputActionData "resetyellowbar|resetmodifiers|resetgamemodifiers", UseArgs_false, Protected_true}, + {"keyBarToChat", + defaultAction(&Actions::barToChat), + InputCondition::INGAME, + "bartochat", + UseArgs_true, + Protected_true}, }; #undef defaultAction |