@@ -13,14 +13,15 @@ import WormHoleLayer from './wormHole'
13
13
import TooltipLayer from './tooltip'
14
14
import type { Store } from "vuex" ;
15
15
import type { State } from "../store" ;
16
- import type { DrawingContext , GameContainer } from "./container" ;
16
+ import { type DrawingContext , type GameContainer } from "./container" ;
17
17
import type { Game , Player , Star as StarData , Carrier as CarrierData } from "../types/game" ;
18
18
import type { Location , MapObject , UserGameSettings } from "@solaris-common" ;
19
19
import { Chunks } from './chunks'
20
20
import Carrier from "./carrier" ;
21
21
import type { EventBus } from '../eventBus'
22
22
import MapEventBusEventNames from '../eventBusEventNames/map'
23
23
import MapCommandEventBusEventNames from "../eventBusEventNames/mapCommand" ;
24
+ import globalGameContainer from './container' ;
24
25
25
26
enum Mode {
26
27
Galaxy = 'galaxy' ,
@@ -286,6 +287,14 @@ export class Map {
286
287
}
287
288
}
288
289
290
+ destroy ( ) {
291
+ if ( this . unsubscribe ) {
292
+ this . unsubscribe ( ) ;
293
+ }
294
+
295
+ this . unsubscribe = undefined ;
296
+ }
297
+
289
298
setupStar ( game : Game , userSettings : UserGameSettings , starData : StarData ) {
290
299
let star = this . stars . find ( x => x . data . _id === starData . _id )
291
300
@@ -791,7 +800,7 @@ export class Map {
791
800
} else if ( this . mode === 'ruler' ) {
792
801
this . rulerPoints ! . onStarClicked ( e )
793
802
}
794
- AnimationService . drawSelectedCircle ( this . app , this . container , e . location )
803
+ AnimationService . drawSelectedCircle ( globalGameContainer . app ! , this . container , e . location )
795
804
}
796
805
797
806
onStarDefaultClicked ( dic ) {
@@ -856,7 +865,7 @@ export class Map {
856
865
this . rulerPoints ! . onCarrierClicked ( e )
857
866
}
858
867
859
- AnimationService . drawSelectedCircle ( this . app , this . container , e . location )
868
+ AnimationService . drawSelectedCircle ( globalGameContainer . app ! , this . container , e . location )
860
869
}
861
870
862
871
onCarrierRightClicked ( e ) {
0 commit comments