mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-26 13:25:27 +01:00
Restore proportional minimap scaling (#15022)
This commit is contained in:
@@ -544,14 +544,21 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
|
||||
}
|
||||
break; }
|
||||
case HUD_ELEM_MINIMAP: {
|
||||
if (e->size.X <= 0 || e->size.Y <= 0)
|
||||
break;
|
||||
if (!client->getMinimap())
|
||||
break;
|
||||
// Draw a minimap of size "size"
|
||||
v2s32 dstsize(e->size.X * m_scale_factor,
|
||||
e->size.Y * m_scale_factor);
|
||||
// (no percent size as minimap would likely be anamorphosed)
|
||||
|
||||
// Only one percentage is supported to avoid distortion.
|
||||
if (e->size.X < 0)
|
||||
dstsize.X = dstsize.Y = m_screensize.X * (e->size.X * -0.01);
|
||||
else if (e->size.Y < 0)
|
||||
dstsize.X = dstsize.Y = m_screensize.Y * (e->size.Y * -0.01);
|
||||
|
||||
if (dstsize.X <= 0 || dstsize.Y <= 0)
|
||||
return;
|
||||
|
||||
v2s32 offset((e->align.X - 1.0) * dstsize.X / 2,
|
||||
(e->align.Y - 1.0) * dstsize.Y / 2);
|
||||
core::rect<s32> rect(0, 0, dstsize.X, dstsize.Y);
|
||||
|
||||
@@ -224,9 +224,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
Add TOCLIENT_MOVE_PLAYER_REL
|
||||
Move default minimap from client-side C++ to server-side builtin Lua
|
||||
[scheduled bump for 5.9.0]
|
||||
PROTOCOL VERSION 45:
|
||||
Minimap HUD element supports negative size values as percentages
|
||||
[bump for 5.9.1]
|
||||
*/
|
||||
|
||||
#define LATEST_PROTOCOL_VERSION 44
|
||||
#define LATEST_PROTOCOL_VERSION 45
|
||||
#define LATEST_PROTOCOL_VERSION_STRING TOSTRING(LATEST_PROTOCOL_VERSION)
|
||||
|
||||
// Server's supported network protocol range
|
||||
|
||||
Reference in New Issue
Block a user