- remove the old settings that now will go to the template file for new Map (the bool flags to add layer + the default author, lug and event)

- udpate also the loca kit accordingly
This commit is contained in:
Alban Nanty
2020-09-22 18:37:22 +08:00
parent 7d0f87cb42
commit 62677eb074
11 changed files with 1960 additions and 3971 deletions

Binary file not shown.

View File

@@ -540,6 +540,30 @@ namespace BlueBrick
this.toolSplitContainer.SplitterDistance = Properties.Settings.Default.UIToolSplitContainerDistance;
}
/// <summary>
/// A util function to fill a combobox with text that is read from a text file.
/// The format of the text file is simple: every line in the text file will create an entry in the combo box
/// This is used to fill the LUG and Event combo box
/// </summary>
/// <param name="comboBoxToFill">The combobox you want to fill</param>
/// <param name="sourceDataFileName">The text file you want to read the data from</param>
private void fillComboBoxFromTextFile(ComboBox comboBoxToFill, string sourceDataFileName)
{
try
{
string sourceDataFullFileName = Application.StartupPath + sourceDataFileName;
System.IO.StreamReader textReader = new System.IO.StreamReader(sourceDataFullFileName);
comboBoxToFill.Items.Clear();
comboBoxToFill.Sorted = true;
while (!textReader.EndOfStream)
comboBoxToFill.Items.Add(textReader.ReadLine());
textReader.Close();
}
catch
{
}
}
private void loadUISettingFromDefaultSettings()
{
// DOT NET BUG: the data binding of the Form size and window state interfere with the
@@ -602,8 +626,8 @@ namespace BlueBrick
// the export window
this.mExportImageForm.loadUISettingFromDefaultSettings();
// fill the combo box in the Properties panel
PreferencesForm.sFillComboBoxFromTextFile(this.lugComboBox, @"/config/LugList.txt");
PreferencesForm.sFillComboBoxFromTextFile(this.eventComboBox, @"/config/EventList.txt");
fillComboBoxFromTextFile(this.lugComboBox, @"/config/LugList.txt");
fillComboBoxFromTextFile(this.eventComboBox, @"/config/EventList.txt");
}
private void saveUISettingInDefaultSettings()
@@ -1313,8 +1337,6 @@ namespace BlueBrick
// no valid template file, create a default map with default settings
ActionManager.Instance.doAction(new AddLayer("LayerGrid", false));
ActionManager.Instance.doAction(new AddLayer("LayerBrick", false));
// by preference we want to select the brick layer
Map.Instance.SelectedLayer = Map.Instance.SelectedLayer;
}
// after adding the two default layer, we reset the WasModified flag of the map

View File

@@ -14,16 +14,12 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.Xml.Serialization;
using System.IO;
using System.Collections;
using BlueBrick.Actions;
using BlueBrick.Actions.Bricks;
using BlueBrick.Actions.Layers;
using BlueBrick.Actions.Maps;
using BlueBrick.Properties;
namespace BlueBrick.MapData
@@ -60,9 +56,9 @@ namespace BlueBrick.MapData
private bool mIsMapNameValid = false;
// data global to the map that can change the user
private string mAuthor = BlueBrick.Properties.Settings.Default.DefaultAuthor;
private string mLUG = BlueBrick.Properties.Settings.Default.DefaultLUG;
private string mShow = BlueBrick.Properties.Settings.Default.DefaultShow;
private string mAuthor = Properties.Resources.DefaultAuthor;
private string mLUG = Properties.Resources.DefaultLUG;
private string mShow = Properties.Resources.DefaultShow;
private DateTime mDate = DateTime.Today;
private string mComment = "";
private Color mBackgroundColor = BlueBrick.Properties.Settings.Default.DefaultBackgroundColor;
@@ -300,14 +296,6 @@ namespace BlueBrick.MapData
/// </summary>
public Map()
{
// check if the default name for Author, LUG and Show is empty in the settings
// then we take the ones for the resources
if (mAuthor.Equals("***NotInitialized***"))
mAuthor = BlueBrick.Properties.Resources.DefaultAuthor;
if (mLUG.Equals("***NotInitialized***"))
mLUG = BlueBrick.Properties.Resources.DefaultLUG;
if (mShow.Equals("***NotInitialized***"))
mShow = BlueBrick.Properties.Resources.DefaultShow;
// and construct the watermark
computeGeneralInfoWatermark();
}

View File

@@ -47,17 +47,8 @@ namespace BlueBrick
this.label8 = new System.Windows.Forms.Label();
this.undoRecordedNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.authorTextBox = new System.Windows.Forms.TextBox();
this.addAreaLayerCheckBox = new System.Windows.Forms.CheckBox();
this.addRulerLayerCheckBox = new System.Windows.Forms.CheckBox();
this.addTextLayerCheckBox = new System.Windows.Forms.CheckBox();
this.showComboBox = new System.Windows.Forms.ComboBox();
this.lugComboBox = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.addBrickLayerCheckBox = new System.Windows.Forms.CheckBox();
this.addGridLayerCheckBox = new System.Windows.Forms.CheckBox();
this.GeneralBrowseNewMapTemplateFileButton = new System.Windows.Forms.Button();
this.GeneralNewMapTemplateFilenameTextBox = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
@@ -118,6 +109,8 @@ namespace BlueBrick
this.defaultFontColorPictureBox = new System.Windows.Forms.PictureBox();
this.defaultFontButton = new System.Windows.Forms.Button();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.label45 = new System.Windows.Forms.Label();
this.label44 = new System.Windows.Forms.Label();
this.otherHullThicknessNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.label43 = new System.Windows.Forms.Label();
this.otherHullColorPictureBox = new System.Windows.Forms.PictureBox();
@@ -194,8 +187,6 @@ namespace BlueBrick
this.restoreAllDefaultButton = new System.Windows.Forms.Button();
this.fontDialog = new System.Windows.Forms.FontDialog();
this.restoreTabDefaultButton = new System.Windows.Forms.Button();
this.label44 = new System.Windows.Forms.Label();
this.label45 = new System.Windows.Forms.Label();
this.optionsTabControl.SuspendLayout();
this.generalTabPage.SuspendLayout();
this.groupBox14.SuspendLayout();
@@ -429,86 +420,26 @@ namespace BlueBrick
//
// groupBox3
//
this.groupBox3.Controls.Add(this.authorTextBox);
this.groupBox3.Controls.Add(this.addAreaLayerCheckBox);
this.groupBox3.Controls.Add(this.addRulerLayerCheckBox);
this.groupBox3.Controls.Add(this.addTextLayerCheckBox);
this.groupBox3.Controls.Add(this.showComboBox);
this.groupBox3.Controls.Add(this.lugComboBox);
this.groupBox3.Controls.Add(this.label7);
this.groupBox3.Controls.Add(this.label6);
this.groupBox3.Controls.Add(this.label5);
this.groupBox3.Controls.Add(this.addBrickLayerCheckBox);
this.groupBox3.Controls.Add(this.addGridLayerCheckBox);
this.groupBox3.Controls.Add(this.GeneralBrowseNewMapTemplateFileButton);
this.groupBox3.Controls.Add(this.GeneralNewMapTemplateFilenameTextBox);
resources.ApplyResources(this.groupBox3, "groupBox3");
this.groupBox3.Name = "groupBox3";
this.groupBox3.TabStop = false;
//
// authorTextBox
// GeneralBrowseNewMapTemplateFileButton
//
resources.ApplyResources(this.authorTextBox, "authorTextBox");
this.authorTextBox.Name = "authorTextBox";
resources.ApplyResources(this.GeneralBrowseNewMapTemplateFileButton, "GeneralBrowseNewMapTemplateFileButton");
this.GeneralBrowseNewMapTemplateFileButton.Name = "GeneralBrowseNewMapTemplateFileButton";
this.GeneralBrowseNewMapTemplateFileButton.UseVisualStyleBackColor = true;
this.GeneralBrowseNewMapTemplateFileButton.Click += new System.EventHandler(this.GeneralBrowseNewMapTemplateFileButton_Click);
//
// addAreaLayerCheckBox
// GeneralNewMapTemplateFilenameTextBox
//
resources.ApplyResources(this.addAreaLayerCheckBox, "addAreaLayerCheckBox");
this.addAreaLayerCheckBox.Name = "addAreaLayerCheckBox";
this.addAreaLayerCheckBox.UseVisualStyleBackColor = true;
//
// addRulerLayerCheckBox
//
resources.ApplyResources(this.addRulerLayerCheckBox, "addRulerLayerCheckBox");
this.addRulerLayerCheckBox.Name = "addRulerLayerCheckBox";
this.addRulerLayerCheckBox.UseVisualStyleBackColor = true;
//
// addTextLayerCheckBox
//
resources.ApplyResources(this.addTextLayerCheckBox, "addTextLayerCheckBox");
this.addTextLayerCheckBox.Name = "addTextLayerCheckBox";
this.addTextLayerCheckBox.UseVisualStyleBackColor = true;
//
// showComboBox
//
this.showComboBox.FormattingEnabled = true;
resources.ApplyResources(this.showComboBox, "showComboBox");
this.showComboBox.Name = "showComboBox";
//
// lugComboBox
//
this.lugComboBox.FormattingEnabled = true;
resources.ApplyResources(this.lugComboBox, "lugComboBox");
this.lugComboBox.Name = "lugComboBox";
//
// label7
//
resources.ApplyResources(this.label7, "label7");
this.label7.Name = "label7";
//
// label6
//
resources.ApplyResources(this.label6, "label6");
this.label6.Name = "label6";
//
// label5
//
resources.ApplyResources(this.label5, "label5");
this.label5.Name = "label5";
//
// addBrickLayerCheckBox
//
resources.ApplyResources(this.addBrickLayerCheckBox, "addBrickLayerCheckBox");
this.addBrickLayerCheckBox.Checked = true;
this.addBrickLayerCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.addBrickLayerCheckBox.Name = "addBrickLayerCheckBox";
this.addBrickLayerCheckBox.UseVisualStyleBackColor = true;
//
// addGridLayerCheckBox
//
resources.ApplyResources(this.addGridLayerCheckBox, "addGridLayerCheckBox");
this.addGridLayerCheckBox.Checked = true;
this.addGridLayerCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.addGridLayerCheckBox.Name = "addGridLayerCheckBox";
this.addGridLayerCheckBox.UseVisualStyleBackColor = true;
this.GeneralNewMapTemplateFilenameTextBox.Cursor = System.Windows.Forms.Cursors.Default;
resources.ApplyResources(this.GeneralNewMapTemplateFilenameTextBox, "GeneralNewMapTemplateFilenameTextBox");
this.GeneralNewMapTemplateFilenameTextBox.Name = "GeneralNewMapTemplateFilenameTextBox";
this.GeneralNewMapTemplateFilenameTextBox.ReadOnly = true;
this.GeneralNewMapTemplateFilenameTextBox.TabStop = false;
//
// groupBox1
//
@@ -534,7 +465,6 @@ namespace BlueBrick
this.languageComboBox.FormattingEnabled = true;
resources.ApplyResources(this.languageComboBox, "languageComboBox");
this.languageComboBox.Name = "languageComboBox";
this.languageComboBox.SelectedIndexChanged += new System.EventHandler(this.languageComboBox_SelectedIndexChanged);
//
// editionTabPage
//
@@ -1109,6 +1039,16 @@ namespace BlueBrick
this.groupBox5.Name = "groupBox5";
this.groupBox5.TabStop = false;
//
// label45
//
resources.ApplyResources(this.label45, "label45");
this.label45.Name = "label45";
//
// label44
//
resources.ApplyResources(this.label44, "label44");
this.label44.Name = "label44";
//
// otherHullThicknessNumericUpDown
//
resources.ApplyResources(this.otherHullThicknessNumericUpDown, "otherHullThicknessNumericUpDown");
@@ -1767,16 +1707,6 @@ namespace BlueBrick
this.restoreTabDefaultButton.UseVisualStyleBackColor = true;
this.restoreTabDefaultButton.Click += new System.EventHandler(this.restoreTabDefaultButton_Click);
//
// label44
//
resources.ApplyResources(this.label44, "label44");
this.label44.Name = "label44";
//
// label45
//
resources.ApplyResources(this.label45, "label45");
this.label45.Name = "label45";
//
// PreferencesForm
//
this.AcceptButton = this.okButton;
@@ -1871,12 +1801,6 @@ namespace BlueBrick
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox addBrickLayerCheckBox;
private System.Windows.Forms.CheckBox addGridLayerCheckBox;
private System.Windows.Forms.TextBox authorTextBox;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.NumericUpDown undoRecordedNumericUpDown;
@@ -1909,7 +1833,6 @@ namespace BlueBrick
private System.Windows.Forms.NumericUpDown gridSubdivisionNumericUpDown;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.NumericUpDown gridSizeNumericUpDown;
private System.Windows.Forms.ComboBox lugComboBox;
private System.Windows.Forms.GroupBox groupBox9;
private System.Windows.Forms.Label label27;
private System.Windows.Forms.NumericUpDown areaCellSizeNumericUpDown;
@@ -1941,7 +1864,6 @@ namespace BlueBrick
private System.Windows.Forms.NumericUpDown GammaForSelectionNumericUpDown;
private System.Windows.Forms.Label label25;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.ComboBox showComboBox;
private System.Windows.Forms.TabPage partLibTabPage;
private System.Windows.Forms.GroupBox groupBox11;
private System.Windows.Forms.Button MoveUpButton;
@@ -1976,9 +1898,6 @@ namespace BlueBrick
private System.Windows.Forms.Label label3;
private System.Windows.Forms.NumericUpDown mouseZoomSpeedNumericUpDown;
private System.Windows.Forms.GroupBox groupBox14;
private System.Windows.Forms.CheckBox addAreaLayerCheckBox;
private System.Windows.Forms.CheckBox addRulerLayerCheckBox;
private System.Windows.Forms.CheckBox addTextLayerCheckBox;
private System.Windows.Forms.GroupBox groupBox15;
private System.Windows.Forms.Label label31;
private System.Windows.Forms.NumericUpDown rulerControlPointRadiusNumericUpDown;
@@ -2028,5 +1947,7 @@ namespace BlueBrick
private System.Windows.Forms.PictureBox brickHullColorPictureBox;
private System.Windows.Forms.Label label45;
private System.Windows.Forms.Label label44;
private System.Windows.Forms.Button GeneralBrowseNewMapTemplateFileButton;
private System.Windows.Forms.TextBox GeneralNewMapTemplateFilenameTextBox;
}
}

View File

@@ -48,11 +48,6 @@ namespace BlueBrick
// save the old value of the setting to restore the old value after a click on "Reset Default Settings" + "Cancel"
private Settings mOldSettings = new Settings();
// save the default string in the old language
private string mLastDefaultAuthor = Resources.DefaultAuthor;
private string mLastDefaultLUG = Resources.DefaultLUG;
private string mLastDefaultShow = Resources.DefaultShow;
// a flag to check if the user changed the part lib order
private bool mHasPartLibOrderChanged = false;
@@ -118,30 +113,6 @@ namespace BlueBrick
}
}
/// <summary>
/// A util function to fill a combobox with text that is read from a text file.
/// The format of the text file is simple: every line in the text file will create an entry in the combo box
/// This is used to fill the LUG and Event combo box
/// </summary>
/// <param name="comboBoxToFill">The combobox you want to fill</param>
/// <param name="sourceDataFileName">The text file you want to read the data from</param>
public static void sFillComboBoxFromTextFile(ComboBox comboBoxToFill, string sourceDataFileName)
{
try
{
string sourceDataFullFileName = Application.StartupPath + sourceDataFileName;
System.IO.StreamReader textReader = new System.IO.StreamReader(sourceDataFullFileName);
comboBoxToFill.Items.Clear();
comboBoxToFill.Sorted = true;
while (!textReader.EndOfStream)
comboBoxToFill.Items.Add(textReader.ReadLine());
textReader.Close();
}
catch
{
}
}
public PreferencesForm()
{
InitializeComponent();
@@ -159,26 +130,8 @@ namespace BlueBrick
{
// language
fillAndSelectLanguageComboBox();
// new map
sFillComboBoxFromTextFile(this.lugComboBox, @"/config/LugList.txt");
sFillComboBoxFromTextFile(this.showComboBox, @"/config/EventList.txt");
this.addGridLayerCheckBox.Checked = Settings.Default.AddGridLayerOnNewMap;
this.addBrickLayerCheckBox.Checked = Settings.Default.AddBrickLayerOnNewMap;
this.addAreaLayerCheckBox.Checked = Settings.Default.AddAreaLayerOnNewMap;
this.addTextLayerCheckBox.Checked = Settings.Default.AddTextLayerOnNewMap;
this.addRulerLayerCheckBox.Checked = Settings.Default.AddRulerLayerOnNewMap;
if (Settings.Default.DefaultAuthor.Equals("***NotInitialized***"))
this.authorTextBox.Text = Resources.DefaultAuthor;
else
this.authorTextBox.Text = Settings.Default.DefaultAuthor;
if (Settings.Default.DefaultLUG.Equals("***NotInitialized***"))
this.lugComboBox.Text = Resources.DefaultLUG;
else
this.lugComboBox.Text = Settings.Default.DefaultLUG;
if (Settings.Default.DefaultShow.Equals("***NotInitialized***"))
this.showComboBox.Text = Resources.DefaultShow;
else
this.showComboBox.Text = Settings.Default.DefaultShow;
// new map template
// recent files
this.RecentFilesNumericUpDown.Value = Settings.Default.MaxRecentFilesNum;
this.clearRecentFilesButton.Enabled = (Settings.Default.RecentFiles.Count > 0);
@@ -318,15 +271,8 @@ namespace BlueBrick
{
// language
destination.Language = source.Language.Clone() as string;
// map
destination.AddBrickLayerOnNewMap = source.AddBrickLayerOnNewMap;
destination.AddGridLayerOnNewMap = source.AddGridLayerOnNewMap;
destination.AddAreaLayerOnNewMap = source.AddAreaLayerOnNewMap;
destination.AddTextLayerOnNewMap = source.AddTextLayerOnNewMap;
destination.AddRulerLayerOnNewMap = source.AddRulerLayerOnNewMap;
destination.DefaultAuthor = source.DefaultAuthor.Clone() as string;
destination.DefaultLUG = source.DefaultLUG.Clone() as string;
destination.DefaultShow = source.DefaultShow.Clone() as string;
// new map template
// performance
destination.StartSavedMipmapLevel = source.StartSavedMipmapLevel;
// recent files
@@ -430,15 +376,8 @@ namespace BlueBrick
bool hasLanguageChanged = setLanguageSettingAccordingToComboBox();
// if the language change, we need to restart the application
mDoesNeedToRestart = hasLanguageChanged;
// new map
Settings.Default.AddGridLayerOnNewMap = this.addGridLayerCheckBox.Checked;
Settings.Default.AddBrickLayerOnNewMap = this.addBrickLayerCheckBox.Checked;
Settings.Default.AddAreaLayerOnNewMap = this.addAreaLayerCheckBox.Checked;
Settings.Default.AddTextLayerOnNewMap = this.addTextLayerCheckBox.Checked;
Settings.Default.AddRulerLayerOnNewMap = this.addRulerLayerCheckBox.Checked;
Settings.Default.DefaultAuthor = this.authorTextBox.Text;
Settings.Default.DefaultLUG = this.lugComboBox.Text;
Settings.Default.DefaultShow = this.showComboBox.Text;
// new map template
// recent files
Settings.Default.MaxRecentFilesNum = (int)this.RecentFilesNumericUpDown.Value;
// undo
@@ -729,6 +668,78 @@ namespace BlueBrick
languageComboBox.SelectedIndex = selectedIndex;
}
private void GeneralBrowseNewMapTemplateFileButton_Click(object sender, EventArgs e)
{
}
private void clearRecentFilesButton_Click(object sender, EventArgs e)
{
Settings.Default.RecentFiles.Clear();
this.clearRecentFilesButton.Enabled = false;
}
private bool setOptimSettingAccordingToComboBox()
{
Settings.Default.StartSavedMipmapLevel = optimComboBox.SelectedIndex;
return (mOldSettings.StartSavedMipmapLevel != Settings.Default.StartSavedMipmapLevel);
}
#endregion
#region edition
private void lineColorPictureBox_Click(object sender, EventArgs e)
{
// set the color with the current back color of the picture box
this.colorDialog.Color = lineColorPictureBox.BackColor;
// open the color box in modal
DialogResult result = this.colorDialog.ShowDialog(this);
if (result == DialogResult.OK)
{
// if the user choose a color, set it back in the back color of the picture box
this.lineColorPictureBox.BackColor = this.colorDialog.Color;
}
}
private void guidelineColorPictureBox_Click(object sender, EventArgs e)
{
// set the color with the current back color of the picture box
this.colorDialog.Color = guidelineColorPictureBox.BackColor;
// open the color box in modal
DialogResult result = this.colorDialog.ShowDialog(this);
if (result == DialogResult.OK)
{
// if the user choose a color, set it back in the back color of the picture box
this.guidelineColorPictureBox.BackColor = this.colorDialog.Color;
}
}
private void rulerFontColorPictureBox_Click(object sender, EventArgs e)
{
// set the color with the current back color of the picture box
this.colorDialog.Color = rulerFontColorPictureBox.BackColor;
// open the color box in modal
DialogResult result = this.colorDialog.ShowDialog(this);
if (result == DialogResult.OK)
{
// if the user choose a color, set it back in the back color of the picture box
this.rulerFontColorPictureBox.BackColor = this.colorDialog.Color;
this.rulerFontNameLabel.ForeColor = this.colorDialog.Color;
}
}
private void rulerFontButton_Click(object sender, EventArgs e)
{
// set the color with the current back color of the picture box
this.fontDialog.Font = this.rulerFontNameLabel.Font;
// open the color box in modal
DialogResult result = this.fontDialog.ShowDialog(this);
if (result == DialogResult.OK)
{
// if the user choose a color, set it back in the back color of the picture box
updateChosenFont(this.rulerFontNameLabel, this.rulerFontColorPictureBox.BackColor, this.fontDialog.Font);
}
}
private void setMultipleAndDuplicateSelectionKeySettingAccordingToComboBox()
{
// Multiple selection
@@ -756,35 +767,6 @@ namespace BlueBrick
}
}
private void languageComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
// get the new language
string newLanguage = getLanguageStringAccordingToComboBox();
// change the culture of the resource to get the string in the correct language
// create a new culture info based on the property
System.Globalization.CultureInfo previousCultureInfo = Resources.Culture;
Resources.Culture = new System.Globalization.CultureInfo(newLanguage);
// check if we need to replace the default string of the old language with the
// default string of the new language
if (this.authorTextBox.Text.Equals(mLastDefaultAuthor))
{
this.authorTextBox.Text = Resources.DefaultAuthor;
mLastDefaultAuthor = Resources.DefaultAuthor;
}
if (this.lugComboBox.Text.Equals(mLastDefaultLUG))
{
this.lugComboBox.Text = Resources.DefaultLUG;
mLastDefaultLUG = Resources.DefaultLUG;
}
if (this.showComboBox.Text.Equals(mLastDefaultShow))
{
this.showComboBox.Text = Resources.DefaultShow;
mLastDefaultShow = Resources.DefaultShow;
}
// and restore the previous culture (to avoid partially translated software before the restart)
Resources.Culture = previousCultureInfo;
}
/// <summary>
/// Return the third value among {0, 1, 2} which is not one of the two specified
/// </summary>
@@ -859,73 +841,6 @@ namespace BlueBrick
this.pasteOffsetValueNumericUpDown.Enabled = enableOffsetValue;
this.OffsetValueLabel.Enabled = enableOffsetValue;
}
private bool setOptimSettingAccordingToComboBox()
{
Settings.Default.StartSavedMipmapLevel = optimComboBox.SelectedIndex;
return (mOldSettings.StartSavedMipmapLevel != Settings.Default.StartSavedMipmapLevel);
}
private void clearRecentFilesButton_Click(object sender, EventArgs e)
{
Settings.Default.RecentFiles.Clear();
this.clearRecentFilesButton.Enabled = false;
}
#endregion
#region edition
private void lineColorPictureBox_Click(object sender, EventArgs e)
{
// set the color with the current back color of the picture box
this.colorDialog.Color = lineColorPictureBox.BackColor;
// open the color box in modal
DialogResult result = this.colorDialog.ShowDialog(this);
if (result == DialogResult.OK)
{
// if the user choose a color, set it back in the back color of the picture box
this.lineColorPictureBox.BackColor = this.colorDialog.Color;
}
}
private void guidelineColorPictureBox_Click(object sender, EventArgs e)
{
// set the color with the current back color of the picture box
this.colorDialog.Color = guidelineColorPictureBox.BackColor;
// open the color box in modal
DialogResult result = this.colorDialog.ShowDialog(this);
if (result == DialogResult.OK)
{
// if the user choose a color, set it back in the back color of the picture box
this.guidelineColorPictureBox.BackColor = this.colorDialog.Color;
}
}
private void rulerFontColorPictureBox_Click(object sender, EventArgs e)
{
// set the color with the current back color of the picture box
this.colorDialog.Color = rulerFontColorPictureBox.BackColor;
// open the color box in modal
DialogResult result = this.colorDialog.ShowDialog(this);
if (result == DialogResult.OK)
{
// if the user choose a color, set it back in the back color of the picture box
this.rulerFontColorPictureBox.BackColor = this.colorDialog.Color;
this.rulerFontNameLabel.ForeColor = this.colorDialog.Color;
}
}
private void rulerFontButton_Click(object sender, EventArgs e)
{
// set the color with the current back color of the picture box
this.fontDialog.Font = this.rulerFontNameLabel.Font;
// open the color box in modal
DialogResult result = this.fontDialog.ShowDialog(this);
if (result == DialogResult.OK)
{
// if the user choose a color, set it back in the back color of the picture box
updateChosenFont(this.rulerFontNameLabel, this.rulerFontColorPictureBox.BackColor, this.fontDialog.Font);
}
}
#endregion
#region tab appearance

File diff suppressed because it is too large Load Diff

View File

@@ -59,30 +59,6 @@ namespace BlueBrick.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool AddGridLayerOnNewMap {
get {
return ((bool)(this["AddGridLayerOnNewMap"]));
}
set {
this["AddGridLayerOnNewMap"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool AddBrickLayerOnNewMap {
get {
return ((bool)(this["AddBrickLayerOnNewMap"]));
}
set {
this["AddBrickLayerOnNewMap"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("50")]
@@ -155,42 +131,6 @@ namespace BlueBrick.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("***NotInitialized***")]
public string DefaultLUG {
get {
return ((string)(this["DefaultLUG"]));
}
set {
this["DefaultLUG"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("***NotInitialized***")]
public string DefaultShow {
get {
return ((string)(this["DefaultShow"]));
}
set {
this["DefaultShow"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("***NotInitialized***")]
public string DefaultAuthor {
get {
return ((string)(this["DefaultAuthor"]));
}
set {
this["DefaultAuthor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("10")]
@@ -792,42 +732,6 @@ namespace BlueBrick.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool AddTextLayerOnNewMap {
get {
return ((bool)(this["AddTextLayerOnNewMap"]));
}
set {
this["AddTextLayerOnNewMap"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool AddAreaLayerOnNewMap {
get {
return ((bool)(this["AddAreaLayerOnNewMap"]));
}
set {
this["AddAreaLayerOnNewMap"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool AddRulerLayerOnNewMap {
get {
return ((bool)(this["AddRulerLayerOnNewMap"]));
}
set {
this["AddRulerLayerOnNewMap"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("8")]

View File

@@ -11,12 +11,6 @@
<Setting Name="WheelMouseIsZoomOnCursor" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AddGridLayerOnNewMap" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AddBrickLayerOnNewMap" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="UndoStackDepth" Type="System.Int32" Scope="User">
<Value Profile="(Default)">50</Value>
</Setting>
@@ -35,15 +29,6 @@
<Setting Name="DefaultSubGridColor" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">LightGray</Value>
</Setting>
<Setting Name="DefaultLUG" Type="System.String" Scope="User">
<Value Profile="(Default)">***NotInitialized***</Value>
</Setting>
<Setting Name="DefaultShow" Type="System.String" Scope="User">
<Value Profile="(Default)">***NotInitialized***</Value>
</Setting>
<Setting Name="DefaultAuthor" Type="System.String" Scope="User">
<Value Profile="(Default)">***NotInitialized***</Value>
</Setting>
<Setting Name="UndoStackDisplayedDepth" Type="System.Int32" Scope="User">
<Value Profile="(Default)">10</Value>
</Setting>
@@ -232,15 +217,6 @@
<Setting Name="DisplayWarningMessageForNotSavingInBBM" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AddTextLayerOnNewMap" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AddAreaLayerOnNewMap" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AddRulerLayerOnNewMap" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="RulerControlPointRadiusInPixel" Type="System.Int32" Scope="User">
<Value Profile="(Default)">8</Value>
</Setting>

View File

@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
@@ -56,11 +54,8 @@ namespace BlueBrick
{
get
{
// get the default author
if (Properties.Settings.Default.DefaultAuthor.Equals("***NotInitialized***"))
return Properties.Resources.DefaultAuthor;
else
return Properties.Settings.Default.DefaultAuthor;
// return the same Author name as the author of the current map
return Map.Instance.Author;
}
}
#endregion

View File

@@ -16,12 +16,6 @@
<setting name="WheelMouseIsZoomOnCursor" serializeAs="String">
<value>True</value>
</setting>
<setting name="AddGridLayerOnNewMap" serializeAs="String">
<value>True</value>
</setting>
<setting name="AddBrickLayerOnNewMap" serializeAs="String">
<value>True</value>
</setting>
<setting name="UndoStackDepth" serializeAs="String">
<value>50</value>
</setting>
@@ -40,15 +34,6 @@
<setting name="DefaultSubGridColor" serializeAs="String">
<value>LightGray</value>
</setting>
<setting name="DefaultLUG" serializeAs="String">
<value>***NotInitialized***</value>
</setting>
<setting name="DefaultShow" serializeAs="String">
<value>***NotInitialized***</value>
</setting>
<setting name="DefaultAuthor" serializeAs="String">
<value>***NotInitialized***</value>
</setting>
<setting name="UndoStackDisplayedDepth" serializeAs="String">
<value>10</value>
</setting>
@@ -245,15 +230,6 @@
<setting name="DisplayWarningMessageForNotSavingInBBM" serializeAs="String">
<value>True</value>
</setting>
<setting name="AddTextLayerOnNewMap" serializeAs="String">
<value>False</value>
</setting>
<setting name="AddAreaLayerOnNewMap" serializeAs="String">
<value>False</value>
</setting>
<setting name="AddRulerLayerOnNewMap" serializeAs="String">
<value>False</value>
</setting>
<setting name="RulerControlPointRadiusInPixel" serializeAs="String">
<value>8</value>
</setting>

View File

@@ -105,11 +105,10 @@ to open the help file (see above for more details).
-------------------------------------------------------------------------------
Open bugs:
- [target 1.9] MISSING FEATURE (supertruper1988): Add the possibility to create and save a template file that should be loaded when creating a new map:
- Put the standard template in the config folder.
- There will be conflict with the default appearance.
- Should have a default file to load like the default budget to load in the preference?
- The reset to default button in the bottom of the screen, will point again on the file in the config folder
- And we may add some explanation text in the preference window ()
- In preference form, when setting a template file, ask user if appearance properties of the file should be applied to default appearance?
- the default appearance settings must stay, for example if the template doesn't contains grid, then default appearance grid color are still used when creating a grid
- The reset to default button in the bottom of the screen, will clear the template file field
- If no template file is set, then all the default appearance settings are used to create a map (with hard-coded grid + bricks layers for newbies users), otherwise if user wants different layers, he creates a template
- [target 1.9] MISSING FEATURE (Alban): For more flexibility during export, make the Hull display PER layer (it can be a small icon next to the eye icon): necessite une nouvelle version du format BBM
- [target 1.9] BUG (Matthias): The export window doesn't remember the type of the image file exported
- [target 1.9] MISSING FEATURE (Ludo): The export window should propose to export on multiple pages: