diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2018-01-03 14:28:55 +0100 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-01-05 20:59:30 +0100 |
commit | 0ebaed430ad5cd2523d78d2e2c051576e948fe13 (patch) | |
tree | 275dd4945128012b6844f9db6b858b31f7a70af4 /src/client.h | |
parent | 549cfd9db80c858bdc8d23a237ea57ccf5f68400 (diff) | |
download | hax-minetest-server-0ebaed430ad5cd2523d78d2e2c051576e948fe13.tar.gz hax-minetest-server-0ebaed430ad5cd2523d78d2e2c051576e948fe13.zip |
GameUI refactor (part 1/X): GameUI object creation + GameUIFlags move to GameUI
Game class is too huge and has too specialization on various subjects, like UI, formspecs, client, renderer. Start to move UI related things to GameUI object and cleanup them
Other improvements:
* updateChat: more performance on error messages by remove string copies
* Initialize all game class members in definition instead of constructor (with nullptr instead of NULL)
* Drop unused Client::show{GameChat,GameHud,Profiler,GameFog}
* Add GameUI unittests
Diffstat (limited to 'src/client.h')
-rw-r--r-- | src/client.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/client.h b/src/client.h index 6093d6a6f..f5929e055 100644 --- a/src/client.h +++ b/src/client.h @@ -112,7 +112,7 @@ private: }; class ClientScripting; -struct GameUIFlags; +class GameUI; class Client : public con::PeerHandler, public InventoryManager, public IGameDef { @@ -133,7 +133,7 @@ public: ISoundManager *sound, MtEventManager *event, bool ipv6, - GameUIFlags *game_ui_flags + GameUI *game_ui ); ~Client(); @@ -400,12 +400,7 @@ public: void pushToEventQueue(ClientEvent *event); - void showGameChat(bool show = true); - void showGameHud(bool show = true); void showMinimap(bool show = true); - void showProfiler(bool show = true); - void showGameFog(bool show = true); - void showGameDebug(bool show = true); const Address getServerAddress(); @@ -570,6 +565,8 @@ private: // own state LocalClientState m_state; + GameUI *m_game_ui; + // Used for saving server map to disk client-side MapDatabase *m_localdb = nullptr; IntervalLimiter m_localdb_save_interval; @@ -580,7 +577,6 @@ private: std::unordered_map<std::string, ModMetadata *> m_mod_storages; float m_mod_storage_save_timer = 10.0f; std::vector<ModSpec> m_mods; - GameUIFlags *m_game_ui_flags; bool m_shutdown = false; |