summaryrefslogtreecommitdiff
path: root/src/to_clt
diff options
context:
space:
mode:
authorLizzy Fleckenstein <eliasfleckenstein@web.de>2023-02-13 17:34:48 +0100
committerLizzy Fleckenstein <eliasfleckenstein@web.de>2023-02-13 17:34:48 +0100
commitef635d1cbdfc26e11bfadb0c28007c5aa7a08ee1 (patch)
tree0fddc14d40b002e6010f00b5a7ef13a632750ccc /src/to_clt
parent9e4a1f1be0685e0ba761bf7d851ff7489789d3d3 (diff)
downloadmt_net-ef635d1cbdfc26e11bfadb0c28007c5aa7a08ee1.tar.xz
Fix various packets
Diffstat (limited to 'src/to_clt')
-rw-r--r--src/to_clt/hud.rs11
-rw-r--r--src/to_clt/media.rs2
2 files changed, 8 insertions, 5 deletions
diff --git a/src/to_clt/hud.rs b/src/to_clt/hud.rs
index 64574f7..64fe26b 100644
--- a/src/to_clt/hud.rs
+++ b/src/to_clt/hud.rs
@@ -19,7 +19,8 @@ pub enum HudChange {
Align([f32; 2]),
Offset([f32; 2]),
WorldPos([f32; 3]),
- ZIndex(i32),
+ Size([i32; 2]),
+ ZIndex(i32), // this is i16 in HudAdd, minetest is weird
Text2(String),
Style(EnumSet<HudStyleFlag>),
}
@@ -47,7 +48,8 @@ pub struct HudElement {
pub align: [f32; 2],
pub offset: [f32; 2],
pub world_pos: [f32; 3],
- pub z_index: i32,
+ pub size: [i32; 2],
+ pub z_index: i16,
pub text_2: String,
pub style: EnumSet<HudStyleFlag>,
}
@@ -67,7 +69,8 @@ impl HudElement {
Align(v) => self.align = v,
Offset(v) => self.offset = v,
WorldPos(v) => self.world_pos = v,
- ZIndex(v) => self.z_index = v,
+ Size(v) => self.size = v,
+ ZIndex(v) => self.z_index = v.try_into().unwrap_or(0),
Text2(v) => self.text_2 = v,
Style(v) => self.style = v,
}
@@ -87,7 +90,7 @@ pub enum HudFlag {
#[mt_derive(to = "clt", repr = "u16", tag = "attribute", content = "value")]
pub enum HotbarParam {
- Size(#[mt(const_before = "4u16")] u32) = 0,
+ Size(#[mt(const_before = "4u16")] u32) = 1,
Image(String),
SelectionImage(String),
}
diff --git a/src/to_clt/media.rs b/src/to_clt/media.rs
index a6ecd32..50c709f 100644
--- a/src/to_clt/media.rs
+++ b/src/to_clt/media.rs
@@ -12,7 +12,7 @@ pub struct NodeDef; // TODO
#[mt_derive(to = "clt")]
pub struct NodeMeta; // TODO
-#[mt_derive(to = "clt", repr = "u16")]
+#[mt_derive(to = "clt", repr = "u8")]
pub enum SoundSrcType {
Nowhere = 0,
Pos,