diff --git a/noita-proxy/assets/lang/en-US/main.ftl b/noita-proxy/assets/lang/en-US/main.ftl index 8f1e2dc5..edf9ccd8 100644 --- a/noita-proxy/assets/lang/en-US/main.ftl +++ b/noita-proxy/assets/lang/en-US/main.ftl @@ -153,10 +153,13 @@ Info = Info connect_settings_random_ports = Don't use a predetermined port. Makes things a bit more robust and allows multiple proxies to be launched on the same computer, but Noita will have to be launched through the proxy. -## Arrow UX settings +## UX settings ping-note = Ping arrow parameters ping-lifetime = Ping arrow lifetime in seconds. ping-scale = Ping arrow size. ping-lifetime-tooltip = This parameter changes how much frames (seconds*60, since game is supposed to run 60 fps?) ping arrow lives. Range: 0-60 seconds. ping-scale-tooltip = This parameter changes size of ping arrow. I dont know which units it is, but range is 0-1.5 units. + +hide-cursors-checkbox = Disable others' cursors +hide-cursors-checkbox-tooltip = Sometimes you can confuse your friends' cursors with yours. In that case, you can disable them altogether with this checkbox. diff --git a/noita-proxy/assets/lang/ru-RU/main.ftl b/noita-proxy/assets/lang/ru-RU/main.ftl index 51b29b65..3c3ca169 100644 --- a/noita-proxy/assets/lang/ru-RU/main.ftl +++ b/noita-proxy/assets/lang/ru-RU/main.ftl @@ -151,7 +151,7 @@ Info = Info connect_settings_random_ports = Don't use a predetermined port. Makes things a bit more robust and allows multiple proxies to be launched on the same computer, but Noita will have to be launched through the proxy. -## Arrow UX settings +## UX settings ping-note = Параметры стрелочки-пинга ping-lifetime = Время жизни стрелки в секундах. @@ -159,10 +159,5 @@ ping-scale = Размер стрелки в юнитах. ping-lifetime-tooltip = Этот параметр изменяет время жизни стрелочки (секунды*60, т.к. игра должна работать в 60 фпс?). Диапазон: 0-60 секунд. ping-scale-tooltip = Этот параметр изменяет размер стрелочки. Не знаю какая единица измерения, но диапазон 0-1.5 юнита. - - - - - - - +hide-cursors-checkbox = Отключить курсоры других игроков. +hide-cursors-checkbox-tooltip = Иногда можно перепутать курсоры других игроков со своим. Этой галочкой можно отключить их. diff --git a/noita-proxy/src/lib.rs b/noita-proxy/src/lib.rs index 205e8c75..37ea7dbb 100644 --- a/noita-proxy/src/lib.rs +++ b/noita-proxy/src/lib.rs @@ -400,6 +400,7 @@ struct PlayerAppearance { pub struct UXSettings { ping_lifetime: Option, ping_scale: Option, + hide_cursors: Option, } impl UXSettings { @@ -409,6 +410,9 @@ impl UXSettings { fn ping_scale(&self) -> f32 { self.ping_scale.unwrap_or(0.5) } + fn hide_cursors(self) -> bool { + self.hide_cursors.unwrap_or(false) + } } impl Default for PlayerAppearance { @@ -1143,6 +1147,15 @@ impl App { { self.ux_settings.ping_scale = Some(tmp); } + + let mut tmp = self.ux_settings.hide_cursors(); + if ui + .add(egui::Checkbox::new(&mut tmp, tr("hide-cursors-checkbox"))) + .on_hover_text(tr("hide-cursors-checkbox-tooltip")) + .changed() + { + self.ux_settings.hide_cursors = Some(tmp); + } } fn connect_to_steam_lobby(&mut self, lobby_id: String) { diff --git a/noita-proxy/src/net.rs b/noita-proxy/src/net.rs index 26c96d3b..47f45ee8 100644 --- a/noita-proxy/src/net.rs +++ b/noita-proxy/src/net.rs @@ -614,7 +614,10 @@ impl NetManager { self.init_settings.ux_settings.ping_lifetime(), ); state.try_ws_write_option("ping_scale", self.init_settings.ux_settings.ping_scale()); - + state.try_ws_write_option( + "hide_cursors", + self.init_settings.ux_settings.hide_cursors(), + ); let progress = settings.progress.join(","); state.try_ws_write_option("progress", progress.as_str()); diff --git a/quant.ew/files/system/player_sync.lua b/quant.ew/files/system/player_sync.lua index 6c8fae66..b87af36b 100644 --- a/quant.ew/files/system/player_sync.lua +++ b/quant.ew/files/system/player_sync.lua @@ -108,7 +108,13 @@ function module.on_world_update() local children = EntityGetAllChildren(ent) or {} if ctx.my_id ~= peer_id then for _, child in ipairs(children) do - if EntityGetName(child) == "cursor" or EntityGetName(child) == "notcursor" then + if EntityGetName(child) == "cursor" and ctx.proxy_opt.hide_cursors == true then + EntitySetComponentIsEnabled(child, EntityGetFirstComponent(child, "SpriteComponent"), false) + else + EntitySetComponentIsEnabled(child, + EntityGetFirstComponentIncludingDisabled(child, "SpriteComponent"), true) + end + if EntityGetName(child) == "notcursor" then EntitySetComponentIsEnabled(child, EntityGetFirstComponentIncludingDisabled(child, "SpriteComponent"), true) end end