@shughesuk/pipewrench-events
v41.73.6
Published
## Description PipeWrench-Events is an extension for the PipeWrench library, packaging Project Zomboid's events in an API that takes advantage of the TypeScript environment. [EventEmitters](https://github.com/asledgehammer/PipeWrench-Events/blob/398ab4405
Downloads
11
Maintainers
Readme
PipeWrench-Events
Description
PipeWrench-Events is an extension for the PipeWrench library, packaging Project Zomboid's events in an API that takes advantage of the TypeScript environment. EventEmitters and EventConsumers , are provided as events and their associated consumer types for listeners.
Custom EventEmitters
import * as Events from 'PipeWrench-Events';
// Example consumer type
export type MusicTrackUpdateListener = (
track: string,
volume: number
) => void;
// Example EventEmitter.
const MusicTrackUpdate = new Events.EventEmitter<MusicTrackUpdateListener>('MusicTrackUpdate');
// Example implementation.
MusicTrackUpdate.addListener((track: string, volume: number) => {
print(`Playing Track: ${track} (Volume: ${volume})`);
});
Setup
- (This library is installed in PipeWrench-Template)
Notes
- The documentation is transcribed from pzwiki.net
Support
Discord Server
https://discord.gg/u3vWvcPX8f
If you like what I do and helped your community a lot, feel free to buy me a coffee! https://ko-fi.com/jabdoesthings https://www.paypal.com/paypalme/JabJabJab