Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/konijima/pzpw-pipewrench-events
PipeWrench-Events repo for PZPW
https://github.com/konijima/pzpw-pipewrench-events
pipewrench pzpw
Last synced: 11 days ago
JSON representation
PipeWrench-Events repo for PZPW
- Host: GitHub
- URL: https://github.com/konijima/pzpw-pipewrench-events
- Owner: Konijima
- License: mit
- Created: 2022-08-16T01:19:56.000Z (over 2 years ago)
- Default Branch: stable
- Last Pushed: 2022-08-16T03:27:43.000Z (over 2 years ago)
- Last Synced: 2024-11-05T18:55:11.766Z (about 2 months ago)
- Topics: pipewrench, pzpw
- Language: Lua
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# PipeWrench-Events (For PZPW)
[![Build](https://github.com/Konijima/pzpw-pipewrench-events/actions/workflows/Build.yml/badge.svg)](https://github.com/Konijima/pzpw-pipewrench-events/actions/workflows/Build.yml)
## 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/398ab440505416eb250f430c8776969a4ec8bd45/PipeWrench-Events.d.ts#L74-L89) and [EventConsumers](https://github.com/asledgehammer/PipeWrench-Events/blob/398ab440505416eb250f430c8776969a4ec8bd45/PipeWrench-Events.d.ts#L292-L298) , are provided as events and their associated consumer types for listeners.## Custom EventEmitters
```ts
import * as Events from 'PipeWrench-Events';// Example consumer type
export type MusicTrackUpdateListener = (
track: string,
volume: number
) => void;// Example EventEmitter.
const MusicTrackUpdate = new Events.EventEmitter('MusicTrackUpdate');// Example implementation.
MusicTrackUpdate.addListener((track: string, volume: number) => {
print(`Playing Track: ${track} (Volume: ${volume})`);
});
```## Setup
- (This library is installed in [PipeWrench-Template](https://github.com/asledgehammer/PipeWrench-Template))## Notes
- The documentation is transcribed from [pzwiki.net](https://pzwiki.net/wiki/Modding:Lua_Events)# Support
![](https://i.imgur.com/ZLnfTK4.png)
## Discord Server
https://discord.gg/u3vWvcPX8fIf 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