Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#332 #353

Merged
merged 3 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 143 additions & 143 deletions xcom2-launcher/xcom2-launcher/Forms/AboutBox.Designer.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions xcom2-launcher/xcom2-launcher/Forms/AboutBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ partial class AboutBox : Form
public AboutBox()
{
InitializeComponent();
CancelButton = okButton;
}

private void AboutBox_Load(object sender, EventArgs e)
Expand Down
3 changes: 2 additions & 1 deletion xcom2-launcher/xcom2-launcher/Forms/CategoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public partial class CategoryManager : Form
public CategoryManager(Settings settings)
{
InitializeComponent();


CancelButton = bClose;
Settings = settings;

foreach (var cat in settings.Mods.CategoryNames)
Expand Down
370 changes: 192 additions & 178 deletions xcom2-launcher/xcom2-launcher/Forms/CleanModsForm.Designer.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions xcom2-launcher/xcom2-launcher/Forms/CleanModsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public CleanModsForm(Settings settings)
{
InitializeComponent();

//
CancelButton = bClose;
Mods = settings.Mods;

// todo save cleaning settings?
// Register Events
button1.Click += onStartButtonClicked;
bStart.Click += onStartButtonClicked;
}

private ModList Mods { get; }
Expand Down
437 changes: 219 additions & 218 deletions xcom2-launcher/xcom2-launcher/Forms/ConfigDiff.Designer.cs

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions xcom2-launcher/xcom2-launcher/Forms/ConfigDiff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static ConfigDiff Instance
public ConfigDiff()
{
InitializeComponent();
CancelButton = bClose;
}

public void CompareStrings(string s1, string s2)
Expand Down Expand Up @@ -90,11 +91,6 @@ private void BeginUpdate()
_updating++;
}

private void btCompare_Click(object sender, EventArgs e)
{
Compare();
}

private void Compare()
{
fctb1.Clear();
Expand Down Expand Up @@ -144,11 +140,16 @@ private void fctb_TextChanged(object sender, TextChangedEventArgs e)
{
IniLanguage.Process(e);
}

private void bClose_Click(object sender, EventArgs e)
{
Close();
}
}

#region Merge stuffs
#region Merge stuffs

namespace DiffMergeStuffs
namespace DiffMergeStuffs
{
public class SimpleDiff<T>
{
Expand Down
16 changes: 10 additions & 6 deletions xcom2-launcher/xcom2-launcher/Forms/MainForm.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ internal void RegisterEvents()
editOptionsToolStripMenuItem.Click += delegate
{
Log.Info("Menu->Options->Settings");
var dialog = new SettingsDialog(Settings);
using var dialog = new SettingsDialog(Settings);

if (dialog.ShowDialog() == DialogResult.OK)
{
Expand Down Expand Up @@ -234,7 +234,11 @@ internal void RegisterEvents()
#region Menu->Tools

// -> Tools
cleanModsToolStripMenuItem.Click += delegate { new CleanModsForm(Settings).ShowDialog(); };
cleanModsToolStripMenuItem.Click += delegate
{
using var dlg = new CleanModsForm(Settings);
dlg.ShowDialog();
};

importFromXCOM2ToolStripMenuItem.Click += delegate
{
Expand Down Expand Up @@ -289,7 +293,7 @@ internal void RegisterEvents()
infoToolStripMenuItem.Click += delegate
{
Log.Info("Menu->About->About");
AboutBox about = new AboutBox();
using var about = new AboutBox();
about.ShowDialog();
};

Expand Down Expand Up @@ -356,7 +360,7 @@ private void ManageCategoriesToolStripMenuItem_Click(object sender, EventArgs e)
{
Log.Info("Menu->Options->Categories");

CategoryManager catManager = new CategoryManager(Settings);
using var catManager = new CategoryManager(Settings);
var result = catManager.ShowDialog();

if (result == DialogResult.OK)
Expand Down Expand Up @@ -459,7 +463,7 @@ private void ExportCheckboxCheckedChanged(object sender, EventArgs e)

private void ExportLoadButtonClick(object sender, EventArgs e)
{
var dialog = new OpenFileDialog
using var dialog = new OpenFileDialog
{
Filter = "Text files|*.txt",
DefaultExt = "txt",
Expand Down Expand Up @@ -608,7 +612,7 @@ private void ExportLoadButtonClick(object sender, EventArgs e)

private void ExportSaveButtonClick(object sender, EventArgs eventArgs)
{
var dialog = new SaveFileDialog
using var dialog = new SaveFileDialog
{
Filter = "Text files|*.txt",
DefaultExt = "txt",
Expand Down
2 changes: 1 addition & 1 deletion xcom2-launcher/xcom2-launcher/Forms/MainForm.ModList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ private ContextMenuStrip CreateModListContextMenu(ModEntry m, ModTag tag)

editColor.Click += (sender, e) =>
{
var colorPicker = new ColorDialog
using var colorPicker = new ColorDialog
{
AllowFullOpen = true,
Color = tag.Color,
Expand Down
2 changes: 0 additions & 2 deletions xcom2-launcher/xcom2-launcher/Forms/MainForm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
Expand All @@ -13,7 +12,6 @@
using XCOM2Launcher.XCOM;
using JR.Utils.GUI.Forms;
using XCOM2Launcher.Classes.Mod;
using XCOM2Launcher.Steam;

namespace XCOM2Launcher.Forms
{
Expand Down
Loading