Required to get the editor are the files:
Follow instructions in the readme. Also make sure you have a backup of your .rpy files, or work in a repository, if you intend to use this. 'Apply' in the editor writes changes to your .rpy files. If you have the file open in an external editor with unsaved changes you get into trouble.
The above files, and a button, e.g. in screen.rpy quickmenu, will enable an edit code button. When pressed, an editor is shown to edit the current .rpy file. As long as changes are syntactically correct, they can be applied to the rpy file. If changes cause a syntax error, this error is shown (unless silenced). Edits can also be cancelled or a return to visual mode can be used to keep the edits in store temporarily. Applied changes might be visible in visual mode after triggering a reload (shift+r) It may be possible that the reload restarts the novel, though.
There is undo (ctrl+z) and redo (ctrl+y) functionality. You may have to press undo a bit more then expected. Cursor can be placed by keyboard or mouse and the mousewheel should work. Multiline selection is possible, and works mostly as expected: deletion of selected text, copy, cut and paste with ctrl+c, ctrl+x and ctrl+v, shift/ctrl + cursor movement, ctrl + shift for word selection.
Latest version fixes an issue for non-linux OS.
Are there particular issues or features missing?
undo/redo is a bit silly
The edit button does not work when translation is active. Not sure how to address this. The editor should work in the native language so this is usually not an issue. Please let me know if editing unicode text still causes problems.
The README.txt indicates how install pygments for color support. Not sure if this works for non-linux OS. I install pygments in the game directory, and removal of some unicode characters was requires as instructed in README.
Add e.g. to the quick menu the last two lines to provide an edit button to start the editor.
Code: Select all
screen quick_menu(): # Ensure this appears on top of other screens. zorder 100 # Add an in-game quick menu. hbox: style_prefix "quick" xalign 0.5 yalign 1.0 if config.developer and _editor.editor: textbutton _("Edit") action [_editor.editor.start(renpy.get_filename_line()), ShowMenu('editor')]