diff --git a/Cargo.toml b/Cargo.toml index 5edebc3..ad06c18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tkd-scoreboard" -version = "1.1.0" +version = "1.1.1" edition = "2021" authors = ["irzinfante "] repository = "https://github.com/irzinfante/tkd-scoreboard/" diff --git a/src/lib.rs b/src/lib.rs index a80be49..c142265 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -231,6 +231,19 @@ impl Scoreboard { return false; } + pub fn check_fifth_gam_jeon(&mut self) { + if self.cheong_gam_jeon_count > 4 && self.hong_gam_jeon_count == 4 { + self.controls.hong_plus_gam_jeon_btn.deactivate(); + } else if self.hong_gam_jeon_count == 4 { + self.controls.hong_plus_gam_jeon_btn.activate(); + } + if self.hong_gam_jeon_count > 4 && self.cheong_gam_jeon_count == 4 { + self.controls.cheong_plus_gam_jeon_btn.deactivate(); + } else if self.cheong_gam_jeon_count == 4 { + self.controls.cheong_plus_gam_jeon_btn.activate(); + } + } + pub fn round_winner(&self) -> Winner { // 5 gam-jeons diff --git a/src/main.rs b/src/main.rs index 72bd7d3..c07d594 100644 --- a/src/main.rs +++ b/src/main.rs @@ -561,6 +561,7 @@ fn main() { if share.cheong_gam_jeon_count > 4 { cheong_plus_gam_jeon_btn.deactivate(); } + share.check_fifth_gam_jeon(); }); }); @@ -573,6 +574,7 @@ fn main() { if share.cheong_gam_jeon_count == 0 { cheong_minus_gam_jeon_btn.deactivate(); } + share.check_fifth_gam_jeon(); }); }); @@ -602,6 +604,7 @@ fn main() { if share.hong_gam_jeon_count > 4 { hong_plus_gam_jeon_btn.deactivate(); } + share.check_fifth_gam_jeon(); }); }); @@ -614,6 +617,7 @@ fn main() { if share.hong_gam_jeon_count == 0 { hong_minus_gam_jeon_btn.deactivate(); } + share.check_fifth_gam_jeon(); }); });