Compare commits

...

6 Commits

Author SHA1 Message Date
LoafyLemon 908beae5d3 Maintain access convention within save compat 2024-04-02 14:19:59 +01:00
Gouvernathor d8751d73b9 Remove nonsense calls of getattr
(cherry picked from commit 7ca17b7ba7)
2024-04-02 13:53:55 +01:00
Gouvernathor 224194754f Avoid using unnecessary screens 2024-04-02 13:44:04 +01:00
Gouvernathor e3c5fb609d Avoid python statement
(cherry picked from commit 22348f0901)
2024-04-02 13:41:44 +01:00
Gouvernathor e04fd221dd Flag unreachable code
(cherry picked from commit 25820e002a)
2024-04-02 13:37:20 +01:00
Gouvernathor ef97c273db Linting dynamic
(cherry picked from commit 60244e258a)
2024-04-02 13:36:59 +01:00
7 changed files with 70 additions and 54 deletions

View File

@ -1,5 +1,14 @@
python early hide:
import inspect
try:
from renpy.lint import python_builtins, renpy_builtins
except ImportError:
import builtins
python_builtins = set(dir(builtins))
del builtins
renpy_builtins = set()
__register_params = frozenset(inspect.signature(renpy.register_statement).parameters).difference({"name", "parse"})
def register_decorator(cls):
"""
@ -54,6 +63,12 @@ python early hide:
evaled = {n: eval(e) for n, e in self.items()}
renpy.dynamic(**evaled)
def lint(self):
for domain, st in (("Python", python_builtins), ("Ren'Py", renpy_builtins)):
inter = st.intersection(self)
if inter:
renpy.error(f"Dynamic statement redefines one or several {domain} builtins: {', '.join(map(repr, inter))}")
@register_decorator
class chibi:
@staticmethod

View File

@ -95,6 +95,7 @@ label update_lun_tier:
# T5 NOT AVAILABLE
return
# unreachable
# Requirement: Tier 4 - Blow me T4 E3
$ lun_level_up = 4
return

View File

@ -145,6 +145,7 @@ label day_start:
# Start Quests
jump quests
# unreachable
$ renpy.choice_for_skipping()
call screen room_menu
@ -239,6 +240,7 @@ label night_start:
# Start Quests
jump quests
# unreachable
$ renpy.choice_for_skipping()
call screen room_menu

View File

@ -142,18 +142,24 @@ label teleport(position=None,effect=True,poof_label=None):
with d1
hide screen blkfade
show screen heal_animation
show heal_ani onlayer screens zorder teleport_zorder:
anchor (0.5, 1.0)
pos teleport_pos
zoom 0.5
with d3
#stop music fadeout 1
hide screen heal_animation
hide heal_animation onlayer screens
if poof_label is not None:
$ renpy.call(poof_label)
show screen teleport_animation
call expression poof_label
show teleport_ani onlayer screens zorder teleport_zorder:
anchor (0.5, 0.7)
pos teleport_pos
zoom 0.5
with d5
hide screen teleport_animation
hide teleport_animation onlayer screens
with d5
if effect == True:
@ -161,17 +167,9 @@ label teleport(position=None,effect=True,poof_label=None):
return
screen teleport_animation():
add "teleport_ani" anchor (0.5, 0.7) xpos teleport_xpos ypos teleport_ypos zoom 0.5
zorder teleport_zorder
screen heal_animation():
add "heal_ani" anchor (0.5, 1.0) xpos teleport_xpos ypos teleport_ypos zoom 0.5
zorder teleport_zorder
# Dummy labels. To prevent crashes. # TODO: Remove later.
default hermione_action = None
label set_her_action(action=None, update=None):
$ hermione_action = action
return
return

View File

@ -156,8 +156,8 @@ init -1 python:
if config.developer:
def __setattr__(self, attr, value):
if hasattr(self, attr) and getattr(self, attr) != value:
id = getattr(self, "id")
if getattr(self, attr, not value) != value:
id = self.id
rollback = f"{stdcol.UNDERLINE}(Rollback){stdcol.END} " if renpy.in_rollback() else ""
caller_id = renpy.get_filename_line()

View File

@ -3,7 +3,7 @@ init -999:
import json
import os
if not getattr(persistent, "mods_enabled"):
if not persistent.mods_enabled:
persistent.mods_enabled = _set()
mods_list = _dict()

File diff suppressed because it is too large Load Diff