From 5a217925e3088bfbb187d274ced159754e2397c2 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Thu, 29 Jan 2009 17:34:37 -0700 Subject: Trimmed out a few help functions from some subclasses, and moved them back to the chat class, where they really belong. Since the party class parses its own suboptions, I left the suboptions within that class. Signed-off-by: Ira Rice --- src/gui/chat.cpp | 13 +++++++++---- src/gui/recorder.cpp | 19 ++----------------- src/gui/recorder.h | 15 ++------------- src/party.cpp | 5 ----- src/party.h | 1 - 5 files changed, 13 insertions(+), 40 deletions(-) diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 3a22581f..36e33160 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -478,7 +478,7 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg) else if (command == "whisper" || command == "msg" || command == "w") whisper(nick, msg); else if (command == "record") - mRecorder->changeStatus(msg); + mRecorder->changeRecordingStatus(msg); else if (command == "toggle") { if (msg == "") @@ -804,10 +804,11 @@ void ChatWindow::help(const std::string & msg1, const std::string & msg2) chatLog(_("/announce: Global announcement (GM only)"), BY_SERVER); chatLog(_("/clear: Clears this window"), BY_SERVER); chatLog(_("/help: Display this help"), BY_SERVER); - mParty->help(); + chatLog(_("/party : Party commands."), BY_SERVER); chatLog(_("/msg : Alternate form for /whisper"), BY_SERVER); chatLog(_("/present: Get list of players present"), BY_SERVER); - mRecorder->help(); + chatLog(_("/record : Start recording the chat to an" + " external file."), BY_SERVER); chatLog(_("/toggle: Determine whether toggles the chat log."), BY_SERVER); chatLog(_("/where: Display map name"), BY_SERVER); @@ -851,7 +852,11 @@ void ChatWindow::help(const std::string & msg1, const std::string & msg2) } else if (msg1 == "record") { - mRecorder->help2(); + chatLog(_("Command: /record "), BY_SERVER); + chatLog(_("This command starts recording the chat log to the file " + "."), BY_SERVER); + chatLog(_("Command: /record"), BY_SERVER); + chatLog(_("This command finishes a recording session."), BY_SERVER); } else if (msg1 == "toggle") { diff --git a/src/gui/recorder.cpp b/src/gui/recorder.cpp index da67875b..02eddbe5 100644 --- a/src/gui/recorder.cpp +++ b/src/gui/recorder.cpp @@ -46,7 +46,7 @@ void Recorder::record(const std::string &msg) } } -void Recorder::changeStatus(const std::string &msg) +void Recorder::changeRecordingStatus(const std::string &msg) { std::string msgCopy = msg; trim(msgCopy); @@ -91,24 +91,9 @@ void Recorder::changeStatus(const std::string &msg) } } -void Recorder::help() const -{ - mChat->chatLog("/record : Start recording the chat.", BY_SERVER); -} - -void Recorder::help2() const -{ - mChat->chatLog("Command: /record ", BY_SERVER); - mChat->chatLog("This command starts recording the chat log to the file " - ".", BY_SERVER); - mChat->chatLog("Command: /record", BY_SERVER); - mChat->chatLog("This command finishes a recording session.", BY_SERVER); -} - void Recorder::action(const gcn::ActionEvent &event) { - if (event.getId() == "activate") - changeStatus(""); + changeRecordingStatus(""); } Recorder::~Recorder() diff --git a/src/gui/recorder.h b/src/gui/recorder.h index 6f917c25..420c4a2b 100644 --- a/src/gui/recorder.h +++ b/src/gui/recorder.h @@ -53,20 +53,9 @@ class Recorder : public Window, public gcn::ActionListener /* * Outputs the message to the recorder file * - * @param msg the line to write to the recorded file. - */ - void changeStatus(const std::string &msg); - - /* - * Displays a help message on how to use this class in the chat window. - */ - void help() const; - - /* - * Displays an extended help message on how to use this class in the - * chat window. + * @param msg The file to write out to. If null, then stop recording. */ - void help2() const; + void changeRecordingStatus(const std::string &msg); /* * Whether or not the recorder is in use. diff --git a/src/party.cpp b/src/party.cpp index ecb0ab2d..67262176 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -166,11 +166,6 @@ void Party::receiveChat(Being *being, const std::string &msg) mChat->chatLog(being->getName() + " : " + msg, BY_PARTY); } -void Party::help() -{ - mChat->chatLog(_("/party : Party commands."), BY_SERVER); -} - void Party::help(const std::string &msg) { if (msg == "") diff --git a/src/party.h b/src/party.h index 8d6dce47..5643f894 100644 --- a/src/party.h +++ b/src/party.h @@ -47,7 +47,6 @@ class Party void leftResponse(const std::string &nick); void receiveChat(Being *being, const std::string &msg); - void help(); void help(const std::string &msg); private: ChatWindow *mChat; -- cgit v1.2.3-70-g09d2