diff --git a/I18N Commander/UI WinForms/Components/SectionTree.Designer.cs b/I18N Commander/UI WinForms/Components/SectionTree.Designer.cs
index ebd2639..219fbad 100644
--- a/I18N Commander/UI WinForms/Components/SectionTree.Designer.cs
+++ b/I18N Commander/UI WinForms/Components/SectionTree.Designer.cs
@@ -34,6 +34,7 @@
this.buttonAdd = new System.Windows.Forms.Button();
this.buttonRemove = new System.Windows.Forms.Button();
this.buttonRename = new System.Windows.Forms.Button();
+ this.buttonGenerate = new System.Windows.Forms.Button();
this.treeView = new System.Windows.Forms.TreeView();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.tableLayout.SuspendLayout();
@@ -61,6 +62,7 @@
this.flowLayoutBottom.Controls.Add(this.buttonAdd);
this.flowLayoutBottom.Controls.Add(this.buttonRemove);
this.flowLayoutBottom.Controls.Add(this.buttonRename);
+ this.flowLayoutBottom.Controls.Add(this.buttonGenerate);
this.flowLayoutBottom.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutBottom.Location = new System.Drawing.Point(0, 445);
this.flowLayoutBottom.Margin = new System.Windows.Forms.Padding(0);
@@ -115,6 +117,22 @@
this.buttonRename.UseVisualStyleBackColor = true;
this.buttonRename.Click += new System.EventHandler(this.buttonRename_Click);
//
+ // buttonGenerate
+ //
+ this.buttonGenerate.AutoSize = true;
+ this.buttonGenerate.Enabled = false;
+ this.buttonGenerate.FlatAppearance.BorderSize = 0;
+ this.buttonGenerate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.buttonGenerate.Image = global::UI_WinForms.Resources.Icons.icons8_code_512__2_;
+ this.buttonGenerate.Location = new System.Drawing.Point(201, 3);
+ this.buttonGenerate.Name = "buttonGenerate";
+ this.buttonGenerate.Size = new System.Drawing.Size(60, 60);
+ this.buttonGenerate.TabIndex = 3;
+ this.buttonGenerate.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+ this.toolTip.SetToolTip(this.buttonGenerate, "Triggers all enabled generators");
+ this.buttonGenerate.UseVisualStyleBackColor = true;
+ this.buttonGenerate.Click += new System.EventHandler(this.buttonGenerate_Click);
+ //
// treeView
//
this.treeView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@@ -159,5 +177,6 @@
private TreeView treeView;
private ToolTip toolTip;
private Button buttonRename;
+ private Button buttonGenerate;
}
}
diff --git a/I18N Commander/UI WinForms/Components/SectionTree.cs b/I18N Commander/UI WinForms/Components/SectionTree.cs
index d402363..a62c2f7 100644
--- a/I18N Commander/UI WinForms/Components/SectionTree.cs
+++ b/I18N Commander/UI WinForms/Components/SectionTree.cs
@@ -28,8 +28,23 @@ public partial class SectionTree : UserControl
// Subscribe to the load event:
this.Load += this.LoadNodes;
+ this.Load += (sender, args) => this.SetupGeneratorButton();
}
+ private async void SetupGeneratorButton()
+ {
+ this.buttonGenerate.Enabled = false;
+
+ // Depend the generator button's visibility on the generator settings:
+ this.buttonGenerate.Enabled = await AppSettings.GetGeneratorDotnetEnabled() || await AppSettings.GetGeneratorGodotEnabled();
+
+ // Subscribe to the changed settings event:
+ AppEvents.WhenSettingsChanged += async (sender, args) =>
+ {
+ this.buttonGenerate.Enabled = await AppSettings.GetGeneratorDotnetEnabled() || await AppSettings.GetGeneratorGodotEnabled();
+ };
+ }
+
private async void LoadNodes(object? sender, EventArgs e)
{
if(this.DesignMode)
@@ -277,4 +292,9 @@ public partial class SectionTree : UserControl
selectedNode.Text = alteredSection.Result!.Name;
selectedNode.Name = alteredSection.Result.DataKey; // [sic] name is the key
}
+
+ private void buttonGenerate_Click(object sender, EventArgs e)
+ {
+
+ }
}
\ No newline at end of file
diff --git a/I18N Commander/UI WinForms/Resources/Icons.Designer.cs b/I18N Commander/UI WinForms/Resources/Icons.Designer.cs
index 7a66bfe..cf5126b 100644
--- a/I18N Commander/UI WinForms/Resources/Icons.Designer.cs
+++ b/I18N Commander/UI WinForms/Resources/Icons.Designer.cs
@@ -150,6 +150,16 @@ namespace UI_WinForms.Resources {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap icons8_code_512__2_ {
+ get {
+ object obj = ResourceManager.GetObject("icons8_code_512__2_", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
diff --git a/I18N Commander/UI WinForms/Resources/Icons.resx b/I18N Commander/UI WinForms/Resources/Icons.resx
index 538f121..8e6f5c8 100644
--- a/I18N Commander/UI WinForms/Resources/Icons.resx
+++ b/I18N Commander/UI WinForms/Resources/Icons.resx
@@ -145,6 +145,9 @@
icons8-code-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ icons8-code-512 (2).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
icons8-collectibles-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
diff --git a/I18N Commander/UI WinForms/Resources/icons8-code-512 (2).png b/I18N Commander/UI WinForms/Resources/icons8-code-512 (2).png
new file mode 100644
index 0000000..298896d
Binary files /dev/null and b/I18N Commander/UI WinForms/Resources/icons8-code-512 (2).png differ