feat(chat-overlay): selection highlight + default size + starting backdrop
- Source.IsDraggable now includes ChatBox and WebSource (was Image-only) - ChatBox default: 400×1080, top-right corner (1520, 0) on first add - SeedStartingBackdrop: embeds starting-backdrop.jpg as Background source in the Starting scene on first launch (pack:// resource)
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 2.8 MiB |
+1
-1
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Assets\llamacasty-icon.png"/>
|
||||
<Resource Include="Assets\llamacasty-logo.jpg"/>
|
||||
<Resource Include="Assets\starting-backdrop.jpg"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user