aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorPierre-Yves Rollo <dev@pyrollo.com>2019-11-04 09:30:02 +0100
committerrubenwardy <rw@rubenwardy.com>2019-12-06 20:31:26 +0000
commitcf7fda00831372d981415f9a830513b2b28fdf25 (patch)
treead8d856fe0c85f3cb35e205a5df4b286e04bf9aa /src/network
parentf6de86ce4b9da21f16d3bcdbc0c55ce4cbe23067 (diff)
downloadminetest-cf7fda00831372d981415f9a830513b2b28fdf25.tar.gz
minetest-cf7fda00831372d981415f9a830513b2b28fdf25.tar.bz2
minetest-cf7fda00831372d981415f9a830513b2b28fdf25.zip
Add z-index management to HUD
Diffstat (limited to 'src/network')
-rw-r--r--src/network/clientpackethandler.cpp7
-rw-r--r--src/network/networkprotocol.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp
index b6e9defb0..79f2b95ba 100644
--- a/src/network/clientpackethandler.cpp
+++ b/src/network/clientpackethandler.cpp
@@ -1081,6 +1081,7 @@ void Client::handleCommand_HudAdd(NetworkPacket* pkt)
v2f offset;
v3f world_pos;
v2s32 size;
+ s16 z_index = 0;
*pkt >> server_id >> type >> pos >> name >> scale >> text >> number >> item
>> dir >> align >> offset;
@@ -1093,6 +1094,11 @@ void Client::handleCommand_HudAdd(NetworkPacket* pkt)
*pkt >> size;
} catch(SerializationError &e) {};
+ try {
+ *pkt >> z_index;
+ }
+ catch(PacketError &e) {}
+
ClientEvent *event = new ClientEvent();
event->type = CE_HUDADD;
event->hudadd.server_id = server_id;
@@ -1108,6 +1114,7 @@ void Client::handleCommand_HudAdd(NetworkPacket* pkt)
event->hudadd.offset = new v2f(offset);
event->hudadd.world_pos = new v3f(world_pos);
event->hudadd.size = new v2s32(size);
+ event->hudadd.z_index = z_index;
m_client_event_queue.push(event);
}
diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h
index 236c7892e..f74027828 100644
--- a/src/network/networkprotocol.h
+++ b/src/network/networkprotocol.h
@@ -563,6 +563,7 @@ enum ToClientCommand
v2f1000 offset
v3f1000 world_pos
v2s32 size
+ s16 z_index
*/
TOCLIENT_HUDRM = 0x4a,