Skip to content

Commit

Permalink
preps for 1-click install
Browse files Browse the repository at this point in the history
  • Loading branch information
N1ghtTheF0x committed Dec 24, 2023
1 parent 636f106 commit 9d2b5b9
Show file tree
Hide file tree
Showing 25 changed files with 2,339 additions and 78 deletions.
25 changes: 18 additions & 7 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,28 @@ static class Program
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
static void Main(string[] argv)
{
#if DEBUG
Utils.AllocConsole();
Utils.AttachConsole(-1);
#endif
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.

Velvet.ConsoleWriteLine("Loading ApplicationConfiguration...");
ApplicationConfiguration.Initialize();
CommandLineResult cmdResult = HandleCommandLine(argv);

Velvet.ConsoleWriteLine("Starting App...");
Application.Run(new MainForm());
}
}

static CommandLineResult HandleCommandLine(string[] argv)
{
foreach(string arg in argv)
{
if(arg.StartsWith(Utils.Scheme))
{
GameBanana.HandleCommandLine(arg[(Utils.Scheme.Length + 1)..]);
return CommandLineResult.GameBanana;
}
}
return CommandLineResult.None;
}
}
63 changes: 59 additions & 4 deletions forms/AboutWindow.Designer.cs → forms/AboutForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions forms/AboutForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace ThemModdingHerds.VelvetBeautifier
{
public partial class AboutForm : Form
{
public AboutForm()
{
InitializeComponent();
}

private void GitHubLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => Utils.OpenLink("https://github.com/ThemModdingHerds/velvet-beautifier");

private void GameBananaLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => Utils.OpenLink("https://gamebanana.com/tools/15674");

private void NightTheFoxLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => Utils.OpenLink("https://github.com/N1ghtTheF0x");
}
}
2 changes: 1 addition & 1 deletion forms/AboutWindow.resx → forms/AboutForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
lxxLuF+4I2XZkh9MFjmleE2xlV0xf+6pXhhetKenlC6zjTHGiTGJhsEKy2Qp0COrLYpLXPajFfytvn9S
XIa4ljHFMUIOC933o/7gd7duuq+3mBSOQvWT5711Qs0WfG163ueh530dQegRLuySP3cAg++ib5a0jn1o
XIezy5JmbMP5BrQ85HVH96WQzGA6Da8n8k0z0HQNdXPF3n72Ob6DhHQ1cQW7e9CVkez5Cu+uLe/tzzN+
f0S/Aaj2crwH4K75AAAACXBIWXMAAAsPAAALDwGS+QOlAAAAB3RJTUUH5wwWDicOQPTWsAAAiGtJREFU
f0S/Aaj2crwH4K75AAAACXBIWXMAAAsMAAALDAE/QCLIAAAAB3RJTUUH5wwWDicOQPTWsAAAiGtJREFU
eF7tvWeQFMeWNrz/31+7Efvni/je3Y3vxruvhADpXulKWokrLyRgRg7hER4hEN4jJBohEEYghADhBw8C
BjN47wY3w8C47nE90z3eMiAkEOju3vzqya6szq7O7qnqru5pk0/EEzDd5boq86mTJ0+e808SEjxsKU/O
snV74sic7h1Kbe91/mPxx88S/Ev/Vj7H9+qmEhISEtEFhGj1gJfITwP/S0h8t2rgiwTbqbtISEhIRB6w
Expand Down
12 changes: 0 additions & 12 deletions forms/AboutWindow.cs

This file was deleted.

100 changes: 100 additions & 0 deletions forms/DownloadForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions forms/DownloadForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ThemModdingHerds.VelvetBeautifier
{
public partial class DownloadForm : Form
{
private string? Url {get;}
private string? UnzippedPath {get;}
public DownloadForm(GameBananaMod mod,string url)
{
InitializeComponent();
Url = url;
Text = "Install " + mod.ModName + '?';
ModNameLabel.Text = mod.ModName;
ModAuthorLabel.Text = "by " + mod.OwnerName;
ModDescriptionBox.Text = mod.Body;
}
public DownloadForm(Mod mod,string unzippedpath)
{
InitializeComponent();
UnzippedPath = unzippedpath;
Text = "Install " + mod.Info.Name;
ModNameLabel.Text = mod.Info.Name;
ModAuthorLabel.Text = "by " + mod.Info.Author;
ModDescriptionBox.Text = mod.Info.Description;
}
public DownloadForm(GameBananaMod mod): this(mod,mod.Files.Values.ToArray()[0].DownloadUrl)
{

}
}
}
Loading

0 comments on commit 9d2b5b9

Please sign in to comment.