Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global transform for the whole display #4775

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions renpy/display/core.py
Expand Up @@ -935,6 +935,9 @@ def after_setstate(self):
if i not in self.camera_list:
self.camera_list[i] = (None, [ ])

self.layer_at_list.setdefault(None, (None, [ ]))
self.camera_list.setdefault(None, (None, [ ]))

def after_upgrade(self, version):

if version < 1:
Expand Down Expand Up @@ -1050,6 +1053,9 @@ def __init__(self, oldsl, shown):
self.music = None
self.focused = None

self.layer_at_list[None] = (None, [ ])
self.camera_list[None] = (None, [ ])

def replace_transient(self, prefix="hide"): # type: (str|None) -> None
"""
Replaces the contents of the transient display list with
Expand Down Expand Up @@ -3970,7 +3976,7 @@ def add_layer(where, layer):
old_root.layers[layer] = d
old_root.add(d)

trans = instantiate_transition(None, old_root, layers_root)
trans = instantiate_transition(None, old_root, renpy.defaultstore.At(layers_root, *scene_lists.layer_at_list[None][1], *scene_lists.camera_list[None][1]))

if not isinstance(trans, Displayable):
raise Exception("Expected transition to return a displayable, not a {!r}".format(trans))
Expand All @@ -3996,7 +4002,7 @@ def add_layer(where, layer):
focus_roots.append(pb)

else:
root_widget.add(layers_root)
root_widget.add(renpy.defaultstore.At(layers_root, *scene_lists.layer_at_list[None][1], *scene_lists.camera_list[None][1]))

# Add top_layers to the root_widget.
for layer in renpy.config.top_layers:
Expand Down
6 changes: 6 additions & 0 deletions renpy/parser.py
Expand Up @@ -842,6 +842,9 @@ def show_layer_statement(l, loc):

layer = l.require(l.name)

if layer == "None":
layer = None

if l.keyword("at"):
at_list = parse_simple_expression_list(l)
else:
Expand All @@ -866,6 +869,9 @@ def camera_statement(l, loc):

layer = l.name() or 'master'

if layer == "None":
layer = None

if l.keyword("at"):
at_list = parse_simple_expression_list(l)
else:
Expand Down