mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +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
|
@ -340,6 +340,14 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
|
|||
std::vector<HudElement*> elems;
|
||||
elems.reserve(player->maxHudId());
|
||||
|
||||
// Add builtin minimap if the server doesn't send it.
|
||||
HudElement minimap;
|
||||
if (client->getProtoVersion() < 44 && (player->hud_flags & HUD_FLAG_MINIMAP_VISIBLE)) {
|
||||
minimap = {HUD_ELEM_MINIMAP, v2f(1, 0), "", v2f(), "", 0 , 0, 0, v2f(-1, 1),
|
||||
v2f(-10, 10), v3f(), v2s32(256, 256), 0, "", 0};
|
||||
elems.push_back(&minimap);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i != player->maxHudId(); i++) {
|
||||
HudElement *e = player->getHud(i);
|
||||
if (!e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue