diff --git a/GlennGUI/GlennGUI.Wpf/GlennGUI.Wpf.csproj b/GlennGUI/GlennGUI.Wpf/GlennGUI.Wpf.csproj index 159e8f8..4131eca 100644 --- a/GlennGUI/GlennGUI.Wpf/GlennGUI.Wpf.csproj +++ b/GlennGUI/GlennGUI.Wpf/GlennGUI.Wpf.csproj @@ -2,6 +2,7 @@ WinExe + applicationIcon.ico LatestMajor net6.0-windows diff --git a/GlennGUI/GlennGUI.Wpf/applicationIcon.ico b/GlennGUI/GlennGUI.Wpf/applicationIcon.ico new file mode 100644 index 0000000..0905c66 Binary files /dev/null and b/GlennGUI/GlennGUI.Wpf/applicationIcon.ico differ diff --git a/GlennGUI/GlennGUI/GlennGUI.csproj b/GlennGUI/GlennGUI/GlennGUI.csproj index 10ccd6e..43f49f7 100644 --- a/GlennGUI/GlennGUI/GlennGUI.csproj +++ b/GlennGUI/GlennGUI/GlennGUI.csproj @@ -13,4 +13,19 @@ + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + True + True + Resources.resx + + + \ No newline at end of file diff --git a/GlennGUI/GlennGUI/MainForm.cs b/GlennGUI/GlennGUI/MainForm.cs index 29aac5b..9e227cc 100644 --- a/GlennGUI/GlennGUI/MainForm.cs +++ b/GlennGUI/GlennGUI/MainForm.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using GlennLib; using Eto.Forms; using Eto.Drawing; +using ResourcesLib = GlennLib.Resources; namespace GlennGUI; @@ -23,8 +24,8 @@ public partial class MainForm : Form return nameOfResource switch { - nameof(Resources.icon) => Resources.icon, - nameof(Resources.splash) => Resources.splash, + nameof(ResourcesLib.icon) => ResourcesLib.icon, + nameof(ResourcesLib.splash) => ResourcesLib.splash, _ => throw new InvalidDataException("Invalid Resource name given!") }; } @@ -34,6 +35,8 @@ public partial class MainForm : Form Title = $"Glenn - v{Core.Version}"; MinimumSize = new Size(260, 280); + Icon = new Icon(1f, new Bitmap(Resources.applicationIcon)); + var mainLayout = new DynamicLayout() {Padding = 10}; mainLayout.BeginVertical(); mainLayout.AddRange(labelSelectMod, @@ -119,12 +122,12 @@ public partial class MainForm : Form private void ButtonEditSplashClick(object sender, EventArgs e) { - ButtonEditResourceClick(imageViewSplash, nameof(Resources.splash)); + ButtonEditResourceClick(imageViewSplash, nameof(ResourcesLib.splash)); } private void ButtonEditIconClick(object sender, EventArgs e) { - ButtonEditResourceClick(imageViewIcon, nameof(Resources.icon)); + ButtonEditResourceClick(imageViewIcon, nameof(ResourcesLib.icon)); } private async void ButtonPortOnClick(object sender, EventArgs e) @@ -140,8 +143,8 @@ public partial class MainForm : Form string androidPath = $"{currentDir}/{Path.GetFileNameWithoutExtension(modZipPath)}_ANDROID.apk"; string macPath = $"{currentDir}/{Path.GetFileNameWithoutExtension(modZipPath)}_MACOS.zip"; - string iconPath = RawMods.GetProperPathToBuiltinIcons(nameof(Resources.icon), userIconPath); - string splashPath = RawMods.GetProperPathToBuiltinIcons(nameof(Resources.splash), userSplashPath); + string iconPath = RawMods.GetProperPathToBuiltinIcons(nameof(ResourcesLib.icon), userIconPath); + string splashPath = RawMods.GetProperPathToBuiltinIcons(nameof(ResourcesLib.splash), userSplashPath); try { @@ -228,8 +231,8 @@ public partial class MainForm : Form string destName = nameOfResource switch { - nameof(Resources.icon) => userIconPath, - nameof(Resources.splash) => userSplashPath, + nameof(ResourcesLib.icon) => userIconPath, + nameof(ResourcesLib.splash) => userSplashPath, _ => throw new Exception("You dun goofed!") }; @@ -295,7 +298,7 @@ public partial class MainForm : Form private readonly ImageView imageViewIcon = new ImageView { - Image = new Bitmap(GetByteArrayFromResource(nameof(Resources.icon))), + Image = new Bitmap(GetByteArrayFromResource(nameof(ResourcesLib.icon))), Size = new Size(64, 64) }; private readonly Button buttonEditIcon = new Button @@ -305,7 +308,7 @@ public partial class MainForm : Form private readonly ImageView imageViewSplash = new ImageView { - Image = new Bitmap(GetByteArrayFromResource(nameof(Resources.splash))), + Image = new Bitmap(GetByteArrayFromResource(nameof(ResourcesLib.splash))), Size = new Size(128, 96), }; private readonly Button buttonEditSplash = new Button diff --git a/GlennGUI/GlennGUI/Resources/Resources.Designer.cs b/GlennGUI/GlennGUI/Resources/Resources.Designer.cs new file mode 100644 index 0000000..1d85243 --- /dev/null +++ b/GlennGUI/GlennGUI/Resources/Resources.Designer.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GlennGUI { + using System; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static System.Resources.ResourceManager resourceMan; + + private static System.Globalization.CultureInfo resourceCulture; + + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Resources.ResourceManager ResourceManager { + get { + if (object.Equals(null, resourceMan)) { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("GlennGUI.Resources.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + public static byte[] applicationIcon { + get { + object obj = ResourceManager.GetObject("applicationIcon", resourceCulture); + return ((byte[])(obj)); + } + } + } +} \ No newline at end of file diff --git a/GlennGUI/GlennGUI/Resources/Resources.resx b/GlennGUI/GlennGUI/Resources/Resources.resx new file mode 100644 index 0000000..2d8d7e3 --- /dev/null +++ b/GlennGUI/GlennGUI/Resources/Resources.resx @@ -0,0 +1,24 @@ + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Resources\applicationIcon.ico;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GlennGUI/GlennGUI/Resources/applicationIcon.ico b/GlennGUI/GlennGUI/Resources/applicationIcon.ico new file mode 100644 index 0000000..0905c66 Binary files /dev/null and b/GlennGUI/GlennGUI/Resources/applicationIcon.ico differ