* Fixed editor active flag becoming stuck after rolling back to before it was called
* Put editor onto interface layer to exclude it from transitions
This commit is contained in:
LoafyLemon 2022-06-16 21:38:20 +01:00
parent 1cee1f2930
commit 8542fabbb4
2 changed files with 17 additions and 1 deletions

View File

@ -153,7 +153,7 @@ init 1 python:
#director = director.Start(),
performance = ToggleScreen("_performance"),
accessibility = ShowMenu("preferences", page="accessibility"),
editor = [ToggleField(e, "active", True, False), ToggleScreen("editor")],
editor = ToggleEditor(),
)
config.underlay = [ _default_keymap ]

View File

@ -410,6 +410,21 @@ init python:
return self.read_history(file, line)
@renpy.pure
class ToggleEditor(Action, NoRollback):
def __call__(self):
if not config.developer:
return
if renpy.get_screen("editor", layer="interface"):
e.active = False
renpy.hide_screen("editor", layer="interface")
else:
e.active = True
renpy.show_screen("editor")
renpy.restart_interaction()
if config.developer:
e = Editor()
@ -421,6 +436,7 @@ init python:
screen editor():
zorder 50
style_prefix "editor"
layer "interface"
text "Active" pos (25, 25)