Skip to content

Commit

Permalink
feat:end when finished in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Jun 11, 2024
1 parent 3a97362 commit 2f07fe2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gdrust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ lto = true
codegen-units = 1
strip = true

[profile.action]
inherits = "dev"
features = ["action"]

[workspace]
members = [".", "derive"]
21 changes: 21 additions & 0 deletions gdrust/src/fight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ impl IControl for Fight {
let mut enchanted_sword = self.get_enchanted_sword();
enchanted_sword.call(ENCHANTED_START.into(), &[]);
self.shake(3.0, 1.0);
enchanted_sword.connect("attack_finished".into(), self.get_end_fight());
}
}

Expand Down Expand Up @@ -98,4 +99,24 @@ impl Fight {
),
);
}

#[debug]
fn get_end_fight(&self) -> Callable {
self.base().callable("end_fight")
}

#[debug]
fn check_end_signal(&self) {
let sword = self.get_enchanted_sword();
assert!(sword.has_signal("attack_finished".into()));
}

#[func]
fn end_fight(&mut self) {
#[cfg(feature = "action")]
{
self.exit_tree();
}
godot_print!("end fight")
}
}

0 comments on commit 2f07fe2

Please sign in to comment.