summaryrefslogtreecommitdiff
path: root/src/client.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-03-19 13:18:52 +0100
committerGitHub <noreply@github.com>2017-03-19 13:18:52 +0100
commit3c4ac70348db5375118d1e714a6d4681c3cfcd05 (patch)
tree351f00d7c980d4c2668d67d5b04fee9f09f9fe5d /src/client.h
parent2e3778ec0c1f77007d064d15310fa816e2a07e88 (diff)
downloadminetest-3c4ac70348db5375118d1e714a6d4681c3cfcd05.tar.gz
minetest-3c4ac70348db5375118d1e714a6d4681c3cfcd05.tar.bz2
minetest-3c4ac70348db5375118d1e714a6d4681c3cfcd05.zip
Refactor Game class (part 2) (#5422)
* showPauseMenu is now part of game * remove many flags parameters passed to game functions, use the member. * rename VolatileRunFlags to GameUIFlags (this will permit to share structure with client and CSM * updatePointedThing: remove pointer ref, we already have the pointer in rundata * move some attributes outside of VolatileRunFlags after renaming, to game class * rename statustext to m_statustext * make some const variables static * All those changes permit to reduce a little bit function class cost and will permit to interface CSM with some interesting Game flags * Expose GameUIFlags to client * Client now have GameUIFlags parameter and setters for other classes * Fix minimap show/hide in Lua because we now have access to the real flag
Diffstat (limited to 'src/client.h')
-rw-r--r--src/client.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client.h b/src/client.h
index fc1cbe310..b1310424d 100644
--- a/src/client.h
+++ b/src/client.h
@@ -307,6 +307,7 @@ private:
};
class ClientScripting;
+class GameUIFlags;
class Client : public con::PeerHandler, public InventoryManager, public IGameDef
{
@@ -326,7 +327,8 @@ public:
IWritableNodeDefManager *nodedef,
ISoundManager *sound,
MtEventManager *event,
- bool ipv6
+ bool ipv6,
+ GameUIFlags *game_ui_flags
);
~Client();
@@ -578,6 +580,13 @@ public:
m_client_event_queue.push(event);
}
+ void showGameChat(const bool show = true);
+ void showGameHud(const bool show = true);
+ void showMinimap(const bool show = true);
+ void showProfiler(const bool show = true);
+ void showGameFog(const bool show = true);
+ void showGameDebug(const bool show = true);
+
private:
// Virtual methods from con::PeerHandler
@@ -725,6 +734,7 @@ private:
bool m_modding_enabled;
UNORDERED_MAP<std::string, ModMetadata *> m_mod_storages;
float m_mod_storage_save_timer;
+ GameUIFlags *m_game_ui_flags;
DISABLE_CLASS_COPY(Client);
};