Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 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();
     }
 }