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

Please allow additional arguments to "function" in Transform class #525

Closed
kyouryuukunn opened this issue Dec 30, 2014 · 2 comments
Closed

Comments

@kyouryuukunn
Copy link
Member

kyouryuukunn commented Dec 30, 2014

Now, Transform class takes a "function" argument and this is called with three arguments.

Please allow additional arguments to "function",
For example, keyword arguments beginning with "_" to Transform class have the prefix stripped off, and are passed to the "funciton" as arguments.

example

    def test(tran, st, at, x, y):
            return None
    Transform(function=test, _x=x, _y=y)

First, I tried to use inner functions, but inner functions isn't saved.
I want to use flexible transforms.

By the way, do you have a plan to add ATL "if" statements?

@renpytom
Copy link
Member

renpytom commented Dec 31, 2014

Why not just use renpy.curry to curry the function, and supply arguments to the curried function. So you'd have:

def uncurried_test(tran, st, at, x, y):
     return None

test = renpy.curry(uncurried_test)
Transform(function=test(x=42, y=37))

ATL2 is being planned, but will take a while. It's a big deal.

@kyouryuukunn
Copy link
Member Author

kyouryuukunn commented Dec 31, 2014

I didn't know renpy.curry. Very thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants