Browse Source

Game folder detection and setting(s)

tags/v1.0.0
NorbiPeti 3 years ago
parent
commit
e890c99c16
13 changed files with 4186 additions and 216 deletions
  1. +0
    -30
      GCMM/Form1.cs
  2. +0
    -132
      GCMM/Form1.resx
  3. +18
    -0
      GCMM/GCMM.csproj
  4. +72
    -53
      GCMM/MainForm.Designer.cs
  5. +102
    -0
      GCMM/MainForm.cs
  6. +1882
    -0
      GCMM/MainForm.resx
  7. +1
    -1
      GCMM/Program.cs
  8. +50
    -0
      GCMM/Properties/Settings.Designer.cs
  9. +12
    -0
      GCMM/Properties/Settings.settings
  10. +133
    -0
      GCMM/SettingsForm.Designer.cs
  11. +46
    -0
      GCMM/SettingsForm.cs
  12. +1870
    -0
      GCMM/SettingsForm.resx
  13. BIN
      GCMM/favicon.ico

+ 0
- 30
GCMM/Form1.cs View File

@@ -1,30 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GCMM
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void playbtn_Click(object sender, EventArgs e)
{

}
}
}

+ 0
- 132
GCMM/Form1.resx View File

@@ -1,132 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="modinfobox.Text" xml:space="preserve">
<value>This update is backwards compatible with mods that work with GamecraftModdingAPI v1.0 and later but adds support for Gamecraft's 2020.06.11.18.50 update.

To get started, follow the install guide: https://www.exmods.org/guides/install.html

Changelog
- Added some simulation (time running) functionality
- Added some player hand information
- Improved API to play in-game audio

In other news, we broke the 100 commit mark! The project is 7 months old, so that works out to just under 1 commit every 2 days, which adds about 5KB of code.</value>
</data>
</root>

+ 18
- 0
GCMM/GCMM.csproj View File

@@ -6,4 +6,22 @@
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>

<ItemGroup>
<Compile Update="SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>

</Project>

GCMM/Form1.Designer.cs → GCMM/MainForm.Designer.cs View File

@@ -1,6 +1,6 @@
namespace GCMM
{
partial class Form1
partial class MainForm
{
/// <summary>
/// Required designer variable.
@@ -28,59 +28,60 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Installed", System.Windows.Forms.HorizontalAlignment.Center);
System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Available", System.Windows.Forms.HorizontalAlignment.Left);
System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {
System.Windows.Forms.ListViewGroup listViewGroup9 = new System.Windows.Forms.ListViewGroup("Installed", System.Windows.Forms.HorizontalAlignment.Center);
System.Windows.Forms.ListViewGroup listViewGroup10 = new System.Windows.Forms.ListViewGroup("Available", System.Windows.Forms.HorizontalAlignment.Left);
System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem(new string[] {
"Mod",
"1.0",
"2020.06.15. 2:01:43",
"1.0"}, -1);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.listView1 = new System.Windows.Forms.ListView();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.modlist = new System.Windows.Forms.ListView();
this.modName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.modVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.modTimestamp = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.latestVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.gamestatus = new System.Windows.Forms.Label();
this.status = new System.Windows.Forms.Label();
this.installbtn = new System.Windows.Forms.Button();
this.uninstallbtn = new System.Windows.Forms.Button();
this.modinfobox = new System.Windows.Forms.TextBox();
this.playbtn = new System.Windows.Forms.Button();
this.settingsbtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// listView1
// modlist
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.modlist.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(240)))), ((int)(((byte)(216)))));
this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.modlist.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(240)))), ((int)(((byte)(216)))));
this.modlist.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.modlist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.modName,
this.modVersion,
this.modTimestamp,
this.latestVersion});
this.listView1.ForeColor = System.Drawing.Color.Green;
this.listView1.FullRowSelect = true;
listViewGroup1.Header = "Installed";
listViewGroup1.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Center;
listViewGroup1.Name = "installed";
listViewGroup2.Header = "Available";
listViewGroup2.Name = "available";
this.listView1.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
listViewGroup1,
listViewGroup2});
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listView1.HideSelection = false;
listViewItem1.Group = listViewGroup1;
this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
listViewItem1});
this.listView1.Location = new System.Drawing.Point(12, 12);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(491, 468);
this.listView1.TabIndex = 0;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
this.modlist.ForeColor = System.Drawing.Color.Green;
this.modlist.FullRowSelect = true;
listViewGroup9.Header = "Installed";
listViewGroup9.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Center;
listViewGroup9.Name = "installed";
listViewGroup10.Header = "Available";
listViewGroup10.Name = "available";
this.modlist.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
listViewGroup9,
listViewGroup10});
this.modlist.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.modlist.HideSelection = false;
listViewItem5.Group = listViewGroup9;
this.modlist.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
listViewItem5});
this.modlist.Location = new System.Drawing.Point(12, 12);
this.modlist.Name = "modlist";
this.modlist.Size = new System.Drawing.Size(491, 468);
this.modlist.TabIndex = 0;
this.modlist.UseCompatibleStateImageBehavior = false;
this.modlist.View = System.Windows.Forms.View.Details;
//
// modName
//
@@ -102,18 +103,18 @@
this.latestVersion.Text = "Latest";
this.latestVersion.Width = 86;
//
// gamestatus
// status
//
this.gamestatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.gamestatus.AutoSize = true;
this.gamestatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.gamestatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.gamestatus.ForeColor = System.Drawing.Color.Lime;
this.gamestatus.Location = new System.Drawing.Point(8, 487);
this.gamestatus.Name = "gamestatus";
this.gamestatus.Size = new System.Drawing.Size(105, 20);
this.gamestatus.TabIndex = 1;
this.gamestatus.Text = "Game status:";
this.status.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.status.AutoSize = true;
this.status.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.status.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.status.ForeColor = System.Drawing.Color.Lime;
this.status.Location = new System.Drawing.Point(8, 487);
this.status.Name = "status";
this.status.Size = new System.Drawing.Size(60, 20);
this.status.TabIndex = 1;
this.status.Text = "Status:";
//
// installbtn
//
@@ -161,8 +162,9 @@
//
// playbtn
//
this.playbtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.playbtn.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.playbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.playbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0)))));
this.playbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.playbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.playbtn.Location = new System.Drawing.Point(250, 487);
@@ -173,21 +175,37 @@
this.playbtn.UseVisualStyleBackColor = true;
this.playbtn.Click += new System.EventHandler(this.playbtn_Click);
//
// Form1
// settingsbtn
//
this.settingsbtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.settingsbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.settingsbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0)))));
this.settingsbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.settingsbtn.Location = new System.Drawing.Point(667, 487);
this.settingsbtn.Name = "settingsbtn";
this.settingsbtn.Size = new System.Drawing.Size(105, 29);
this.settingsbtn.TabIndex = 6;
this.settingsbtn.Text = "Settings";
this.settingsbtn.UseVisualStyleBackColor = true;
this.settingsbtn.Click += new System.EventHandler(this.settingsbtn_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(784, 561);
this.Controls.Add(this.settingsbtn);
this.Controls.Add(this.playbtn);
this.Controls.Add(this.modinfobox);
this.Controls.Add(this.uninstallbtn);
this.Controls.Add(this.installbtn);
this.Controls.Add(this.gamestatus);
this.Controls.Add(this.listView1);
this.Controls.Add(this.status);
this.Controls.Add(this.modlist);
this.ForeColor = System.Drawing.Color.Lime;
this.Name = "Form1";
this.Text = "Form1";
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Text = "Gamecraft Mod Manager";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
@@ -196,16 +214,17 @@

#endregion

private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ListView modlist;
private System.Windows.Forms.ColumnHeader modName;
private System.Windows.Forms.ColumnHeader modVersion;
private System.Windows.Forms.ColumnHeader modTimestamp;
private System.Windows.Forms.ColumnHeader latestVersion;
private System.Windows.Forms.Label gamestatus;
private System.Windows.Forms.Label status;
private System.Windows.Forms.Button installbtn;
private System.Windows.Forms.Button uninstallbtn;
private System.Windows.Forms.TextBox modinfobox;
private System.Windows.Forms.Button playbtn;
private System.Windows.Forms.Button settingsbtn;
}
}


+ 102
- 0
GCMM/MainForm.cs View File

@@ -0,0 +1,102 @@
using GCMM.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GCMM
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
modlist.Items.Clear();
UpdateButton(installbtn, false);
modinfobox.Text = "";
if (string.IsNullOrWhiteSpace(Settings.Default.GamePath))
{
Settings.Default.GamePath = GetGameFolder();
if (string.IsNullOrWhiteSpace(Settings.Default.GamePath))
Settings.Default.GamePath = SelectGameFolder();
else
MessageBox.Show("Found game at " + Settings.Default.GamePath);
Settings.Default.Save();
}
}

public void UpdateButton(Button button, bool enabled)
{
if (enabled)
{
button.ForeColor = Color.Lime;
button.FlatAppearance.MouseOverBackColor = Color.FromArgb(0, 40, 0);
button.FlatAppearance.MouseDownBackColor = Color.Green;
}
else
{
button.ForeColor = Color.Green;
button.FlatAppearance.MouseOverBackColor = Color.Black;
button.FlatAppearance.MouseDownBackColor = Color.Black;
}
}

public string GetGameFolder()
{
string libs;
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
libs = @"C:\Program Files (x86)\Steam\steamapps\libraryfolders.vdf";
else
return null;
foreach (var line in File.ReadAllLines(libs).Concat(new[] { @"C:\Program Files (x86)\Steam\" }))
{
var regex = new Regex("\\t\"\\d+\"\\t\\t\"(.+)\"");
var match = regex.Match(line);
if (!match.Success)
continue;
string library = match.Groups[1].Value.Replace("\\\\", "\\");
library += @"\steamapps\common\";
if (File.Exists(library + @"Gamecraft\Gamecraft.exe"))
return library + "Gamecraft";
if (File.Exists(library + @"RobocraftX\Gamecraft.exe"))
return library + "RobocraftX";
}
return libs;
}

public string SelectGameFolder()
{
var ofd = new OpenFileDialog();
ofd.Filter = "Gamecraft executable|Gamecraft.exe";
ofd.Title = "Game location";
ofd.InitialDirectory = @"C:\Program Files (x86)\Steam\steamapps\common\";
ofd.CheckFileExists = true;
ofd.ShowDialog();
if (string.IsNullOrWhiteSpace(ofd.FileName))
return null;
return Directory.GetParent(ofd.FileName).FullName;
}

private void playbtn_Click(object sender, EventArgs e)
{

}

private void settingsbtn_Click(object sender, EventArgs e)
{
var sf = new SettingsForm();
sf.ShowDialog(this);
}
}
}

+ 1882
- 0
GCMM/MainForm.resx
File diff suppressed because it is too large
View File


+ 1
- 1
GCMM/Program.cs View File

@@ -17,7 +17,7 @@ namespace GCMM
//Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new MainForm());
}
}
}

+ 50
- 0
GCMM/Properties/Settings.Designer.cs View File

@@ -0,0 +1,50 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace GCMM.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string GamePath {
get {
return ((string)(this["GamePath"]));
}
set {
this["GamePath"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string WinePath {
get {
return ((string)(this["WinePath"]));
}
set {
this["WinePath"] = value;
}
}
}
}

+ 12
- 0
GCMM/Properties/Settings.settings View File

@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="GCMM.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="GamePath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="WinePath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

+ 133
- 0
GCMM/SettingsForm.Designer.cs View File

@@ -0,0 +1,133 @@
namespace GCMM
{
partial class SettingsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm));
this.label1 = new System.Windows.Forms.Label();
this.gamelocation = new System.Windows.Forms.TextBox();
this.browsebtn = new System.Windows.Forms.Button();
this.savebtn = new System.Windows.Forms.Button();
this.cancelbtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(12, 15);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(116, 20);
this.label1.TabIndex = 0;
this.label1.Text = "Game location:";
//
// gamelocation
//
this.gamelocation.Location = new System.Drawing.Point(135, 15);
this.gamelocation.Name = "gamelocation";
this.gamelocation.Size = new System.Drawing.Size(210, 20);
this.gamelocation.TabIndex = 1;
//
// browsebtn
//
this.browsebtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.browsebtn.Location = new System.Drawing.Point(352, 12);
this.browsebtn.Name = "browsebtn";
this.browsebtn.Size = new System.Drawing.Size(75, 23);
this.browsebtn.TabIndex = 2;
this.browsebtn.Text = "Browse";
this.browsebtn.UseVisualStyleBackColor = true;
this.browsebtn.Click += new System.EventHandler(this.browsebtn_Click);
//
// savebtn
//
this.savebtn.DialogResult = System.Windows.Forms.DialogResult.OK;
this.savebtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.savebtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0)))));
this.savebtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.savebtn.Location = new System.Drawing.Point(271, 74);
this.savebtn.Name = "savebtn";
this.savebtn.Size = new System.Drawing.Size(75, 23);
this.savebtn.TabIndex = 3;
this.savebtn.Text = "Save";
this.savebtn.UseVisualStyleBackColor = true;
this.savebtn.Click += new System.EventHandler(this.savebtn_Click);
//
// cancelbtn
//
this.cancelbtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.cancelbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0)))));
this.cancelbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cancelbtn.Location = new System.Drawing.Point(352, 74);
this.cancelbtn.Name = "cancelbtn";
this.cancelbtn.Size = new System.Drawing.Size(75, 23);
this.cancelbtn.TabIndex = 4;
this.cancelbtn.Text = "Cancel";
this.cancelbtn.UseVisualStyleBackColor = true;
this.cancelbtn.Click += new System.EventHandler(this.cancelbtn_Click);
//
// SettingsForm
//
this.AcceptButton = this.savebtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.CancelButton = this.cancelbtn;
this.ClientSize = new System.Drawing.Size(439, 109);
this.Controls.Add(this.cancelbtn);
this.Controls.Add(this.savebtn);
this.Controls.Add(this.browsebtn);
this.Controls.Add(this.gamelocation);
this.Controls.Add(this.label1);
this.ForeColor = System.Drawing.Color.Lime;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Settings";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox gamelocation;
private System.Windows.Forms.Button browsebtn;
private System.Windows.Forms.Button savebtn;
private System.Windows.Forms.Button cancelbtn;
}
}


+ 46
- 0
GCMM/SettingsForm.cs View File

@@ -0,0 +1,46 @@
using GCMM.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GCMM
{
public partial class SettingsForm : Form
{
private MainForm mainForm;
public SettingsForm()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
gamelocation.Text = Settings.Default.GamePath;
mainForm = Owner as MainForm;
}

private void browsebtn_Click(object sender, EventArgs e)
{
gamelocation.Text = mainForm.SelectGameFolder() ?? gamelocation.Text;
}

private void savebtn_Click(object sender, EventArgs e)
{
Settings.Default.GamePath = gamelocation.Text;
Close();
}

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

+ 1870
- 0
GCMM/SettingsForm.resx
File diff suppressed because it is too large
View File


BIN
GCMM/favicon.ico View File

Before After

Loading…
Cancel
Save