Added a feature for give all characters

In fact, it is to fix the constellation function error...
This commit is contained in:
Asayu233 2022-07-05 14:51:21 +08:00 committed by GitHub
parent daa883a96c
commit 608cd86981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -723,25 +723,27 @@ namespace GrasscutterTools.Forms
AvatarInputChanged();
}
private void NUDAvatarConstellation_ValueChanged(object sender, EventArgs e)
{
AvatarInputChanged();
}
private void AvatarInputChanged()
{
if (CmbAvatar.SelectedIndex >= 0)
GenAvatar(GameData.Avatars.Ids[CmbAvatar.SelectedIndex], (int)NUDAvatarLevel.Value, (int)NUDAvatarConstellation.Value);
GenAvatar(GameData.Avatars.Ids[CmbAvatar.SelectedIndex], (int)NUDAvatarLevel.Value);
}
private void GenAvatar(int avatarId, int level, int constellation)
private void GenAvatar(int avatarId, int level)
{
if (ChkNewCommand.Checked)
SetCommand("/give", $"{avatarId} lv{level} c{constellation}");
SetCommand("/give", $"{avatarId} lv{level}");
else
SetCommand("/givechar", $"{avatarId} {level}");
}
private void BtnGiveAllChar_Click(object sender, EventArgs e)
{
var level = NUDAvatarLevel.Value;
var constellation = NUDAvatarConstellation.Value;
SetCommand("/give avatars", $"lv{level} c{constellation}");
}
#endregion - -
#region - -