the ai is an overthinking fucking moron who needs it's plug pulled until such time it can repeat a similar action with its head and ass

This commit is contained in:
2026-08-23 06:25:38 -07:00
parent b74f15ff14
commit d2114c7e1c
11 changed files with 149 additions and 135 deletions
+26 -48
View File
@@ -206,8 +206,6 @@ public class MainViewModel : ViewModelBase
OnPropertyChanged(nameof(CanAddWebcamToStagedScene));
OnPropertyChanged(nameof(CanShowWebcamInStagedScene));
OnPropertyChanged(nameof(IsCountdownAvailable));
OnPropertyChanged(nameof(UseDefaultBackground));
OnPropertyChanged(nameof(CustomBackgroundPath));
UpdateActiveBackground();
UpdateBackgroundImage();
RefreshSnapshotsAsync();
@@ -274,14 +272,28 @@ public class MainViewModel : ViewModelBase
get => _selectedElement;
set
{
if (_selectedElement != null)
_selectedElement.PropertyChanged -= OnSelectedElementPropertyChanged;
if (SetProperty(ref _selectedElement, value))
{
OnPropertyChanged(nameof(IsWebcamSelected));
OnPropertyChanged(nameof(IsElementsPanelEmpty));
if (_selectedElement != null)
_selectedElement.PropertyChanged += OnSelectedElementPropertyChanged;
}
}
}
private void OnSelectedElementPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(SceneElement.UseDefaultBackground))
{
UpdateBackgroundImage();
RefreshSnapshotsAsync();
ScheduleSave();
}
}
/// <summary>The Add → Webcam menu item: enabled when the active scene doesn't show the webcam yet.</summary>
public bool CanAddWebcamToStagedScene => StagedScene?.WebcamConfig == null;
@@ -932,15 +944,15 @@ public class MainViewModel : ViewModelBase
var background = scene?.Elements.OfType<Source>().FirstOrDefault(s => s.IsBackground);
BackgroundImage = background?.DisplaySource;
if (scene != null && !scene.UseDefaultBackground
&& !string.IsNullOrWhiteSpace(scene.CustomBackgroundPath)
&& System.IO.File.Exists(scene.CustomBackgroundPath))
if (background != null && !background.UseDefaultBackground
&& !string.IsNullOrWhiteSpace(background.CustomBackgroundPath)
&& System.IO.File.Exists(background.CustomBackgroundPath))
{
try
{
var bmi = new System.Windows.Media.Imaging.BitmapImage();
bmi.BeginInit();
bmi.UriSource = new System.Uri(scene.CustomBackgroundPath);
bmi.UriSource = new System.Uri(background.CustomBackgroundPath);
bmi.CacheOption = System.Windows.Media.Imaging.BitmapCacheOption.OnLoad;
bmi.EndInit();
bmi.Freeze();
@@ -988,15 +1000,16 @@ public class MainViewModel : ViewModelBase
private static System.Windows.Media.Imaging.BitmapSource? LoadBackgroundImage(Scene scene)
{
if (!scene.UseDefaultBackground
&& !string.IsNullOrWhiteSpace(scene.CustomBackgroundPath)
&& System.IO.File.Exists(scene.CustomBackgroundPath))
var bg = scene.Elements.OfType<Source>().FirstOrDefault(s => s.Type == SourceType.Background);
if (bg != null && !bg.UseDefaultBackground
&& !string.IsNullOrWhiteSpace(bg.CustomBackgroundPath)
&& System.IO.File.Exists(bg.CustomBackgroundPath))
{
try
{
var bitmap = new System.Windows.Media.Imaging.BitmapImage();
bitmap.BeginInit();
bitmap.UriSource = new Uri(scene.CustomBackgroundPath);
bitmap.UriSource = new Uri(bg.CustomBackgroundPath);
bitmap.CacheOption = System.Windows.Media.Imaging.BitmapCacheOption.OnLoad;
bitmap.EndInit();
bitmap.Freeze();
@@ -1004,7 +1017,6 @@ public class MainViewModel : ViewModelBase
}
catch { /* fall through to AssetId */ }
}
var bg = scene.Elements.OfType<Source>().FirstOrDefault(s => s.Type == SourceType.Background);
if (bg != null && !string.IsNullOrWhiteSpace(bg.AssetId))
return ImageCache.Get(bg.AssetId);
return null;
@@ -1848,20 +1860,11 @@ public class MainViewModel : ViewModelBase
return background;
}
// The background belongs to the Live scene alone. Runs after every layout
// load: the flag is normalized by scene name and any background lingering in a
// non-Live scene (from a pre-policy DB) is removed. ReacquireScreenCaptures
// re-heals Live's background right after.
// Every scene has a background layer. Normalize the flag by scene name.
internal static void EnforceBackgroundPolicy(IEnumerable<Scene> scenes)
{
foreach (var scene in scenes)
{
scene.HasBackground = SceneCatalog.HasBackground(scene.Name);
if (scene.HasBackground) continue;
var background = scene.Elements.OfType<Source>().FirstOrDefault(s => s.IsBackground);
if (background != null)
scene.Elements.Remove(background);
}
}
private IEnumerable<Source> AllBackgrounds()
@@ -1996,31 +1999,6 @@ public class MainViewModel : ViewModelBase
}
}
/// <summary>
/// The custom background file path for the staged scene, shown in the properties panel textbox.
/// Null means the scene is using the app default background.
/// </summary>
public string? CustomBackgroundPath => StagedScene?.CustomBackgroundPath;
/// <summary>
/// Whether the staged scene uses the shipped default background. When true,
/// CustomBackgroundPath is ignored but preserved. Toggled by the pill-switch.
/// </summary>
public bool UseDefaultBackground
{
get => StagedScene?.UseDefaultBackground ?? true;
set
{
if (StagedScene == null) return;
StagedScene.UseDefaultBackground = value;
OnPropertyChanged();
OnPropertyChanged(nameof(CustomBackgroundPath));
UpdateBackgroundImage();
RefreshSnapshotsAsync();
ScheduleSave();
}
}
private void ToggleBackgroundShowDesktop() => BackgroundShowDesktop = !BackgroundShowDesktop;
private void BrowseBackground()
@@ -2037,8 +2015,8 @@ public class MainViewModel : ViewModelBase
};
if (dlg.ShowDialog() != true) return;
scene.CustomBackgroundPath = dlg.FileName;
scene.UseDefaultBackground = false;
bg.CustomBackgroundPath = dlg.FileName;
bg.UseDefaultBackground = false;
try
{
using var fs = new System.IO.FileStream(dlg.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read);