Add option to give all variant bodies/item remakes (#601)

This commit is contained in:
hp3721
2022-04-24 18:32:00 -05:00
committed by GitHub
parent 1849f15334
commit 994349eeaf
3 changed files with 51 additions and 34 deletions

View File

@@ -75,7 +75,7 @@ private void FillRemake(IReadOnlyList<string> items)
public void GiveAll(IReadOnlyList<ushort> indexes, bool value = true)
{
foreach (var item in indexes)
GiveItem(item, value);
GiveItem(item, value, CB_VariantBodiesOnly.Checked);
System.Media.SystemSounds.Asterisk.Play();
}
@@ -84,7 +84,7 @@ private void GiveEverything(IReadOnlyList<string> items, bool value = true)
if (!value)
{
for (ushort i = 0; i < CLB_Items.Items.Count; i++)
GiveItem(i, false);
GiveItem(i, false, CB_VariantBodiesOnly.Checked);
return;
}
@@ -95,7 +95,7 @@ private void GiveEverything(IReadOnlyList<string> items, bool value = true)
continue;
if (skip.Contains(i))
continue;
GiveItem(i);
GiveItem(i, remakeOnly: CB_VariantBodiesOnly.Checked);
}
System.Media.SystemSounds.Asterisk.Play();
}
@@ -114,13 +114,14 @@ private void GiveAllFurniture(IReadOnlyList<string> items, bool value = true)
continue;
if (skip.Contains(i))
continue;
GiveItem(i, value);
GiveItem(i, value, CB_VariantBodiesOnly.Checked);
}
System.Media.SystemSounds.Asterisk.Play();
}
private void GiveItem(ushort item, bool value = true)
private void GiveItem(ushort item, bool value = true, bool remakeOnly = false)
{
CLB_Items.SetItemChecked(item, value);
if (!remakeOnly)
CLB_Items.SetItemChecked(item, value);
var remakeIndex = ItemRemakeUtil.GetRemakeIndex(item);
if (!ItemRemakeInfoData.List.TryGetValue(remakeIndex, out var info))