diff --git a/game/scripts/interface/hotkeys.rpy b/game/scripts/interface/hotkeys.rpy index f7f5c0d1..0b498805 100644 --- a/game/scripts/interface/hotkeys.rpy +++ b/game/scripts/interface/hotkeys.rpy @@ -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 ] diff --git a/game/scripts/utility/editor.rpy b/game/scripts/utility/editor.rpy index c6899ad9..31acc28c 100644 --- a/game/scripts/utility/editor.rpy +++ b/game/scripts/utility/editor.rpy @@ -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)