textadventures / squiffy-editor

MIT License
18 stars 13 forks source link

ascii characters in file dialog rendered as boxes #11

Closed aSpookyNinja closed 6 years ago

aSpookyNinja commented 6 years ago

OS: Arch Linux Squiffy version: 5.1

When attempting to save or load a file, the ascii characters are not rendered, resulting in showing a ton of boxes. I've tested this on various machines, to the same result.

squiffy-editor

Baltasarq commented 6 years ago

Same here, in Manjaro Linux. Is as the ¿system? encoding was incorrect.

Baltasarq commented 6 years ago

I've made some research in this issue. I cannot say why this is happening, only that it disappears in the last version of electron. If you clone the "quick start" repository from electron's last version (1.8.2), everything works. After checking out, I found out that squiffy-editor uses electron v0.36.2. First of all, this version can be upgraded to 0.37.8 without danger of breaking anything. Unfortunately, this does not solves the issue. Electron upgrade can be carried out by editing the line in package.json: "electron-prebuilt": "^0.36.2", and changin it into: "electron-prebuilt": "^0.37.8", and just run "npm install".

Bad news is that next version was bumped to version number 1.0.0, because a major overhaul of the electron framework was done. This is not compatible with the squiffy-editor code, since, for example. one has to require "electron" instead of "app".

Of course, the only other possibility is that squiffy-editor does some kind of configuration that involves the appearance of this issue. If that's true, I haven't been able to spot the problem (not meaning it does not exist).

I will do some more research on this issue.

Baltasarq commented 6 years ago

Solved! I was finally able to make squiffy-editor run under electron 1.8.0. Change the line in package.json, from: "electron-prebuilt": "^0.36.2", to: "electron": "^1.8.0",

Then change all the beginning of the following files:

menu.js: l2: var remote = require('electron').remote; var app = remote.app;

l440: var Menu = remote.Menu;

storage.js: l4: var app;

try { app = require('electron').remote.app; } catch(e) { app = require('electron').app; }

desktop.js: l5:

$(function () { var remote = require('electron').remote; var compiler = require('squiffy/compiler.js'); var shell = remote.shell; var path = require('path'); var dialog = remote.dialog; var fs = require('fs'); var clipboard = remote.clipboard; var storage = require('./storage.js');

And that is. You have a version of the squiffy-editor using electron 1.8.0 (the most recent), and without that horrible glitch of showing squares instead of characters in the file dialogs.

The only problem is that the squiffy-editor will not close. I'll check later on that.

Baltasarq commented 6 years ago

I've created a pull request in order to update electron and get rid of this bug.