From c34858a4c7889483a8775c65c9bd1f357bca2572 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Jan 2016 17:46:28 +0300 Subject: Remove copy to clipboard action in npc dialog popup. --- src/gui/popups/popupmenu.cpp | 6 +----- src/gui/windows/npcdialog.cpp | 15 +++------------ src/gui/windows/npcdialog.h | 3 +-- 3 files changed, 5 insertions(+), 19 deletions(-) (limited to 'src/gui') diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 9cc00b06d..d79a2f92d 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1134,10 +1134,6 @@ void PopupMenu::handleLink(const std::string &link, inputManager.executeChatCommand(InputAction::ENABLE_AWAY, std::string(), mTab); } - else if (link == "npc clipboard" && mBeingId != BeingId_zero) - { - NpcDialog::copyToClipboard(mBeingId, mX, mY); - } else if (link == "remove pickup" && !mNick.empty()) { if (actorManager) @@ -2275,7 +2271,7 @@ void PopupMenu::showNpcDialogPopup(const BeingId npcId, mBrowserBox->clearRows(); // TRANSLATORS: popup menu item // TRANSLATORS: copy npc text to clipboard - mBrowserBox->addRow("npc clipboard", _("Copy to clipboard")); + mBrowserBox->addRow("/npcclipboard 'X' 'Y'", _("Copy to clipboard")); mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item // TRANSLATORS: close menu diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 862c6bfcd..60c8f06d6 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -1241,19 +1241,10 @@ void NpcDialog::mousePressed(MouseEvent &event) } } -void NpcDialog::copyToClipboard(const BeingId npcId, - const int x, const int y) +void NpcDialog::copyToClipboard(const int x, const int y) const { - NpcDialogs::iterator it = mNpcDialogs.find(npcId); - if (it != mNpcDialogs.end()) - { - const BrowserBox *const text = (*it).second->mTextBox; - if (!text) - return; - - std::string str = text->getTextAtPos(x, y); - sendBuffer(str); - } + std::string str = mTextBox->getTextAtPos(x, y); + sendBuffer(str); } void NpcDialog::setSkin(const std::string &skin) diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h index 524ae7bd8..fa3e52097 100644 --- a/src/gui/windows/npcdialog.h +++ b/src/gui/windows/npcdialog.h @@ -250,8 +250,7 @@ class NpcDialog final : public Window, NpcInputState getInputState() { return mInputState; } - static void copyToClipboard(const BeingId npcId, - const int x, const int y); + void copyToClipboard(const int x, const int y) const; static NpcDialogs mNpcDialogs; -- cgit v1.2.3-70-g09d2