Compare commits
No commits in common. "52ed1d37de7d7a20ce0016120dba6fca1cfb835e" and "b5500403693c73aedddb20d9115785799ee8252f" have entirely different histories.
52ed1d37de
...
b550040369
@ -1,3 +1,4 @@
|
||||
|
||||
init -999 python:
|
||||
# Remove style overrides
|
||||
adv.who_args.pop("style", None)
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
# Preferences
|
||||
# https://www.renpy.org/doc/html/preferences.html
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
label start:
|
||||
python:
|
||||
version = version_float()
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
# Legacy styles (still in use)
|
||||
|
||||
style yesno_button:
|
||||
|
@ -11,7 +11,6 @@ init python early:
|
||||
import re
|
||||
import string
|
||||
import functools
|
||||
import timeit as timeit_module
|
||||
from bisect import bisect
|
||||
from operator import itemgetter
|
||||
from operator import add as _add
|
||||
@ -126,28 +125,26 @@ init python early:
|
||||
if isinstance(obj, _list):
|
||||
return [make_revertable(x) for x in obj]
|
||||
elif isinstance(obj, _dict):
|
||||
return dict((make_revertable(k), make_revertable(v)) for (k,v) in obj.items())
|
||||
return dict([(make_revertable(k), make_revertable(v)) for (k,v) in obj.items()])
|
||||
else:
|
||||
return obj
|
||||
|
||||
def is_integer(s):
|
||||
def zero(s):
|
||||
return (len(s) > 1 and s.startswith("0"))
|
||||
|
||||
s = str(s)
|
||||
if not s:
|
||||
return False
|
||||
if s[0] in ("-", "+"):
|
||||
# calling lstrip("0+-") would be faster but not exactly identical
|
||||
s = s[1:]
|
||||
if s.lstrip("0").isdigit():
|
||||
return True
|
||||
return False
|
||||
|
||||
if s and s[0] in ("-", "+"):
|
||||
return (not zero(s[1:]) and s[1:].isdigit())
|
||||
return (not zero(s) and s.isdigit())
|
||||
|
||||
def timeit(func, loops=10000, args=(), kwargs={}):
|
||||
rv = timeit_module.timeit("func(*args, **kwargs)", number=loops, globals=dict(func=func, args=args, kwargs=kwargs))
|
||||
print(f"The task has taken {rv} seconds to finish")
|
||||
|
||||
def autorange(func, args=(), kwargs={}):
|
||||
loops, time = timeit_module.Timer("func(*args, **kwargs)", globals=dict(func=func, args=args, kwargs=kwargs)).autorange()
|
||||
print(f"The task has taken {time/loops} seconds to finish ({loops} iterations in {time} seconds)")
|
||||
start = time.time()
|
||||
for i in range(loops):
|
||||
func(*args, **kwargs)
|
||||
end = time.time()
|
||||
print(f"The task has taken {end-start} seconds to finish")
|
||||
|
||||
def list_swap_values(l, val1, val2):
|
||||
"""Mutates the original list."""
|
||||
@ -189,9 +186,9 @@ init python early:
|
||||
return s1.replace(filter, "") == s2.replace(filter, "")
|
||||
|
||||
def istype(inst, clss):
|
||||
if isinstance(clss, (list, tuple, set)):
|
||||
return type(inst) in clss
|
||||
return type(inst) is clss
|
||||
if not isinstance(clss, (list, tuple, set)):
|
||||
clss = (clss,)
|
||||
return type(inst) in clss
|
||||
|
||||
class IntLike(python_object):
|
||||
# Does not support rollback
|
||||
|
@ -1,4 +1,4 @@
|
||||
python early:
|
||||
init -999 python early:
|
||||
if renpy.version_tuple < (7,5,3,22090809):
|
||||
raise RuntimeWarning("Your Ren'Py launcher is outdated, the current minimal requirement is 7.5.3.22090809+\nPlease perform an update and try launching the game again.")
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
# Custom text tags
|
||||
# https://www.renpy.org/doc/html/custom_text_tags.html
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
image fade = "#00000080"
|
||||
image fade_gradient = "interface/bld.webp"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user