Skip to content

Commit 73cf6df

Browse files
committed
quick and dirty sonlvl parser
1 parent 1b9acf5 commit 73cf6df

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

TODO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ definition([
2121

2222
// project files
2323

24-
/* tile deletes when drawing (unmap pieces / shortcuts in drawing mode) */
24+
/* https://unix.stackexchange.com/questions/585645/launch-an-application-by-a-double-click */
2525
// provide a custom definition, but have a default
2626

2727
// crackers first, then kd cham

app/controls/commands.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export function getCommandLabel(name) {
3939
}
4040

4141
export const commands = [
42-
4342
[
4443
{
4544
map: 'f12', name: 'DevTools', hidden: true,
@@ -131,7 +130,7 @@ export const commands = [
131130
[
132131
{
133132
map: 'h', name: 'Horizontal Flip', color: 'orange',
134-
func: (e) => {
133+
func: () => {
135134
const { x } = mappingState.center || {};
136135
mappingState.mutateActive((mapping) => {
137136
mapping.hflip = !mapping.hflip;
@@ -142,7 +141,7 @@ export const commands = [
142141
},
143142
{
144143
map: 'v', name: 'Vertical Flip', color: 'orange',
145-
func: (e) => {
144+
func: () => {
146145
const { y } = mappingState.center || {};
147146
mappingState.mutateActive((mapping) => {
148147
mapping.vflip = !mapping.vflip;
@@ -153,15 +152,15 @@ export const commands = [
153152
},
154153
{
155154
map: 'f', name: 'Toggle Priority', color: 'orange',
156-
func: (e) => {
155+
func: () => {
157156
mappingState.mutateActive((mapping) => {
158157
mapping.priority = !mapping.priority;
159158
});
160159
},
161160
},
162161
{
163162
map: 'p', name: 'Shift Palette', color: 'orange',
164-
func: (e) => {
163+
func: () => {
165164
mappingState.mutateActive((mapping) => {
166165
mapping.palette = (mapping.palette+1) % 4;
167166
});

development/sonlvl.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const { readFileSync } = require('fs');
2+
const { join } = require('path');
3+
4+
const base = __dirname + '/../../flex2_test/s1disasm/SonLVL INI Files/';
5+
6+
const levels = ['objGHZ.ini'];
7+
8+
const objects = [];
9+
10+
levels.forEach(filename => {
11+
const folder = [];
12+
13+
ini = readFileSync(join(base, filename), 'utf8');
14+
ini = ini.match(/\[.+\][^[]+/gm);
15+
ini.forEach(sect => {
16+
const obj = {};
17+
sect.split('\n')
18+
.forEach(line => {
19+
if (line.includes('=')) {
20+
const [name, prop] = line.split('=');
21+
obj[name] = prop;
22+
}
23+
})
24+
if (obj.name && obj.art && obj.mapasm) {
25+
console.log(obj);
26+
}
27+
})
28+
});

0 commit comments

Comments
 (0)