Skip to content

Commit

Permalink
Extend the api to support fetching soundsets, online global elements and
Browse files Browse the repository at this point in the history
online elements

Fixes #46
  • Loading branch information
frondeus committed Jan 20, 2023
1 parent 984b147 commit 5ec9024
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/syrin/services/game.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="@league-of-foundry-developers/foundry-vtt-types" />
import { injectable } from 'tsyringe';
import { MODULE } from './utils';
import type { Soundset, Mood, Element } from '@/models';
import type { Soundset, Mood, Element, Soundsets } from '@/models';
import { socket } from '@/socket';

export interface PlayMoodParams {
Expand All @@ -16,6 +16,9 @@ export interface Global {
openDebug(): void;
isPlayerActive(): boolean;
refresh(): void;
soundSources(): Promise<Soundsets>;
onlineElements(id: string): Promise<Element[]>;
onlineGlobalElements(): Promise<Element[]>;
}

export interface FVTTGame {
Expand Down
9 changes: 9 additions & 0 deletions src/syrin/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ export function initSettings(ctx: Context) {
},
refresh: () => {
ctx.stores.refresh();
},
soundSources: async () => {
return await api.onlineSoundsets();
},
onlineElements: async (id: string) => {
return await api.onlineElements(id);
},
onlineGlobalElements: async() => {
return await api.onlineGlobalElements();
}
});

Expand Down

0 comments on commit 5ec9024

Please sign in to comment.