Skip to content

Commit

Permalink
update-check: don't show update check settings in non-release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
necauqua committed Oct 14, 2024
1 parent 6327c24 commit d8f4ba1
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/tools/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl Settings {
let info = RichText::new(label).font(font);
ui.hyperlink_to(info, url.clone()).on_hover_text(url);

if let Some(ref s) = self.newest_version {
if let Some(s) = &self.newest_version {
let text = RichText::new(format!(" (latest: {s})"))
.small()
.color(ui.style().visuals.weak_text_color());
Expand Down Expand Up @@ -121,20 +121,22 @@ impl Settings {
ui.end_row();
}

ui.checkbox(&mut self.check_for_updates, "Check for updates on startup")
.on_hover_text("This makes one request to the GitHub API on startup to check the latest release version");
ui.end_row();
if RELEASE_VERSION.is_some() {
ui.checkbox(&mut self.check_for_updates, "Check for updates on startup")
.on_hover_text("This makes one request to the GitHub API on startup to check the latest release version");
ui.end_row();

if !self.check_for_updates {
self.notify_when_outdated = false;
}
ui.vertical(|ui| {
ui.indent("update-check", |ui| {
ui.add_enabled(self.check_for_updates, Checkbox::new(&mut self.notify_when_outdated, "Startup update notification"))
.on_hover_text("This controls the popup shown on startup if the latest release version is newer than the current version");
if !self.check_for_updates {
self.notify_when_outdated = false;
}
ui.vertical(|ui| {
ui.indent("update-check", |ui| {
ui.add_enabled(self.check_for_updates, Checkbox::new(&mut self.notify_when_outdated, "Startup update notification"))
.on_hover_text("This controls the popup shown on startup if the latest release version is newer than the current version");
});
});
});
ui.end_row();
ui.end_row();
}

ui.checkbox(&mut self.check_export_name, "Check export name")
.on_hover_text("When detecting noita, check that the executable export name is 'wizard_physics.exe'");
Expand Down

0 comments on commit d8f4ba1

Please sign in to comment.