Skip to content

Commit

Permalink
Merge pull request #37 from Matt-Hurd/mhurd/minor_stuff
Browse files Browse the repository at this point in the history
Minor stuff
  • Loading branch information
Matt-Hurd authored Sep 14, 2023
2 parents 07a9fb7 + 3b3c8e6 commit b9905c3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
15 changes: 15 additions & 0 deletions public/assets/default_routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@
"name": "Centum v1.2",
"gh": true,
"path": "gh/Matt-Hurd/totk-speedrun-routes/hundo_centum_v1.2/"
},
{
"name": "Any% Scuffed",
"gh": true,
"path": "gh/Matt-Hurd/totk-speedrun-routes/any_scuffed_abahbob_1.0/"
},
{
"name": "AD Scuffed",
"gh": true,
"path": "gh/Matt-Hurd/totk-speedrun-routes/ad_scuffed_abahbob_1.0/"
},
{
"name": "AMQ Scuffed",
"gh": true,
"path": "gh/Matt-Hurd/totk-speedrun-routes/amq_scuffed_abahbob_1.0/"
}
]
}
Expand Down
1 change: 1 addition & 0 deletions src/models/Route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default class Route {
url: string;
game: Game;
version: string;
category: string = "";
branches: Branch[] = [];
things: Record<string, Thing> = {};

Expand Down
11 changes: 9 additions & 2 deletions src/store/progressSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit";
import { RootState } from ".";
import liveSplitService from "../services/LiveSplitWebSocket";

interface ProgressState {
export interface ProgressState {
branchIndex: number;
pointIndex: number;
}
Expand All @@ -25,7 +25,14 @@ export const incrementProgress = createAsyncThunk("progress/increment", async (_
((thing.type === "Shrine" && point.action === "COMPLETE") || thing.type === "Lightroot")
) {
const currentSplitName = await liveSplit.getCurrentSplitName();
if (currentSplitName.endsWith(thing.name)) {

const shrineName = thing.name.replace(" Shrine", "").replace(" Lightroot", "");

const sanitizedCurrentSplitName = currentSplitName.startsWith("-")
? currentSplitName.substring(1)
: currentSplitName;

if (sanitizedCurrentSplitName === shrineName) {
liveSplit.split();
}
}
Expand Down

0 comments on commit b9905c3

Please sign in to comment.