public void Initialize(Menu menu, IModToggleInput toggleTemplate, IModSliderInput sliderTemplate, IModTextInput textInputTemplate, IModNumberInput numberInputTemplate, IModComboInput comboInputTemplate) { _toggleTemplate = toggleTemplate; _sliderTemplate = sliderTemplate; _textInputTemplate = textInputTemplate; _numberInputTemplate = numberInputTemplate; _comboInputTemplate = comboInputTemplate; base.Initialize(menu); Title = Manifest.Name; AddInputs(); }
public void Initialize(Menu menu, IModToggleInput toggleTemplate, IModSliderInput sliderTemplate, IModTextInput textInputTemplate, IModNumberInput numberInputTemplate) { _toggleTemplate = toggleTemplate; _sliderTemplate = sliderTemplate; _textInputTemplate = textInputTemplate; _numberInputTemplate = numberInputTemplate; var layoutGroup = menu.GetComponentsInChildren <VerticalLayoutGroup>().Single(x => x.name == "Content"); Initialize(menu, layoutGroup); var blocker = menu.GetComponentsInChildren <GraphicRaycaster>().Single(x => x.name == "RebindingModeBlocker"); blocker.gameObject.SetActive(false); var labelPanel = menu.GetValue <GameObject>("_selectableItemsRoot").GetComponentInChildren <HorizontalLayoutGroup>(); labelPanel.gameObject.SetActive(false); Title = ModData.Manifest.Name; var saveButton = GetButton("UIElement-SaveAndExit"); var resetButton = GetButton("UIElement-ResetToDefaultsButton"); var cancelButton = GetButton("UIElement-DiscardChangesButton"); saveButton.OnClick += OnSave; resetButton.OnClick += OnReset; cancelButton.OnClick += Close; saveButton.SetControllerCommand(InputLibrary.confirm); resetButton.SetControllerCommand(InputLibrary.setDefaults); cancelButton.SetControllerCommand(InputLibrary.cancel); GetButton("UIElement-CancelOutOfRebinding").Hide(); GetButton("UIElement-KeyRebinder").Hide(); AddInputs(); }
public IModNumberInput AddNumberInput(IModNumberInput input, int index) { NumberInputs.Add(input); AddInput(input, index); return(input); }
public IModNumberInput AddNumberInput(IModNumberInput input) { return(AddNumberInput(input, input.Index)); }