Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GDColon/GD-Randomizer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2
Choose a base ref
...
head repository: GDColon/GD-Randomizer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 6 commits
  • 2 files changed
  • 3 contributors

Commits on Jul 13, 2020

  1. More plist error handling

    GDColon committed Jul 13, 2020
    2
    Copy the full SHA
    99d7327 View commit details

Commits on Jun 15, 2022

  1. shuffle.js: rm \n/\r's from gdPath that may occur

    AtticFinder65536 committed Jun 15, 2022
    Copy the full SHA
    70b4610 View commit details
  2. shuffle.js: support reading dir from argv[2]

    AtticFinder65536 committed Jun 15, 2022
    Copy the full SHA
    ab80198 View commit details
  3. Merge pull request #21 from AtticFinder65536/allow-pass-dir-arg

    shuffle.js: support reading dir from argv[2]
    GDColon authored Jun 15, 2022
    Copy the full SHA
    93273c3 View commit details
  4. Merge branch 'master' into fix-gdpath-read

    Attila Fidan authored Jun 15, 2022
    Copy the full SHA
    b81a785 View commit details
  5. Merge pull request #20 from AtticFinder65536/fix-gdpath-read

    shuffle.js: remove newlines and carriage returns from gdPath before using it
    GDColon authored Jun 15, 2022
    Copy the full SHA
    49fea56 View commit details
Showing with 13 additions and 4 deletions.
  1. +6 −1 readme.txt
  2. +7 −3 shuffle.js
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -19,4 +19,9 @@ HOW TO USE:
===

If the program closes as soon as you open it, that means it crashed.
A file called crash_log.txt will be created - send it to Colon and he'll hopefully get around to fixing it.
A file called crash_log.txt will be created - send it to Colon and he'll hopefully get around to fixing it.

===

Mac/Linux/non-Windows users, or if the game is installed in a nonstandard location:
Replace the directory in directory.txt with whereever the game's Resources folder is located on your system, or simply pass it as a command-line argument.
10 changes: 7 additions & 3 deletions shuffle.js
Original file line number Diff line number Diff line change
@@ -36,7 +36,10 @@ let iconRegex = /^.+?_(\d+?)_.+/
let forms = assets.forms
let sheetList = Object.keys(assets.sheets)
let glowName = sheetList.filter(x => x.startsWith('GJ_GameSheetGlow'))
let gdPath = fs.readFileSync('directory.txt', 'utf8')

// newlines/CRs are usually present in text files, strip them out so they aren't part of the pathname
let gdPath = process.argv[2] ?? fs.readFileSync('directory.txt', 'utf8').replace(/[\n\r]/g, '')

if (!fs.existsSync(gdPath)) throw "Couldn't find your GD directory! Make sure to enter the correct file path in directory.txt"
let glowPlist = fs.readFileSync(`${gdPath}/${glowName[0]}.plist`, 'utf8')
let sheetNames = sheetList.filter(x => !glowName.includes(x))
@@ -54,7 +57,8 @@ resources.forEach(x => {
sheetNames.forEach(x => {
let file = fs.readFileSync(`${gdPath}/${x}.plist`, 'utf8')
plists.push(file)
sheets.push(plistToJson(file))
try { sheets.push(plistToJson(file)) }
catch(e) { throw `Error parsing ${x}.plist - ${e.message}` }
})

sheets.forEach((gameSheet, sheetNum) => {
@@ -134,4 +138,4 @@ console.log("Randomization complete!")

}

catch(e) { console.log(e); fs.writeFileSync('crash_log.txt', e.stack ? `Something went wrong! Send this error to Colon and he'll get around to fixing it at some point.\n\n${e.stack}` : e, 'utf8') }
catch(e) { console.log(e); fs.writeFileSync('crash_log.txt', e.stack ? `Something went wrong! Send this error to Colon and he'll get around to fixing it at some point.\n\n${e.stack}` : e, 'utf8') }