Skip to content

Commit 7699ad1

Browse files
committed
lint
1 parent 5605b31 commit 7699ad1

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

src/frontend/components/atoms/loading.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export function Loading({
2828
return;
2929
}
3030
if (progress === undefined) {
31-
videoRef.current.playbackRate = 2;
32-
videoRef.current.play();
33-
return;
31+
videoRef.current.playbackRate = 2;
32+
videoRef.current.play();
33+
return;
3434
}
3535
const expectedProgress = VIDEO_TIME_S * progress;
3636
const currentTime = videoRef.current.currentTime;

src/frontend/components/ingame-view.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import styles from "./ingame-view.module.css";
33
import { Game } from "../../game";
44
import { AmmoCount, GameReactChannel } from "../../interop/gamechannel";
55
import { WeaponSelector } from "./gameui/weapon-select";
6-
import { IRunningGameInstance, LocalGameInstance } from "../../logic/gameinstance";
6+
import {
7+
IRunningGameInstance,
8+
LocalGameInstance,
9+
} from "../../logic/gameinstance";
710
import { LoadingPage } from "./loading-page";
811

912
export function IngameView({
@@ -23,16 +26,21 @@ export function IngameView({
2326
const ref = useRef<HTMLDivElement>(null);
2427
const [weaponMenu, setWeaponMenu] = useState<AmmoCount | null>(null);
2528
useEffect(() => {
26-
2729
async function init() {
2830
if (gameInstance instanceof LocalGameInstance) {
2931
// XXX: Only so the game feels more responsive by capturing this inside the loading phase.
3032
await gameInstance.startGame();
3133
console.log("Game started");
3234
}
33-
const game = await Game.create(window, scenario, gameReactChannel, gameInstance, level);
35+
const game = await Game.create(
36+
window,
37+
scenario,
38+
gameReactChannel,
39+
gameInstance,
40+
level,
41+
);
3442
setGame(game);
35-
game.ready$.subscribe(r => {
43+
game.ready$.subscribe((r) => {
3644
if (r) {
3745
console.log("Game loaded");
3846
setLoaded(true);
@@ -42,7 +50,7 @@ export function IngameView({
4250
(globalThis as unknown as { wormgine: Game }).wormgine = game;
4351
await game.loadResources();
4452
}
45-
53+
4654
void init().catch((ex) => {
4755
setFatalError(ex);
4856
});

src/game.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ import Logger from "./log";
1414
import { CriticalGameError } from "./errors";
1515
import { getGameSettings } from "./settings";
1616
import { NetGameWorld } from "./net/netGameWorld";
17-
import { BehaviorSubject, debounceTime, fromEvent, map, merge, Observable, of } from "rxjs";
17+
import {
18+
BehaviorSubject,
19+
debounceTime,
20+
fromEvent,
21+
map,
22+
merge,
23+
Observable,
24+
of,
25+
} from "rxjs";
1826
import { IRunningGameInstance } from "./logic/gameinstance";
1927
import { RunningNetGameInstance } from "./net/netgameinstance";
2028

@@ -30,7 +38,7 @@ export class Game {
3038
public readonly rapierGfx: Graphics;
3139
public readonly screenSize$: Observable<{ width: number; height: number }>;
3240
private readonly ready = new BehaviorSubject(false);
33-
public readonly ready$ = this.ready.asObservable() ;
41+
public readonly ready$ = this.ready.asObservable();
3442

3543
public get pixiRoot() {
3644
return this.viewport;

0 commit comments

Comments
 (0)