Skip to content

Commit 0b152dd

Browse files
committed
fix: add show layer support
ref #4
1 parent 1818b84 commit 0b152dd

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

renpy/ast.py

+23-1
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,30 @@ def get_code(self, **kwargs) -> str:
322322

323323

324324
class ShowLayer(Node):
325+
"""
326+
show layer <name> at a,b,c :
327+
atl
328+
"""
329+
325330
__slots__ = [
326331
"layer",
327332
"at_list",
328333
"atl",
329334
]
330335

336+
def get_code(self, **kwargs) -> str:
337+
start = "show layer"
338+
if hasattr(self, "layer") and self.layer:
339+
start += f" {self.layer}"
340+
if hasattr(self, "at_list") and self.at_list:
341+
start += f" at {util.get_code(self.at_list,**kwargs)}"
342+
if hasattr(self, "atl") and self.atl:
343+
start += ":"
344+
rv = [start]
345+
if hasattr(self, "atl") and self.atl:
346+
rv.append(util.indent(util.get_code(self.atl)))
347+
return "\n".join(rv)
348+
331349

332350
class Scene(Node):
333351
__slots__ = [
@@ -785,14 +803,18 @@ class Camera(Node):
785803
camera background:
786804
perspective True
787805
806+
camera master at a,b,c:
807+
atl
788808
"""
789809

810+
__slots__ = ["layer", "at_list", "atl"]
811+
790812
def get_code(self, **kwargs) -> str:
791813
start = "camera"
792814
if self.layer:
793815
start += f" {self.layer}"
794816
if self.at_list:
795-
raise NotImplementedError
817+
start += f" at {util.get_code(self.at_list,**kwargs)}"
796818
if self.atl:
797819
start += ":"
798820
rv = [start]

0 commit comments

Comments
 (0)