Skip to content

Commit

Permalink
save 20 amiibos and fix a bug that cant write amiibo nick with space
Browse files Browse the repository at this point in the history
  • Loading branch information
elmagnificogi committed Oct 3, 2022
1 parent dbfefc2 commit a95f43e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
34 changes: 22 additions & 12 deletions EasyCon2/Forms/ControllerConfig.Designer.cs

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

12 changes: 9 additions & 3 deletions EasyCon2/Forms/ControllerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private void saveAmiibo_Click(object sender, EventArgs e)

//Debug.WriteLine(AmiiboDir + selectAmiiboBox.SelectedItem);

if(saveIndexBox.SelectedIndex >=10)
if(saveIndexBox.SelectedIndex >=20)
{
MessageBox.Show("请选择存储位置");
return;
Expand Down Expand Up @@ -135,7 +135,7 @@ private void saveAmiibo_Click(object sender, EventArgs e)
//bw.Close();
//fs.Close();

if (saveIndexBox.SelectedIndex >= 10)
if (saveIndexBox.SelectedIndex >= 20)
return;

if (NS.SaveAmiibo((byte)saveIndexBox.SelectedIndex, data))
Expand Down Expand Up @@ -299,6 +299,12 @@ private void gripr_Click(object sender, EventArgs e)
private void changeAmiibo_Click(object sender, EventArgs e)
{
byte index = (byte)amiiboIndexNum.Value;
if(index >= 20)
{
MessageBox.Show("当前序号不存在");
return;
}

if (!NS.IsConnected())
{
MessageBox.Show("串口未连接");
Expand Down Expand Up @@ -371,7 +377,7 @@ private void amiibo_SelectionChangeCommitted(object sender, EventArgs e)
imageName = imageName.Replace("png", "jpg");
Debug.WriteLine(imageName);
amiiboView.Image = Image.FromFile(AmiiboDir + "AmiiboImages\\" + imageName);
nickBox.Text = amiibo.name;
nickBox.Text = amiibo.name.Replace(" ","");
}
}
private static byte[] CreateAmiibo(string id, string nick = "cale", string owner = "EasyCon")
Expand Down

0 comments on commit a95f43e

Please sign in to comment.