Skip to content

Commit 3eb7c99

Browse files
committed
S1 project file support
1 parent b548782 commit 3eb7c99

File tree

2 files changed

+18
-23
lines changed

2 files changed

+18
-23
lines changed

CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
- Sonic 3&K Sonic/Supersonic partial support
88
- New ASM parser/writer
99
- Added File tab
10-
- Create new files / better file selection
10+
- Create new files
1111
- Save/Load individual assets
1212
- Art offset [#15](/../../issues/15)
1313
- Blank entries in palette line
14+
- Various UX improvements for file input
1415
- Rebuilt Project tab
1516
- Tree structure for projects
1617
- Reuse file menu

development/sonlvl.js

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,6 @@ const basePalette = [
2121
];
2222
const pathMod = (str) => str.slice(3).replace(/&/g, '&').replace(/\|.+/, '');
2323

24-
const baseObj = {
25-
name: '???',
26-
format,
27-
art: {
28-
path: '',
29-
compression: defaultCmp,
30-
offset: 0,
31-
},
32-
mappings: {
33-
path: '',
34-
label: '',
35-
},
36-
dplcs: {
37-
enabled: false,
38-
path: '',
39-
label: '',
40-
},
41-
};
42-
4324
function parseINI(ini) {
4425
ini = ini.match(/\[.+\][^[]+/gm);
4526
return ini.map(sect => {
@@ -84,7 +65,14 @@ folders.forEach(filename => {
8465
parseINI(ini).forEach(obj => {
8566
if (obj.codefile) {
8667
const cs = readFileSync(join(base, obj.codefile), 'utf8');
87-
const flexObj = { ...baseObj, palettes };
68+
const flexObj = {
69+
name: '???',
70+
format,
71+
palettes,
72+
art: { path: '', compression: defaultCmp, offset: 0, },
73+
mappings: { path: '', label: '', },
74+
dplcs: { enabled: false, path: '', label: '', },
75+
};
8876
const name = cs.match(/Name\s+{\s+get { return "(.+?)"/)
8977
if (name) {
9078
flexObj.name = name[1];
@@ -101,8 +89,14 @@ folders.forEach(filename => {
10189

10290
} else if (obj.xmlfile) {
10391
const xml = readFileSync(join(base, obj.xmlfile), 'utf8');
104-
const flexObj = { ...baseObj, palettes };
105-
92+
const flexObj = {
93+
name: '???',
94+
format,
95+
palettes,
96+
art: { path: '', compression: defaultCmp, offset: 0, },
97+
mappings: { path: '', label: '', },
98+
dplcs: { enabled: false, path: '', label: '', },
99+
};
106100
const name = xml.match(/Name="(.+?)"/);
107101
if (name) {
108102
flexObj.name = name[1];

0 commit comments

Comments
 (0)