From 5fc3f04c158a19c0456d3ddc7ff5be3d38b61097 Mon Sep 17 00:00:00 2001 From: ozxybox Date: Sat, 11 Apr 2026 18:00:04 -0700 Subject: [PATCH 01/15] fix: Correct return type for GetCampaignMeta --- p2ce/campaign.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2ce/campaign.d.ts b/p2ce/campaign.d.ts index 98cbbb2..d6c96b3 100644 --- a/p2ce/campaign.d.ts +++ b/p2ce/campaign.d.ts @@ -49,7 +49,7 @@ declare namespace CampaignAPI { function IsCampaignActive(): boolean; function FindCampaign(campaign: string): CampaignPair|null; - function GetCampaignMeta(name: string|null): Map; + function GetCampaignMeta(name: string|null): Map|null; function SetActiveCampaign(name: string|null): boolean; function StartCampaign(campaign: string, chapter: string, map: number): boolean; From 03e747a7984ffea4eaad60f8227f8b43cc9df9ad Mon Sep 17 00:00:00 2001 From: ozxybox Date: Sat, 11 Apr 2026 18:00:24 -0700 Subject: [PATCH 02/15] feat: Add mapgroup arg to PopulateLoadingScreen --- shared/events.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/events.d.ts b/shared/events.d.ts index d2984c2..3dcbe8b 100644 --- a/shared/events.d.ts +++ b/shared/events.d.ts @@ -146,7 +146,7 @@ interface GlobalEventNameMap { 'MapLoaded': (mapName: string, isBackgroundMap: boolean) => void, 'MapUnloaded': () => void, 'Cancelled': (sourceID: string, source: PanelEventSource) => void, - 'PopulateLoadingScreen': (mapName: string) => void, + 'PopulateLoadingScreen': (mapName: string, mapGroup: string) => void, 'ApplyVideoSettings': () => void, 'VideoSettingsInit': () => void, 'VideoSettingsResetDefault': () => void, From 1b2b04c1fca902a7d9f7566898a9a6d96aa78a51 Mon Sep 17 00:00:00 2001 From: ozxybox Date: Sun, 12 Apr 2026 01:55:44 -0700 Subject: [PATCH 03/15] feat(campaign): Add PanoramaComponent_Campaign_OnRefreshList --- p2ce/campaign.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/p2ce/campaign.d.ts b/p2ce/campaign.d.ts index d6c96b3..f26c496 100644 --- a/p2ce/campaign.d.ts +++ b/p2ce/campaign.d.ts @@ -60,4 +60,5 @@ declare namespace CampaignAPI { interface GlobalEventNameMap { PanoramaComponent_Campaign_OnActiveCampaignChanged: (campaign: string|null) => void; + PanoramaComponent_Campaign_OnRefreshList: () => void; } From e85408abba7e02d0a8dd8aa16995d13fe0bd10a5 Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Sun, 12 Apr 2026 20:29:52 -0500 Subject: [PATCH 04/15] feat(workshop): update workshop types --- p2ce/workshop.d.ts | 59 +++++++++------------------------------------- 1 file changed, 11 insertions(+), 48 deletions(-) diff --git a/p2ce/workshop.d.ts b/p2ce/workshop.d.ts index 2c18925..157a289 100644 --- a/p2ce/workshop.d.ts +++ b/p2ce/workshop.d.ts @@ -10,16 +10,7 @@ * ``` */ -/** @group enum */ -declare enum DownloadState { - UninstallPending = 0, - Uninstalling = 1, - Uninstalled = 2, - - InstallPending = 3, - Installing = 4, - Installed = 5, -} +declare type AddonIndex_t = int32; /** @group enum */ declare enum AddonRating { @@ -40,7 +31,6 @@ interface AddonMeta { authors: string[]; tags: string[]; - dependencies: {[uuid: string]: { required: boolean }}; votescore: number; flagged: boolean; upvotes: number; @@ -53,21 +43,6 @@ interface AddonMeta { // 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. */ -interface AddonChapterMeta { - map: string; - title: string; - description: string; - - unlocked: boolean; - thumb: string; - background: string; } /** [API not finalized] The workshop content API. Exclusive to P2:CE! */ @@ -76,48 +51,36 @@ declare namespace WorkshopAPI { function GetAddonCount(): number; /** Returns the metadata for the addon at the specified index. */ - function GetAddonMeta(index: uint32): AddonMeta; + function GetAddonMeta(index: AddonIndex_t): AddonMeta; /** Sets the subscription state of the addon at the specified index */ - function SetAddonSubscribed(index: uint32, subscribed: boolean): void; + function SetAddonSubscribed(index: AddonIndex_t, subscribed: boolean): void; /** Returns the subscription state of the addon at the specified index. */ - function GetAddonSubscribed(index: uint32): boolean; + function GetAddonSubscribed(index: AddonIndex_t): boolean; /** Sets the enable state of the addon at the specified index */ - function SetAddonEnabled(index: uint32, enabled: boolean): void; + function SetAddonEnabled(index: AddonIndex_t, enabled: boolean): void; /** Returns the enable state of the addon at the specified index. */ - function GetAddonEnabled(index: uint32): boolean; + function GetAddonEnabled(index: AddonIndex_t): boolean; /** Gets the user rating for the given addon. If installed locally, returns AddonRating.None */ - function GetAddonUserRating(index: uint32): AddonRating; + function GetAddonUserRating(index: AddonIndex_t): AddonRating; /** Sets the user rating for the given addon */ - function SetAddonUserRating(index: uint32, rating: AddonRating): void; + function SetAddonUserRating(index: AddonIndex_t, rating: AddonRating): void; /** Enables or disables a set of addons in one fell swoop. Use this if you're planning to enable/disable multiple at once */ - function SetAddonListEnabled(addons: Record): void; + function SetAddonListEnabled(addons: Record): void; /** Returns the content path of an addon at the specified index. */ - function GetAddonNamedPath(index: number): string; + function GetAddonNamedPath(index: AddonIndex_t): string; /** Launched the game from Hammer or using the -workshop_tools launch option */ function IsWorkshopToolsMode(): string; - - /****** Below here are @TODO items!! *******/ - - /** Returns the index of the addon that owns the specified map, or null if the map is not owned by an addon. */ - function GetAddonByMap(mapname: string): number|null; - - /** Returns the metadata of the maps for the addon at the specified index. */ - function GetAddonChapters(index: uint32): AddonChapterMeta[]; - - /** Returns the download state of the addon at the specified index. */ - function GetAddonState(index: uint32): DownloadState; } interface GlobalEventNameMap { - /** Fires when the installation state of an addon is updated. */ - 'WorkshopAddonStateUpdated': (index: uint32, state: DownloadState) => void, + 'PanoramaComponent_Workshop_OnAddonInstalled': (index: AddonIndex_t) => void, } From 1d59b1ad174009f02d1f0c7a1544e592b2836cb7 Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Sun, 12 Apr 2026 20:46:54 -0500 Subject: [PATCH 05/15] feat(campaign): add CampaignHasSaveData --- p2ce/campaign.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/p2ce/campaign.d.ts b/p2ce/campaign.d.ts index f26c496..da24cf3 100644 --- a/p2ce/campaign.d.ts +++ b/p2ce/campaign.d.ts @@ -56,6 +56,8 @@ declare namespace CampaignAPI { function ContinueCampaign(campaign: string): boolean; function GetCampaignUnlockProgress(campaign: string): number; + + function CampaignHasSaveData(campaign: string|null): boolean; } interface GlobalEventNameMap { From 933b36883b8f4f985278a93fe77e7936d2975be2 Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:41:59 -0500 Subject: [PATCH 06/15] feat: add GetAddonDependencies & Missing --- p2ce/workshop.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/p2ce/workshop.d.ts b/p2ce/workshop.d.ts index 157a289..fe4b0d2 100644 --- a/p2ce/workshop.d.ts +++ b/p2ce/workshop.d.ts @@ -79,6 +79,9 @@ declare namespace WorkshopAPI { /** Launched the game from Hammer or using the -workshop_tools launch option */ function IsWorkshopToolsMode(): string; + + function GetAddonDependencies(index: AddonIndex_t): Array | null; + function GetAddonDependenciesMissing(index: AddonIndex_t): Array | null; } interface GlobalEventNameMap { From 59487df52df2eb75e382489d41f4dae988cf447b Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:20:09 -0500 Subject: [PATCH 07/15] feat: CreateQueryUGCDetailsRequest --- p2ce/workshop.d.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/p2ce/workshop.d.ts b/p2ce/workshop.d.ts index fe4b0d2..bccb10d 100644 --- a/p2ce/workshop.d.ts +++ b/p2ce/workshop.d.ts @@ -11,6 +11,7 @@ */ declare type AddonIndex_t = int32; +declare type PublishedFileId_t = bigint; /** @group enum */ declare enum AddonRating { @@ -25,7 +26,7 @@ interface AddonMeta { index: number; title: string; description: string; - workshopid: number; + workshopid: PublishedFileId_t; local: boolean; authors: string[]; @@ -45,6 +46,12 @@ interface AddonMeta { thumb: string; } +interface SteamUGCDetails_t { + m_nPublishedFileId: PublishedFileId_t; + m_rgchTitle: string; + m_rgchDescription: string; +} + /** [API not finalized] The workshop content API. Exclusive to P2:CE! */ declare namespace WorkshopAPI { /** Returns the number of addons in the addons list. */ @@ -81,7 +88,8 @@ declare namespace WorkshopAPI { function IsWorkshopToolsMode(): string; function GetAddonDependencies(index: AddonIndex_t): Array | null; - function GetAddonDependenciesMissing(index: AddonIndex_t): Array | null; + function GetAddonDependenciesMissing(index: AddonIndex_t): Array | null; + function CreateQueryUGCDetailsRequest(callback: (success: boolean, data: Array | null) => void, workshopIds: Array): void; } interface GlobalEventNameMap { From 409339c6dbe602031be3156cb57431875327a91a Mon Sep 17 00:00:00 2001 From: ozxybox Date: Tue, 14 Apr 2026 21:45:31 -0700 Subject: [PATCH 08/15] feat(workshop): Add m_rgchPreviewUrl to SteamUGCDetails_t --- p2ce/workshop.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/p2ce/workshop.d.ts b/p2ce/workshop.d.ts index bccb10d..a28ede2 100644 --- a/p2ce/workshop.d.ts +++ b/p2ce/workshop.d.ts @@ -50,6 +50,7 @@ interface SteamUGCDetails_t { m_nPublishedFileId: PublishedFileId_t; m_rgchTitle: string; m_rgchDescription: string; + m_rgchPreviewUrl: string; } /** [API not finalized] The workshop content API. Exclusive to P2:CE! */ From f8fb46d3710e4256a8bb205c5a43e2d337f626aa Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Wed, 15 Apr 2026 02:10:26 -0500 Subject: [PATCH 09/15] fix: AddonRating enum values --- p2ce/workshop.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2ce/workshop.d.ts b/p2ce/workshop.d.ts index a28ede2..7b6b072 100644 --- a/p2ce/workshop.d.ts +++ b/p2ce/workshop.d.ts @@ -16,8 +16,8 @@ declare type PublishedFileId_t = bigint; /** @group enum */ declare enum AddonRating { None = 0, - ThumbsDown = 1, - ThumbsUp = 2, + ThumbsUp = 1, + ThumbsDown = 2, } /** Describes a workshop item. */ From 5bdf577f98c3d482051e94ec779fbf1898d71328 Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Wed, 15 Apr 2026 19:32:33 -0500 Subject: [PATCH 10/15] fix: IsWorkshopToolsMode bool --- p2ce/workshop.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2ce/workshop.d.ts b/p2ce/workshop.d.ts index 7b6b072..38f2df2 100644 --- a/p2ce/workshop.d.ts +++ b/p2ce/workshop.d.ts @@ -86,7 +86,7 @@ declare namespace WorkshopAPI { function GetAddonNamedPath(index: AddonIndex_t): string; /** Launched the game from Hammer or using the -workshop_tools launch option */ - function IsWorkshopToolsMode(): string; + function IsWorkshopToolsMode(): boolean; function GetAddonDependencies(index: AddonIndex_t): Array | null; function GetAddonDependenciesMissing(index: AddonIndex_t): Array | null; From c9d545293e18ccd6be9f0ea9602ed048dcb7962b Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Wed, 22 Apr 2026 09:43:40 -0500 Subject: [PATCH 11/15] fix: CreateQueryUGCDetailsRequest return type --- p2ce/workshop.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2ce/workshop.d.ts b/p2ce/workshop.d.ts index 38f2df2..00ef22f 100644 --- a/p2ce/workshop.d.ts +++ b/p2ce/workshop.d.ts @@ -90,7 +90,7 @@ declare namespace WorkshopAPI { function GetAddonDependencies(index: AddonIndex_t): Array | null; function GetAddonDependenciesMissing(index: AddonIndex_t): Array | null; - function CreateQueryUGCDetailsRequest(callback: (success: boolean, data: Array | null) => void, workshopIds: Array): void; + function CreateQueryUGCDetailsRequest(callback: (success: boolean, data: Array | null) => void, workshopIds: Array): boolean; } interface GlobalEventNameMap { From 9d88da183bfd9fe1ff253858c380adcd99d22c35 Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Sun, 26 Apr 2026 03:37:13 -0500 Subject: [PATCH 12/15] feat: campaign - next map & campaign eval --- p2ce/campaign.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/p2ce/campaign.d.ts b/p2ce/campaign.d.ts index da24cf3..6653255 100644 --- a/p2ce/campaign.d.ts +++ b/p2ce/campaign.d.ts @@ -58,9 +58,11 @@ declare namespace CampaignAPI { function GetCampaignUnlockProgress(campaign: string): number; function CampaignHasSaveData(campaign: string|null): boolean; + function MoveToNextMap(): void; } interface GlobalEventNameMap { PanoramaComponent_Campaign_OnActiveCampaignChanged: (campaign: string|null) => void; PanoramaComponent_Campaign_OnRefreshList: () => void; + PanoramaComponent_Campaign_OnCampaignEvaluationRequested: (campaign: string) => void; } From 177cb3be5e086e64776b73af5630e8e84c5c72ca Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Fri, 1 May 2026 20:59:06 -0500 Subject: [PATCH 13/15] feat: add GetActiveMountList() --- p2ce/workshop.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/p2ce/workshop.d.ts b/p2ce/workshop.d.ts index 00ef22f..b9b689d 100644 --- a/p2ce/workshop.d.ts +++ b/p2ce/workshop.d.ts @@ -91,6 +91,7 @@ declare namespace WorkshopAPI { function GetAddonDependencies(index: AddonIndex_t): Array | null; function GetAddonDependenciesMissing(index: AddonIndex_t): Array | null; function CreateQueryUGCDetailsRequest(callback: (success: boolean, data: Array | null) => void, workshopIds: Array): boolean; + function GetActiveMountList(): Array; } interface GlobalEventNameMap { From 40b76413280e25904fe82c26b64097cbfa8b5c8e Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Fri, 1 May 2026 20:59:18 -0500 Subject: [PATCH 14/15] feat: add m_ulSteamIDOwner --- p2ce/workshop.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/p2ce/workshop.d.ts b/p2ce/workshop.d.ts index b9b689d..05c6a83 100644 --- a/p2ce/workshop.d.ts +++ b/p2ce/workshop.d.ts @@ -51,6 +51,7 @@ interface SteamUGCDetails_t { m_rgchTitle: string; m_rgchDescription: string; m_rgchPreviewUrl: string; + m_ulSteamIDOwner: uint64_num; } /** [API not finalized] The workshop content API. Exclusive to P2:CE! */ From 7f9fee5d204026fa85878be8a40c98cfcfa8c7bb Mon Sep 17 00:00:00 2001 From: iamsirenstorm <120330118+iamsirenstorm@users.noreply.github.com> Date: Thu, 26 Feb 2026 05:36:52 -0600 Subject: [PATCH 15/15] feat: captions api --- p2ce/caption.d.ts | 31 +++++++++++++++++++++++++++++++ shared/panels.d.ts | 6 ++++++ 2 files changed, 37 insertions(+) create mode 100644 p2ce/caption.d.ts diff --git a/p2ce/caption.d.ts b/p2ce/caption.d.ts new file mode 100644 index 0000000..d681222 --- /dev/null +++ b/p2ce/caption.d.ts @@ -0,0 +1,31 @@ +/** + * @packageDocumentation + * Captioning Interface + */ + +interface Caption { + bLowPriority: boolean; + bSFX: boolean; + flNoRepeat: number; + flDelay: number; + flLifetimeOverride: number; + text: string; + options: Map; +} + +declare enum CloseCaptioningExpiryMethod { + STACK = 0, + INDIVIDUAL = 1 +} + +interface GlobalEventNameMap { + DisplayCaption: (token: string, caption: Caption, lifetime: number, emitTime: number) => void; + BadCaption: (token: string, lifetime: number, emitTime: number) => void; + EndCaption: (token: string) => void; +} + +declare namespace ClosedCaptionsAPI { + function SetMaxCaptionEntries(num: number): void; + function GetAvailableLanguages(): Array; + function SetCaptioningExpiryMethod(method: CloseCaptioningExpiryMethod): void; +} diff --git a/shared/panels.d.ts b/shared/panels.d.ts index aae03d3..702cb0e 100644 --- a/shared/panels.d.ts +++ b/shared/panels.d.ts @@ -454,6 +454,12 @@ declare interface Label extends AbstractPanel<'Label'> { SetLocalizationString(text: string): void; SetProceduralTextThatIPromiseIsLocalizedAndEscaped(text: string, allowDialogVariables: boolean): void; + + /** + * Approximates the height this label would have + * if the passed in text was set, given a pre-determined width. + */ + GetHeightForText(width: number, text: string): number; } declare interface Movie extends AbstractPanel<'Movie'> {