mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue