From 3c4ac70348db5375118d1e714a6d4681c3cfcd05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sun, 19 Mar 2017 13:18:52 +0100 Subject: 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 --- src/script/lua_api/l_minimap.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/script/lua_api') diff --git a/src/script/lua_api/l_minimap.cpp b/src/script/lua_api/l_minimap.cpp index cb0245576..8e03936a7 100644 --- a/src/script/lua_api/l_minimap.cpp +++ b/src/script/lua_api/l_minimap.cpp @@ -118,21 +118,31 @@ int LuaMinimap::l_toggle_shape(lua_State *L) int LuaMinimap::l_show(lua_State *L) { + Client *client = getClient(L); + assert(client); + LuaMinimap *ref = checkobject(L, 1); Minimap *m = getobject(ref); if (m->getMinimapMode() == MINIMAP_MODE_OFF) m->setMinimapMode(MINIMAP_MODE_SURFACEx1); + + client->showMinimap(true); return 1; } int LuaMinimap::l_hide(lua_State *L) { + Client *client = getClient(L); + assert(client); + LuaMinimap *ref = checkobject(L, 1); Minimap *m = getobject(ref); if (m->getMinimapMode() != MINIMAP_MODE_OFF) m->setMinimapMode(MINIMAP_MODE_OFF); + + client->showMinimap(false); return 1; } -- cgit v1.2.3