From 8091712153d5e4f9d7a1808971dddf5a73314db1 Mon Sep 17 00:00:00 2001 From: sdasda7777 <17746796+sdasda7777@users.noreply.github.com> Date: Sun, 24 Mar 2024 13:19:24 +0100 Subject: [PATCH] Added build date and GitHub link --- Cargo.toml | 4 ++++ build.rs | 5 +++++ src/main.rs | 15 ++++++++++++--- 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 build.rs diff --git a/Cargo.toml b/Cargo.toml index 19be99f..6c52872 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,10 @@ name = "minesweeper6d" version = "0.1.3" edition = "2021" +# build dependencies +[build-dependencies] +chrono = "0.4.35" + # shared dependencies for all versions: [dependencies] eframe = "0.26" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..ced967b --- /dev/null +++ b/build.rs @@ -0,0 +1,5 @@ +use chrono; + +fn main() { + println!("cargo:rustc-env=BUILD_DATE={}", chrono::offset::Utc::now().to_rfc3339()); +} diff --git a/src/main.rs b/src/main.rs index 1995dd0..54d4ca9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -610,10 +610,19 @@ If neighbor hints are enabled, holding Shift freezes them in place, whereas hold if about_window_enabled { egui::Window::new("About") .open(&mut about_window_enabled).show(ctx, |ui| { - ui.label(format!( -r"Minesweeper4D (version {}) -Code written by sdasda7777 (github.com/sdasda7777) (except where noted otherwise) with a lot of help from amazing members of the egui Discord server", option_env!("CARGO_PKG_VERSION").unwrap())); + ui.vertical(|ui| { + ui.spacing_mut().item_spacing.y = 10.0; + ui.label(format!("Minesweeper4D\n(version {}, built on {})", + env!("CARGO_PKG_VERSION"), + env!("BUILD_DATE"))); + ui.horizontal_wrapped(|ui| { + ui.hyperlink_to("GitHub page", "https://github.com/sdasda7777/minesweeper6d"); + ui.label("(https://github.com/sdasda7777/minesweeper6d)"); + }); + + ui.label("Code written by sdasda7777 (github.com/sdasda7777) (except where noted otherwise) with a lot of help from amazing members of the egui Discord server."); + }); }); } self.about_window_enabled = about_window_enabled;