diff --git a/README.md b/README.md index abab7e5..cbf8d94 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,13 @@ Tracker for All Stats Entry runs in Spelunky Classic This tracker is meant to be used as a browser source in OBS to avoid the need to worry about chroma keys and ugly masking. To setup this up select a `Browser` under sources and fill in `http://127.0.0.1:4224` for the URL. Setting a height of `1600` allowed the full window to be displayed for me. +We also support multiple rulesets in the tracker. + +Ruleset 1 - Requires getting all enemy deaths and kills +Ruleset 2 - Requires getting a death OR kill for each enemy + +The default ruleset currently is 1 however you can choose an explicit ruleset by adding a `ruleset` query parameter. For example to use ruleset 2 use the URL `http://127.0.0.1:4224?ruleset=2`. + ![unknown](https://user-images.githubusercontent.com/231118/166628232-703a7bf7-170c-4863-9bbb-2212dd746442.png)![image](https://user-images.githubusercontent.com/231118/166628340-3edaac5a-901e-4a89-8f61-206d0f08bbd7.png) ## Development diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index c0eb97c..166c319 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -1,5 +1,8 @@ @@ -34,26 +45,28 @@ - {#if showDeaths} - - {:else} - - {/if} + {#if store.ruleset == 1} + {#if showDeaths} + + {:else} + + {/if} - {#if showKills} - - {:else} - + {#if showKills} + + {:else} + + {/if} {/if} diff --git a/frontend/src/EnemyList1.svelte b/frontend/src/EnemyList1.svelte new file mode 100644 index 0000000..ead32f9 --- /dev/null +++ b/frontend/src/EnemyList1.svelte @@ -0,0 +1,64 @@ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + diff --git a/frontend/src/EnemyList2.svelte b/frontend/src/EnemyList2.svelte new file mode 100644 index 0000000..815003a --- /dev/null +++ b/frontend/src/EnemyList2.svelte @@ -0,0 +1,51 @@ + + +
+
+ + + + + +
+
+
+ + + + +
+
+ + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + +
+
+ + diff --git a/frontend/src/MiscDeaths1.svelte b/frontend/src/MiscDeaths1.svelte new file mode 100644 index 0000000..47fd090 --- /dev/null +++ b/frontend/src/MiscDeaths1.svelte @@ -0,0 +1,29 @@ + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + diff --git a/frontend/src/MiscDeaths2.svelte b/frontend/src/MiscDeaths2.svelte new file mode 100644 index 0000000..b8a3b1f --- /dev/null +++ b/frontend/src/MiscDeaths2.svelte @@ -0,0 +1,31 @@ + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + diff --git a/frontend/src/stores.ts b/frontend/src/stores.ts index 1c9e9a3..e953c4b 100644 --- a/frontend/src/stores.ts +++ b/frontend/src/stores.ts @@ -1,8 +1,21 @@ -import { writable } from "svelte/store"; +import { writable, readable } from "svelte/store"; import constants from "./constants"; const stats = writable({ ...constants.DEFAULT_STATS }); const connected = writable(false); + +function get_ruleset() { + const params = new URLSearchParams(window.location.search); + let ruleset = parseInt(params.get("ruleset")); + if (ruleset == null || isNaN(ruleset) || ruleset < 1 || ruleset > 2) { + ruleset = 1; + } + + return ruleset; +} + +const ruleset = get_ruleset(); + let ws = null; function connect() { @@ -37,4 +50,5 @@ connect(); export default { stats, connected, + ruleset, };