//----------------------- private void bnOpen_Click(object sender, EventArgs e) { // present the palette selector to the user. DialogResult result = _brushPaletteSelectionDlg.ShowDialog(); if (result != DialogResult.OK || _brushPaletteSelectionDlg.Selection == null) { return; } // select the new palette. Palette = _brushPaletteSelectionDlg.Selection; // save the fact that the user selected this palette. Bootstrap.Settings settings = Bootstrap.Settings.Get(); if (settings != null) { string paletteName = ""; if (Palette != null) { paletteName = Palette.Name; } settings.SetUserSetting("selectedbrushpalette", paletteName); settings.Save(); } }
void Settings_FormClosing(object sender, FormClosingEventArgs e) { // if the user didn't click OK, do nothing. if (this.DialogResult != DialogResult.OK) { return; } // ensure that the brush folder has been created. if (bnBrushLibrary.Text != "") { if (!System.IO.Directory.Exists(bnBrushLibrary.Text)) { System.IO.Directory.CreateDirectory(bnBrushLibrary.Text); } } // save each path. Bootstrap.Settings settings = Bootstrap.Settings.Get(); settings.SetWorkingFolder(bnWorkingFolder.Text); settings.SetBrushFolder(bnBrushLibrary.Text); settings.Save(); // ensure that "editor/textures" has been created. EnsureEditorTexturesFolderCreated(); }
//----------------------- void thumbnailSelector_SelectionChanged(object sender, EventArgs e) { if (!_loadingSettings) { // save the brush selection (if we're not currently loading settings). Bootstrap.Settings settings = Bootstrap.Settings.Get(); if (settings != null) { Bootstrap.Brush selection = this.Selection; string brush = ""; if (selection != null) { brush = selection.Name; } settings.SetUserSetting("selectedbrush", brush); settings.Save(); } } // notify others that the selection has changed. if (SelectionChanged != null) { SelectionChanged(sender, e); } // close the "edit brush" popup. popupEditBrush.Close(); }