/// <summary> /// Presses the button in the radio list with the given id /// </summary> /// <param name="radioId">id of the radio list that the button is in</param> /// <param name="id">id of the button to press</param> public void PressRadioButton(string radioId, string id) { RadioListElement list = CurrentView.GetScreenElement <RadioListElement> (radioId); try { list.Elements[id].TestPress(); list.Elements["confirm"].TestPress(); } catch (System.Exception ex) { throw new System.Exception("No element found with id '" + id + "'."); } }
protected override void OnShow() { RadioListElement list = GetScreenElement <RadioListElement> ("game_list"); Game.Multiplayer.RequestHostList((List <string> hosts) => { if (hosts.Contains("__error")) { GetScreenElement <TextElement> ("searching").Text = GetText("error"); } else { GetScreenElement <TextElement> ("searching").Text = GetText("searching"); list.Set(hosts); Elements["searching"].Active = hosts.Count == 0; } }); }