From a34d46f57eb0093a762ba3290d3066b373d9d132 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sat, 10 Sep 2016 13:40:06 +0800 Subject: [PATCH] Add chat messages to log in client Cleanup redundant code in GUIChat class --- apps/openmw/mwmp/GUIChat.cpp | 15 ++++----------- apps/openmw/mwmp/GUIChat.hpp | 6 +----- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/apps/openmw/mwmp/GUIChat.cpp b/apps/openmw/mwmp/GUIChat.cpp index a18d473a3..875c30855 100644 --- a/apps/openmw/mwmp/GUIChat.cpp +++ b/apps/openmw/mwmp/GUIChat.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" @@ -66,22 +67,13 @@ namespace mwmp //WindowBase::exit(); } - void GUIChat::resetReference() - { - ReferenceInterface::resetReference(); - //setSelectedObject(MWWorld::Ptr()); - } - - void GUIChat::onReferenceUnavailable() - { - //setSelectedObject(MWWorld::Ptr()); - } - void GUIChat::acceptCommand(MyGUI::EditBox *_sender) { const std::string &cm = mCommandLine->getOnlyText(); if (cm.empty()) return; + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Player: %s", cm.c_str()); + // Add the command to the history, and set the current pointer to // the end of the list if (mCommandHistory.empty() || mCommandHistory.back() != cm) @@ -115,6 +107,7 @@ namespace mwmp setVisible(true); } mHistory->addText(color + MyGUI::TextIterator::toTagsString(msg)); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", msg.c_str()); } void GUIChat::printOK(const std::string &msg) diff --git a/apps/openmw/mwmp/GUIChat.hpp b/apps/openmw/mwmp/GUIChat.hpp index 0259ab075..e36024430 100644 --- a/apps/openmw/mwmp/GUIChat.hpp +++ b/apps/openmw/mwmp/GUIChat.hpp @@ -23,7 +23,7 @@ namespace mwmp { class GUIController; - class GUIChat : public MWGui::WindowBase, public MWGui::ReferenceInterface + class GUIChat : public MWGui::WindowBase { friend class GUIController; public: @@ -76,14 +76,10 @@ namespace mwmp /// Error message void printError(const std::string &msg); - virtual void resetReference (); - void send(const std::string &str); protected: - virtual void onReferenceUnavailable(); - private: void keyPress(MyGUI::Widget* _sender,