A downloadable library

Download NowName your own price

Create lists of character callbacks with ease!

Have you ever needed to create multiple callbacks on the same character that do different things? Do you not want to cram unrelated things into a single callback? If so, this is the tool for you!

This library provides a tiny helper class called CallbackList that groups multiple character callbacks into a single callable!

It's just a class that wraps callbacks, it's that simple!

Usage

init python:
    def cb1(event, interact=True, **kwargs):
        ...
    def cb2(event, interact=True, **kwargs):
        ...
define e = Character("Eileen", callback=CallbackList(cb1, cb2))
  1. Create your character callbacks
  2. Define your character(s)
  3. Create a CallbackList
  4. Pass that CallbackList to the target character(s) with the callback keyword.

Examples

Inline CallbackLists

If you only have one character that you want to apply the CallbackList to, you can inline the construction of that CallbackList in the character constructor:

define e = Character("Eileen", callback=CallbackList(cb1, cb2))

Separate CallbackLists

If you want to use the same CallbackList for multiple characters, you may define it separately and pass it to the character constructors:

define my_cb_list = CallbackList(cb1, cb2)
define a = Character("Annie", callback=my_cb_list)
define e = Character("Eileen", callback=my_cb_list)

License

This source code and project are released under the MIT license, which to paraphrase in a way that is not legally binding:

  • You can use it for free things
  • You can use it for paid things
  • You can modify it however you see fit
  • You can redistribute it as you see fit
  • Go nuts!

For a better breakdown of what the license actually means see: ChooseALicense.com

I do ask that you credit me in some way, but if you don't, I'm not gonna call the open-source police on you. If you do choose to credit me you can do so by providing a link to my GitHub, my Itch.io, or just call me Foxcapades.

Download

Download NowName your own price

Click download now to get access to the following files:

From GitHub
External

Leave a comment

Log in with itch.io to leave a comment.