Skip to content

Konijima/pzpw-pipewrench-events

Repository files navigation

PipeWrench-Events (For PZPW)

Build

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

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

About

PipeWrench-Events repo for PZPW

Topics

Resources

License

Stars

Watchers

Forks

Languages