private void ResetButton_eventClicked(UIComponent component, UIMouseEventParameter eventParam) { Brush.BrushOptions options = Brush.BrushOptions.Default(); UserMod.Settings.SelectedBrush.Options = options; UpdateBindings(options); autoDensityCheckBox.isChecked = options.AutoDensity; UserMod.SaveSettings(); }
private void ProbabilityTextField_eventLostFocus(UIComponent component, UIFocusEventParameter eventParam) { if (float.TryParse(probabilityTextField.text, out float value)) { probabilitySlider.eventValueChanged -= ProbabilitySlider_eventValueChanged; probabilitySlider.value = value; probabilitySlider.eventValueChanged += ProbabilitySlider_eventValueChanged; SetProbability(value, Prefab); UserMod.SaveSettings(); } }
private void ToggleOptionsButton_eventClicked(UIComponent component, UIMouseEventParameter eventParam) { bool optionsVisible = owner.ToggleBrushOptions(); toggleOptionsButton.normalBgSprite = toggleOptionsButton.focusedBgSprite = optionsVisible ? ResourceLoader.OptionsDropboxFocused : ResourceLoader.OptionsDropbox; if (optionsVisible) { owner.KeepWithinScreen(); } UserMod.Settings.BrushOptionsOpen = optionsVisible; UserMod.SaveSettings(); }
private void SelectBitmapButton_eventClicked(UIComponent component, UIMouseEventParameter eventParam) { bool shapeSelectorVisible = owner.ToggleBrushShapes(); selectBitmapButton.normalBgSprite = selectBitmapButton.focusedBgSprite = shapeSelectorVisible ? ResourceLoader.PaintBrushFocused : ResourceLoader.PaintBrushNormal; if (shapeSelectorVisible) { owner.KeepWithinScreen(); } UserMod.Settings.BrushShapesOpen = shapeSelectorVisible; UserMod.SaveSettings(); }
private void ToggleEditButton_eventClicked(UIComponent component, UIMouseEventParameter eventParam) { bool editVisible = owner.ToggleBrushEdit(); toggleEditButton.normalBgSprite = toggleEditButton.focusedBgSprite = editVisible ? ResourceLoader.SettingsDropboxFocused : ResourceLoader.SettingsDropbox; if (editVisible) { owner.ClampToScreen(); } UserMod.Settings.BrushEditOpen = editVisible; UserMod.SaveSettings(); }
private void AutoDensityCheckBox_eventCheckChanged(UIComponent component, bool value) { UserMod.Settings.SelectedBrush.Options.AutoDensity = value; densityLabel.isEnabled = densitySlider.isEnabled = !value; UserMod.SaveSettings(); }
private void DensitySlider_eventMouseUp(UIComponent component, UIMouseEventParameter eventParam) { UserMod.SaveSettings(); }
private void RenameBrushTextField_eventLostFocus(UIComponent component, UIFocusEventParameter eventParam) { UserMod.SaveSettings(); }
public void SavePanelPosition() { UserMod.Settings.PanelPosX = parent.absolutePosition.x; UserMod.Settings.PanelPosY = parent.absolutePosition.y; UserMod.SaveSettings(); }
private void ProbabilitySlider_eventMouseUp(UIComponent component, UIMouseEventParameter eventParam) { SetProbability(probabilitySlider.value, Prefab); UserMod.SaveSettings(); }