diff --git a/src/ui/battle/ArenaDrone.ts b/src/ui/battle/ArenaDrone.ts index a5e54a3..ccf17d0 100644 --- a/src/ui/battle/ArenaDrone.ts +++ b/src/ui/battle/ArenaDrone.ts @@ -17,7 +17,7 @@ module TS.SpaceTac.UI { // Activation effect activation: Phaser.Graphics; - + // Destroyed state destroyed = false; @@ -46,7 +46,10 @@ module TS.SpaceTac.UI { this.sprite.anchor.set(0.5, 0.5); this.sprite.scale.set(0.1, 0.1); this.addChild(this.sprite); - this.view.tooltip.bindDynamicText(this.sprite, () => this.drone.getDescription()); + + this.view.tooltip.bindDynamicText(this.sprite, () => { + return this.destroyed ? "" : this.drone.getDescription(); + }); } /** @@ -66,7 +69,7 @@ module TS.SpaceTac.UI { tween.start(); return 500; } - + /** * Set the sprite as destroyed */ diff --git a/src/ui/common/Tooltip.ts b/src/ui/common/Tooltip.ts index c82e264..ce7e2e7 100644 --- a/src/ui/common/Tooltip.ts +++ b/src/ui/common/Tooltip.ts @@ -90,8 +90,13 @@ module TS.SpaceTac.UI { */ bindDynamicText(obj: Phaser.Button, text_getter: () => string): void { this.bind(obj, container => { - container.add(new Phaser.Text(container.game, 0, 0, text_getter(), { font: "bold 20pt Arial", fill: "#cccccc" })); - return true; + let content = text_getter(); + if (content) { + container.add(new Phaser.Text(container.game, 0, 0, content, { font: "bold 20pt Arial", fill: "#cccccc" })); + return true; + } else { + return false; + } }); }