Skip to content

Commit

Permalink
feat: add About and Donate
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjiequan committed Nov 21, 2023
1 parent 6aa5b67 commit 3c83e8e
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 25 deletions.
32 changes: 31 additions & 1 deletion AssetStudioGUI/AssetStudioGUIForm.Designer.cs

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

22 changes: 22 additions & 0 deletions AssetStudioGUI/AssetStudioGUIForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,28 @@ private void toolStripMenuItem15_Click(object sender, EventArgs e)
logger.ShowErrorMessage = toolStripMenuItem15.Checked;
}

private void aboutAssetStudioToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("AssetStudio is a tool for exploring, extracting and exporting assets and assetbundles.\n" +
"For more information, visit https://github.com/zhangjiequan/AssetStudio.",
"About AssetStudio",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}

private void donateAssetStudioToolStripMenuItem_Click(object sender, EventArgs e)
{
DonateForm donateForm = new DonateForm();

donateForm.StartPosition = FormStartPosition.Manual;
Point center = this.Location;
center.X += (this.Width - donateForm.Width) / 2;
center.Y += (this.Height - donateForm.Height) / 2;
donateForm.Location = center;

donateForm.ShowDialog();
}

private void glControl1_MouseWheel(object sender, MouseEventArgs e)
{
if (glControl1.Visible)
Expand Down
34 changes: 34 additions & 0 deletions AssetStudioGUI/DonateForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Windows.Forms;
using System.Drawing;

public class DonateForm : Form
{
public DonateForm()
{
InitializeComponent();
}

private void InitializeComponent()
{
this.Icon = global::AssetStudioGUI.Properties.Resources._as;
this.Size = new Size(613, 420);
this.Text = "Donate to AssetStudio";

Label label = new Label();
label.Text = "AssetStudio is a free and open-source software.\nIf you like it and find it helpful, you can buy me a coffee!";
label.AutoSize = false;
label.Size = new Size(613, 50);
label.Location = new Point(10, 10);
label.Font = new Font(label.Font.FontFamily, 12, FontStyle.Regular);
label.Padding = new Padding(0, 5, 0, 5);

PictureBox pictureBox = new PictureBox();
pictureBox.Size = new Size(573, 306);
pictureBox.Location = new Point(10, 60);
pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBox.Image = global::AssetStudioGUI.Properties.Resources.donate;

this.Controls.Add(label);
this.Controls.Add(pictureBox);
}
}
56 changes: 33 additions & 23 deletions AssetStudioGUI/Properties/Resources.Designer.cs

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

5 changes: 4 additions & 1 deletion AssetStudioGUI/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="donate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\donate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="fs" xml:space="preserve">
<value>#version 140

Expand Down Expand Up @@ -158,7 +162,6 @@ void main()
outputColor = color;
}</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="preview" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\preview.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down
Binary file added AssetStudioGUI/Resources/donate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3c83e8e

Please sign in to comment.