pylance: Address more type warnings.

This commit is contained in:
Tom Rothamel
2023-02-23 01:25:21 -05:00
parent 51e89cb7bd
commit 9f96f132e7
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -624,6 +624,9 @@ class MultiBox(Container):
_camera_list = None # type: list|None
layers = None # type: dict|None
# Used when this is representing a layer.
raw_child = None # type: renpy.display.core.Displayable|None
layer_name = None # type: str|None
def __init__(self, spacing=None, layout=None, style='default', **properties):
@@ -2431,6 +2434,11 @@ class Layer(AdjustTimes):
anything exceeding the bounds will be trimmed.
"""
# An instance variable that's used to store the layer_transitions
# when this layer s being processed. (This is only being created
# as a dict for typing purposes.)
layers = { }
def __init__(self, layer, **properties):
self.layer = layer
self._clipping = properties.pop('clipping', True)
+2 -2
View File
@@ -529,11 +529,11 @@ def MoveTransition(delay, old_widget=None, new_widget=None, enter=None, leave=No
# If we're dealing with a wrapped layer widget, merge the raw
# children then re-apply the transform.
if hasattr(new, 'raw_child'):
if getattr(new, 'raw_child', None):
rv = new
new = new.raw_child
layer = new.layer_name
layer = new.layer_name # type: ignore
if (isinstance(new, renpy.display.layout.MultiBox) and
layer in layers and new.scene_list is not None):