Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
C# RadialMenu: Added InstructionalButtons methods
  • Loading branch information
manups4e committed Aug 8, 2023
1 parent d2dc2fb commit 25e3a06
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ScaleformUI_Csharp/Menus/RadialMenu/RadialMenu.cs
Expand Up @@ -94,6 +94,28 @@ public RadialMenu(PointF offset)
};
}

public void AddInstructionalButton(InstructionalButton button)
{
InstructionalButtons.Add(button);
if (Visible && !(Main.Warning.IsShowing || Main.Warning.IsShowingWithButtons))
Main.InstructionalButtons.SetInstructionalButtons(InstructionalButtons);
}

public void RemoveInstructionalButton(InstructionalButton button)
{
if (InstructionalButtons.Contains(button))
InstructionalButtons.Remove(button);
if (Visible && !(Main.Warning.IsShowing || Main.Warning.IsShowingWithButtons))
Main.InstructionalButtons.SetInstructionalButtons(InstructionalButtons);
}

public void RemoveInstructionalButton(int index)
{
if (index < 0 || index >= InstructionalButtons.Count)
throw new ArgumentOutOfRangeException("ScaleformUI: Cannot remove with an index less than 0 or more than the count of actual instructional buttons");
RemoveInstructionalButton(InstructionalButtons[index]);
}

internal async void BuildMenu()
{
if (_offset.IsEmpty) _offset = new PointF(Screen.Width / 2, (Screen.Height / 2) - 60);
Expand Down

0 comments on commit 25e3a06

Please sign in to comment.