Skip to content

Commit

Permalink
Merge pull request #646 from UQcsse3200/team2_upgrades2
Browse files Browse the repository at this point in the history
Fixed meter.remove(), text.remove() issue for Main
  • Loading branch information
CalvinJohn99 authored Oct 16, 2024
2 parents 8402f8a + c03d86b commit 4898d7a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@ public void activate() {
public void deactivate() {
isActive = false;
layout.setVisible(false);
meter.remove();
text.remove();
// Ensure the text and meter are removed from the stage after time finish
if (meter != null && meter.hasParent()) {
meter.remove();
text.remove();
}

ServiceLocator.getDocketService().getEvents().trigger("UnDancing");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ public void deactivate() {
ServiceLocator.getRandomComboService().getEvents().trigger("extortion unactive");


meter.remove();
text.remove();
// Ensure the text and meter are removed from the stage after time finish
if (meter != null && meter.hasParent()) {
meter.remove();
text.remove();
}
}

/**
Expand Down

0 comments on commit 4898d7a

Please sign in to comment.