Refactor PartyModes in preparation for a more unified name selection and maybe config
This commit is contained in:
1 parent
29dccbd8ae
commit
84e9163b96
22 files changed
+386
-426
No files matched your search
@@ -390,6 +390,15 @@ namespace VocaluxeLib.Menu
|
||||
_NeedsRevalidate = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds an integer to the slide setting its tag to the value and its text to the text representation of the tag
|
||||
/// </summary>
|
||||
/// <param name="tag">Value to add</param>
|
||||
public void AddValue(int tag)
|
||||
{
|
||||
AddValue(tag.ToString(), null, tag);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds an entry to the slide.
|
||||
/// </summary>
|
||||
@@ -434,6 +443,17 @@ namespace VocaluxeLib.Menu
|
||||
AddValue(values[i], textures[i]);
|
||||
}
|
||||
|
||||
public void RemoveValue(string text)
|
||||
{
|
||||
int idx = _Values.FindIndex(val => val.Text == text);
|
||||
if (idx < 0)
|
||||
return;
|
||||
_Values.RemoveAt(idx);
|
||||
if (Selection >= idx)
|
||||
Selection--;
|
||||
_Invalidate();
|
||||
}
|
||||
|
||||
public void SetValues<T>(int selection)
|
||||
{
|
||||
AddValues(Enum.GetNames(typeof(T)));
|
||||
|
||||
Reference in new issue
Block a user