1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Minimap as HUD element with API control

Features:
 * Define Minimap available modes (surface/radar, scale) from Lua, using player:set_minimap_modes()
 * New HUD elements for displaying minimap with custom size and placing
 * New minimap mode for displaying a texture instead of the map
This commit is contained in:
Pierre-Yves Rollo 2020-10-04 15:24:29 +02:00 committed by SmallJoker
parent 3068853e8a
commit 81c66d6efb
20 changed files with 470 additions and 144 deletions

View file

@ -118,6 +118,14 @@ struct ServerPlayingSound
std::unordered_set<session_t> clients; // peer ids
};
struct MinimapMode {
MinimapType type = MINIMAP_TYPE_OFF;
std::string label;
u16 size = 0;
std::string texture;
u16 scale = 1;
};
class Server : public con::PeerHandler, public MapEventReceiver,
public IGameDef
{
@ -331,6 +339,10 @@ public:
void SendPlayerSpeed(session_t peer_id, const v3f &added_vel);
void SendPlayerFov(session_t peer_id);
void SendMinimapModes(session_t peer_id,
std::vector<MinimapMode> &modes,
size_t wanted_mode);
void sendDetachedInventories(session_t peer_id, bool incremental);
virtual bool registerModStorage(ModMetadata *storage);