From 2da5ed6517bf0749e7dfdcf493cd5c4987d7e746 Mon Sep 17 00:00:00 2001 From: Arnold Zhou Date: Tue, 23 Jul 2024 20:49:57 +1000 Subject: [PATCH] [Plugin API] Fix: add missing hook types, order & style (#22134) --- distribution/openrct2.d.ts | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 5688620814..85ec3a3abf 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -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. @@ -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" |