Skip to content

Commit

Permalink
fix: tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
domi7777 committed Oct 25, 2024
1 parent 292f61c commit 74ca597
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/scenes/LoopTracksScene.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Phaser from 'phaser';
import {HexaColor, hexToColor} from '../colors.ts';

const trackColorsState: Record<boolean, HexaColor> = {
true: '#DDD',
false: '#000',
const trackColorsState: Record<string, HexaColor> = {
selected: '#DDD',
unselected: '#000',
}

type Track = {
Expand All @@ -13,7 +13,7 @@ type Track = {
};

export class LoopTracksScene extends Phaser.Scene {
private tracks: Track[]
private tracks!: Track[]

constructor() {
super('LoopTracksScene');
Expand Down Expand Up @@ -65,7 +65,7 @@ export class LoopTracksScene extends Phaser.Scene {

private updateSelectedColor() {
this.tracks.forEach(({button, selected}) => {
button.setFillStyle(hexToColor(trackColorsState[selected]));
button.setFillStyle(hexToColor(selected? trackColorsState.selected: trackColorsState.unselected));
});
}
}

0 comments on commit 74ca597

Please sign in to comment.