public static void Insert(ModButton button, int to) { AvailableButtons.TryRemove(button); if (ActiveButtons.Contains(button)) { if (ActiveButtons.IndexOf(button) < to) { to--; } ActiveButtons.Remove(button); } ActiveButtons.Insert(Mathf.Clamp(to, 0, ActiveButtons.Count), button); Notify_ModOrderChanged(); }
public static void Insert(ModButton button, int to) { AllButtons.TryAdd(button); AvailableButtons.TryRemove(button); if (ActiveButtons.Contains(button)) { if (ActiveButtons.IndexOf(button) < to) { to--; } ActiveButtons.Remove(button); } ActiveButtons.Insert(Mathf.Clamp(to, 0, ActiveButtons.Count), button); if (button is ModButton_Installed installed) { Notify_ModListChanged(); } }