You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeDownloadState=ValueOf<DownloadStateEnum>;interfaceDownloadStateEnum{UninstallPending: 0,Uninstalling: 1,Uninstalled: 2,InstallPending: 3,Installing: 4,Installed: 5,}/** Describes a workshop item. */interfaceAddonMeta{type: string;index: number;title: string;description: string;local: boolean;authors: string[];tags: string[];dependencies: {[uuid: string]: {required: boolean}};subscriptions: number;votescore: number;flagged: boolean;// The standard workshop thumbnail. Exists on all addons.thumb: string;// These only exist when the addon is a campaign.cover?: string;logo?: string;}/** A chapter of an addon. */interfaceAddonChapterMeta{map: string;title: string;description: string;unlocked: boolean;thumb: string;background: string;}/** [API not finalized] The workshop content API. Exclusive to P2:CE! */declarenamespaceWorkshopAPI{/** Returns the number of addons in the addons list. */functionGetAddonCount(): number;/** Returns the index of the addon that owns the specified map, or null if the map is not owned by an addon. */functionGetAddonByMap(mapname: string): number;/** Returns the metadata for the addon at the specified index. */functionGetAddonMeta(index: number): AddonMeta;/** Returns the metadata of the maps for the addon at the specified index. */functionGetAddonChapters(index: number): AddonChapterMeta[];/** Returns the download state of the addon at the specified index. */functionGetAddonState(index: number): DownloadState;/** Returns the subscription state of the addon at the specified index. */functionGetAddonSubscribed(index: number): boolean;/** Returns the enable state of the addon at the specified index. */functionGetAddonEnabled(index: number): boolean;/** Sets the subscription state of the addon at the specified index, returning whether the operation succeeded. */functionSetAddonSubscribed(index: number,subscribed: boolean): boolean;/** Sets the enable state of the addon at the specified index, returning whether the operation succeeded. */functionSetAddonEnabled(index: number,enabled: boolean): boolean;}interfaceGlobalEventNameMap{/** Fires when the installation state of an addon is updated. */'WorkshopAddonStateUpdated': (index: uint32,state: DownloadState)=>void,}
Events
NOTES:
uuid is the workshop addon ID. This may be empty string if the addon is locally installed (i.e. directly in the addons/ directory)
Invoked when there's a download status update to an item that's downloading
We need an API to manage workshop addons.
This of course depends on workshop support as detailed in the p2ce tracker.
See: https://github.com/StrataSource/pano-typed/tree/feat/workshop-api
API Description
Events
NOTES:
uuid
is the workshop addon ID. This may be empty string if the addon is locally installed (i.e. directly in the addons/ directory)Invoked when there's a download status update to an item that's downloading
WorkshopDownloadStatus(index: int, uuid: string, bytesDownloaded: uint64, bytesTotal: uint64)
Invoked when the addon's state has changed
WorkshopStateChanged(index: int, uuid: string, state: DownloadState)
Invoked when a new addon is subscribed and added to the internal addon list
WorkshopItemAdded(index: int, uuid: string)
The text was updated successfully, but these errors were encountered: