Commit bb48d3ba authored by 16서원빈's avatar 16서원빈

Fixed panel width issue importing without BPM

parent d76fc6c8
No preview for this file type
......@@ -492,7 +492,10 @@ namespace ButtonPusherEditor
|| nt == Note.LMOReset || nt==Note.SMOReset)
continue;
if ((key & nt & ~(Note)0b1111) != 0)
{
body += nt.ToString();
break;
}
}
}
}
......@@ -536,9 +539,9 @@ namespace ButtonPusherEditor
float outBPM;
if (float.TryParse(value, out outBPM))
bpm = outBPM;
else
if (bpm == 0)
bpm = 120;
BPM.Text = outBPM.ToString();
BPM.Text = bpm.ToString();
break;
case "#PLAYLEVEL":
int outLevel;
......@@ -556,7 +559,8 @@ namespace ButtonPusherEditor
{
ResetMeasures();
Tuple<int, int> tempLongStart = null;
Tuple<int, int> tempLongBtnStart = null;
Tuple<int, int> tempLongMtnStart = null;
using (StreamReader reader
= new StreamReader(new BufferedStream(file.OpenRead())))
......@@ -591,46 +595,89 @@ namespace ButtonPusherEditor
for (int i = 0; i < seq; i++)
{
string key = value.Substring(i * 2, 2);
Note type = Note.SBT;
bool isMotion = false;
if (key == "00")
continue;
else if(channel == "SMO" || channel == "LMO")
{
isMotion = true;
foreach (Note nt in Enum.GetValues(typeof(Note)))
{
if (nt < (Note)0b1111
|| nt == Note.LMOReset || nt == Note.SMOReset)
continue;
if(nt.ToString() == key)
{
type = nt;
break;
}
}
}
int beat = i * npm / seq;
if (channel == "SMO")
{
measures[measure][beat] |= Note.SMO;
}
else if (channel[0] == 'S')
if (channel[0] == 'S')
{
measures[measure][beat] |= Note.SBT;
measures[measure][beat] |= type;
}
else if (channel[0] == 'L')
{
if (tempLongStart == null)
if (isMotion && tempLongBtnStart == null)
{
tempLongStart = new Tuple<int, int>(measure, beat);
tempLongBtnStart = new Tuple<int, int>(measure, beat);
continue;
}
else if (!isMotion && tempLongMtnStart == null)
{
tempLongMtnStart = new Tuple<int, int>(measure, beat);
continue;
}
else if (isMotion && tempLongBtnStart != null)
{
if (measure == tempLongBtnStart.Item1)
{
for (int b = tempLongBtnStart.Item2; b < beat; b++)
measures[measure][b] |= type;
}
else
{
for (int b = tempLongBtnStart.Item2; b < npm; b++)
measures[tempLongBtnStart.Item1][b] |= type;
for (int m = tempLongBtnStart.Item1 + 1; m < measure; m++)
{
for (int b = 0; b < npm; b++)
measures[m][b] |= type;
}
for (int b = 0; b < beat; b++)
measures[measure][b] |= type;
}
if (measure == tempLongStart.Item1)
tempLongBtnStart = null;
}
else if (!isMotion && tempLongMtnStart != null)
{
for (int b = tempLongStart.Item2; b < beat; b++)
measures[measure][b] |= Note.SBT;
if (measure == tempLongMtnStart.Item1)
{
for (int b = tempLongMtnStart.Item2; b < beat; b++)
measures[measure][b] |= type;
}
else
{
for (int b = tempLongStart.Item2; b < npm; b++)
measures[tempLongStart.Item1][b] |= Note.SBT;
for (int m = tempLongStart.Item1 + 1; m < measure; m++)
for (int b = tempLongMtnStart.Item2; b < npm; b++)
measures[tempLongMtnStart.Item1][b] |= type;
for (int m = tempLongMtnStart.Item1 + 1; m < measure; m++)
{
for (int b = 0; b < npm; b++)
measures[m][b] |= Note.SBT;
measures[m][b] |= type;
}
for (int b = 0; b < beat; b++)
measures[measure][b] |= Note.SBT;
measures[measure][b] |= type;
}
tempLongStart = null;
tempLongMtnStart = null;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment