Remove .config file, clean up buttons, bump version

This will remove the .config file that used to be required alongside
BrawlBuilder's exe file. Now instead of relying on the config file to
speicify where BrawlBuilder should look for it's dll files, it is
hardcoded into the application. I did this to clean up the base folder
and prevent confusion for users (mainly users who have file extensions
disabled).

Additionally this will change the 'Custom banner' browse button to not
inherit appearances from the groupbox, which should prevent it from
appearing transparent on some Windows versions/themes.
This commit is contained in:
Mogzol 2016-09-12 20:07:52 -07:00
parent 57bcadef3d
commit d438d8f307
8 changed files with 88 additions and 71 deletions

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Resources"/>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -1,6 +1,4 @@
using BrawlBuilder.Properties;
namespace BrawlBuilder
namespace BrawlBuilder
{
partial class BrawlBuilder
{
@ -41,8 +39,7 @@ namespace BrawlBuilder
this.gctFile_lbl = new System.Windows.Forms.LinkLabel();
this.gctFileBrowse = new System.Windows.Forms.Button();
this.gctFile = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.bannerBrowse = new System.Windows.Forms.Button();
this.extrasBox = new System.Windows.Forms.GroupBox();
this.banner = new System.Windows.Forms.TextBox();
this.gameTitle = new System.Windows.Forms.TextBox();
this.gameID = new System.Windows.Forms.TextBox();
@ -50,11 +47,12 @@ namespace BrawlBuilder
this.cutomTitle = new System.Windows.Forms.CheckBox();
this.customID = new System.Windows.Forms.CheckBox();
this.removeSubspace = new System.Windows.Forms.CheckBox();
this.bannerBrowse = new System.Windows.Forms.Button();
this.build = new System.Windows.Forms.Button();
this.buildWorker = new System.ComponentModel.BackgroundWorker();
this.blinker = new System.ComponentModel.BackgroundWorker();
((System.ComponentModel.ISupportInitialize)(this.exit)).BeginInit();
this.groupBox1.SuspendLayout();
this.extrasBox.SuspendLayout();
this.SuspendLayout();
//
// exit
@ -174,36 +172,23 @@ namespace BrawlBuilder
this.gctFile.Size = new System.Drawing.Size(125, 20);
this.gctFile.TabIndex = 8;
//
// groupBox1
// extrasBox
//
this.groupBox1.BackColor = System.Drawing.Color.Transparent;
this.groupBox1.Controls.Add(this.bannerBrowse);
this.groupBox1.Controls.Add(this.banner);
this.groupBox1.Controls.Add(this.gameTitle);
this.groupBox1.Controls.Add(this.gameID);
this.groupBox1.Controls.Add(this.customBanner);
this.groupBox1.Controls.Add(this.cutomTitle);
this.groupBox1.Controls.Add(this.customID);
this.groupBox1.Controls.Add(this.removeSubspace);
this.groupBox1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.groupBox1.Location = new System.Drawing.Point(12, 325);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(310, 112);
this.groupBox1.TabIndex = 10;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Optional Extras";
//
// bannerBrowse
//
this.bannerBrowse.Enabled = false;
this.bannerBrowse.ForeColor = System.Drawing.SystemColors.ControlText;
this.bannerBrowse.Location = new System.Drawing.Point(227, 85);
this.bannerBrowse.Name = "bannerBrowse";
this.bannerBrowse.Size = new System.Drawing.Size(75, 22);
this.bannerBrowse.TabIndex = 7;
this.bannerBrowse.Text = "Browse...";
this.bannerBrowse.UseVisualStyleBackColor = true;
this.bannerBrowse.Click += new System.EventHandler(this.bannerBrowse_Click);
this.extrasBox.BackColor = System.Drawing.Color.Transparent;
this.extrasBox.Controls.Add(this.banner);
this.extrasBox.Controls.Add(this.gameTitle);
this.extrasBox.Controls.Add(this.gameID);
this.extrasBox.Controls.Add(this.customBanner);
this.extrasBox.Controls.Add(this.cutomTitle);
this.extrasBox.Controls.Add(this.customID);
this.extrasBox.Controls.Add(this.removeSubspace);
this.extrasBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.extrasBox.Location = new System.Drawing.Point(12, 325);
this.extrasBox.Name = "extrasBox";
this.extrasBox.Size = new System.Drawing.Size(310, 112);
this.extrasBox.TabIndex = 10;
this.extrasBox.TabStop = false;
this.extrasBox.Text = "Optional Extras";
//
// banner
//
@ -211,7 +196,7 @@ namespace BrawlBuilder
this.banner.Location = new System.Drawing.Point(121, 86);
this.banner.Name = "banner";
this.banner.Size = new System.Drawing.Size(104, 20);
this.banner.TabIndex = 6;
this.banner.TabIndex = 17;
//
// gameTitle
//
@ -220,7 +205,7 @@ namespace BrawlBuilder
this.gameTitle.MaxLength = 63;
this.gameTitle.Name = "gameTitle";
this.gameTitle.Size = new System.Drawing.Size(181, 20);
this.gameTitle.TabIndex = 4;
this.gameTitle.TabIndex = 15;
//
// gameID
//
@ -229,7 +214,7 @@ namespace BrawlBuilder
this.gameID.MaxLength = 6;
this.gameID.Name = "gameID";
this.gameID.Size = new System.Drawing.Size(73, 20);
this.gameID.TabIndex = 2;
this.gameID.TabIndex = 13;
//
// customBanner
//
@ -237,7 +222,7 @@ namespace BrawlBuilder
this.customBanner.Location = new System.Drawing.Point(6, 88);
this.customBanner.Name = "customBanner";
this.customBanner.Size = new System.Drawing.Size(100, 17);
this.customBanner.TabIndex = 5;
this.customBanner.TabIndex = 16;
this.customBanner.Text = "Custom banner:";
this.customBanner.UseVisualStyleBackColor = true;
this.customBanner.CheckedChanged += new System.EventHandler(this.customBanner_CheckedChanged);
@ -248,7 +233,7 @@ namespace BrawlBuilder
this.cutomTitle.Location = new System.Drawing.Point(6, 65);
this.cutomTitle.Name = "cutomTitle";
this.cutomTitle.Size = new System.Drawing.Size(114, 17);
this.cutomTitle.TabIndex = 3;
this.cutomTitle.TabIndex = 14;
this.cutomTitle.Text = "Change game title:";
this.cutomTitle.UseVisualStyleBackColor = true;
this.cutomTitle.CheckedChanged += new System.EventHandler(this.customTitle_CheckedChanged);
@ -259,7 +244,7 @@ namespace BrawlBuilder
this.customID.Location = new System.Drawing.Point(6, 42);
this.customID.Name = "customID";
this.customID.Size = new System.Drawing.Size(109, 17);
this.customID.TabIndex = 1;
this.customID.TabIndex = 12;
this.customID.Text = "Change game ID:";
this.customID.UseVisualStyleBackColor = true;
this.customID.CheckedChanged += new System.EventHandler(this.customID_CheckedChanged);
@ -270,10 +255,21 @@ namespace BrawlBuilder
this.removeSubspace.Location = new System.Drawing.Point(6, 19);
this.removeSubspace.Name = "removeSubspace";
this.removeSubspace.Size = new System.Drawing.Size(296, 17);
this.removeSubspace.TabIndex = 0;
this.removeSubspace.TabIndex = 11;
this.removeSubspace.Text = "Remove Subspace Emissary (greatly reduces output size)";
this.removeSubspace.UseVisualStyleBackColor = true;
//
// bannerBrowse
//
this.bannerBrowse.Enabled = false;
this.bannerBrowse.Location = new System.Drawing.Point(240, 410);
this.bannerBrowse.Name = "bannerBrowse";
this.bannerBrowse.Size = new System.Drawing.Size(75, 22);
this.bannerBrowse.TabIndex = 18;
this.bannerBrowse.Text = "Browse...";
this.bannerBrowse.UseVisualStyleBackColor = true;
this.bannerBrowse.Click += new System.EventHandler(this.bannerBrowse_Click);
//
// build
//
this.build.BackColor = System.Drawing.Color.Transparent;
@ -287,7 +283,7 @@ namespace BrawlBuilder
this.build.Location = new System.Drawing.Point(12, 449);
this.build.Name = "build";
this.build.Size = new System.Drawing.Size(310, 81);
this.build.TabIndex = 11;
this.build.TabIndex = 19;
this.build.Text = "Build ISO";
this.build.UseVisualStyleBackColor = false;
this.build.Click += new System.EventHandler(this.build_Click);
@ -313,7 +309,6 @@ namespace BrawlBuilder
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(334, 542);
this.Controls.Add(this.build);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.gctFile_lbl);
this.Controls.Add(this.gctFileBrowse);
this.Controls.Add(this.gctFile);
@ -323,10 +318,12 @@ namespace BrawlBuilder
this.Controls.Add(this.modFolder_lbl);
this.Controls.Add(this.modFolderBrowse);
this.Controls.Add(this.modFolder);
this.Controls.Add(this.bannerBrowse);
this.Controls.Add(this.exit);
this.Controls.Add(this.extrasBox);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = Resources.icon;
this.Icon = global::BrawlBuilder.Properties.Resources.icon;
this.MaximumSize = new System.Drawing.Size(334, 542);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(334, 542);
@ -339,8 +336,8 @@ namespace BrawlBuilder
this.Shown += new System.EventHandler(this.Form1_Shown);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
((System.ComponentModel.ISupportInitialize)(this.exit)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.extrasBox.ResumeLayout(false);
this.extrasBox.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -358,7 +355,7 @@ namespace BrawlBuilder
private System.Windows.Forms.LinkLabel gctFile_lbl;
private System.Windows.Forms.Button gctFileBrowse;
private System.Windows.Forms.TextBox gctFile;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox extrasBox;
private System.Windows.Forms.CheckBox cutomTitle;
private System.Windows.Forms.CheckBox customID;
private System.Windows.Forms.CheckBox removeSubspace;

View File

@ -29,7 +29,7 @@ namespace BrawlBuilder
}
// Yes most of these are the same. I realized after I wrote them out it would have probably been faster to just make a few special cases, but w/e
private static readonly NameValueCollection pacRelMappings = new NameValueCollection
private static readonly NameValueCollection pacRelMappings = new NameValueCollection()
{
{"stgdonkey", "st_donkey"}, /* 75m */ {"stgkart", "st_kart"}, /* Mario Circuit */
{"stgbattlefield", "st_battle"}, /* Battlefield */ {"stgmariopast", "st_mariopast"}, /* Mushroomy Kingdom */

View File

@ -23,7 +23,6 @@ namespace BrawlBuilder
// Save initial button value
build.Tag = _curStatus = build.Text;
}
// For dragging the form around

View File

@ -42,9 +42,9 @@
<ItemGroup>
<Reference Include="Ookii.Dialogs">
<HintPath>..\Resources\Ookii.Dialogs.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
@ -84,9 +84,6 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\bg.png" />
</ItemGroup>

View File

@ -1,22 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Reflection;
namespace BrawlBuilder
{
static class Program
{
private const string DllDir = @"Resources\";
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// Load DLLs from a custom directory
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CustomAssemblyPathResolver);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new BrawlBuilder());
}
// This allows us to load our DLLs from a folder other than the folder our exe is in. Code based off https://support.microsoft.com/en-gb/kb/837908.
// I was using the application config method for BrawlBuilder up to v1.2, but I hated that I had to include the BrawlBuilder.exe.config file, since
// the reason I want to do this in the first place was to keep everything other than the exe itself outside of the base directory.
private static Assembly CustomAssemblyPathResolver(object sender, ResolveEventArgs args)
{
// Get an array of all the assemblies that BrawlBuilder references
AssemblyName[] referencedAssemblies = Assembly.GetExecutingAssembly().GetReferencedAssemblies();
string assemblyPath = null;
foreach (AssemblyName assemblyName in referencedAssemblies)
{
//Check for the assembly names that have raised the "AssemblyResolve" event.
if (assemblyName.FullName.Substring(0, assemblyName.FullName.IndexOf(",")) == args.Name.Substring(0, args.Name.IndexOf(",")))
{
//Build the path of the assembly from where it has to be loaded.
assemblyPath = DllDir + args.Name.Substring(0, args.Name.IndexOf(",")) + ".dll";
break;
}
}
if (assemblyPath == null)
return null;
// Return the loaded assembly.
return Assembly.LoadFrom(assemblyPath);
}
}
}

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]

View File

@ -1,5 +1,5 @@
------------------------------------/
-------- BRAWLBUILDER v1.2 --------/
------- BRAWLBUILDER v1.2.1 -------/
----------------------------------/
"The Ultimate Super Smash Bros. Brawl ISO Builder"
@ -85,6 +85,10 @@ if it doesn't, just copy it manually.
--------------------/
------ Changelog --/
------------------/
1.2.1:
- Remove the BrawlBuilder.exe.config file
- Fix 'Custom banner' browse button appearance for certain Windows versions/themes
1.2:
- Fix some stages glitching/crashing due to improper .rel files