Example #1
0
 public StringElement(string text, Color color, List <string> options, string startValue, Action <string> onValueChanged, string subtitleText = "") : base(text, color, subtitleText)
 {
     this.options = options;
     if (options.Contains(startValue))
     {
         this.value = startValue;
     }
     else
     {
         this.value = options[0];
     }
     this.onValueChanged = new StringElement.OnValueChanged(onValueChanged.Invoke);
 }
Example #2
0
 public override void OnRight()
 {
     this.currentOption++;
     if (this.currentOption == this.options.Count)
     {
         this.currentOption = 0;
     }
     this.value = this.options[this.currentOption];
     StringElement.OnValueChanged onValueChanged = this.onValueChanged;
     if (onValueChanged != null)
     {
         onValueChanged(this.value);
     }
     this.Render(base.GetTextObject());
 }