Skip to content

Commit

Permalink
save settings on create/connect to lobby to prevent them from being d…
Browse files Browse the repository at this point in the history
…eleted as easily
  • Loading branch information
bgkillas committed Dec 7, 2024
1 parent e9bddda commit 59f0c73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions noita-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -964,13 +964,15 @@ impl App {
match &self.steam_state {
Ok(_) => {
if ui.button(tr("connect_steam_create")).clicked() {
self.set_settings();
self.start_steam_host();
}
if ui.button(tr("connect_steam_connect")).clicked() {
let id = ClipboardProvider::new()
.and_then(|mut ctx: ClipboardContext| ctx.get_contents());
match id {
Ok(id) => {
self.set_settings();
self.connect_to_steam_lobby(id);
}
Err(error) => self.notify_error(error),
Expand All @@ -982,6 +984,7 @@ impl App {
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() {
self.set_settings();
self.connect_to_steam_lobby(self.lobby_id_field.clone());
}
}
Expand All @@ -997,6 +1000,7 @@ impl App {

ui.label(tr("ip_note"));
if ui.button(tr("ip_host")).clicked() {
self.set_settings();
self.start_server();
}

Expand All @@ -1011,6 +1015,7 @@ impl App {
ui.add_enabled_ui(addr.is_ok(), |ui| {
if ui.button(tr("ip_connect")).clicked() {
if let Ok(addr) = addr {
self.set_settings();
self.start_connect(addr);
}
}
Expand Down

0 comments on commit 59f0c73

Please sign in to comment.