#[WIP] Event Bus Ride

1 messages · Page 1 of 1 (latest)

crimson oxide
#

I've recently (mostly yesterday) gotten into modding Balalatro and I wanted to get a quick mod out while I work on a bigger project. So, here it is! Mini

Event Bus Ride (or Bus Ride, I can't make up my mind) is a library??(? API???) mod I'm working on to try to cut down slightly on the amount of times a function has to be wrapped and hooked onto, by adding an event bus kind of system. Essentially, you call BUSRIDE.on("love.update", function(args) end) and your function will automatically run whenever love.update is used!
You can also cancel the included events by returning false*, and wrap your own functions using BUSRIDE.hookFunction!
-# * This only works for the on time events. Ones like love.draw#pre and love.update#post cannot cancel.
Documentation is in the README.md .

Async functions are another system that's included. By running the code below, you have a function that runs over two or more frames!

BUSRIDE.runAsync(function()
    print("hello!")
    BUSRIDE.wait(500)
    print("hello again!")
end)

-# Feedback would be very much appreciated. I'm very new to modding Balatro, so I don't know all the functions that would be good to hook into.
-# The async functions also haven't been tested extensively, so please let me know if there are any issues or confusion.
-# i also didnt know what to call this since there's already an events system so like um

inland trench
#

It'd be great if the async tasks in particular would desugar into the game's pre-existing event loop (instead of adding another event loop to reason about and cause race conditions on)

#

The hooks I don't think I'd use personally (it's not that much boilerplate to write one, and there are so many random functions I end up hooking. especially since this would be an extra dependency to pass on to users, when there's not a great system in place to automatically pull it in). It might be good for less experienced programmers, though?

crimson oxide
inland trench
#

goated