From de883eb968bc899cf4df34ee3e5283e6f033bd6f Mon Sep 17 00:00:00 2001 From: IQuant Date: Sat, 2 Nov 2024 20:15:41 +0300 Subject: [PATCH] Add info rect --- noita-proxy/assets/lang/en-US/main.ftl | 7 ++++- noita-proxy/assets/lang/ja-JP/main.ftl | 7 ++++- noita-proxy/assets/lang/ru-RU/main.ftl | 6 ++++ noita-proxy/assets/lang/zh-CN/main.ftl | 7 ++++- noita-proxy/src/lib.rs | 43 +++++++++++++++++++++----- 5 files changed, 59 insertions(+), 11 deletions(-) diff --git a/noita-proxy/assets/lang/en-US/main.ftl b/noita-proxy/assets/lang/en-US/main.ftl index 773712c2..debea008 100644 --- a/noita-proxy/assets/lang/en-US/main.ftl +++ b/noita-proxy/assets/lang/en-US/main.ftl @@ -89,6 +89,7 @@ connect_settings_autostart = Start the game automatically ## Game settings +connect_settings_spacewars = Allow using steam networking even if you don't have the game on steam, in case you have the gog version of the game. All players need this ticked to work, restart proxy to take effect Health-per-player = Health per player Enable-friendly-fire = Enable friendly fire, allows picking teams in lobby Have-perk-pools-be-independent-of-each-other = Have perk pools be independent of each other @@ -140,4 +141,8 @@ Record-everything-sent-to-noita = Record EVERYTHING sent to noita. ## IP Connect ip_could_not_connect = Could not connect -ip_wait_for_connection = Connecting to ip... \ No newline at end of file +ip_wait_for_connection = Connecting to ip... +## Info + +info_stress_tests = We're doing public lobbies (a.k.a stress tests) every saturday, 18:00 UTC. Join our discord for more info. +Info = Info \ No newline at end of file diff --git a/noita-proxy/assets/lang/ja-JP/main.ftl b/noita-proxy/assets/lang/ja-JP/main.ftl index a23481ee..7c285b4d 100644 --- a/noita-proxy/assets/lang/ja-JP/main.ftl +++ b/noita-proxy/assets/lang/ja-JP/main.ftl @@ -86,6 +86,7 @@ connect_settings_autostart = ゲームを自動的に開始する ## Game settings +connect_settings_spacewars = Allow using steam networking even if you don't have the game on steam, in case you have the gog version of the game. All players need this ticked to work, restart proxy to take effect Health-per-player = Health per player Enable-friendly-fire = Enable friendly fire, allows picking teams in lobby Have-perk-pools-be-independent-of-each-other = Have perk pools be independent of each other @@ -132,4 +133,8 @@ hint_ping = [Middle mouse button or right thumb stick] spawns a ping ## IP Connect ip_could_not_connect = Could not connect -ip_wait_for_connection = Connecting to ip... \ No newline at end of file +ip_wait_for_connection = Connecting to ip... +## Info + +info_stress_tests = We're doing public lobbies (a.k.a stress tests) every saturday, 18:00 UTC. Join our discord for more info. +Info = Info \ No newline at end of file diff --git a/noita-proxy/assets/lang/ru-RU/main.ftl b/noita-proxy/assets/lang/ru-RU/main.ftl index d1a290ac..2fa598c7 100644 --- a/noita-proxy/assets/lang/ru-RU/main.ftl +++ b/noita-proxy/assets/lang/ru-RU/main.ftl @@ -89,6 +89,7 @@ connect_settings_autostart = Запускать игру автоматичес ## Game settings +connect_settings_spacewars = Allow using steam networking even if you don't have the game on steam, in case you have the gog version of the game. All players need this ticked to work, restart proxy to take effect Health-per-player = Стартовое здоровье Enable-friendly-fire = Включить дружественный огонь Have-perk-pools-be-independent-of-each-other = Сделать перки локальными для каждого игрока @@ -141,3 +142,8 @@ Record-everything-sent-to-noita = Записывать всё что отпра ip_could_not_connect = Не удалось подключиться ip_wait_for_connection = Подключение к ip... + +## Info + +info_stress_tests = We're doing public lobbies (a.k.a stress tests) every saturday, 18:00 UTC. Join our discord for more info. +Info = Info \ No newline at end of file diff --git a/noita-proxy/assets/lang/zh-CN/main.ftl b/noita-proxy/assets/lang/zh-CN/main.ftl index 55fbf8a6..abab7307 100644 --- a/noita-proxy/assets/lang/zh-CN/main.ftl +++ b/noita-proxy/assets/lang/zh-CN/main.ftl @@ -86,6 +86,7 @@ connect_settings_autostart = 自动启动游戏 ## Game settings +connect_settings_spacewars = Allow using steam networking even if you don't have the game on steam, in case you have the gog version of the game. All players need this ticked to work, restart proxy to take effect Health-per-player = Health per player Enable-friendly-fire = 启用队友伤害 Have-perk-pools-be-independent-of-each-other = 启用神山独立天赋池 @@ -132,4 +133,8 @@ hint_ping = [鼠标中键或右摇杆] 会产生一个信号 ## IP Connect ip_could_not_connect = 无法连接 -ip_wait_for_connection = 连接至IP... \ No newline at end of file +ip_wait_for_connection = 连接至IP... +## Info + +info_stress_tests = We're doing public lobbies (a.k.a stress tests) every saturday, 18:00 UTC. Join our discord for more info. +Info = Info \ No newline at end of file diff --git a/noita-proxy/src/lib.rs b/noita-proxy/src/lib.rs index 088cfb20..d9e98f3d 100644 --- a/noita-proxy/src/lib.rs +++ b/noita-proxy/src/lib.rs @@ -199,7 +199,7 @@ impl Default for AppSavedState { start_game_automatically: false, show_extra_debug_stuff: false, record_all: false, - spacewars: false + spacewars: false, } } } @@ -537,7 +537,8 @@ impl App { let (rect, right_b_panel) = rect.split_left_right_at_x(rect.width() - (50.0 + group_shrink * 2.0)); let (settings_rect, right) = rect.split_left_right_at_fraction(0.5); - let (steam_connect_rect, ip_connect_rect) = right.split_top_bottom_at_fraction(0.5); + let (steam_connect_rect, other_rect) = right.split_top_bottom_at_fraction(0.33); + let (ip_connect_rect, info_rect) = other_rect.split_top_bottom_at_fraction(0.5); ui.allocate_new_ui( UiBuilder { @@ -556,6 +557,20 @@ impl App { }, ); + ui.allocate_new_ui( + UiBuilder { + max_rect: Some(info_rect.shrink(group_shrink)), + ..Default::default() + }, + |ui| { + filled_group(ui, |ui| { + ui.set_min_size(ui.available_size()); + heading_with_underline(ui, tr("Info")); + ui.label(tr("info_stress_tests")); + }); + }, + ); + ui.allocate_new_ui( UiBuilder { max_rect: Some(right_b_panel.shrink(group_shrink)), @@ -663,7 +678,7 @@ impl App { } if cfg!(target_os = "linux") { - ui.add_space(30.0); + ui.add_space(15.0); ui.label(tr("connect_steam_workaround_label")); ui.text_edit_singleline(&mut self.lobby_id_field); if ui.button(tr("connect_steam_connect_2")).clicked() { @@ -734,9 +749,15 @@ impl App { ui.label(tr("local_health_desc_2")); ui.add_space(5.0); ui.label(tr("Health-percent-lost-on-reviving")); - ui.add(Slider::new(&mut game_settings.health_lost_on_revive, 0..=100)); + ui.add(Slider::new( + &mut game_settings.health_lost_on_revive, + 0..=100, + )); ui.checkbox(&mut game_settings.global_hp_loss, tr("global_hp_loss")); - ui.checkbox(&mut game_settings.no_material_damage, tr("no_material_damage")); + ui.checkbox( + &mut game_settings.no_material_damage, + tr("no_material_damage"), + ); } } }); @@ -795,7 +816,7 @@ impl App { ); ui.checkbox( &mut self.app_saved_state.spacewars, - "make steam work with non steam noita versions, all players need this ticked to work, restart proxy to take effect", + tr("connect_settings_spacewars"), ); ui.add_space(20.0); if self.player_image.width() == 1 { @@ -807,7 +828,13 @@ impl App { let old_hue = self.appearance.hue; let old = ui.style_mut().spacing.slider_width; ui.style_mut().spacing.slider_width = 256.0; - ui.add(Slider::new(&mut self.appearance.hue, 0.0..=360.0).text(tr("Shift-hue")).min_decimals(0).max_decimals(0).step_by(2.0)); + ui.add( + Slider::new(&mut self.appearance.hue, 0.0..=360.0) + .text(tr("Shift-hue")) + .min_decimals(0) + .max_decimals(0) + .step_by(2.0), + ); ui.style_mut().spacing.slider_width = old; if old_hue != self.appearance.hue { let diff = self.appearance.hue - old_hue; @@ -1428,4 +1455,4 @@ pub fn host_cli(port: u16) { let player_path = netmaninit.player_path.clone(); let netman = net::NetManager::new(varient, netmaninit); netman.start_inner(player_path, true).unwrap(); -} \ No newline at end of file +}