Skip to content

Commit

Permalink
Add UserScript API for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Nov 24, 2023
1 parent 0459c7f commit 54c0d82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/kitten-scientists/source/UserScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Engine, EngineState, GameLanguage, SupportedLanguage } from "./Engine.j
import { ScienceSettings } from "./settings/ScienceSettings.js";
import { SpaceSettings } from "./settings/SpaceSettings.js";
import { WorkshopSettings } from "./settings/WorkshopSettings.js";
import { State } from "./state/State.js";
import { cdebug, cerror, cinfo, cwarn } from "./tools/Log.js";
import { Game } from "./types/index.js";
import { UserInterface } from "./ui/UserInterface.js";
Expand Down Expand Up @@ -237,6 +238,12 @@ export class UserScript {
this.engine.imessage("settings.imported");
}

async importSettingsFromUrl(url: string) {
const importState = new State(url);
const settings = await importState.resolve();
settings.report.aggregate(console);
}

/**
* Copies an engine state to the clipboard.
*
Expand Down

0 comments on commit 54c0d82

Please sign in to comment.