From 6f2764397782e91ac0e670ba574e6ed0f8797813 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Wed, 12 Jun 2024 09:51:02 -0400 Subject: [PATCH] Fix lint errors --- src/Myrian/Myrian.ts | 2 +- src/NetscriptFunctions/Myrian.ts | 2 +- src/engine.tsx | 52 +++++++++++++++++--------------- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/Myrian/Myrian.ts b/src/Myrian/Myrian.ts index c93268562..761179ccf 100644 --- a/src/Myrian/Myrian.ts +++ b/src/Myrian/Myrian.ts @@ -2,7 +2,7 @@ import { Device, DeviceType, Component, DeviceID, Glitch } from "@nsdefs"; import { glitchMult } from "./formulas/glitches"; import { isDeviceISocket, pickOne } from "./utils"; import { componentTiers } from "./formulas/components"; -import { NewBattery, NewBus, NewCache, NewISocket, NewLock, NewOSocket, NewReducer } from "./NewDevices"; +import { NewBus, NewISocket, NewOSocket } from "./NewDevices"; import { startRoaming } from "./glitches/roaming"; import { startRust } from "./glitches/rust"; import { startSegmentation } from "./glitches/segmentation"; diff --git a/src/NetscriptFunctions/Myrian.ts b/src/NetscriptFunctions/Myrian.ts index 81336f533..764fff85a 100644 --- a/src/NetscriptFunctions/Myrian.ts +++ b/src/NetscriptFunctions/Myrian.ts @@ -1,4 +1,3 @@ -import { Bus, Myrian as IMyrian, DeviceType, Component, Reducer, Glitch, Battery, ISocket } from "@nsdefs"; import { InternalAPI } from "../Netscript/APIWrapper"; import { helpers } from "../Netscript/NetscriptHelpers"; import { @@ -53,6 +52,7 @@ import { import { installSpeed, emissionSpeed, moveSpeed, reduceSpeed, transferSpeed } from "../Myrian/formulas/speed"; import { NewBattery, NewBus, NewCache, NewISocket, NewLock, NewOSocket, NewReducer } from "../Myrian/NewDevices"; import { rustBus } from "../Myrian/glitches/rust"; +import { Bus, Myrian as IMyrian, DeviceType, Component, Reducer, Glitch, Battery, ISocket } from "@nsdefs"; export function NetscriptMyrian(): InternalAPI { return { diff --git a/src/engine.tsx b/src/engine.tsx index 5e5059ca8..ef1c9ef83 100644 --- a/src/engine.tsx +++ b/src/engine.tsx @@ -360,31 +360,33 @@ const Engine: { Player.lastUpdate = Engine._lastUpdate; Engine.start(); // Run main game loop and Scripts loop - // const timeOfflineString = convertTimeMsToTimeElapsedString(time); - // setTimeout( - // () => - // AlertEvents.emit( - // <> - // Offline for {timeOfflineString}. While you were offline: - // - // , - // ), - // 250, - // ); + if (process.env.NODE_ENV !== "development") { + const timeOfflineString = convertTimeMsToTimeElapsedString(time); + setTimeout( + () => + AlertEvents.emit( + <> + Offline for {timeOfflineString}. While you were offline: + + , + ), + 250, + ); + } } else { // No save found, start new game FormatsNeedToChange.emit();