public void OnSettingsUI(UIHelperBase helper) { if (LocalizationManager.instance == null) { LocalizationManager.CreateManager(); } UIHelperBase group = helper.AddGroup(" Procedural Objects"); UIPanel globalPanel = ((UIPanel)((UIHelper)group).self); propRenderSlider = (UISlider)group.AddSlider(string.Format(LocalizationManager.instance.current["settings_RD_PROP_label"], PropRenderDistance.value.ToString()), 0f, 16000f, 10f, PropRenderDistance.value, propRenderDistanceChanged); propRenderSlider.width = 715; propRenderSlider.height = 16; propRenderSlider.tooltip = LocalizationManager.instance.current["settings_RD_PROP_tooltip"]; var propRenderPanel = globalPanel.Find <UIPanel>("OptionsSliderTemplate(Clone)"); propRenderPanel.name = "PropRenderSliderPanel"; propRenderLabel = propRenderPanel.Find <UILabel>("Label"); propRenderLabel.width *= 3.5f; // group.AddSpace(10); buildingRenderSlider = (UISlider)group.AddSlider(string.Format(LocalizationManager.instance.current["settings_RD_BUILDING_label"], BuildingRenderDistance.value.ToString()), 0f, 16000f, 10f, BuildingRenderDistance.value, buildingRenderDistanceChanged); buildingRenderSlider.width = 715; buildingRenderSlider.height = 16; buildingRenderSlider.tooltip = LocalizationManager.instance.current["settings_RD_BUILDING_tooltip"]; var buildingRenderPanel = globalPanel.components.First(c => c.GetType() == typeof(UIPanel) && c != propRenderPanel); buildingRenderPanel.name = "BuildingRenderSliderPanel"; buildingRenderLabel = buildingRenderPanel.Find <UILabel>("Label"); buildingRenderLabel.width *= 3.5f; // group.AddSpace(10); gizmoSizeSlider = (UISlider)group.AddSlider(string.Format(LocalizationManager.instance.current["settings_GIZMO_label"], GizmoSize.value.ToString()), 0.3f, 2.5f, 0.1f, GizmoSize.value, gizmoSizeChanged); gizmoSizeSlider.width = 715; gizmoSizeSlider.height = 16; gizmoSizeSlider.tooltip = LocalizationManager.instance.current["settings_GIZMO_tooltip"]; var gizmoPanel = globalPanel.components.First(c => c.GetType() == typeof(UIPanel) && c != propRenderPanel && c != buildingRenderPanel); gizmoPanel.name = "GizmoSizePanel"; gizmoSizeLabel = gizmoPanel.Find <UILabel>("Label"); gizmoSizeLabel.width *= 3.5f; group.AddSpace(32); var sliderGroup = helper.AddGroup(" " + LocalizationManager.instance.current["settings_CONFDEL_title"]); confirmDelCheckbox = (UICheckBox)sliderGroup.AddCheckbox(LocalizationManager.instance.current["settings_CONFDEL_toggle"], ShowConfirmDeletion.value, confirmDeletionCheckboxChanged); // sliderGroup.AddSpace(10); confirmDelThresholdSlider = (UISlider)sliderGroup.AddSlider(string.Format(LocalizationManager.instance.current["settings_CONFDEL_SLIDER_label"], ConfirmDeletionThreshold.value.ToString()), 1f, 15f, 1f, ConfirmDeletionThreshold.value, confirmDeletionThresholdChanged); confirmDelThresholdSlider.width = 715; confirmDelThresholdSlider.height = 16; confirmDelThresholdSlider.tooltip = LocalizationManager.instance.current["settings_CONFDEL_SLIDER_tooltip"]; confirmDelThresholdLabel = (UILabel)((UIPanel)((UIHelper)sliderGroup).self).components.First(c => c.GetType() == typeof(UIPanel) && c.components.Any(comp => comp.GetType() == typeof(UISlider))) .components.First(c => c.GetType() == typeof(UILabel)); confirmDelThresholdLabel.width *= 3.5f; if (!ShowConfirmDeletion.value) { confirmDelThresholdSlider.isEnabled = false; } sliderGroup.AddSpace(32); var languageGroup = helper.AddGroup(" " + LocalizationManager.instance.current["settings_LANG_title"]); languageGroup.AddDropdown("Language selection", LocalizationManager.instance.identifiers, LocalizationManager.instance.available.IndexOf(LocalizationManager.instance.current), languageChanged); languageGroup.AddSpace(32); showDevCheckbox = (UICheckBox)languageGroup.AddCheckbox(LocalizationManager.instance.current["settings_DEVTOOLS_toggle"], ShowDeveloperTools.value, (value) => { ShowDeveloperTools.value = value; }); showDevCheckbox.tooltip = LocalizationManager.instance.current["settings_DEVTOOLS_tooltip"]; }
public void OnSettingsUI(UIHelperBase helper) { if (LocalizationManager.instance == null) { LocalizationManager.CreateManager(); } SetUnits(); ExtUITabstrip tabStrip = ExtUITabstrip.Create((UIHelper)helper); UIHelper gentab = tabStrip.AddTabPage(" " + LocalizationManager.instance.current["settings_GENERAL"] + " ", out genTabButton); UIHelperBase group = gentab.AddGroup(LocalizationManager.instance.current["settings_GENERAL"]); UIHelper keybindingsTab = tabStrip.AddTabPage(" " + LocalizationManager.instance.current["settings_KB"] + " ", out kbTabButton); UIHelperBase kbGroup = keybindingsTab.AddGroup(LocalizationManager.instance.current["settings_KB"]); // UIHelperBase group = helper.AddGroup(" Procedural Objects"); // KEY BINDINGS TAB ((UIPanel)((UIHelper)kbGroup).self).gameObject.AddComponent <OptionsKeymappingGeneral>(); kbGroup.AddSpace(8); var KBPosGroup = kbGroup.AddGroup(LocalizationManager.instance.current["position"]); ((UIPanel)((UIHelper)KBPosGroup).self).gameObject.AddComponent <OptionsKeymappingPosition>(); KBPosGroup.AddSpace(8); var KBRotGroup = kbGroup.AddGroup(LocalizationManager.instance.current["rotation"]); ((UIPanel)((UIHelper)KBRotGroup).self).gameObject.AddComponent <OptionsKeymappingRotation>(); KBRotGroup.AddSpace(8); var KBScaleGroup = kbGroup.AddGroup(LocalizationManager.instance.current["scale_obj"]); ((UIPanel)((UIHelper)KBScaleGroup).self).gameObject.AddComponent <OptionsKeymappingScale>(); KBScaleGroup.AddSpace(8); var KBSMActionsGroup = kbGroup.AddGroup(LocalizationManager.instance.current["CTActions"] + " (" + LocalizationManager.instance.current["selection_mode"] + ")"); ((UIPanel)((UIHelper)KBSMActionsGroup).self).gameObject.AddComponent <OptionsKeymappingSelectionModeActions>(); KBSMActionsGroup.AddSpace(8); openKeybindingsButton = (UIButton)kbGroup.AddButton(LocalizationManager.instance.current["open_kbd_cfg"], openKeybindings); KeyBindingsManager.Initialize(); // GENERAL TAB UIPanel globalPanel = ((UIPanel)((UIHelper)group).self); gizmoSizeSlider = (UISlider)group.AddSlider(string.Format(LocalizationManager.instance.current["settings_GIZMO_label"], (GizmoSize.value * 100).ToString()), 0.2f, 3f, 0.1f, GizmoSize.value, gizmoSizeChanged); gizmoSizeSlider.width = 600; gizmoSizeSlider.height = 16; gizmoSizeSlider.tooltip = LocalizationManager.instance.current["settings_GIZMO_tooltip"]; var gizmoSizePanel = globalPanel.Find <UIPanel>("OptionsSliderTemplate(Clone)"); gizmoSizePanel.name = "GizmoSizePanel"; gizmoSizeLabel = gizmoSizePanel.Find <UILabel>("Label"); gizmoSizeLabel.width *= 3.5f; gizmoOpacitySlider = (UISlider)group.AddSlider(string.Format(LocalizationManager.instance.current["settings_GIZMO_OPACITY_label"], (GizmoOpacity.value * 100).ToString()), .1f, 1f, 0.05f, GizmoOpacity.value, gizmoOpacityChanged); gizmoOpacitySlider.width = 600; gizmoOpacitySlider.height = 16; var gizmoOpacityPanel = globalPanel.components.First(c => c.GetType() == typeof(UIPanel) && c != gizmoSizePanel); gizmoOpacityPanel.name = "GizmoOpacityPanel"; gizmoOpacityLabel = gizmoOpacityPanel.Find <UILabel>("Label"); gizmoOpacityLabel.width *= 3.5f; group.AddDropdown(LocalizationManager.instance.current["settings_DISTUNITS_label"], new string[] { LocalizationManager.instance.current["settings_DISTUNITS_m"] + " (m)", LocalizationManager.instance.current["settings_DISTUNITS_ft"] + " (ft)", LocalizationManager.instance.current["settings_DISTUNITS_yd"] + " (yd)" }, DistanceUnits.value, (int value) => { DistanceUnits.value = value; SetUnits(); // propRenderDistanceChanged(PropRenderDistance.value); // buildingRenderDistanceChanged(BuildingRenderDistance.value); }); group.AddDropdown(LocalizationManager.instance.current["settings_ANGUNITS_label"], new string[] { LocalizationManager.instance.current["settings_ANGUNITS_deg"] + " (°)", LocalizationManager.instance.current["settings_ANGUNITS_rad"] + " (rad)" }, AngleUnits.value, (int value) => { AngleUnits.value = value; SetUnits(); }); useUINightModeCheckbox = (UICheckBox)group.AddCheckbox(LocalizationManager.instance.current["settings_USEUINIGHTMODE_toggle"], UseUINightMode.value, (bool value) => { UseUINightMode.value = value; }); hideDisLayerIconCheckbox = (UICheckBox)group.AddCheckbox(LocalizationManager.instance.current["settings_HIDEDISABLEDLAYERSICON_toggle"], HideDisabledLayersIcon.value, hideDisabledLayersIconChanged); // usePasteIntoCheckbox = (UICheckBox)group.AddCheckbox(LocalizationManager.instance.current["settings_USEPASTEINTO_toggle"], UsePasteInto.value, usePasteIntoChanged); autoResizeDecalsCheckbox = (UICheckBox)group.AddCheckbox(LocalizationManager.instance.current["settings_AUTORESIZEDECALS_toggle"], AutoResizeDecals.value, autoResizeDecalsChanged); includeSubBuildingsCheckbox = (UICheckBox)group.AddCheckbox(LocalizationManager.instance.current["settings_CONVERTSUBBUILDINGS_toggle"], IncludeSubBuildings.value, includeSubBuildingsChanged); useColorVariationCheckbox = (UICheckBox)group.AddCheckbox(LocalizationManager.instance.current["settings_USECOLORVAR_toggle"], UseColorVariation.value, useColorVariationChanged); group.AddSpace(10); var sliderGroup = gentab.AddGroup(" " + LocalizationManager.instance.current["settings_CONFDEL_title"]); confirmDelCheckbox = (UICheckBox)sliderGroup.AddCheckbox(LocalizationManager.instance.current["settings_CONFDEL_toggle"], ShowConfirmDeletion.value, confirmDeletionCheckboxChanged); confirmDelThresholdSlider = (UISlider)sliderGroup.AddSlider(string.Format(LocalizationManager.instance.current["settings_CONFDEL_SLIDER_label"], ConfirmDeletionThreshold.value.ToString()), 1f, 15f, 1f, ConfirmDeletionThreshold.value, confirmDeletionThresholdChanged); confirmDelThresholdSlider.width = 715; confirmDelThresholdSlider.height = 16; confirmDelThresholdSlider.tooltip = LocalizationManager.instance.current["settings_CONFDEL_SLIDER_tooltip"]; confirmDelThresholdLabel = (UILabel)((UIPanel)((UIHelper)sliderGroup).self).components.First(c => c.GetType() == typeof(UIPanel) && c.components.Any(comp => comp.GetType() == typeof(UISlider))) .components.First(c => c.GetType() == typeof(UILabel)); confirmDelThresholdLabel.width *= 3.5f; if (!ShowConfirmDeletion.value) { confirmDelThresholdSlider.isEnabled = false; } sliderGroup.AddSpace(10); var languageGroup = gentab.AddGroup(" " + LocalizationManager.instance.current["settings_LANG_title"]); languageGroup.AddDropdown(LocalizationManager.instance.current["settings_LANG_title"], LocalizationManager.instance.identifiers, LocalizationManager.instance.available.IndexOf(LocalizationManager.instance.current), languageChanged); languageGroup.AddSpace(10); showDevCheckbox = (UICheckBox)languageGroup.AddCheckbox(LocalizationManager.instance.current["settings_DEVTOOLS_toggle"], ShowDeveloperTools.value, (value) => { ShowDeveloperTools.value = value; }); showDevCheckbox.tooltip = LocalizationManager.instance.current["settings_DEVTOOLS_tooltip"]; }