mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-01 05:39:39 +00:00
Add chat messages to log in client
Cleanup redundant code in GUIChat class
This commit is contained in:
parent
e5e9c90441
commit
a34d46f57e
2 changed files with 5 additions and 16 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <apps/openmw/mwgui/windowmanagerimp.hpp>
|
||||
#include <apps/openmw/mwinput/inputmanagerimp.hpp>
|
||||
#include <MyGUI_InputManager.h>
|
||||
#include <components/openmw-mp/Log.hpp>
|
||||
|
||||
#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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue