forked from ori-community/rando-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
127 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { AreasWotwService } from '~/electron/src/lib/AreasWotwService' | ||
|
||
export default { | ||
async getColliderData() { | ||
return await AreasWotwService.getColliderData() | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import path from 'path' | ||
import fs from 'fs/promises' | ||
|
||
const directoryPath = 'D:\\SteamLibrary\\steamapps\\common\\Ori and the Will of the Wisps\\sceneCollisions' | ||
|
||
export class AreasWotwService { | ||
// public static getCollidersFilePath() { | ||
// return path.resolve(RANDOMIZER_BASE_PATH, './map/colliders.wotw') | ||
// } | ||
|
||
static async getColliderData() { | ||
|
||
const files = await fs.readdir(directoryPath) | ||
const data = [] | ||
for (const file of files){ | ||
try { | ||
const filepath = path.join(directoryPath, file) | ||
const content = await fs.readFile(filepath, {encoding: 'utf-8'}) | ||
const jsonString = JSON.parse(content) | ||
data.push({file, data: jsonString}) | ||
|
||
} catch (err) { | ||
console.error(`Error parsing JSON in ${file}:`, err) | ||
} | ||
} | ||
return data | ||
} | ||
} |