Skip to content

Fades out and deletes materialize_overlay and secondary_overlay upon skipTurn #2708

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
12 changes: 12 additions & 0 deletions src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,18 @@ export default class Game {
// NOTE: If skipping a turn and there is a temp creature, destroy it.
this.creatures.filter((c) => c.temp).forEach((c) => c.destroy());

// Removing any potential previews - specifically addressing skipTurn after Scavenger Escort Service
if (this.grid.materialize_overlay) {
this.grid.fadeOutTempCreature(); // tween alpha → 0
this.grid.materialize_overlay.destroy(); // remove from display list
this.grid.materialize_overlay = null; // clear the reference
}
if (this.grid.secondary_overlay) {
this.grid.fadeOutTempCreature(this.grid.secondary_overlay);
this.grid.secondary_overlay.destroy();
this.grid.secondary_overlay = null;
}

// Send skip turn to server

if (this.turnThrottle) {
Expand Down