diff --git a/Assets/starting-backdrop.jpg b/Assets/starting-backdrop.jpg new file mode 100644 index 0000000..4a5feb0 Binary files /dev/null and b/Assets/starting-backdrop.jpg differ diff --git a/Models/Source.cs b/Models/Source.cs index 743b994..8df332d 100644 --- a/Models/Source.cs +++ b/Models/Source.cs @@ -44,7 +44,7 @@ public class Source : SceneElement } } - public override bool IsDraggable => Type == SourceType.Image; + public override bool IsDraggable => Type is SourceType.Image or SourceType.WebSource or SourceType.ChatBox; public override bool IsWebSource => Type == SourceType.WebSource; diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index d9a38f9..cff7d76 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -1351,8 +1351,11 @@ public class MainViewModel : ViewModelBase Scenes.Add(scene); if (Scenes.Count == 0) + { foreach (var name in SceneCatalog.All) AddScene(name); + SeedStartingBackdrop(); + } // The live backdrop belongs to Live only; a pre-policy DB may have // backdrops lingering in other scenes — drop them, then @@ -1733,6 +1736,32 @@ public class MainViewModel : ViewModelBase ActiveScene = scene; } + private void SeedStartingBackdrop() + { + try + { + var uri = new Uri("pack://application:,,,/Assets/starting-backdrop.jpg", UriKind.Absolute); + using var stream = Application.GetResourceStream(uri)?.Stream; + if (stream == null) return; + using var ms = new MemoryStream(); + stream.CopyTo(ms); + var bytes = ms.ToArray(); + var assetId = AddAsset(bytes); + if (assetId == null) return; + var starting = Scenes.FirstOrDefault(s => SceneCatalog.Is(s.Name, "Starting")); + if (starting == null) return; + starting.Elements.Add(new Source + { + Name = "Background", + Type = SourceType.Background, + AssetId = assetId, + Width = 1920, + Height = 1080, + }); + } + catch { /* non-critical — stream works fine without a default bg */ } + } + private void BeginEditElement(SceneElement? element) { if (element == null) return; @@ -1790,7 +1819,15 @@ public class MainViewModel : ViewModelBase return; } - scene.Elements.Add(new Source { Name = NextSourceName(scene, baseName), Type = sourceType }); + scene.Elements.Add(new Source + { + Name = NextSourceName(scene, baseName), + Type = sourceType, + X = sourceType == SourceType.ChatBox ? 1520 : 0, + Y = 0, + Width = sourceType == SourceType.ChatBox ? 400 : 0, + Height = sourceType == SourceType.ChatBox ? 1080 : 0, + }); OnPropertyChanged(nameof(ShowEmptySceneHint)); OnPropertyChanged(nameof(ShowSourcesEmptyHint)); UpdateActiveBackground(); diff --git a/ytLive.csproj b/ytLive.csproj index 9c296f1..5d10a34 100644 --- a/ytLive.csproj +++ b/ytLive.csproj @@ -22,6 +22,7 @@ +