Ejemplo n.º 1
0
        public BotSelector()
        {
            LoadControllers();

            redList = new VerticalLayout(VerticalLayout.VerticalAlign.Left);
            redList.SetDisplayLine(5);
            redGroup = new RadioButtonControlGroup(redList);
            foreach (var ctrl in selectableBots)
            {
                redGroup.AddRadioButton(ctrl.GetAttribute <NameAttribute>().Name);
            }

            blueList = new VerticalLayout(VerticalLayout.VerticalAlign.Right);
            blueList.SetDisplayLine(5);
            blueGroup = new RadioButtonControlGroup(blueList);
            foreach (var ctrl in selectableBots)
            {
                blueGroup.AddRadioButton(ctrl.GetAttribute <NameAttribute>().Name);
            }

            buttonConfirmLayout = new VerticalLayout(VerticalLayout.VerticalAlign.Center);
            buttonConfirmLayout.SetDisplayLine(6 + selectableBots.Count);
            buttonConfirmLayout.Add(new ButtonControl("Confirm", SelectionConfirm));

            AddControlLayout(redList);
            AddControlLayout(blueList);
            AddControlLayout(buttonConfirmLayout);
        }