Skip to content

Commit

Permalink
Fix compatibility issues on Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
Tnze committed Oct 26, 2024
1 parent 53f8d8c commit 2e75e8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
18 changes: 6 additions & 12 deletions src/components/designer/MacroImporter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,15 @@ function confirm() {
} else {
result = input
.split(/\/[^\s]+|<wait\.\d+>|\n/)
.flatMap(v => {
if (v.length == 0) {
return [];
}
v = v.trim()
// remove quotation
.map(v => v.trim())
.filter(v => v.length > 0)
.map(v => {
if (v.charAt(0) == '"' && v.charAt(v.length - 1) == '"') {
v = v.substring(1, v.length - 1);
}
const action = namesToAction.get(v);
if (action == undefined) {
return [];
}
return [action]
});
return namesToAction.get(v);
})
.filter(v => v != undefined);
if (result.length == 0) {
ElMessage({
type: 'warning',
Expand Down
5 changes: 4 additions & 1 deletion src/libs/Craft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ const waitTimes = new Map([
[Actions.TrainedPerfection, 3],
])

const postCastDelay = new Map(waitTimes.entries().map(x => [x[0], x[1] - 0.5]))
const postCastDelay = new Map()
for (const [action, time] of waitTimes.entries()) {
postCastDelay.set(action, time + 0.5)
}

export const newRecipe = async (
rlv: number,
Expand Down

0 comments on commit 2e75e8f

Please sign in to comment.