Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show the game version at the bottom-right of the main menu. #887

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: show the game version at the bottom-right of the main menu.
zicklag committed Dec 22, 2023
commit ee48b8382c0814975a9844397185e9f994247a28
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -35,9 +35,10 @@ serde_yaml = "0.9.25"
thiserror = "1.0.48"
peg = "0.8.1"
egui_extras = { version = "0.23.0", default-features = false }
git-version = "0.3.9"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy_dylib = "0.11"
bevy_dylib = "0.11"

# anyhow = "1.0"
# async-channel = "1.7"
16 changes: 16 additions & 0 deletions src/ui/main_menu.rs
Original file line number Diff line number Diff line change
@@ -88,6 +88,22 @@ fn main_menu_system(world: &World) {
MenuPage::Credits => world.run_system(credits::widget, ui),
MenuPage::NetworkGame => todo!(),
});

egui::CentralPanel::default()
.frame(egui::Frame::none())
.show(&ctx, |ui| {
ui.with_layout(egui::Layout::bottom_up(egui::Align::Max), |ui| {
ui.add_space(5.0);
ui.with_layout(egui::Layout::right_to_left(egui::Align::Max), |ui| {
ui.add_space(5.0);
ui.add(
egui::TextEdit::singleline(&mut git_version::git_version!())
.text_color(egui::Color32::WHITE)
.horizontal_align(egui::Align::Max),
);
})
});
});
}

/// System to render the home menu.