public void SetPosition(int position, bool isCallBack)
 {
     if (listButton == null)
     {
         return;
     }
     if (position > listButton.Count)
     {
         return;
     }
     for (int i = 0; i < listButton.Count; i++)
     {
         RadioButtonView itemRB = listButton[i];
         if (i == position)
         {
             itemRB.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
             if (isCallBack)
             {
                 if (mRGCallBack != null)
                 {
                     mRGCallBack.RadioButtonSelected(this, i, itemRB);
                 }
             }
         }
         else
         {
             itemRB.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
         }
     }
 }
Beispiel #2
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
        StoreForBankTypeEnum type = EnumUtil.GetEnum <StoreForBankTypeEnum>(rbview.name);

        InitDataByType(type);
    }
Beispiel #3
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
        switch (rbview.name)
        {
        case "Hair":
            this.bodyType  = BodyTypeEnum.Hair;
            listSelectData = CharacterBodyHandler.Instance.manager.GetAllHair();
            break;

        case "Eye":
            this.bodyType  = BodyTypeEnum.Eye;
            listSelectData = CharacterBodyHandler.Instance.manager.GetAllEye();
            break;

        case "Mouth":
            this.bodyType  = BodyTypeEnum.Mouth;
            listSelectData = CharacterBodyHandler.Instance.manager.GetAllMouth();
            break;

        case "Skin":
            this.bodyType = BodyTypeEnum.Skin;
            listSelectData.Clear();
            listSelectData.Add("Def");
            listSelectData.AddRange(CharacterBodyHandler.Instance.manager.GetAllTrunk());
            break;
        }
        gridVertical.SetCellCount(listSelectData.Count);
        gridVertical.RefreshAllCells();
    }
Beispiel #4
0
 public void RadioButtonSelected(RadioButtonView view, bool isSelect)
 {
     if (listButton.IsNull())
     {
         return;
     }
     for (int i = 0; i < listButton.Count; i++)
     {
         RadioButtonView itemRB = listButton[i];
         if (itemRB.Equals(view))
         {
             if (!isCancelSelect)
             {
                 itemRB.ChangeStates(true);
             }
             if (mRGCallBack != null)
             {
                 mRGCallBack.RadioButtonSelected(this, i, itemRB);
             }
         }
         else
         {
             itemRB.ChangeStates(false);
             if (mRGCallBack != null)
             {
                 mRGCallBack.RadioButtonUnSelected(this, i, itemRB);
             }
         }
     }
 }
Beispiel #5
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
        int timeScale = 1;

        if (rbview == rbTimeScale2)
        {
            timeScale = 2;
        }
        else if (rbview == rbTimeScale5)
        {
            timeScale = 5;
        }
        else if (rbview == rbTimeScale8)
        {
            timeScale = 8;
        }
        else if (rbview == rbTimeScaleStop)
        {
            timeScale = 0;
        }
        if (rbview.status == RadioButtonView.RadioButtonStatus.Selected)
        {
            GameTimeHandler.Instance.SetTimeScale(timeScale);
        }
        else
        {
            GameTimeHandler.Instance.SetTimeScale(1);
        }
    }
 public void RadioButtonSelected(RadioButtonView view, RadioButtonView.RadioButtonStatus buttonStates)
 {
     if (CheckUtil.ListIsNull(listButton))
     {
         return;
     }
     for (int i = 0; i < listButton.Count; i++)
     {
         RadioButtonView itemRB = listButton[i];
         if (itemRB.Equals(view))
         {
             if (!isCancelSelect)
             {
                 itemRB.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
             }
             if (mRGCallBack != null)
             {
                 mRGCallBack.RadioButtonSelected(this, i, itemRB);
             }
         }
         else
         {
             itemRB.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
             if (mRGCallBack != null)
             {
                 mRGCallBack.RadioButtonUnSelected(this, i, itemRB);
             }
         }
     }
 }
Beispiel #7
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);

        innUI.Close();
        revenueUI.Close();
        achUI.Close();
        customerUI.Close();
        menuUI.Close();
        if (rbview == rbTypeInn)
        {
            innUI.Open();
        }
        else if (rbview == rbTypeRevenue)
        {
            revenueUI.Open();
        }
        else if (rbview == rbTypeAch)
        {
            achUI.Open();
        }
        else if (rbview == rbTypeCustomer)
        {
            customerUI.Open();
        }
        else if (rbview == rbTypeMenu)
        {
            menuUI.Open();
        }
    }
Beispiel #8
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {
        BuildItemTypeEnum    buildItemType = EnumUtil.GetEnum <BuildItemTypeEnum>(rbview.name);
        List <StoreInfoBean> listData      = GetListBedDataByType(buildItemType);

        CreateBedDataList(listData);
    }
Beispiel #9
0
 public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
 {
     switch (rbview.name)
     {
     case "Medicine":
         CreateItemsList(listData);
         break;
     }
 }
Beispiel #10
0
 public void RadioButtonSelected(RadioButtonView view, RadioButtonView.RadioButtonStatus buttonStatus)
 {
     AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
     if (buttonStatus == RadioButtonView.RadioButtonStatus.Selected)
     {
         SetAttendance(WorkerStatusEnum.Work);
     }
     else
     {
         SetAttendance(WorkerStatusEnum.Rest);
     }
 }
Beispiel #11
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
        ClearData();
        rankType = EnumUtil.GetEnum <RankTypeEnum>(rbview.name);
        string rankName = RankTypeEnumTool.GetRankTypeName(rankType);

        //设置本地数据
        SetLocalData();
        //获取排行榜ID
        SteamHandler.Instance.GetLeaderboardId(rankName, this);
    }
Beispiel #12
0
 public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
 {
     AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
     //删除当前选中
     GameControlHandler.Instance.manager.GetControl <ControlForBuildCpt>(GameControlHandler.ControlEnum.Build).ClearBuildItem();
     btDismantle.gameObject.SetActive(true);
     if (rbview == rbTypeTable)
     {
         SetInnBuildActive(true, true);
         CreateBuildList(BuildItemTypeEnum.Table);
     }
     else if (rbview == rbTypeStove)
     {
         SetInnBuildActive(true, true);
         CreateBuildList(BuildItemTypeEnum.Stove);
     }
     else if (rbview == rbTypeCounter)
     {
         SetInnBuildActive(true, true);
         CreateBuildList(BuildItemTypeEnum.Counter);
     }
     else if (rbview == rbTypeDoor)
     {
         SetInnBuildActive(true, true);
         CreateBuildList(BuildItemTypeEnum.Door);
     }
     else if (rbview == rbTypeDecoration)
     {
         SetInnBuildActive(true, true);
         CreateBuildList(BuildItemTypeEnum.Decoration);
     }
     else if (rbview == rbTypeFloor)
     {
         SetInnBuildActive(false, false);
         btDismantle.gameObject.SetActive(false);
         CreateBuildList(BuildItemTypeEnum.Floor);
     }
     else if (rbview == rbTypeWall)
     {
         SetInnBuildActive(true, true);
         CreateBuildList(BuildItemTypeEnum.Wall);
     }
     else if (rbview == rbTypeBed)
     {
         SetInnBuildActive(true, true);
         CreateBuildList(BuildItemTypeEnum.Bed);
     }
     else if (rbview == rbTypeStairs)
     {
         SetInnBuildActive(true, true);
         CreateBuildList(BuildItemTypeEnum.Stairs);
     }
 }
Beispiel #13
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView view)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);

        if (position == 0)
        {
            characterBodyCpt.SetSex(1, null);
        }
        else
        {
            characterBodyCpt.SetSex(2, null);
        }
    }
Beispiel #14
0
 public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
 {
     AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
     if (rgView == rgStyleType)
     {
         mStyleType = EnumUtil.GetEnum <StoreForDressTypeEnum>(rbview.name);
     }
     else if (rgView == rgPartType)
     {
         mPartType = EnumUtil.GetEnum <GeneralEnum>(rbview.name);
     }
     InitDataByType(mStyleType, mPartType);
 }
Beispiel #15
0
 public void RadioButtonSelected(RadioButtonView view, bool isSelect)
 {
     if (isSelect)
     {
         callBack?.Invoke(true);
         ui_RB.SetText(TextHandler.Instance.GetTextById(10001));
     }
     else
     {
         callBack?.Invoke(false);
         ui_RB.SetText(TextHandler.Instance.GetTextById(10002));
     }
 }
Beispiel #16
0
 public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
 {
     this.labelIndex = position;
     if (rbview == ui_ViewLabel_Equip)
     {
         ui_ViewCharacterEquip.OpenUI();
         ui_ViewSynthesis.CloseUI();
     }
     else if (rbview == ui_ViewLabel_Synthesis)
     {
         ui_ViewCharacterEquip.CloseUI();
         ui_ViewSynthesis.OpenUI();
     }
 }
Beispiel #17
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
        SeasonsEnum          season = EnumUtil.GetEnum <SeasonsEnum>(rbview.name);
        UserRevenueMonthBean userRevenueMonthData = GetUserRevenueMonthData((int)season, userRevenueData);

        if (userRevenueMonthData == null)
        {
            cartogramBar.SetData(new List <CartogramDataBean>());
        }
        else
        {
            ((RevenueCartogramBarView)cartogramBar).SetData(userRevenueMonthData.GetListCartogramDataForIncome(), userRevenueMonthData.listDayData);
        }
    }
Beispiel #18
0
    public void RadioButtonSelected(RadioButtonView view, RadioButtonView.RadioButtonStatus buttonStates)
    {
        bool isWork = false;

        if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
        {
            isWork = true;
        }
        else
        {
            isWork = false;
        }
        if (callBack != null)
        {
            callBack.ChangeStatus(this, isWork);
        }
    }
Beispiel #19
0
    public void RadioButtonSelected(RadioButtonView view, RadioButtonView.RadioButtonStatus buttonStatus)
    {
        if (view == rbShow && tvShow != null)
        {
            AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
            switch (buttonStatus)
            {
            case RadioButtonView.RadioButtonStatus.Selected:
                tvShow.text        = TextHandler.Instance.manager.GetTextById(2021);
                menuOwnData.isSell = true;
                break;

            case RadioButtonView.RadioButtonStatus.Unselected:
                tvShow.text        = TextHandler.Instance.manager.GetTextById(2020);
                menuOwnData.isSell = false;
                break;
            }
        }
    }
Beispiel #20
0
 public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
 {
     this.index = position;
     if (rbview == ui_ViewLabel_Game)
     {
         settingGameContent.Open();
     }
     else if (rbview == ui_ViewLabel_Display)
     {
         settingDisplayContent.Open();
     }
     else if (rbview == ui_ViewLabel_Audio)
     {
         settingAudioContent.Open();
     }
     else if (rbview == ui_ViewLabel_Control)
     {
         settingControlContent.Open();
     }
 }
Beispiel #21
0
 /// <summary>
 /// 设置标签
 /// </summary>
 public void SetLabels(List <BookModelInfoBean> listBookModel)
 {
     ui_Labels.DestroyAllChild(true, 1);
     listLabels.Clear();
     for (int i = 0; i < listBookModel.Count; i++)
     {
         BookModelInfoBean bookModel = listBookModel[i];
         //创建一个标签
         GameObject objItemLabel = Instantiate(ui_Labels.gameObject, ui_LabelItem.gameObject);
         objItemLabel.SetActive(true);
         //设置文本
         Transform tfTitle = objItemLabel.transform.Find("Title");
         Text      tvTitle = tfTitle.GetComponent <Text>();
         tvTitle.text = bookModel.name;
         //获取按钮
         RadioButtonView btLabel = objItemLabel.GetComponent <RadioButtonView>();
         listLabels.Add(btLabel);
     }
     ui_Labels.InitRadioButton();
     ui_Labels.SetPosition(0, true);
 }
Beispiel #22
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
        objBaseHelp.SetActive(false);
        objBuildHelp.SetActive(false);
        objManageHelp.SetActive(false);
        objLevelUpHelp.SetActive(false);
        objFavorabilityHelp.SetActive(false);
        objHotel.SetActive(false);
        switch (rbview.name)
        {
        case "Base":
            objBaseHelp.SetActive(true);
            break;

        case "Build":
            objBuildHelp.SetActive(true);
            break;

        case "Manage":
            objManageHelp.SetActive(true);
            break;

        case "LevelUp":
            objLevelUpHelp.SetActive(true);
            break;

        case "Favorability":
            objFavorabilityHelp.SetActive(true);
            break;

        case "Hotel":
            objHotel.SetActive(true);
            break;
        }
    }
Beispiel #23
0
    public void RadioButtonSelected(RadioButtonView view, RadioButtonView.RadioButtonStatus buttonStates)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
        GameConfigBean gameConfig = GameDataHandler.Instance.manager.GetGameConfig();

        if (view == rbKeyTip)
        {
            //按键提示
            if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
            {
                gameConfig.statusForKeyTip = 1;
            }
            else if (buttonStates == RadioButtonView.RadioButtonStatus.Unselected)
            {
                gameConfig.statusForKeyTip = 0;
            }
        }
        else if (view == rbFrames)
        {
            //按键提示
            if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
            {
                gameConfig.statusForFrames = 1;
            }
            else if (buttonStates == RadioButtonView.RadioButtonStatus.Unselected)
            {
                gameConfig.statusForFrames = 0;
            }
            FPSHandler.Instance.SetData(gameConfig.statusForFrames, gameConfig.frames);
        }
        else if (view == rbMouseMove)
        {
            //按键提示
            if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
            {
                gameConfig.statusForMouseMove = 1;
            }
            else if (buttonStates == RadioButtonView.RadioButtonStatus.Unselected)
            {
                gameConfig.statusForMouseMove = 0;
            }
        }
        else if (view == rbEventCameraMove)
        {
            //按键提示
            if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
            {
                gameConfig.statusForEventCameraMove = 1;
            }
            else if (buttonStates == RadioButtonView.RadioButtonStatus.Unselected)
            {
                gameConfig.statusForEventCameraMove = 0;
            }
        }
        else if (view == rbEventStopTimeScale)
        {
            //按键提示
            if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
            {
                gameConfig.statusForEventStopTimeScale = 1;
            }
            else if (buttonStates == RadioButtonView.RadioButtonStatus.Unselected)
            {
                gameConfig.statusForEventStopTimeScale = 0;
            }
        }
        else if (view == rbEvent)
        {
            //按键提示
            if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
            {
                gameConfig.statusForEvent = 1;
            }
            else if (buttonStates == RadioButtonView.RadioButtonStatus.Unselected)
            {
                gameConfig.statusForEvent = 0;
            }
        }
        else if (view == rbWorkerNumber)
        {
            //按键提示
            if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
            {
                gameConfig.statusForWorkerNumber = 1;
            }
            else if (buttonStates == RadioButtonView.RadioButtonStatus.Unselected)
            {
                gameConfig.statusForWorkerNumber = 0;
            }
        }
        else if (view == rbPowerTest)
        {
            //按键提示
            if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
            {
                gameConfig.statusForCombatForPowerTest = 1;
            }
            else if (buttonStates == RadioButtonView.RadioButtonStatus.Unselected)
            {
                gameConfig.statusForCombatForPowerTest = 0;
            }
        }
        else if (view == rbTownerInfo)
        {
            if (buttonStates == RadioButtonView.RadioButtonStatus.Selected)
            {
                gameConfig.isShowDetailsForTower = true;
            }
            else if (buttonStates == RadioButtonView.RadioButtonStatus.Unselected)
            {
                gameConfig.isShowDetailsForTower = false;
            }
        }
    }
Beispiel #24
0
    public void RadioButtonUnSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {

    }
Beispiel #25
0
 public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
 {
     this.selectTypePosition = position;
     TrophyTypeEnum trophyType = EnumUtil.GetEnum<TrophyTypeEnum>(rbview.name);
     InitData(trophyType);
 }
Beispiel #26
0
 public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
 {
     this.selectTypePosition = position;
     AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
     InitDataByWorker(rbview.name);
 }
Beispiel #27
0
        public MaterialControls(PrinterConfig printer, ThemeConfig theme, int initialMaterialIndex)
            : base(FlowDirection.TopToBottom)
        {
            this.theme   = theme;
            this.HAnchor = HAnchor.Fit;
            this.VAnchor = VAnchor.Fit;

            materialButtons.Clear();
            int extruderCount = 4;

            for (int extruderIndex = -1; extruderIndex < extruderCount; extruderIndex++)
            {
                var name = $"{"Material".Localize()} {extruderIndex + 1}";
                if (extruderIndex == -1)
                {
                    name = "Default".Localize();
                }

                var buttonView = new FlowLayoutWidget()
                {
                    HAnchor = HAnchor.Fit,
                    VAnchor = VAnchor.Fit
                };

                var scaledButtonSize = 24 * GuiWidget.DeviceScale;

                GuiWidget colorButton;
                buttonView.AddChild(colorButton = new ItemColorButton(theme, MaterialRendering.Color(printer, extruderIndex, theme.BorderColor))
                {
                    Width                  = scaledButtonSize,
                    Height                 = scaledButtonSize,
                    BackgroundRadius       = scaledButtonSize / 2,
                    BackgroundOutlineWidth = 1,
                    BorderColor            = theme.TextColor,
                    VAnchor                = VAnchor.Center,
                    Margin                 = new BorderDouble(3, 0, 5, 0),
                });

                buttonView.AddChild(new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.TextColor)
                {
                    VAnchor = VAnchor.Center
                });

                var radioButtonView = new RadioButtonView(buttonView)
                {
                    TextColor  = theme.TextColor,
                    Selectable = false
                };
                radioButtonView.RadioCircle.Margin = radioButtonView.RadioCircle.Margin.Clone(right: 5);

                var radioButton = new RadioButton(radioButtonView)
                {
                    HAnchor   = HAnchor.Fit,
                    VAnchor   = VAnchor.Fit,
                    TextColor = theme.TextColor,
                    Checked   = extruderIndex == initialMaterialIndex,
                    Name      = name + " Button"
                };
                materialButtons.Add(radioButton);
                this.AddChild(radioButton);

                int localExtruderIndex = extruderIndex;
                radioButton.Click += (sender, e) =>
                {
                    IndexChanged?.Invoke(this, localExtruderIndex);
                };
            }
        }
 public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView view)
 {
     AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
     InitDataByType(position);
 }
Beispiel #29
0
        public MaterialControls(InteractiveScene scene, ThemeConfig theme)
            : base(FlowDirection.TopToBottom)
        {
            this.theme   = theme;
            this.scene   = scene;
            this.HAnchor = HAnchor.Stretch;
            this.VAnchor = VAnchor.Fit;

            materialButtons.Clear();
            int extruderCount = 4;

            for (int extruderIndex = -1; extruderIndex < extruderCount; extruderIndex++)
            {
                var name = $"{"Material".Localize()} {extruderIndex +1}";
                if (extruderIndex == -1)
                {
                    name = "Default".Localize();
                }

                var buttonView = new FlowLayoutWidget()
                {
                    HAnchor = HAnchor.Fit,
                    VAnchor = VAnchor.Fit
                };

                var scaledButtonSize = 16 * GuiWidget.DeviceScale;

                buttonView.AddChild(new ColorButton(extruderIndex == -1 ? Color.Black : MaterialRendering.Color(extruderIndex))
                {
                    Margin  = new BorderDouble(right: 5),
                    Width   = scaledButtonSize,
                    Height  = scaledButtonSize,
                    VAnchor = VAnchor.Center,
                });

                buttonView.AddChild(new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor)
                {
                    VAnchor = VAnchor.Center
                });

                var radioButtonView = new RadioButtonView(buttonView)
                {
                    TextColor = theme.Colors.PrimaryTextColor
                };
                radioButtonView.RadioCircle.Margin = radioButtonView.RadioCircle.Margin.Clone(right: 5);

                var radioButton = new RadioButton(radioButtonView)
                {
                    HAnchor   = HAnchor.Stretch,
                    VAnchor   = VAnchor.Fit,
                    TextColor = theme.Colors.PrimaryTextColor
                };
                materialButtons.Add(radioButton);
                this.AddChild(radioButton);

                int extruderIndexCanPassToClick = extruderIndex;
                radioButton.Click += (sender, e) =>
                {
                    var selectedItem = scene.SelectedItem;
                    if (selectedItem != null)
                    {
                        selectedItem.MaterialIndex = extruderIndexCanPassToClick;
                        scene.Invalidate(new InvalidateArgs(null, InvalidateType.Material));
                    }
                };
            }

            scene.SelectionChanged += Scene_SelectionChanged;
        }
Beispiel #30
0
        public MaterialControls(ThemeConfig theme, int initialMaterialIndex)
            : base(FlowDirection.TopToBottom)
        {
            this.theme   = theme;
            this.HAnchor = HAnchor.Fit;
            this.VAnchor = VAnchor.Fit;

            materialButtons.Clear();
            int extruderCount = 4;

            for (int extruderIndex = -1; extruderIndex < extruderCount; extruderIndex++)
            {
                var name = $"{"Material".Localize()} {extruderIndex +1}";
                if (extruderIndex == -1)
                {
                    name = "Default".Localize();
                }

                var buttonView = new FlowLayoutWidget()
                {
                    HAnchor = HAnchor.Fit,
                    VAnchor = VAnchor.Fit
                };

                var scaledButtonSize = 16 * GuiWidget.DeviceScale;

                buttonView.AddChild(new ColorButton(MaterialRendering.Color(extruderIndex, theme.MinimalHighlight))
                {
                    Width    = scaledButtonSize,
                    Height   = scaledButtonSize,
                    VAnchor  = VAnchor.Center,
                    DrawGrid = true,
                });

                buttonView.AddChild(new TextWidget(name, pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor)
                {
                    VAnchor = VAnchor.Center
                });

                var radioButtonView = new RadioButtonView(buttonView)
                {
                    TextColor = theme.Colors.PrimaryTextColor
                };
                radioButtonView.RadioCircle.Margin = radioButtonView.RadioCircle.Margin.Clone(right: 5);

                var radioButton = new RadioButton(radioButtonView)
                {
                    HAnchor   = HAnchor.Fit,
                    VAnchor   = VAnchor.Fit,
                    TextColor = theme.Colors.PrimaryTextColor,
                    Checked   = extruderIndex == initialMaterialIndex
                };
                materialButtons.Add(radioButton);
                this.AddChild(radioButton);

                int localExtruderIndex = extruderIndex;
                radioButton.Click += (sender, e) =>
                {
                    IndexChanged?.Invoke(this, localExtruderIndex);
                };
            }
        }