Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust SFX references, add nameplate export #350

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/SerialLoops/Dialogs/ItemReferenceDialogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ private void InitializeComponent()
MinimumSize = new Size(400, 275);
Padding = 10;

List<ItemDescription> results = Project.Items.FindAll(i => !IGNORED_ORPHAN_TYPES.Contains(i.Type) && i.GetReferencesTo(Project).Count == 0);
List<ItemDescription> results = Project.Items.FindAll(i => !IGNORED_ORPHAN_TYPES.Contains(i.Type) && i.GetReferencesTo(Project).Count == 0
&& !(i.Type == ItemDescription.ItemType.SFX && ((SfxItem)i).Name.Contains("SSE") && ((SfxItem)i).AssociatedGroups.Count > 0)); // assume SFX that are in groups are referenced in code
Content = new StackLayout
{
Orientation = Orientation.Vertical,
Expand Down
15 changes: 15 additions & 0 deletions src/SerialLoops/Editors/CharacterEditor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Eto.Forms;
using HaruhiChokuretsuLib.Archive.Graphics;
using HaruhiChokuretsuLib.Util;
using SerialLoops.Controls;
using SerialLoops.Lib;
Expand Down Expand Up @@ -35,11 +36,25 @@ public override Container GetEditorPanel()
using SKCanvas baseCanvas = new(nameplatePreview);
baseCanvas.DrawBitmap(_project.NameplateBitmap, new SKRect(0, 16 * ((int)_character.MessageInfo.Character - 1), 64, 16 * ((int)_character.MessageInfo.Character)), new SKRect(0, 0, 64, 16));
baseCanvas.Flush();
Button exportNameplatePreviewButton = new() { Text = "Export" };
exportNameplatePreviewButton.Click += (sender, args) =>
{
SaveFileDialog saveFileDialog = new();
saveFileDialog.Filters.Add(new() { Name = Application.Instance.Localize(this, "PNG image"), Extensions = [".png"] });
if (saveFileDialog.ShowAndReportIfFileSelected(this))
{
using FileStream fs = new(saveFileDialog.FileName, FileMode.Create);
nameplatePreview.Encode(fs, SKEncodedImageFormat.Png, GraphicsFile.PNG_QUALITY);
}
};
StackLayout nameplatePreviewLayout = new()
{
Orientation = Orientation.Horizontal,
Spacing = 5,
Items =
{
new SKGuiImage(nameplatePreview),
exportNameplatePreviewButton,
},
};

Expand Down