Added check for no more offsets in CustomSkinEditor

This commit is contained in:
MayNL
2026-05-06 00:18:50 -04:00
parent adb4f928d2
commit 091b91ebe3

View File

@@ -362,10 +362,18 @@ namespace PckStudio.Forms.Editor
{
var offsets = renderer3D1.GetOffsets().Select(offset => offset.Type).ToList();
string[] available = SkinPartOffset.ValidModelOffsetTypes.Where(s => !offsets.Contains(s)).ToArray();
if (available.Length == 0)
{
MessageBox.Show(this, "All possible offset types are already present on this skin.", "Parameter not added");
return;
}
using ItemSelectionPopUp typeSelection = new ItemSelectionPopUp(available);
using NumericPrompt valuePrompt = new NumericPrompt(0f, -cOffsetMaximum, cOffsetMaximum);
valuePrompt.DecimalPlaces = 1;
valuePrompt.ValueStep = (decimal)0.1f;
valuePrompt.OKButton.Text = "Add";
if (typeSelection.ShowDialog() == DialogResult.OK && valuePrompt.ShowDialog() == DialogResult.OK)
{
renderer3D1.SetPartOffset(typeSelection.SelectedItem, (float)valuePrompt.SelectedValue);