GML [Tool] GMEdit

Discussion in 'Game Design, Development And Publishing' started by YellowAfterlife, Dec 25, 2017.

  1. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    Link: https://yellowafterlife.itch.io/gml-code-editor
    Screenshots:
    17-12-31-1.png 17-12-31-2.png 17-12-31-3.png 17-12-31-4.png
    Hello! This is a free and open-source code editor for GameMaker: Studio and GameMaker Studio 2 projects that I've been working on.

    It represents what I consider to be the most important when working with code - being able to edit code quickly and comfortably, with features expected from a modern day editor and conventional tabbed document design.

    Rough lineup of features:

    • Feature-complete syntax highlighting and auto-completion on all built-in and user-defined elements (functions, scripts, variables, assets, ...).
    • A high-performance code editor (Ace), extended and fine-tuned for GML.
    • Code folding - fold GMS2 regions, events, comments ("//#region" .. "//#endregion") and code blocks. Memorized between sessions.
    • Edit object code in a combined editor - no need to switch back and forth between event tabs/windows.
    • Works carefully - only modifies what you've asked it to modify (by hitting Ctrl+S on a file) and produces binary identical results for version control.
    • Memorizes position in files and projects between sessions.
    • Multiple instances can work with the same project at the same time.
    • Heavily customizable with CSS-based themes and settings.
      Comes with GMS2-like and GM Classic like themes.
    That said, while it can be viewed as a slightly more pleasant alternative to GMS2 code editor, for GMS1 workflow it's a huge step up. Since it only updates the requested files, it allows for far faster workflow with things like GMLive.

    By design it is something that you run alongside with GMS1/GMS2, using the original editor to manage the resources and run the game, and using this editor to edit the code.

    Have fun!
     
    Last edited: Jul 12, 2018
    dannyjenn, Lithalean, Shut and 23 others like this.
  2. BlessHayGaming

    BlessHayGaming Member

    Joined:
    Jun 20, 2016
    Posts:
    86
    I tried it out today - very nice indeed :) I think I will come to use it a lot.
    It would be nice with a "recent projects" list or something when opening the software to easily continue work on a project, but it is not much hassle to find and drag in the project file, so not something that will stop me from using it.

    As always, great job! Always like Christmas when you release new stuff :D

    Edit: Would be nice if the program took parameters, so that you could use "open with" on the project file to load it.
     
    Last edited: Dec 25, 2017
  3. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    Thanks!

    I vaguely intend to have some sort of "recent projects" list but have not yet decided how exactly that would look and work.

    Added ability to pass a parameter for project/file to load on start.

    Also switched to a custom window border, which saves space and looks stylish:
    17-12-26-1.png
     
    Mick and BlessHayGaming like this.
  4. TrunX

    TrunX Member

    Joined:
    Jun 30, 2016
    Posts:
    134
    Looks very nice and handy. I will definitely try it out in the next days!
     
  5. Mick

    Mick Member

    Joined:
    Jun 30, 2016
    Posts:
    678
    Looks very nice, I will try it out asap! Good job! :)
     
  6. NicoFIDI

    NicoFIDI Member

    Joined:
    Apr 7, 2017
    Posts:
    356
    This is was it was missing...
    We already have a "Full DND" option.
    So, this is his lost brother, the "Full code" option.
    :D
     
  7. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    New version is out,
    • The program now has a name, and that name is GMEdit.
    • Added local variable highlighting and auto-completion.
      To avoid this taking toll on extra large files, variables are re-checked upon saving.
      This completes coverage of GMS2-style features as far as code display goes.
    • Added a GMS2-style resource filter dialog (Ctrl+T).
    • Added a project-wide search dialog (Ctrl+Shift+F).
      (project-wide replace coming later)
    • Related to above feature, comments can now contain link-tags, such as `// @[scr_some:4]`, which can be navigated to (F12 / middle click) to open the related resource. Supported formats are as following:
      @[name]: Navigates to script/object.
      @[object_name(event_name)]: Navigates to a specific event in an object (e.g. `@[obj_some(draw)]`)
      @[destination:line number]: Navigates to a specific line in a script/event (e.g. `@[scr_some:4]` to open line 4 of scr_some).
      @[destination:text]: Navigates to first occurrence of text in a script/event (e.g. `@[scr_some:draw_set_color]`)
    • Added a recent project list to the start page.
    • Pressing Ctrl+W with no code tabs open now closes the project, taking you back to the start page.
    • You can now navigate to definition of macros in GMS2 projects via middle-click/F12.
    • Middle-clicking/pressing F12 on hexadecimal color constants ($BbGgRr/0xBbGgRr) opens a color picker dialog.
    • Code inside gml_pragma("global") is now highlighted.
    • You can now press Ctrl+Space to bring up auto-completion menu if you closed it or need it without starting to type.
    • You can now add notes to GMS1 project macros - notes are saved into a separate file (with relation to which macro they were put before).
    • Keyboard events are now generally labelled instead of having magic numbers.
    • Tab titles now overflow to the left, as it is usually the end of the name that tells things apart with GM naming conventions.
    • You can now press Ctrl+Shift+S to save all tabs
    • You can now press Ctrl+1..Ctrl+9,Ctrl+0 to switch between the first 10 tabs open.
    • Fixed a few minor oddities with syntax highlighting and auto-completion.
    • Fixed a bug with GMX attribute printing (sometimes causing audio group names to vanish when updating GMS1 project macros)
    17-12-31-3.png
     
    Barvix, jaydee, Dmi7ry and 4 others like this.
  8. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003

    Attached Files:

    Mick and Dmi7ry like this.
  9. stigmund77

    stigmund77 Member

    Joined:
    Nov 23, 2016
    Posts:
    40
    Really great editor and super fast!
     
  10. Mick

    Mick Member

    Joined:
    Jun 30, 2016
    Posts:
    678
    I have worked on a project using GMEdit a little bit, it is "already" really good and faast! Thanks a lot for making this! :)

    I styled it a little bit to my taste with a bigger font for the resource tree etc. Nice to see that the editor is so costumizable! I will make a Solarized inspired theme since I'm not a fan of the default GMS colour coding.

    So far I have a few suggestions, you might have ideas about these things already. Take these suggestions with a grain of salt if you wish. :)

    - A method to quickly navigate between events would be nice (a clickable list of events or keyboard shortcuts for previous/next events).

    - A keyboard shortcut to collapse/expand all events in a code window.

    - The position and size of the editor window are not remembered between sessions.

    - When loading a previous project, it would be nice if previously opened tabs would open automatically. The cursor position in a tab / folded code status are already remembered which is great!
     
    bbbower likes this.
  11. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    Thanks!
    Same as in GMS2, Ctrl+Up, Ctrl+Down, Ctrl+M, Ctrl+U.
    I'm putting this off until it is known how it should be done reliably - any mistakes in the process or user changing their screen layout can result in windows being completely off-screen, and Windows couldn't be less interested in addressing the issue - windows are only snapped back into screen bounds upon changing the screen resolution.
    I've not yet decided if this should be done, as it would give an impression that everything is saved, while things like search results or "show externally updated file in a new tab" aren't (and dumping them into project directory would be awful for version control).
     
    Mick likes this.
  12. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    Updated the program,
    • Added timeline editing for GMS1 and GMS2.
    • Shaders are now shown in the resource tree and can be double-clicked to open them in external editor.
    • Mac-style keyboard shortcuts are now supported for some things (thanks to topherlicious).
    • Editor now checks for file changes and displays a confirmation dialog if there are file changes with unsaved local changes.
    • Keyboard events are now highlighted separately and there's auto-completion for names. Also digit keys are now just 0..9 instead of d0..9.
    • Comment/string filter now works in global search, and works for searching events.
    timelines.png file-changes.png search-settings.png search-events.png
     
    Dmi7ry and Mick like this.
  13. Mick

    Mick Member

    Joined:
    Jun 30, 2016
    Posts:
    678
    Those shortcuts are are also jumping between and collapsing/expanding if/while clauses etc. so they are not very useful for jumping between different events.

    EDIT: If somebody else want the same functionality, I found the regex for the folding logic and edited it to ignore bracket parts. This line can be found in mode-gml.js (line 117 in the latest version).
    Code:
    this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)|#define\b|#event\b|#moment\b|#section\b|#region\b/;
    
    to
    
    this.foldingStartMarker = /#define\b|#event\b|#moment\b|#section\b|#region\b/;
    
    I made a theme that uses brighter colours for the event names and brighter lines between the events, this helps in locating events.

    gmedit.png
     
    Last edited: Jan 7, 2018
    Cloaked Games likes this.
  14. Yal

    Yal Member GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,250
    This is really cool, I've seen it on Itchio but not really had the time to look into what it actually offers until now :)

    I've heard a lot of people that's "moved on" from GM because of interface issues, so this hopefully should be a deal-unbreaker for some of those guys.
     
  15. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    I forgot to post here about the previous update. Basically that added a Mac build, named argument syntax, and a few other features like context menus on resource tree items:
    [​IMG]

    In today's update I added namespaces, ability to edit code straight in search results window, ability to set custom icons for any items, and a few other things.
    namespaces.gif
     
    Reign and Mick like this.
  16. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
  17. Joh

    Joh Member

    Joined:
    Jul 23, 2016
    Posts:
    52
    This is very impressive! much faster than the GM editor (although I think GM is just not friend with my new computer, used to work just fine before).
    Like having the GM2 slickness for GMS. Had no issue so far although I do wonder what might occur with conflicts(editing from both editors).

    Is it possible to autocomplete variables? since I'd assume that would be one of the first features, I assume its no easy task? But then the global ones are, and local vs general are colored differently, so there is clearly "knowledge" of those.
    Also right click... I'm familiar enough with the general shortcuts to function, but it just feels so weird not to have a right-click menu. limitation?

    Just some extra convenience features, program is already amazing.
    Wish you the best, your work (in general) is a blessing!
     
    bbbower likes this.
  18. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    GMEdit makes backups of files when saving, which you can then restore via right-click menu on a tab. GMS1 can discard changes made by external programs if you've opened the same items in it, which is why the option was added.
    Ideally I would want to show only the variables associated with the current object (showing completion on all variables is worthless in big projects) but there's nowhere near enough free time to do that properly as of now.
    Right-click menus have to be added separately for things so are getting added gradually - e.g. now you can click treeview items and tabs but not random fields or code editor yet.
     
  19. Reign

    Reign Member

    Joined:
    Jul 14, 2017
    Posts:
    71
    This is fantastic! WAY better than the default GM:S editor.
     
  20. Justice

    Justice Member

    Joined:
    May 8, 2017
    Posts:
    393
    Is there anything I can edit to stop auto-indenting on a newline after a left brace?

    Code:
    if (something)
        {
        // prefer to go here
        }
    if (something_else)
        {
            // do not prefer this so much
        }
    
    I've blundered around the various javascript files without success.

    If I was starting from scratch, it wouldn't matter, but I've been doing this kind of indentation for the last eight months in this project...
     
  21. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    I think it's MatchingBraceOutdent in mode-gml.js that is responsible for calculating indentation rules.
    Not entirely sure what Ace setting is responsible for enabling/disabling it but you can strip out/change code in it if needed.
     
    Justice likes this.
  22. Cowlord

    Cowlord Member

    Joined:
    Jun 29, 2017
    Posts:
    36
    Is there a setting in GMS2 I'm not seeing that would allow me to automatically open GMLEdit over GMS editor?
     
  23. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    Not that I know of - even in GMS1 "external code editor" option would only affect what happens when you pick "open in external editor", not override code editor completely. You can Ctrl+T your way to the desired resource in both GMS2 and GMEdit though.
     
  24. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    New version (itch post)!

    There's now template-snippet support:
    snippets.gif

    There's also argument documentation auto-fill for those annoyed with it in GMS2:
    args-doc.gif

    Also you can now open YYZ files without having to extract them anywhere.
    And many other fixes and improvements.
     
  25. RangerX

    RangerX Member

    Joined:
    Jun 20, 2016
    Posts:
    2,546
    When you start writing something, does it search for global variables? (and not just functions, object, rooms, constants, etc)
     
  26. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    It does
    upload_2018-5-16_20-20-24.png
    upload_2018-5-16_20-20-21.png
     
    RangerX likes this.
  27. RangerX

    RangerX Member

    Joined:
    Jun 20, 2016
    Posts:
    2,546
    OMG. I need this now.
     
  28. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    New version is now out!

    Most importantly it got preprocessors for methods and lightweight objects,
    type-all.png
    but also GMLive.js integration,
    gmlive_js.png
    auto-completion for instance variables, bug fixes, and a few other things.
     
    kagamma, Mick and Cpaz like this.
  29. ZeDuval

    ZeDuval Member

    Joined:
    Jun 20, 2016
    Posts:
    114
    Aaaaaaalright, that's it - enough is enough! Unlike you, I am a human being and I can only take so much. How could I now click on "No thanks, just take me to the downloads" like before? Take my money, buy yourself a few beers and keep on rocking.
     
    Yal, Cpaz and YellowAfterlife like this.
  30. Mick

    Mick Member

    Joined:
    Jun 30, 2016
    Posts:
    678
    Awesome work @YellowAfterlife ! I love the typescript inspired syntax and how you did lightweight objects!
     
  31. kagamma

    kagamma Member

    Joined:
    Sep 18, 2017
    Posts:
    13
    With this new version, especially with preprocessors for types and lightweight objects, combine with your GMLive.gml addon (as I put it in nearly every scripts for hot loading purpose) looks like I can finally ditch GMS2 editor now. The only thing I miss from your editor is the ability to create new resources.
     
  32. ZeDuval

    ZeDuval Member

    Joined:
    Jun 20, 2016
    Posts:
    114
    The type system doesn't seem to work with instance variables!?

    Works:

    #event create
    #import ds.list.* as List

    var names:List = new List()
    //var names/*:List*/ = ds_list_create()

    Doesn't work:

    #event create
    #import ds.list.* as List

    names:List = new List()
    //names:List = ds_list_create()

    Works:

    #event create
    #import ds.list.* as List

    names = new List()
    //names = ds_list_create()


    Or is something wrong with my syntax?
     
  33. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    Only local variables - for them you can be sure that you are replacing the right thing so long as the name matches and there's no "." in front. With instance variables it would need to keep track of with-block nesting, context (e.g. what variables "other" has in a collision event), and look over the entire project rather than a single file that you are opening. A lot more trouble and more ways to make mistakes (and any mistake with patching up code means code corruption)
     
  34. 00.Archer

    00.Archer Member

    Joined:
    Jul 24, 2018
    Posts:
    24
    Since you released this software, I've very rarely used GM's own editor. Fantastic piece of work.
     
    YellowAfterlife likes this.
  35. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    gmedit-scripts.gif
    New update is now out!

    Most importantly, you no longer need to switch back and forth between GM/GMEdit to create scripts. Full log:
    Additions:
    • You can now create, remove, rename, and drag around scripts and script groups.
      If you feel like helping out with other resource types, be my guest - it's non excessively hard but monotonous work (except for extensions & included files, those require different handling)
    • There's now an option to auto-complete by partial match (GMS2 style) instead of start-match (GMS1 style).
    • Added "show in directory" to the main menu.
    Improvements:
    • Trying to open a file from a project (via Open-with, etc.) will now open the according project and then open a file tab in it.
    • Trailing whitespace is now ignored when detecting changes (fixes GMS1 projects reporting changes when it's just IDE adding/removing trailing lines randomly)
    Changes:
    • If you have a custom theme, you'll need to change up treeview highlight selectors from
      .treeview .heade:hover
      to
      .treeview .header:not:)active):hover
      (same for .item and > span)
      This is to prevent item background from being visible while dragging them around.
    Fixes:
    • The recently introduced #macro Config:name syntax now works correctly with GMEdit auto-completion.
    • Fixed auto-completion data occasionally breaking after soft reload (Ctrl+R).
    • Fixed "open declaration" not working for #import-ed identifiers.
    • Fixed variable_global_ functions not being highlighted/shown in auto-completion.
    • Fixed #args causing #imports on subsequent line to not expand.
    • Fixed #args not collapsing optional arguments on load since introduction of types.
    • Fixed file conflict message using odd precision for sizes.
    • Fixed GMX loader not working on Mac/Linux because of backslashes in extensions.
    • Fixed type magic not working for a line after #args magic.
    • Fixed type magic not working if there are no #imports.
    • Fixed type magic dot auto-completion not popping up if there's a longer variable than one being completed (#28).
    • Fixed it not being possible to open help for GMS1 functions with "color" in the name (source data is incomplete)
     
  36. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    New update is now out!

    Most importantly, it has inline functions - now you define scripts anywhere - inside events, scripts, even each other. It's allows to implement methods, callbacks, events, and many other things in new and much more intuitive ways.
    gmedit-lambda.gif
     
    Dmi7ry, Cloaked Games and 00.Archer like this.
  37. 00.Archer

    00.Archer Member

    Joined:
    Jul 24, 2018
    Posts:
    24
    Nice! Does it still needs the helper extension? If so, does it need to have a specific name?
     
  38. immortalx

    immortalx Member

    Joined:
    Sep 6, 2018
    Posts:
    68
    I'm totally impressed by this and cannot thank you enough!
    Is there any chance you could optionally read room creation code?
     
  39. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    The resulting scripts have to go somewhere, so yes. The extension is to be called "gmedit_lambda" and GMEdit will inform you if you are trying to use lambdas with no extension to put them into.

    If it's just the creation code than yeah, probably. GMS2, I hope?
     
    immortalx likes this.
  40. immortalx

    immortalx Member

    Joined:
    Sep 6, 2018
    Posts:
    68
    Thanks for taking the time to respond @YellowAfterlife !
    Yes, for GSM2. It would be nice if you could gather every room's creation code into a single file, split into sections (like: #rm_01_creation, #rm_02_creation, etc.)
    I can't stress enough how much nicer is working in GMEdit than in the built-in editor. It's not that GM's editor is inferior, it's just that everything is many clicks away.
    Having the room creation code in GMEdit would be a complete solution. I guess the only place left where additional code could be "hiding" would be instances' creation code, but I guess people rarely use that.
     
  41. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    the new mini-update has this and hopefully you are not the only person to need this as that took two hours to do.
     
  42. immortalx

    immortalx Member

    Joined:
    Sep 6, 2018
    Posts:
    68
    I too hope it's just not me!
    I just downloaded it and it works perfectly!
    I did a small donation for my appreciation of your work. Again, thank you very very much!
     
  43. Ludorverr

    Ludorverr Member

    Joined:
    Jun 20, 2016
    Posts:
    29
    I like this, if you can make something better than yoyogames maybe they'll make some good changes to their own software as a result. Their lack of suggestion forum bugs the hell out of me.

    Not sure if it's a big deal but when opening shaders it looks like it's sometimes putting the first line of the fragment shader on the same YOYO_SHADER_MARKER line, on the end. So it looks like:
    Code:
    //######################_==_YOYO_SHADER_MARKER_==_######################@~varying vec2 v_vTexcoord;
    Ctrl + T is an awkward keybind to be pressing all the time. I can reach the keys - my hand is average sized I think (lol), but it's not exactly comfortable.
    When you have too many scripts scrolling through a list to find the script you want is definitely no good, so GMS1's clickable "Search for Resources" filter thing has been faster for me to use. It looks like GMS2 is when they added the quick Ctrl+T resource lookup feature, but man that's really not the best keybind to be pressing every 3 seconds.

    I'll probably be ignored like usual (post #1, post #2) but it would be nice if you could single-click to open a script (maybe as an option). Please don't make an argument about accidentally opening something, there's no such thing, anyone would quickly adapt.

    Keep up the good work. thinking of making a color theme.
     
    Last edited: Nov 20, 2018
  44. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    This is exactly how it's stored in the file, unfortunately. As of yet undecided whether it's worthwhile to write a preprocessor just to replace that with something else on save/load to obscure the fact.

    It's oddish but matches GMS2 keyboard shortcut - I can sort of see how that happened because very much every normal key combination is already taken up.
    Could open app.js with a text/code editor, find
    Code:
        case 84:
           if(isMod) {
               e.preventDefault();
               ui_GlobalLookup.toggle();
           }
           break;
    and change 84 to 81 (Q) or 69 (E) - those two are not taken yet in GMEdit.

    I'm slowly getting to allowing to customize keyboard shortcuts, but it's sort of awkward because there are multiple contexts (code editor / tab shortcuts / global) and each handles keyboard events in it's own spot.

    Can find
    Code:
    r.addEventListener("dblclick",ui_treeview_TreeView.handleItemClick);
    in app.js and change "dblclick" to "click".

    not sure if this'll break anything but I don't support "click and hold still to rename" anyway so hopefully not.
    I've just put up a wiki page with instructions for this.
     
    Edwin likes this.
  45. Ludorverr

    Ludorverr Member

    Joined:
    Jun 20, 2016
    Posts:
    29
    Absolutely awesome, my dream of a quick and snappy Game Maker has come true.
    Thanks for pointing out where to change the ctrl+t keybind. I removed the ctrl modifier and just made it "F1" after looking up javascript keycodes.

    Bug: if my scaling setting in Windows 8.1 display settings is at 125% and I drag the window's scrollbar it starts selecting text. Scroll a long way and it selects all your code. If it's too bothersome to fix don't worry I've always got the mousewheel.

    On your github wiki pages "Running games from GMEdit", I'm impressed by the AutoIt script. Being able to press F5 while in GMEdit is a total game changer, anyone new to your program is missing out if they don't know about this.
    But there was a funny bug that had me guessing for a few hours. If GMS1 is displaying the news ("Show news on startup" in preferences) it changes the window's title to add "- [GameMaker News]" which prevents the AutoIt script from being able to detect the window.
    I'm new to AutoIt but I was able to add some things onto the end of the script (after F5 is sent to GMS):
    Code:
    ; Faster window switching
    Opt("WinWaitDelay", 0)
    ; Show GMS, even if minimized
    WinSetState($hwnd, "", @SW_MAXIMIZE )
    WinActivate($hwnd)
    ; Wait until your compiled game appears.
    WinWait("[CLASS:YYGameMakerYY]")
    ; Wait until your compiled game closes.
    WinWaitClose("[CLASS:YYGameMakerYY]")
    ; Switch back to GMEdit
    WinActivate($title)
    
    Essentially turning GameMaker:Studio into a compile window that pops up just for the compilation and is instantly pushed aside afterwards. Haha.
     
    Last edited: Nov 23, 2018
  46. Annoyed Grunt

    Annoyed Grunt Member

    Joined:
    Jun 20, 2016
    Posts:
    53
    Is there any documentation on expanding the preprocessor? I've looked at the source code briefly, but I find it obscure.
    I'd like to create myself some kind of short hand script execution syntax, like:
    Code:
    foo:bar(arg1, arg2, ...)
    Being translated to:
    Code:
    /*:*/script_execute(foo.bar, arg1, arg2, ...)
    And viceversa.
     
  47. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,003
    That's strange, probably an issue with the code editor component, but not sure if that can be solved on GMEdit side.

    Does that get stuck if you get a compile error?

    Every preprocessor has it's own parsers.* class, usually uses GmlReader to read through the code, and is self-contained (as you can disable them individually).

    That would not be as simple as that because you want to preserve the context (self-instance).
    I did come up with a single-script trick for this specific thing at one point though
    https://yal.cc/gamemaker-instance-methods/
     
  48. Ludorverr

    Ludorverr Member

    Joined:
    Jun 20, 2016
    Posts:
    29
    I edited my last post adding an extra WinActivate() line. I was only testing GMS1 where the maximize was enough to focus the window but that wasn't enough for GMS2, should work with both now. https://pastebin.com/g7VYWpHV
    The script "waits" there for a game that doesn't appear but I can't see any evidence of that being a bad thing. The next time you press F5 it seems to start the script over fine and when there's finally a successful compile it's thankfully not executing the end part multiple times for each "stuck script" (tested with MsgBox and Run("notepad.exe")), so I have to doubt if the script even becomes "stuck" - maybe it's being replaced? I see nothing wrong but you're asking a newbie here surely you're the expert.
    Putting a timeout value in the line WinWait("[CLASS:YYGameMakerYY]") would be bad for games with long compile times.
     
    Last edited: Nov 24, 2018
  49. DBenji

    DBenji Member

    Joined:
    Sep 20, 2016
    Posts:
    23
    I really enjoy using this but I have one gripe with the editor and that's using middle mouse to access the manual while offline. I do a lot of my dev while not having access to a network, so I'm wondering is there a way to access the local html files from the YoYoStudioHelp folder through the GmLive server localhost port... possibly by changing config.json's url address? I'm no js wiz, but I tried changing the line with the url to things like "helpURL": "http://127.0.0.1:5100/C:/.../YoYoStudioHelp/$1" while running the gmlive server offline... no luck.
     
    Last edited: Nov 30, 2018
  50. CameronScottMusic

    CameronScottMusic Member

    Joined:
    Dec 1, 2018
    Posts:
    11
    This looks great! I'm impressed with your work as I've just recently started using GMLive. I'm going to check this out, thanks for putting the work in and making the community better :)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice