Skip to content

Commit

Permalink
デバッグ時に強制終了できるように、ウィンドウサイズの調整
Browse files Browse the repository at this point in the history
  • Loading branch information
Misaki0331 committed Nov 13, 2023
1 parent 7ab2296 commit a92bb14
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion WindowManiaPlayer2/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ private void playerplay_Click(object sender, EventArgs e)
bool isdebug = IsDebugMode.Checked;
if (isdebug)
{
dw.WantClose = false;
dw.Show();
dw.Location = new Point(10, 10);
}
Expand All @@ -270,7 +271,6 @@ private void playerplay_Click(object sender, EventArgs e)
double bpm = 0;
while (timer.ElapsedMilliseconds - 3000 < endtime || notewindow.Find(a => a.NoteNumber != -1) != null)
{

if(isdebug)tmplp[timer.ElapsedMilliseconds / 20 % 50]++;
int now = (int)timer.ElapsedMilliseconds - 3000;
if (!started && now > numericUpDown1.Value)
Expand Down Expand Up @@ -313,6 +313,7 @@ private void playerplay_Click(object sender, EventArgs e)
empty.Opacity = 1;
if (notesObjects[notecount].LongScrollTime != 0)
empty.ClientSize = new(150, (int)((double)notesObjects[notecount].LongScrollTime * 2 + shortsize));
else empty.ClientSize = new(150, shortsize);
if (isEmpty) notewindow.Add(empty);
}

Expand Down Expand Up @@ -425,6 +426,11 @@ private void playerplay_Click(object sender, EventArgs e)
notewindow.Remove(empty);
cnt++;
if (cnt >= 3) break;
}
if (dw.WantClose)
{
StopSound();
break;
}
}
foreach(var win in notewindow)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-11-12T21:48:16.8898891Z;</History>
<History>True|2023-11-13T10:47:47.7441761Z;True|2023-11-13T06:48:16.8898891+09:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion WindowManiaPlayer2/debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ public DebugWindow()
{
InitializeComponent();
}

public bool WantClose = false;
private void debug_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
WantClose = true;
}
}
}
2 changes: 1 addition & 1 deletion WindowManiaPlayer2/notes.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions WindowManiaPlayer2/notes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public partial class Notes : Form
public Notes()
{
InitializeComponent();

// ClientSize = new(150, 1);
Hide();
}
public int NoteNumber=-1;
Expand Down

0 comments on commit a92bb14

Please sign in to comment.