Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foxcapades/renpy-callback-list
Create lists of character callbacks with ease!
https://github.com/foxcapades/renpy-callback-list
Last synced: 5 days ago
JSON representation
Create lists of character callbacks with ease!
- Host: GitHub
- URL: https://github.com/foxcapades/renpy-callback-list
- Owner: Foxcapades
- License: mit
- Created: 2023-07-29T18:06:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-31T17:20:31.000Z (over 1 year ago)
- Last Synced: 2024-10-17T01:18:55.488Z (20 days ago)
- Language: Ren'Py
- Homepage:
- Size: 1.1 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.adoc
- License: license
Awesome Lists containing this project
README
= Ren'Py Character Callback List
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 have to cram unrelated things into a
single callback? If so, this is the tool for you!This library provides a new class called `CallbackList` that allows you to group
multiple character callbacks into a single callable!It's just a class wrapping a list of callbacks, it's that simple!
[IMPORTANT]
--
This library only supports Ren'Py versions 8.1+
--== Usage
[source, python]
----
init python:
def callback1(event, interact=True, **kwargs):
...def callback2(event, interact=True, **kwargs):
...define e = Character("Eileen", callback=CallbackList(callback1, callback2))
----. Create your character callbacks.
. Define your character(s)
. Create a `CallbackList`
. Pass that `CallbackList` to the 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:[source, python]
----
define e = Character("Eileen", callback=CallbackList(callback1, callback2))
----
--*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:[source, python]
----
define my_cb_list = CallbackList(callback1, callback2)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:
https://choosealicense.com/licenses/mit/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 link:https://github.com/Foxcapades[GitHub], my
link:https://foxcapades.itch.io/[Itch.io], or just call me Foxcapades.