]> git.lizzy.rs Git - minetest.git/blobdiff - src/terminal_chat_console.h
Update minetest.conf.example, settings strings and locale files (#8230)
[minetest.git] / src / terminal_chat_console.h
index 2111b7ecba31434bc338c7b02caaf07f03cdacd6..eae7c6b22db5fecfa142561f1ce0efad51ddd0fa 100644 (file)
@@ -17,16 +17,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef TERMINAL_CHAT_CONSOLE_H
-#define TERMINAL_CHAT_CONSOLE_H
+#pragma once
 
 #include "chat.h"
 #include "threading/thread.h"
-#include "chat_interface.h"
+#include "util/container.h"
 #include "log.h"
-
 #include <sstream>
 
+
+struct ChatInterface;
+
 class TermLogOutput : public ILogOutput {
 public:
 
@@ -52,13 +53,7 @@ class TerminalChatConsole : public Thread {
 public:
 
        TerminalChatConsole() :
-               Thread("TerminalThread"),
-               m_log_level(LL_ACTION),
-               m_utf8_bytes_to_wait(0),
-               m_kill_requested(NULL),
-               m_esc_mode(false),
-               m_game_time(0),
-               m_time_of_day(0)
+               Thread("TerminalThread")
        {}
 
        void setup(
@@ -74,7 +69,7 @@ class TerminalChatConsole : public Thread {
        virtual void *run();
 
        // Highly required!
-       void clearKillStatus() { m_kill_requested = NULL; }
+       void clearKillStatus() { m_kill_requested = nullptr; }
 
        void stopAndWaitforThread();
 
@@ -102,10 +97,10 @@ class TerminalChatConsole : public Thread {
                ~CursesInitHelper() { cons->deInitOfCurses(); }
        };
 
-       int m_log_level;
+       int m_log_level = LL_ACTION;
        std::string m_nick;
 
-       u8 m_utf8_bytes_to_wait;
+       u8 m_utf8_bytes_to_wait = 0;
        std::string m_pending_utf8_bytes;
 
        std::list<std::string> m_nicks;
@@ -114,18 +109,16 @@ class TerminalChatConsole : public Thread {
        int m_rows;
        bool m_can_draw_text;
 
-       bool *m_kill_requested;
+       bool *m_kill_requested = nullptr;
        ChatBackend m_chat_backend;
        ChatInterface *m_chat_interface;
 
        TermLogOutput m_log_output;
 
-       bool m_esc_mode;
+       bool m_esc_mode = false;
 
-       u64 m_game_time;
-       u32 m_time_of_day;
+       u64 m_game_time = 0;
+       u32 m_time_of_day = 0;
 };
 
 extern TerminalChatConsole g_term_console;
-
-#endif