private void CreateNodeMarkingsHiddenCheckbox() { nodeMarkingsHiddenCheckbox = AddUIComponent <CheckboxPanel>(); nodeMarkingsHiddenCheckbox.Build(PanelType.None, new Layout(new Vector2(0.0f, 28.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 10)); nodeMarkingsHiddenCheckbox.Initialize( NetworkSkinPanelController.RoadDecoration.NodeMarkingsHidden, Translation.Instance.GetTranslation(TranslationID.LABEL_HIDE_NODE_MARKINGS), Translation.Instance.GetTranslation(TranslationID.TOOLTIP_HIDE_NODE_MARKINGS)); nodeMarkingsHiddenCheckbox.EventCheckboxStateChanged += NetworkSkinPanelController.RoadDecoration.SetNodeMarkingsHidden; }
private void CreateDisableCompileCheckbox() { _disableCompileCheckboxPanel = _saveMixPanel.AddUIComponent <CheckboxPanel>(); string label = Translation.Instance.GetTranslation(TranslationID.LABEL_DISABLECOMPILE); string checkboxTooltip = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_DISABLECOMPILE); _disableCompileCheckboxPanel.Initialize(Data.DisableCompile, label, checkboxTooltip); _disableCompileCheckboxPanel.MakeSmallVersion(); _disableCompileCheckboxPanel.EventCheckboxStateChanged += OnDisableCompileCheckChanged; }
private void CreateUseAsDefaultCheckbox() { _useAsDefaultCheckbox = _selectMixPanel.AddUIComponent <CheckboxPanel>(); var state = false; if (_selectMixDropDown.items.Length > 0 && _selectMixDropDown.selectedIndex >= 0 && _selectMixDropDown.selectedIndex < _selectMixDropDown.items.Length) { state = Data.IsDefaultMix(_selectMixDropDown.items[_selectMixDropDown.selectedIndex]); } string label = Translation.Instance.GetTranslation(TranslationID.LABEL_USEASDEFAULT); string checkboxTooltip = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_USEASDEFAULT); _useAsDefaultCheckbox.Initialize(state, label, checkboxTooltip); _useAsDefaultCheckbox.MakeSmallVersion(); _useAsDefaultCheckbox.EventCheckboxStateChanged += OnUseAsDefaultCheckChanged; }
private void CreateDetailPanel() { DetailPanel = _panelRight.AddUIComponent <PanelBase>(); DetailPanel.Setup("Terrain Detail Panel", 350.0f, 231.0f, 5, bgSprite: "WhiteRect"); DetailPanelInner = DetailPanel.AddUIComponent <PanelBase>(); DetailPanelInner.Setup("Terrain Detail Panel Inside", 1.0f, 1.0f, 5, true, LayoutDirection.Vertical); DetailPanelInner.anchor = UIAnchorStyle.CenterHorizontal | UIAnchorStyle.CenterVertical; UILabel label = DetailPanelInner.AddUIComponent <UILabel>(); label.font = UIUtils.Font; label.textScale = 1.0f; label.padding = new RectOffset(4, 0, 4, 0); label.relativePosition = Vector2.zero; label.text = Translation.Instance.GetTranslation(TranslationID.LABEL_TITLE_DETAIL); GrassDetail = DetailPanelInner.AddUIComponent <CheckboxPanel>(); bool grassState = Controller.GetValue <bool>(ValueID.GrassDetailEnabled); string grassLabelText = Translation.Instance.GetTranslation(TranslationID.LABEL_VALUE_GRASSDETAIL); string grassTooltipText = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_VALUE_GRASSDETAIL); GrassDetail.Initialize(grassState, grassLabelText, grassTooltipText); GrassDetail.EventCheckboxStateChanged += OnDetailStateChanged; FertileDetail = DetailPanelInner.AddUIComponent <CheckboxPanel>(); bool fertileState = Controller.GetValue <bool>(ValueID.FertileDetailEnabled); string fertileLabelText = Translation.Instance.GetTranslation(TranslationID.LABEL_VALUE_FERTILEDETAIL); string fertileTooltipText = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_VALUE_FERTILEDETAIL); FertileDetail.Initialize(fertileState, fertileLabelText, fertileTooltipText); FertileDetail.EventCheckboxStateChanged += OnDetailStateChanged; CliffDetail = DetailPanelInner.AddUIComponent <CheckboxPanel>(); bool cliffState = Controller.GetValue <bool>(ValueID.RocksDetailEnabled); string cliffLabelText = Translation.Instance.GetTranslation(TranslationID.LABEL_VALUE_CLIFFDETAIL); string cliffTooltipText = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_VALUE_CLIFFDETAIL); CliffDetail.Initialize(cliffState, cliffLabelText, cliffTooltipText); CliffDetail.EventCheckboxStateChanged += OnDetailStateChanged; DetailPanelInner.autoFitChildrenHorizontally = true; }
private void CreateNodeMarkingsHiddenCheckbox() { nodeMarkingsHiddenCheckbox = AddUIComponent <CheckboxPanel>(); nodeMarkingsHiddenCheckbox.Build(PanelType.None, new Layout(new Vector2(0.0f, 28.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 10)); nodeMarkingsHiddenCheckbox.Initialize( NetworkSkinPanelController.RoadDecoration.NodeMarkingsHidden, Translation.Instance.GetTranslation(TranslationID.LABEL_HIDE_NODE_MARKINGS), Translation.Instance.GetTranslation(TranslationID.TOOLTIP_HIDE_NODE_MARKINGS)); nodeMarkingsHiddenCheckbox.EventCheckboxStateChanged += NetworkSkinPanelController.RoadDecoration.SetNodeMarkingsHidden; nodeMarkingsHiddenCheckbox.isVisible = NetworkSkinPanelController.RoadDecoration.CanHideNodeMarkings; arrowsHiddenCheckbox = AddUIComponent <CheckboxPanel>(); arrowsHiddenCheckbox.Build(PanelType.None, new Layout(new Vector2(0.0f, 28.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 10)); arrowsHiddenCheckbox.Initialize( NetworkSkinPanelController.RoadDecoration.ArrowsHidden, Translation.Instance.GetTranslation(TranslationID.LABEL_HIDE_ROAD_ARROWS), Translation.Instance.GetTranslation(TranslationID.TOOLTIP_HIDE_ROAD_ARROWS)); arrowsHiddenCheckbox.EventCheckboxStateChanged += NetworkSkinPanelController.RoadDecoration.SetArrowsHidden; arrowsHiddenCheckbox.isVisible = NetworkSkinPanelController.RoadDecoration.HasArrows; signsHiddenCheckbox = AddUIComponent <CheckboxPanel>(); signsHiddenCheckbox.Build(PanelType.None, new Layout(new Vector2(0.0f, 28.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 10)); signsHiddenCheckbox.Initialize( NetworkSkinPanelController.RoadDecoration.SignsHidden, Translation.Instance.GetTranslation(TranslationID.LABEL_HIDE_ROAD_SIGNS), Translation.Instance.GetTranslation(TranslationID.TOOLTIP_HIDE_ROAD_SIGNS)); signsHiddenCheckbox.EventCheckboxStateChanged += NetworkSkinPanelController.RoadDecoration.SetSignsHidden; signsHiddenCheckbox.isVisible = NetworkSkinPanelController.RoadDecoration.HasSigns; decorationHiddenCheckbox = AddUIComponent <CheckboxPanel>(); decorationHiddenCheckbox.Build(PanelType.None, new Layout(new Vector2(0.0f, 28.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 10)); decorationHiddenCheckbox.Initialize( NetworkSkinPanelController.RoadDecoration.SignsHidden, Translation.Instance.GetTranslation(TranslationID.LABEL_HIDE_ROAD_DECORATION), Translation.Instance.GetTranslation(TranslationID.TOOLTIP_HIDE_ROAD_DECORATION)); decorationHiddenCheckbox.EventCheckboxStateChanged += NetworkSkinPanelController.RoadDecoration.SetDecorationHidden; decorationHiddenCheckbox.isVisible = NetworkSkinPanelController.RoadDecoration.HasDecoration; transportStopsHiddenCheckbox = AddUIComponent <CheckboxPanel>(); transportStopsHiddenCheckbox.Build(PanelType.None, new Layout(new Vector2(0.0f, 28.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 10)); transportStopsHiddenCheckbox.Initialize( NetworkSkinPanelController.RoadDecoration.TransportStopsHidden, Translation.Instance.GetTranslation(TranslationID.LABEL_HIDE_TRANSPORT_STOPS), Translation.Instance.GetTranslation(TranslationID.TOOLTIP_HIDE_TRANSPORT_STOPS)); transportStopsHiddenCheckbox.EventCheckboxStateChanged += NetworkSkinPanelController.RoadDecoration.SetTransportStopsHidden; transportStopsHiddenCheckbox.isVisible = NetworkSkinPanelController.RoadDecoration.HasTransportStops; trafficLightsHiddenCheckbox = AddUIComponent <CheckboxPanel>(); trafficLightsHiddenCheckbox.Build(PanelType.None, new Layout(new Vector2(0.0f, 28.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 10)); trafficLightsHiddenCheckbox.Initialize( NetworkSkinPanelController.RoadDecoration.TransportStopsHidden, Translation.Instance.GetTranslation(TranslationID.LABEL_HIDE_TRAFFIC_LIGHTS), Translation.Instance.GetTranslation(TranslationID.TOOLTIP_HIDE_TRAFFIC_LIGHTS)); trafficLightsHiddenCheckbox.EventCheckboxStateChanged += NetworkSkinPanelController.RoadDecoration.SetTrafficLightsHidden; trafficLightsHiddenCheckbox.isVisible = NetworkSkinPanelController.RoadDecoration.HasTrafficLights; levelCrossingsHiddenCheckbox = AddUIComponent <CheckboxPanel>(); levelCrossingsHiddenCheckbox.Build(PanelType.None, new Layout(new Vector2(0.0f, 28.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 10)); levelCrossingsHiddenCheckbox.Initialize( NetworkSkinPanelController.RoadDecoration.LevelCrossingsHidden, Translation.Instance.GetTranslation(TranslationID.LABEL_HIDE_LEVEL_CROSSINGS), Translation.Instance.GetTranslation(TranslationID.TOOLTIP_HIDE_LEVEL_CROSSINGS)); levelCrossingsHiddenCheckbox.EventCheckboxStateChanged += NetworkSkinPanelController.RoadDecoration.SetLevelCrossingsHidden; levelCrossingsHiddenCheckbox.isVisible = NetworkSkinPanelController.RoadDecoration.HasLevelCrossings; }