fxrjson 14.0.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/fxrjson.js +22 -23
  2. package/package.json +2 -2
package/fxrjson.js CHANGED
@@ -79,38 +79,37 @@ await (async () => {
79
79
  }
80
80
  }
81
81
 
82
- if (game === null) try {
83
- const cliSelect = (await import('cli-select')).default
84
- console.log('What game is this for?')
85
- const result = await cliSelect({
86
- values: [
87
- 'Dark Souls III',
88
- 'Sekiro: Shadows Die Twice',
89
- 'Elden Ring',
90
- 'Armored Core VI Fires of Rubicon',
91
- ],
92
- defaultValue: 2,
93
- indentation: 2,
94
- unselected: '[ ]',
95
- selected: '[✓]',
96
- })
97
- game = games[Game[result.id].toLowerCase()]
98
- console.log(`Selected: ${result.value}`)
99
- } catch {
100
- console.log('Canceled.')
101
- return
102
- }
103
-
104
82
  const filePath = process.argv[2]
105
83
  const content = await fs.readFile(filePath)
106
84
 
107
85
  if (content.subarray(0, 4).equals(Buffer.from('FXR\0'))) {
108
- const fxr = FXR.read(content, game, { round: true })
86
+ const fxr = FXR.read(content, Game.Heuristic, { round: true })
109
87
  await fs.writeFile(filePath + '.json', beautify({
110
88
  version: `${name}@${version}`,
111
89
  fxr
112
90
  }, null, 2, 80))
113
91
  } else {
92
+ if (game === null) try {
93
+ const cliSelect = (await import('cli-select')).default
94
+ console.log('What game is this for?')
95
+ const result = await cliSelect({
96
+ values: [
97
+ 'Dark Souls III',
98
+ 'Sekiro: Shadows Die Twice',
99
+ 'Elden Ring',
100
+ 'Armored Core VI Fires of Rubicon',
101
+ ],
102
+ defaultValue: 2,
103
+ indentation: 2,
104
+ unselected: '[ ]',
105
+ selected: '[✓]',
106
+ })
107
+ game = games[Game[result.id].toLowerCase()]
108
+ console.log(`Selected: ${result.value}`)
109
+ } catch {
110
+ console.log('Canceled.')
111
+ return
112
+ }
114
113
  const json = JSON.parse(await fs.readFile(filePath, 'utf-8'))
115
114
  if (json.version !== `${name}@${version}`) {
116
115
  console.warn(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fxrjson",
3
- "version": "14.0.0",
3
+ "version": "18.0.0",
4
4
  "description": "Convert FXR files from Dark Souls 3, Sekiro, Elden Ring, and Armored Core 6 to and from JSON.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,7 +21,7 @@
21
21
  "url": "https://github.com/EvenTorset/fxrjson/issues"
22
22
  },
23
23
  "dependencies": {
24
- "@cccode/fxr": "^14.0.0",
24
+ "@cccode/fxr": "^18.0.0",
25
25
  "cli-select": "^1.1.2",
26
26
  "json-beautify": "^1.1.1",
27
27
  "rage-edit": "^1.2.0"