diff options
Diffstat (limited to 'webAO/viewport/utils/initTestimonyUpdater.ts')
| -rw-r--r-- | webAO/viewport/utils/initTestimonyUpdater.ts | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/webAO/viewport/utils/initTestimonyUpdater.ts b/webAO/viewport/utils/initTestimonyUpdater.ts index e6f6e9d..c1e4d93 100644 --- a/webAO/viewport/utils/initTestimonyUpdater.ts +++ b/webAO/viewport/utils/initTestimonyUpdater.ts @@ -1,31 +1,33 @@ -import { Testimony } from '../interfaces/Testimony' -import { client, UPDATE_INTERVAL } from '../../client' +import { Testimony } from "../interfaces/Testimony"; +import { client, UPDATE_INTERVAL } from "../../client"; /** * Intialize testimony updater */ export const initTestimonyUpdater = () => { - const testimonyFilenames: Testimony = { - 1: "witnesstestimony", - 2: "crossexamination", - 3: "notguilty", - 4: "guilty", - }; + const testimonyFilenames: Testimony = { + 1: "witnesstestimony", + 2: "crossexamination", + 3: "notguilty", + 4: "guilty", + }; - const testimony = testimonyFilenames[client.testimonyID]; - if (!testimony) { - console.warn(`Invalid testimony ID ${client.testimonyID}`); - return; - } + const testimony = testimonyFilenames[client.testimonyID]; + if (!testimony) { + console.warn(`Invalid testimony ID ${client.testimonyID}`); + return; + } - client.viewport.testimonyAudio.src = client.resources[testimony].sfx; - client.viewport.testimonyAudio.play(); + client.viewport.testimonyAudio.src = client.resources[testimony].sfx; + client.viewport.testimonyAudio.play(); - const testimonyOverlay = <HTMLImageElement>( - document.getElementById("client_testimony") - ); - testimonyOverlay.src = client.resources[testimony].src; - testimonyOverlay.style.opacity = "1"; + const testimonyOverlay = <HTMLImageElement>( + document.getElementById("client_testimony") + ); + testimonyOverlay.src = client.resources[testimony].src; + testimonyOverlay.style.opacity = "1"; - client.viewport.setTestimonyTimer(0); - client.viewport.setTestimonyUpdater(setTimeout(() => client.viewport.updateTestimony(), UPDATE_INTERVAL)); -};
\ No newline at end of file + client.viewport.setTestimonyTimer(0); + client.viewport.setTestimonyUpdater( + setTimeout(() => client.viewport.updateTestimony(), UPDATE_INTERVAL), + ); +}; |
