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

Fixup chibi placement and BG crop/resize on dual screen #260

Merged
merged 2 commits into from
Jun 22, 2023
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
4 changes: 2 additions & 2 deletions src/SerialLoops/Dialogs/BackgroundCropResizeDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ImageCropResizeDialog(SKBitmap startImage, int width, int height, ILogger
{
_log = log;
Title = "Crop & Scale";
MinimumSize = new(900, 650);
MinimumSize = new(900, 750);
Padding = 10;
StartImage = startImage;
FinalImage = new(width, height);
Expand All @@ -55,7 +55,7 @@ private void InitializeComponent()
};

// Preview
_preview = new SKBitmap(650, 500);
_preview = new SKBitmap(650, 600);
_previewLayout = new() { Padding = 10 };
_previewLayout.Invalidate();

Expand Down
25 changes: 21 additions & 4 deletions src/SerialLoops/Editors/ScriptEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1581,6 +1581,15 @@ private void UpdatePreview()
}
for (int i = 0; i < commands.Count; i++)
{
if (commands[i].Verb == CommandVerb.OP_MODE)
{
// Kyon auto-added by OP_MODE command
ChibiItem chibi = ((ChibiItem)_project.Items.First(i => i.Type == ItemDescription.ItemType.Chibi && ((ChibiItem)i).ChibiIndex == 1));
if (!chibis.Contains(chibi))
{
chibis.Add(chibi);
}
}
if (commands[i].Verb == CommandVerb.CHIBI_ENTEREXIT)
{
if (((ChibiEnterExitScriptParameter)commands[i].Parameters[1]).Mode == ChibiEnterExitScriptParameter.ChibiEnterExitType.ENTER)
Expand Down Expand Up @@ -1630,14 +1639,14 @@ private void UpdatePreview()
}

int chibiStartX, chibiY;
if (commands.Any(c => c.Verb == EventFile.CommandVerb.OP_MODE))
if (commands.Any(c => c.Verb == CommandVerb.OP_MODE))
{
chibiStartX = 100;
chibiY = 50;
}
else
{
chibiStartX = 44;
chibiStartX = 80;
chibiY = 100;
}
int chibiCurrentX = chibiStartX;
Expand All @@ -1646,8 +1655,16 @@ private void UpdatePreview()
{
SKBitmap chibiFrame = chibi.ChibiAnimations.First().Value.ElementAt(0).Frame;
canvas.DrawBitmap(chibiFrame, new SKPoint(chibiCurrentX, chibiY));
chibiWidth = chibiFrame.Width - 10;
chibiCurrentX += chibiWidth;
chibiWidth = chibiFrame.Width - 16;
if (chibiY == 50)
{
chibiY = 100;
chibiCurrentX = 80;
}
else
{
chibiCurrentX += chibiWidth;
}
}

// Draw top screen chibi emotes
Expand Down