From 5723acaf84106183ed0f429919f93279d7f4ee05 Mon Sep 17 00:00:00 2001 From: CKY- Date: Thu, 30 Jan 2025 17:11:25 -0700 Subject: [PATCH 1/6] feat(effects): add a way to see and clear unknown sources in obs selection effects --- .../obs/effects/toggle-obs-source-filter.ts | 52 +++++++++++++++--- .../obs/effects/toggle-obs-source-muted.ts | 46 ++++++++++++++-- .../effects/toggle-obs-source-visibility.ts | 55 ++++++++++++++++--- 3 files changed, 133 insertions(+), 20 deletions(-) diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts index 07003ed2e..3cca1a856 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts @@ -30,7 +30,26 @@ export const ToggleSourceFilterEffectType: EffectType = categories: ["common"] }, optionsTemplate: ` - + +
+
+
+
+ Source: {{filterName.sourceName}} +
    +
  • Name: {{filterName.filterName}}
  • +
  • Action: {{filterName.action}}
  • +
+
+
+ +
+
+
+
+
+ +
Filter @@ -76,13 +95,15 @@ export const ToggleSourceFilterEffectType: EffectType = $scope.searchText = ""; + $scope.orphanedSources = []; + if ($scope.effect.selectedFilters == null) { $scope.effect.selectedFilters = []; } $scope.filterIsSelected = (sourceName: string, filterName: string) => { return $scope.effect.selectedFilters.some( - (s) => s.sourceName === sourceName && s.filterName === filterName + s => s.sourceName === sourceName && s.filterName === filterName ); }; @@ -92,7 +113,7 @@ export const ToggleSourceFilterEffectType: EffectType = ) => { if ($scope.filterIsSelected(sourceName, filterName)) { $scope.effect.selectedFilters = $scope.effect.selectedFilters.filter( - (s) => !(s.sourceName === sourceName && s.filterName === filterName) + s => !(s.sourceName === sourceName && s.filterName === filterName) ); } else { $scope.effect.selectedFilters.push({ @@ -109,7 +130,7 @@ export const ToggleSourceFilterEffectType: EffectType = action: "toggle" | boolean ) => { const selectedFilter = $scope.effect.selectedFilters.find( - (s) => s.sourceName === sourceName && s.filterName === filterName + s => s.sourceName === sourceName && s.filterName === filterName ); if (selectedFilter != null) { selectedFilter.action = action; @@ -121,8 +142,11 @@ export const ToggleSourceFilterEffectType: EffectType = filterName: string ) => { const selectedFilter = $scope.effect.selectedFilters.find( - (s) => s.sourceName === sourceName && s.filterName === filterName + s => s.sourceName === sourceName && s.filterName === filterName ); + + $scope.orphanedSources = $scope.orphanedSources.filter(item => item !== selectedFilter); + if (selectedFilter == null) { return ""; } @@ -140,7 +164,7 @@ export const ToggleSourceFilterEffectType: EffectType = input .split(" ") .map( - (w) => w[0].toLocaleUpperCase() + w.substr(1).toLocaleLowerCase() + w => w[0].toLocaleUpperCase() + w.substr(1).toLocaleLowerCase() ) .join(" "); @@ -153,12 +177,25 @@ export const ToggleSourceFilterEffectType: EffectType = $scope.searchText = searchText; } $scope.sourceListFiltered = ($scope.sourceList as Array).filter((source: OBSSource) => { - return source.filters.some(filter => { + return source.filters.some((filter) => { return filter.name.toLowerCase().includes(searchText.toLowerCase()); }); }); }; + $scope.deleteSceneAtIndex = (index: number) => { + $scope.effect.selectedFilters = $scope.effect.selectedFilters.filter( + item => item !== $scope.orphanedSources[index] + ); + $scope.orphanedSources.splice(index, 1); + }; + + $scope.getOrphanedData = () => { + for (const filterName of $scope.effect.selectedFilters) { + $scope.orphanedSources.push(filterName); + } + }; + $scope.getSourceList = () => { $scope.isObsConfigured = backendCommunicator.fireEventSync("obs-is-configured"); @@ -171,6 +208,7 @@ export const ToggleSourceFilterEffectType: EffectType = }; $scope.getSourceList(); + $scope.getOrphanedData(); }, optionsValidator: () => { return []; diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts index 3da2998d2..1f856966f 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts @@ -25,7 +25,22 @@ export const ToggleSourceMutedEffectType: EffectType = categories: ["common"] }, optionsTemplate: ` - + +
+
+
+
+ Source: {{sourceList.sourceName}} +
+
+ +
+
+
+
+
+ +
@@ -61,20 +76,22 @@ export const ToggleSourceMutedEffectType: EffectType = $scope.sourceList = null; + $scope.orphanedSources = []; + if ($scope.effect.selectedSources == null) { $scope.effect.selectedSources = []; } $scope.sourceIsSelected = (sourceName: string) => { return $scope.effect.selectedSources.some( - (s) => s.sourceName === sourceName + s => s.sourceName === sourceName ); }; $scope.toggleSourceSelected = (sourceName: string) => { if ($scope.sourceIsSelected(sourceName)) { $scope.effect.selectedSources = $scope.effect.selectedSources.filter( - (s) => !(s.sourceName === sourceName) + s => !(s.sourceName === sourceName) ); } else { $scope.effect.selectedSources.push({ @@ -89,7 +106,7 @@ export const ToggleSourceMutedEffectType: EffectType = action: "toggle" | boolean ) => { const selectedSource = $scope.effect.selectedSources.find( - (s) => s.sourceName === sourceName + s => s.sourceName === sourceName ); if (selectedSource != null) { selectedSource.action = action; @@ -98,8 +115,11 @@ export const ToggleSourceMutedEffectType: EffectType = $scope.getSourceActionDisplay = (sourceName: string) => { const selectedSource = $scope.effect.selectedSources.find( - (s) => s.sourceName === sourceName + s => s.sourceName === sourceName ); + + $scope.orphanedSources = $scope.orphanedSources.filter(item => item !== selectedSource); + if (selectedSource == null) { return ""; } @@ -117,7 +137,7 @@ export const ToggleSourceMutedEffectType: EffectType = input .split(" ") .map( - (w) => w[0].toLocaleUpperCase() + w.substr(1).toLocaleLowerCase() + w => w[0].toLocaleUpperCase() + w.substr(1).toLocaleLowerCase() ) .join(" "); @@ -125,6 +145,19 @@ export const ToggleSourceMutedEffectType: EffectType = return capitalizeWords((type ?? "").replace(/_/, " ")); }; + $scope.deleteSceneAtIndex = (index: number) => { + $scope.effect.selectedSources = $scope.effect.selectedSources.filter( + item => item !== $scope.orphanedSources[index] + ); + $scope.orphanedSources.splice(index, 1); + }; + + $scope.getOrphanedData = () => { + for (const sceneName of $scope.effect.selectedSources) { + $scope.orphanedSources.push(sceneName); + } + }; + $scope.getSourceList = () => { $scope.isObsConfigured = backendCommunicator.fireEventSync("obs-is-configured"); @@ -136,6 +169,7 @@ export const ToggleSourceMutedEffectType: EffectType = }; $scope.getSourceList(); + $scope.getOrphanedData(); }, optionsValidator: () => { return []; diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts index a55466ac7..e2d5e58ca 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts @@ -12,6 +12,7 @@ type EffectProperties = { sceneName: string; sourceId: number; groupName?: string; + sourceName?: string; action: SourceAction; }>; }; @@ -31,7 +32,27 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType + +
+
+
+
+ Scene: {{sceneName.sceneName}} +
    +
  • Name: {{sceneName.sourceName}}
  • +
  • Id: {{sceneName.sourceId}}
  • +
  • Action: {{sceneName.action}}
  • +
+
+
+ +
+
+
+
+
+ +
Filter @@ -48,7 +69,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType{{sceneName}}
@@ -78,6 +99,8 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { return $scope.effect.selectedSources.some( - (s) => s.sceneName === sceneName && s.sourceId === sourceId + s => s.sceneName === sceneName && s.sourceId === sourceId ); }; - $scope.toggleSourceSelected = (sceneName: string, sourceId: number, groupName: string) => { + $scope.toggleSourceSelected = (sceneName: string, sourceId: number, groupName: string, sourceName: string) => { if ($scope.sourceIsSelected(sceneName, sourceId)) { $scope.effect.selectedSources = $scope.effect.selectedSources.filter( - (s) => !(s.sceneName === sceneName && s.sourceId === sourceId) + s => !(s.sceneName === sceneName && s.sourceId === sourceId) ); } else { $scope.effect.selectedSources.push({ sceneName, sourceId, groupName, + sourceName, action: true }); } @@ -130,7 +154,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { const selectedSource = $scope.effect.selectedSources.find( - (s) => s.sceneName === sceneName && s.sourceId === sourceId + s => s.sceneName === sceneName && s.sourceId === sourceId ); if (selectedSource != null) { selectedSource.action = action; @@ -139,8 +163,11 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { const selectedSource = $scope.effect.selectedSources.find( - (s) => s.sceneName === sceneName && s.sourceId === sourceId + s => s.sceneName === sceneName && s.sourceId === sourceId ); + + $scope.orphanedSources = $scope.orphanedSources.filter(item => item !== selectedSource); + if (selectedSource == null) { return ""; } @@ -154,6 +181,19 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { + $scope.effect.selectedSources = $scope.effect.selectedSources.filter( + item => item !== $scope.orphanedSources[index] + ); + $scope.orphanedSources.splice(index, 1); + }; + + $scope.getOrphanedData = () => { + for (const sceneName of $scope.effect.selectedSources) { + $scope.orphanedSources.push(sceneName); + } + }; + $scope.getSourceData = () => { $scope.isObsConfigured = backendCommunicator.fireEventSync("obs-is-configured"); @@ -165,6 +205,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { return []; From 233ff99119b4cec57504c6b707c4544f70d9a0d6 Mon Sep 17 00:00:00 2001 From: CKY- Date: Mon, 3 Feb 2025 09:13:30 -0700 Subject: [PATCH 2/6] moved to settings container --- .../obs/effects/toggle-obs-source-filter.ts | 33 ++++++++++--------- .../obs/effects/toggle-obs-source-muted.ts | 27 ++++++++------- .../effects/toggle-obs-source-visibility.ts | 29 ++++++++-------- 3 files changed, 50 insertions(+), 39 deletions(-) diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts index 3cca1a856..0a356d9bb 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts @@ -30,24 +30,27 @@ export const ToggleSourceFilterEffectType: EffectType = categories: ["common"] }, optionsTemplate: ` - -
-
-
-
- Source: {{filterName.sourceName}} -
    -
  • Name: {{filterName.filterName}}
  • -
  • Action: {{filterName.action}}
  • -
-
-
+ +
+

Warning! There are {{orphanedSources.length}} orphaned source(s) referenced by this effect. + Items in inactive OBS profiles or scene collections will inaccurately show these errors. +

+
+
+ +
+
+
+ Source: {{filterName.sourceName}}, + Name: {{filterName.filterName}}, + Action: {{filterName.action}} +
+
-
-
+
- +
diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts index 1f856966f..96b15f4c3 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts @@ -25,20 +25,25 @@ export const ToggleSourceMutedEffectType: EffectType = categories: ["common"] }, optionsTemplate: ` - -
-
-
-
+ +
+

Warning! There are {{orphanedSources.length}} orphaned source(s) referenced by this effect. + Items in inactive OBS profiles or scene collections will inaccurately show these errors. +

+
+
+ +
+
+
Source: {{sourceList.sourceName}} -
-
- -
-
+
+
+
+
- + diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts index e2d5e58ca..bfac2f018 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts @@ -32,25 +32,28 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType -
+ +
+

Warning! There are {{orphanedSources.length}} orphaned source(s) referenced by this effect. + Items in inactive OBS profiles or scene collections will inaccurately show these errors. +

+
+
+
-
-
- Scene: {{sceneName.sceneName}} -
    -
  • Name: {{sceneName.sourceName}}
  • -
  • Id: {{sceneName.sourceId}}
  • -
  • Action: {{sceneName.action}}
  • -
+
+
+ Scene: {{sceneName.sceneName}}, + Name: {{sceneName.sourceName}}, + Id: {{sceneName.sourceId}}, + Action: {{sceneName.action}}
-
+
-
- +
From 98961634f3d9f4cbda5c31aa59d63a30b2991d7a Mon Sep 17 00:00:00 2001 From: CKY- Date: Sun, 9 Feb 2025 18:47:29 -0700 Subject: [PATCH 3/6] adjust warning verbage --- .../builtin/obs/effects/toggle-obs-source-filter.ts | 4 ++-- .../builtin/obs/effects/toggle-obs-source-muted.ts | 6 +++--- .../builtin/obs/effects/toggle-obs-source-visibility.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts index 0a356d9bb..676807de0 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts @@ -32,8 +32,8 @@ export const ToggleSourceFilterEffectType: EffectType = optionsTemplate: `
-

Warning! There are {{orphanedSources.length}} orphaned source(s) referenced by this effect. - Items in inactive OBS profiles or scene collections will inaccurately show these errors. +

Warning! + Cannot find {{orphanedSources.length}} sources in this effect. Ensure the correct profile or scene collection is loaded in OBS, and OBS is running.

diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts index 96b15f4c3..eb2b5a9c3 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts @@ -27,9 +27,9 @@ export const ToggleSourceMutedEffectType: EffectType = optionsTemplate: `
-

Warning! There are {{orphanedSources.length}} orphaned source(s) referenced by this effect. - Items in inactive OBS profiles or scene collections will inaccurately show these errors. -

+

Warning! + Cannot find {{orphanedSources.length}} sources in this effect. Ensure the correct profile or scene collection is loaded in OBS, and OBS is running. +

diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts index bfac2f018..7b9411057 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts @@ -34,9 +34,9 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType
-

Warning! There are {{orphanedSources.length}} orphaned source(s) referenced by this effect. - Items in inactive OBS profiles or scene collections will inaccurately show these errors. -

+

Warning! + Cannot find {{orphanedSources.length}} sources in this effect. Ensure the correct profile or scene collection is loaded in OBS, and OBS is running. +

From 3455acc5b8420a0c5ff64cfa19f131f280b8e27c Mon Sep 17 00:00:00 2001 From: CKY- Date: Mon, 10 Feb 2025 10:34:06 -0700 Subject: [PATCH 4/6] rename OrphanedSources to MissingSources --- .../obs/effects/toggle-obs-source-filter.ts | 41 +++++++++++++------ .../obs/effects/toggle-obs-source-muted.ts | 24 +++++------ .../effects/toggle-obs-source-visibility.ts | 41 +++++++++++++------ 3 files changed, 68 insertions(+), 38 deletions(-) diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts index 676807de0..294cdc666 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts @@ -30,20 +30,20 @@ export const ToggleSourceFilterEffectType: EffectType = categories: ["common"] }, optionsTemplate: ` - +

Warning! - Cannot find {{orphanedSources.length}} sources in this effect. Ensure the correct profile or scene collection is loaded in OBS, and OBS is running. + Cannot find {{missingSources.length}} sources in this effect. Ensure the correct profile or scene collection is loaded in OBS, and OBS is running.

- -
+ +
Source: {{filterName.sourceName}}, Name: {{filterName.filterName}}, - Action: {{filterName.action}} + Action: {{getMissingActionDisplay(filterName.action)}}
@@ -52,7 +52,7 @@ export const ToggleSourceFilterEffectType: EffectType =
- +
Filter @@ -98,7 +98,7 @@ export const ToggleSourceFilterEffectType: EffectType = $scope.searchText = ""; - $scope.orphanedSources = []; + $scope.missingSources = []; if ($scope.effect.selectedFilters == null) { $scope.effect.selectedFilters = []; @@ -148,7 +148,7 @@ export const ToggleSourceFilterEffectType: EffectType = s => s.sourceName === sourceName && s.filterName === filterName ); - $scope.orphanedSources = $scope.orphanedSources.filter(item => item !== selectedFilter); + $scope.missingSources = $scope.missingSources.filter(item => item !== selectedFilter); if (selectedFilter == null) { return ""; @@ -163,6 +163,21 @@ export const ToggleSourceFilterEffectType: EffectType = return "Disable"; }; + $scope.geMissingActionDisplay = ( + selectedFilter: unknown + ) => { + if (selectedFilter == null) { + return ""; + } + if (selectedFilter === "toggle") { + return "Toggle"; + } + if (selectedFilter === true) { + return "Enable"; + } + return "Disable"; + }; + const capitalizeWords = (input: string) => input .split(" ") @@ -188,14 +203,14 @@ export const ToggleSourceFilterEffectType: EffectType = $scope.deleteSceneAtIndex = (index: number) => { $scope.effect.selectedFilters = $scope.effect.selectedFilters.filter( - item => item !== $scope.orphanedSources[index] + item => item !== $scope.missingSources [index] ); - $scope.orphanedSources.splice(index, 1); + $scope.missingSources.splice(index, 1); }; - $scope.getOrphanedData = () => { + $scope.getMissingData = () => { for (const filterName of $scope.effect.selectedFilters) { - $scope.orphanedSources.push(filterName); + $scope.missingSources.push(filterName); } }; @@ -211,7 +226,7 @@ export const ToggleSourceFilterEffectType: EffectType = }; $scope.getSourceList(); - $scope.getOrphanedData(); + $scope.getMissingData(); }, optionsValidator: () => { return []; diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts index eb2b5a9c3..238bec322 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts @@ -25,15 +25,15 @@ export const ToggleSourceMutedEffectType: EffectType = categories: ["common"] }, optionsTemplate: ` - +

Warning! - Cannot find {{orphanedSources.length}} sources in this effect. Ensure the correct profile or scene collection is loaded in OBS, and OBS is running. + Cannot find {{missingSources.length}} sources in this effect. Ensure the correct profile or scene collection is loaded in OBS, and OBS is running.

- -
+ +
Source: {{sourceList.sourceName}} @@ -45,7 +45,7 @@ export const ToggleSourceMutedEffectType: EffectType =
- +
@@ -81,7 +81,7 @@ export const ToggleSourceMutedEffectType: EffectType = $scope.sourceList = null; - $scope.orphanedSources = []; + $scope.missingSources = []; if ($scope.effect.selectedSources == null) { $scope.effect.selectedSources = []; @@ -123,7 +123,7 @@ export const ToggleSourceMutedEffectType: EffectType = s => s.sourceName === sourceName ); - $scope.orphanedSources = $scope.orphanedSources.filter(item => item !== selectedSource); + $scope.missingSources = $scope.missingSources.filter(item => item !== selectedSource); if (selectedSource == null) { return ""; @@ -152,14 +152,14 @@ export const ToggleSourceMutedEffectType: EffectType = $scope.deleteSceneAtIndex = (index: number) => { $scope.effect.selectedSources = $scope.effect.selectedSources.filter( - item => item !== $scope.orphanedSources[index] + item => item !== $scope.missingSources [index] ); - $scope.orphanedSources.splice(index, 1); + $scope.missingSources.splice(index, 1); }; - $scope.getOrphanedData = () => { + $scope.getMissingData = () => { for (const sceneName of $scope.effect.selectedSources) { - $scope.orphanedSources.push(sceneName); + $scope.missingSources.push(sceneName); } }; @@ -174,7 +174,7 @@ export const ToggleSourceMutedEffectType: EffectType = }; $scope.getSourceList(); - $scope.getOrphanedData(); + $scope.getMissingData(); }, optionsValidator: () => { return []; diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts index 7b9411057..bba900d75 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts @@ -32,21 +32,21 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType +

Warning! - Cannot find {{orphanedSources.length}} sources in this effect. Ensure the correct profile or scene collection is loaded in OBS, and OBS is running. + Cannot find {{missingSources.length}} sources in this effect. Ensure the correct profile or scene collection is loaded in OBS, and OBS is running.

- -
+ +
Scene: {{sceneName.sceneName}}, Name: {{sceneName.sourceName}}, Id: {{sceneName.sourceId}}, - Action: {{sceneName.action}} + Action: {{geMissingActionDisplay(sceneName.action)}}
@@ -55,7 +55,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType - +
Filter @@ -102,7 +102,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType s.sceneName === sceneName && s.sourceId === sourceId ); - $scope.orphanedSources = $scope.orphanedSources.filter(item => item !== selectedSource); + $scope.missingSources = $scope.missingSources.filter(item => item !== selectedSource); if (selectedSource == null) { return ""; @@ -184,16 +184,31 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { + if (selectedFilter == null) { + return ""; + } + if (selectedFilter === "toggle") { + return "Toggle"; + } + if (selectedFilter === true) { + return "Enable"; + } + return "Disable"; + }; + $scope.deleteSceneAtIndex = (index: number) => { $scope.effect.selectedSources = $scope.effect.selectedSources.filter( - item => item !== $scope.orphanedSources[index] + item => item !== $scope.missingSources [index] ); - $scope.orphanedSources.splice(index, 1); + $scope.missingSources.splice(index, 1); }; - $scope.getOrphanedData = () => { + $scope.getMissingData = () => { for (const sceneName of $scope.effect.selectedSources) { - $scope.orphanedSources.push(sceneName); + $scope.missingSources.push(sceneName); } }; @@ -208,7 +223,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { return []; From 3a24cff78b3aba3c9f903a516b8a964bc7e91f16 Mon Sep 17 00:00:00 2001 From: CKY- Date: Mon, 10 Feb 2025 12:09:28 -0700 Subject: [PATCH 5/6] fixed typeo added unknown source name --- .../builtin/obs/effects/toggle-obs-source-filter.ts | 3 ++- .../builtin/obs/effects/toggle-obs-source-visibility.ts | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts index 294cdc666..dc838da06 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts @@ -163,9 +163,10 @@ export const ToggleSourceFilterEffectType: EffectType = return "Disable"; }; - $scope.geMissingActionDisplay = ( + $scope.getMissingActionDisplay = ( selectedFilter: unknown ) => { + console.log(selectedFilter); if (selectedFilter == null) { return ""; } diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts index bba900d75..b34f3f7c8 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts @@ -44,9 +44,9 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType
Scene: {{sceneName.sceneName}}, - Name: {{sceneName.sourceName}}, + Name: {{sceneName.sourceName || 'Unknown'}}, Id: {{sceneName.sourceId}}, - Action: {{geMissingActionDisplay(sceneName.action)}} + Action: {{getMissingActionDisplay(sceneName.action)}}
@@ -184,7 +184,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { if (selectedFilter == null) { From 6d71c06e8ce9ef56a857d089bc783a2400f58a22 Mon Sep 17 00:00:00 2001 From: CKY- Date: Mon, 10 Feb 2025 12:18:05 -0700 Subject: [PATCH 6/6] remove the id if we have a name for new instaces --- .../builtin/obs/effects/toggle-obs-source-filter.ts | 4 ++-- .../builtin/obs/effects/toggle-obs-source-muted.ts | 4 ++-- .../builtin/obs/effects/toggle-obs-source-visibility.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts index dc838da06..bb5d114b4 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-filter.ts @@ -209,7 +209,7 @@ export const ToggleSourceFilterEffectType: EffectType = $scope.missingSources.splice(index, 1); }; - $scope.getMissingData = () => { + $scope.getStoredData = () => { for (const filterName of $scope.effect.selectedFilters) { $scope.missingSources.push(filterName); } @@ -227,7 +227,7 @@ export const ToggleSourceFilterEffectType: EffectType = }; $scope.getSourceList(); - $scope.getMissingData(); + $scope.getStoredData(); }, optionsValidator: () => { return []; diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts index 238bec322..7c45bb60b 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-muted.ts @@ -157,7 +157,7 @@ export const ToggleSourceMutedEffectType: EffectType = $scope.missingSources.splice(index, 1); }; - $scope.getMissingData = () => { + $scope.getStoredData = () => { for (const sceneName of $scope.effect.selectedSources) { $scope.missingSources.push(sceneName); } @@ -174,7 +174,7 @@ export const ToggleSourceMutedEffectType: EffectType = }; $scope.getSourceList(); - $scope.getMissingData(); + $scope.getStoredData(); }, optionsValidator: () => { return []; diff --git a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts index b34f3f7c8..36dcec9c8 100644 --- a/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts +++ b/src/backend/integrations/builtin/obs/effects/toggle-obs-source-visibility.ts @@ -45,7 +45,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType Scene: {{sceneName.sceneName}}, Name: {{sceneName.sourceName || 'Unknown'}}, - Id: {{sceneName.sourceId}}, + Id: {{sceneName.sourceId}}, Action: {{getMissingActionDisplay(sceneName.action)}}
@@ -206,7 +206,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { + $scope.getStoredData = () => { for (const sceneName of $scope.effect.selectedSources) { $scope.missingSources.push(sceneName); } @@ -223,7 +223,7 @@ export const ToggleSourceVisibilityEffectType: Firebot.EffectType { return [];