main menu fixes
This commit is contained in:
@@ -183,10 +183,12 @@ impl GameManager {
|
||||
let idx = self.current_day_index;
|
||||
self.base_mut()
|
||||
.call_deferred("start_day", &[idx.to_variant()]);
|
||||
godot_print!("GameManager: Starting day {}", idx);
|
||||
}
|
||||
|
||||
#[func]
|
||||
pub fn on_retry_pressed(&mut self) {
|
||||
godot_print!("GameManager: Retrying day {}", self.current_day_index);
|
||||
let idx = self.current_day_index;
|
||||
self.base_mut()
|
||||
.call_deferred("start_day", &[idx.to_variant()]);
|
||||
@@ -195,12 +197,14 @@ impl GameManager {
|
||||
#[func]
|
||||
pub fn on_menu_pressed(&mut self) {
|
||||
if let Some(menu) = &self.main_menu_scene {
|
||||
godot_print!("GameManager: Returning to main menu");
|
||||
let menu_ref = menu.clone();
|
||||
self.base()
|
||||
.get_tree()
|
||||
.unwrap()
|
||||
.change_scene_to_packed(&menu_ref);
|
||||
} else {
|
||||
godot_error!("GameManager: No main menu scene assigned");
|
||||
self.base().get_tree().unwrap().quit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user