mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Move hard coded minimap to builtin (#14071)
This commit is contained in:
parent
f2b99332d9
commit
adaa4cc2f3
20 changed files with 51 additions and 87 deletions
|
@ -1281,24 +1281,15 @@ void Client::handleCommand_HudSetFlags(NetworkPacket* pkt)
|
|||
LocalPlayer *player = m_env.getLocalPlayer();
|
||||
assert(player != NULL);
|
||||
|
||||
bool was_minimap_visible = player->hud_flags & HUD_FLAG_MINIMAP_VISIBLE;
|
||||
bool was_minimap_radar_visible = player->hud_flags & HUD_FLAG_MINIMAP_RADAR_VISIBLE;
|
||||
|
||||
player->hud_flags &= ~mask;
|
||||
player->hud_flags |= flags;
|
||||
|
||||
m_minimap_disabled_by_server = !(player->hud_flags & HUD_FLAG_MINIMAP_VISIBLE);
|
||||
bool m_minimap_radar_disabled_by_server = !(player->hud_flags & HUD_FLAG_MINIMAP_RADAR_VISIBLE);
|
||||
|
||||
// Not so satisying code to keep compatibility with old fixed mode system
|
||||
// -->
|
||||
|
||||
// Hide minimap if it has been disabled by the server
|
||||
if (m_minimap && m_minimap_disabled_by_server && was_minimap_visible)
|
||||
// defers a minimap update, therefore only call it if really
|
||||
// needed, by checking that minimap was visible before
|
||||
m_minimap->setModeIndex(0);
|
||||
|
||||
// If radar has been disabled, try to find a non radar mode or fall back to 0
|
||||
if (m_minimap && m_minimap_radar_disabled_by_server
|
||||
&& was_minimap_radar_visible) {
|
||||
|
|
|
@ -222,6 +222,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
PROTOCOL VERSION 44:
|
||||
AO_CMD_SET_BONE_POSITION extended
|
||||
Add TOCLIENT_MOVE_PLAYER_REL
|
||||
Move default minimap from client-side C++ to server-side builtin Lua
|
||||
[scheduled bump for 5.9.0]
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue