add option to disable other players' cursors

This commit is contained in:
kcalbxof 2024-11-30 07:10:03 +03:00
parent f40b13a628
commit 9737e47eb0
5 changed files with 31 additions and 11 deletions

View file

@ -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.

View file

@ -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 = Иногда можно перепутать курсоры других игроков со своим. Этой галочкой можно отключить их.

View file

@ -400,6 +400,7 @@ struct PlayerAppearance {
pub struct UXSettings {
ping_lifetime: Option<u32>,
ping_scale: Option<f32>,
hide_cursors: Option<bool>,
}
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) {

View file

@ -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());