Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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();
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
 private void AutoDensityCheckBox_eventCheckChanged(UIComponent component, bool value)
 {
     UserMod.Settings.SelectedBrush.Options.AutoDensity = value;
     densityLabel.isEnabled = densitySlider.isEnabled = !value;
     UserMod.SaveSettings();
 }
Exemplo n.º 7
0
 private void DensitySlider_eventMouseUp(UIComponent component, UIMouseEventParameter eventParam)
 {
     UserMod.SaveSettings();
 }
Exemplo n.º 8
0
 private void RenameBrushTextField_eventLostFocus(UIComponent component, UIFocusEventParameter eventParam)
 {
     UserMod.SaveSettings();
 }
Exemplo n.º 9
0
 public void SavePanelPosition()
 {
     UserMod.Settings.PanelPosX = parent.absolutePosition.x;
     UserMod.Settings.PanelPosY = parent.absolutePosition.y;
     UserMod.SaveSettings();
 }
Exemplo n.º 10
0
 private void ProbabilitySlider_eventMouseUp(UIComponent component, UIMouseEventParameter eventParam)
 {
     SetProbability(probabilitySlider.value, Prefab);
     UserMod.SaveSettings();
 }