Refactor PartyModes in preparation for a more unified name selection and maybe config

This commit is contained in:
Flamefire committed 2014-12-14 20:40:08 +01:00
1 parent 29dccbd8ae
commit 84e9163b96
22 files changed
+386 -426

No files matched your search

+20
View File
@@ -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)));