diff options
-rw-r--r-- | src/gui/chat.cpp | 5 | ||||
-rw-r--r-- | src/gui/chat.h | 4 | ||||
-rw-r--r-- | src/gui/popupmenu.cpp | 21 |
3 files changed, 14 insertions, 16 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 86e5865a..b7a57da5 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -365,7 +365,7 @@ void ChatWindow::keyPressed(gcn::KeyEvent &event) } } -void ChatWindow::setInputText(std::string input_str) +void ChatWindow::addInputText(std::string input_str) { mChatInput->setText(mChatInput->getText() + input_str + " "); requestChatFocus(); @@ -375,8 +375,7 @@ void ChatWindow::addItemText(const std::string &item) { std::ostringstream text; text << "[" << item << "] "; - mChatInput->setText(mChatInput->getText() + text.str()); - requestChatFocus(); + addInputText(text.str()); } void ChatWindow::setVisible(bool isVisible) diff --git a/src/gui/chat.h b/src/gui/chat.h index d28cecd4..20586add 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -158,8 +158,8 @@ class ChatWindow : public Window, /** Called when key is pressed */ void keyPressed(gcn::KeyEvent &event); - /** Called to set current text */ - void setInputText(std::string input_str); + /** Add the given text to the chat input */ + void addInputText(std::string input_str); /** Called to add item to chat */ void addItemText(const std::string &item); diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index c016245b..00e71290 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -76,6 +76,9 @@ void PopupMenu::showPopup(int x, int y, Being *being) mBeingId = being->getId(); mBrowserBox->clearRows(); + // Any being's name can be added to chat + mBrowserBox->addRow(_("@@name|Add name to chat@@")); + switch (being->getType()) { case Being::PLAYER: @@ -109,12 +112,12 @@ void PopupMenu::showPopup(int x, int y, Being *being) //mBrowserBox->addRow(_("@@follow|Follow ") + name + "@@"); //mBrowserBox->addRow(_("@@buddy|Add ") + name + " to Buddy List@@"); - mBrowserBox->addRow(strprintf(_("@@guild|Invite %s@@"), name.c_str())); + mBrowserBox->addRow(strprintf(_("@@guild|Invite %s to join your guild@@"), name.c_str())); mBrowserBox->addRow(strprintf(_("@@party|Invite %s to join your party@@"), name.c_str())); + /* mBrowserBox->addRow("##3---"); - mBrowserBox->addRow(strprintf(_("@@party-invite|Invite %s to party@@"), name.c_str())); - //mBrowserBox->addRow(_("@@admin-kick|Kick player@@")); + mBrowserBox->addRow(_("@@admin-kick|Kick player@@"));*/ } break; @@ -242,6 +245,10 @@ void PopupMenu::handleLink(const std::string &link) buddyWindow->addBuddy(being->getName()); }*/ + else if (link == "name") + { + chatWindow->addInputText(being->getName()); + } // Pick Up Floor Item action else if ((link == "pickup") && mFloorItem) @@ -293,13 +300,6 @@ void PopupMenu::handleLink(const std::string &link) new ItemAmountWindow(ItemAmountWindow::ItemDrop, inventoryWindow, mItem); } -#ifdef EATHENA_SUPPORT - else if (link == "party-invite" && - being && - being->getType() == Being::PLAYER) - { - player_node->inviteToParty(dynamic_cast<Player*> (being)); - } else if (link == "admin-kick" && being && (being->getType() == Being::PLAYER || @@ -307,7 +307,6 @@ void PopupMenu::handleLink(const std::string &link) { Net::getAdminHandler()->kick(being->getId()); } -#endif // Unknown actions else |