Got some editor questions

0 favourites
  • 7 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • Hello!

    Just a couple questions/comments about the javascript functionality:

    1. While editing a script, hitting escape reverts all changes since you last clicked outside the script editor. I think a pop-up would be appropriate here - "You're about to lose your changes. Are you sure?" or something to that effect. I'm a javascript developer in my day job and while I feel comfortable using your built in editor, I've already run into a couple instances where I hit escape like I would normally in my IDE, and I ended up losing progress in the script I was working on. At the very least, is there an option to turn this into a save action instead of discard action?

    2. Will there be external IDE support in the future?

    Love the app so far! I can't believe how easy and quick it has been to get things working how I want them. Even being a programmer professionally, I've only started messing with the javascript feature just to test it because the visual event system has been so easy to use.

    Tagged:

  • +1 on the ESC key QoL comment, I have done the same a number of times.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yup I can confirm the esc key behaviour is frustrating... I personally try to only have function calls in the event sheet script blocks, and put the actual function declarations in a script file. Minimises this issue for the most part, and the text editor itself is more practical for large chunks of script anyway.

    As for the external editor there isn't currently a way to open an external editor from the browser. If your using the experimental local folder saves for projects you should be able to open and edit script files in your project quite easily. One caveat of this is that C3 won't be aware that the project is being edited, so you shouldn't have the project open in C3 at the same time or you might lose the edits you made in the external editor. This is something that might improve in the future, but the ability to read/write local files from the browser is very new.

  • The reason ESC cancels editing is because comments have always worked that way. If we changed it, ESC while editing scripts would be inconsistent with editing comments, which seems confusing. I guess we could add a confirmation prompt if pressing ESC with unsaved changes though?

  • I think a contributing factor is if you press esc to try and close the autocomplete window it will also close the script editor. Frustratingly it doesn't look like codemirror passes the event object to the handler for the autocomplete handler, so it cannot prevent the event from bubbling to the script view.

  • Nepeo Exactly - the autocomplete escape is _one_ of the culprits for me too.

  • Exactly, it usually happens when I'm escaping the auto-complete. Just something I do out of habit so whatever IDE I'm working in doesn't auto-complete for me when I don't want it to.

    A confirmation prompt would be perfectly fine for me. Make the confirmation itself escapable so I don't have to click out of it. Make the "Ok" option of "Are you sure?" clickable only, so losing progress can't be accidental.

    Honestly though, the sake of consistency here sounds a little counter-intuitive. I wouldn't want a comment I just wrote to undo itself either if I just hit escape. I guess if your user base is used to that being the thing, and you have a lot of users undoing their comments in this manner... ok... but do you? You already have the undo feature (ctrl+z) in place to handle this anyway. Personally, I would expect escape to remove focus from an element but never undo the progress regardless of what the element is (code or comment or whatever else).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)