Skip to content

Commit

Permalink
[Plugin API] Fix: add missing hook types, order & style (OpenRCT2#22134)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmagic2020 authored Jul 23, 2024
1 parent 035e409 commit 2da5ed6
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions distribution/openrct2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,20 +496,20 @@ declare global {
*/
subscribe(hook: HookType, callback: Function): IDisposable;

subscribe(hook: "action.query", callback: (e: GameActionEventArgs) => void): IDisposable;
subscribe(hook: "action.execute", callback: (e: GameActionEventArgs) => void): IDisposable;
subscribe(hook: "interval.tick", callback: () => void): IDisposable;
subscribe(hook: "action.location", callback: (e: ActionLocationArgs) => void): IDisposable;
subscribe(hook: "action.query", callback: (e: GameActionEventArgs) => void): IDisposable;
subscribe(hook: "guest.generation", callback: (e: GuestGenerationArgs) => void): IDisposable;
subscribe(hook: "interval.day", callback: () => void): IDisposable;
subscribe(hook: "network.chat", callback: (e: NetworkChatEventArgs) => void): IDisposable;
subscribe(hook: "interval.tick", callback: () => void): IDisposable;
subscribe(hook: "map.change", callback: () => void): IDisposable;
subscribe(hook: "map.save", callback: () => void): IDisposable;
subscribe(hook: "network.authenticate", callback: (e: NetworkAuthenticateEventArgs) => void): IDisposable;
subscribe(hook: "network.chat", callback: (e: NetworkChatEventArgs) => void): IDisposable;
subscribe(hook: "network.join", callback: (e: NetworkEventArgs) => void): IDisposable;
subscribe(hook: "network.leave", callback: (e: NetworkEventArgs) => void): IDisposable;
subscribe(hook: "ride.ratings.calculate", callback: (e: RideRatingsCalculateArgs) => void): IDisposable;
subscribe(hook: "action.location", callback: (e: ActionLocationArgs) => void): IDisposable;
subscribe(hook: "guest.generation", callback: (e: GuestGenerationArgs) => void): IDisposable;
subscribe(hook: "vehicle.crash", callback: (e: VehicleCrashArgs) => void): IDisposable;
subscribe(hook: "map.save", callback: () => void): IDisposable;
subscribe(hook: "map.change", callback: () => void): IDisposable;

/**
* Can only be used in intransient plugins.
Expand Down Expand Up @@ -620,10 +620,21 @@ declare global {
"footpath_railings";

type HookType =
"interval.tick" | "interval.day" |
"network.chat" | "network.action" | "network.join" | "network.leave" |
"ride.ratings.calculate" | "action.location" | "vehicle.crash" |
"map.change" | "map.changed" | "map.save";
"action.execute" |
"action.location" |
"action.query" |
"guest.generation" |
"interval.day" |
"interval.tick" |
"map.change" |
"map.changed" |
"map.save" |
"network.authenticate" |
"network.chat" |
"network.join" |
"network.leave" |
"ride.ratings.calculate" |
"vehicle.crash";

type ExpenditureType =
"ride_construction" |
Expand Down

0 comments on commit 2da5ed6

Please sign in to comment.