erkyrath / lectrote

The IF interpreter in an Electron shell
Other
248 stars 28 forks source link

Centralise all format and engine details in formats.js #95

Closed curiousdannii closed 7 years ago

curiousdannii commented 7 years ago

I've centralised all the format and engine details in formats.js. This reduces some redundancies, and also makes functions like game_file_discriminate and load_named_game much more systematic.

I've also added Git for testing purposes. It chooses the first listed engine, so Quixe unless you manually switch the order. It would be very easy to make launch_game choose another engine though.

I don't think it will take much more to move to a single play.html (for all except inkjs maybe). I'd like to do that for the VMs I'm providing at least.

erkyrath commented 7 years ago

Thanks, I will try to look at this later in the week.

erkyrath commented 7 years ago

I have started looking at this. It's good, but I want to adjust the way the formats module is laid out. So it's not merged yet. Assume main.js, apphooks.js, and formats.js are in flux until tomorrow.

curiousdannii commented 7 years ago

Of course. I never expected it to be more than a starting point :)

I realised after I committed this that Git also needs blorb_gamechunk_type to be set. In my WIP I stopped using a common emglken_options function and just made specific ones for Git and Hugo.

And thinking for the future, would you be willing to give me commit access for me to update the VMs? For anything other than a routine update of VM-internal code I would still make pull requests.

erkyrath commented 7 years ago

I've merged a cleaned-up version of this.

It all works from "npm start", but when I build an app bundle, the Hugo interpreter stops working.

Uncaught TypeError: Cannot read property 'buffer' of undefined at ReadFileContext.fs.readFile [as callback] (/Users/zarf/src/lectrote/dist/Lectrote-darwin-x64/Lectrote.app/Contents/Resources/app/emglken/hugo.js:53:41) at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:336:13)

Can you take a look at this?

erkyrath commented 7 years ago

It's possible that I'm not copying the correct files into the distributed emglken directory. Currently:

emglken_dispload.min.js
 git-core.js.mem
 git.js
 hugo-core.js.mem
 hugo.js
 versions.json

There's also the line

game_options.memdir = 'hugoem';

...which disappeared somewhere; I'm not sure if you dropped it on purpose.

curiousdannii commented 7 years ago

Your cleaned up version looks good!

The .bin files are needed as well.

The memdir option has changed into the dirname option, to match the __dirname Node variable, and because it's used for more than just memory now.

And when you're satisfied it's stable, I'd appreciate if you could do a release soon so that I could get more feedback on whether the Hugo undo buffer is large enough.

erkyrath commented 7 years ago

Thanks. I needed one change in the emglken code -- see https://github.com/curiousdannii/emglken/pull/2 . With that, Hugo works.

erkyrath commented 7 years ago

Release is up.