diff --git a/FModel/App.config b/FModel/App.config index 5274fd67..aec39c13 100644 --- a/FModel/App.config +++ b/FModel/App.config @@ -23,23 +23,35 @@ 0 - False + True - False + True - False + True - False + True - False + True + + 0 + + + 0 + + + + + + False + \ No newline at end of file diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index ccf46d94..aae9ad1a 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -146,6 +146,7 @@ + diff --git a/FModel/Options.Designer.cs b/FModel/Options.Designer.cs index a919243b..81b8f742 100644 --- a/FModel/Options.Designer.cs +++ b/FModel/Options.Designer.cs @@ -44,25 +44,36 @@ this.textBox2 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.checkBox7 = new System.Windows.Forms.CheckBox(); + this.filenameLabel = new System.Windows.Forms.Label(); + this.trackBar1 = new System.Windows.Forms.TrackBar(); + this.label9 = new System.Windows.Forms.Label(); + this.trackBar2 = new System.Windows.Forms.TrackBar(); + this.label8 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.wPictureBox = new System.Windows.Forms.PictureBox(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.label7 = new System.Windows.Forms.Label(); this.checkBox6 = new System.Windows.Forms.CheckBox(); this.checkBox5 = new System.Windows.Forms.CheckBox(); this.checkBox4 = new System.Windows.Forms.CheckBox(); this.checkBox3 = new System.Windows.Forms.CheckBox(); this.checkBox2 = new System.Windows.Forms.CheckBox(); this.label6 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.imgsPerRow)).BeginInit(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); this.groupBox4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.wPictureBox)).BeginInit(); this.SuspendLayout(); // // optionsOKButton // this.optionsOKButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.optionsOKButton.Location = new System.Drawing.Point(475, 245); + this.optionsOKButton.Location = new System.Drawing.Point(475, 415); this.optionsOKButton.Name = "optionsOKButton"; this.optionsOKButton.Size = new System.Drawing.Size(97, 21); this.optionsOKButton.TabIndex = 1; @@ -130,7 +141,7 @@ this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.textBox3); this.groupBox1.Controls.Add(this.label4); - this.groupBox1.Location = new System.Drawing.Point(12, 220); + this.groupBox1.Location = new System.Drawing.Point(12, 390); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(414, 46); this.groupBox1.TabIndex = 10; @@ -203,6 +214,14 @@ // // groupBox4 // + this.groupBox4.Controls.Add(this.checkBox7); + this.groupBox4.Controls.Add(this.filenameLabel); + this.groupBox4.Controls.Add(this.trackBar1); + this.groupBox4.Controls.Add(this.label9); + this.groupBox4.Controls.Add(this.trackBar2); + this.groupBox4.Controls.Add(this.label8); + this.groupBox4.Controls.Add(this.button1); + this.groupBox4.Controls.Add(this.wPictureBox); this.groupBox4.Controls.Add(this.comboBox1); this.groupBox4.Controls.Add(this.label7); this.groupBox4.Controls.Add(this.checkBox6); @@ -213,11 +232,111 @@ this.groupBox4.Controls.Add(this.label6); this.groupBox4.Location = new System.Drawing.Point(12, 144); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(560, 70); + this.groupBox4.Size = new System.Drawing.Size(560, 240); this.groupBox4.TabIndex = 13; this.groupBox4.TabStop = false; this.groupBox4.Text = "Icon Creation"; // + // checkBox7 + // + this.checkBox7.AutoSize = true; + this.checkBox7.Location = new System.Drawing.Point(6, 118); + this.checkBox7.Name = "checkBox7"; + this.checkBox7.Size = new System.Drawing.Size(15, 14); + this.checkBox7.TabIndex = 25; + this.checkBox7.UseVisualStyleBackColor = true; + this.checkBox7.CheckedChanged += new System.EventHandler(this.checkBox7_CheckedChanged); + // + // filenameLabel + // + this.filenameLabel.AutoSize = true; + this.filenameLabel.Location = new System.Drawing.Point(115, 119); + this.filenameLabel.Name = "filenameLabel"; + this.filenameLabel.Size = new System.Drawing.Size(60, 13); + this.filenameLabel.TabIndex = 24; + this.filenameLabel.Text = "File Name: "; + // + // trackBar1 + // + this.trackBar1.Location = new System.Drawing.Point(58, 171); + this.trackBar1.Maximum = 100; + this.trackBar1.Name = "trackBar1"; + this.trackBar1.Size = new System.Drawing.Size(325, 45); + this.trackBar1.TabIndex = 20; + this.trackBar1.TickStyle = System.Windows.Forms.TickStyle.None; + this.trackBar1.ValueChanged += new System.EventHandler(this.trackBar1_ValueChanged); + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(22, 142); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(30, 13); + this.label9.TabIndex = 23; + this.label9.Text = "Size:"; + // + // trackBar2 + // + this.trackBar2.Location = new System.Drawing.Point(58, 142); + this.trackBar2.Maximum = 1000; + this.trackBar2.Minimum = 1; + this.trackBar2.Name = "trackBar2"; + this.trackBar2.Size = new System.Drawing.Size(325, 45); + this.trackBar2.TabIndex = 22; + this.trackBar2.TickFrequency = 25; + this.trackBar2.TickStyle = System.Windows.Forms.TickStyle.None; + this.trackBar2.Value = 1; + this.trackBar2.ValueChanged += new System.EventHandler(this.trackBar2_ValueChanged); + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(6, 174); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(46, 13); + this.label8.TabIndex = 21; + this.label8.Text = "Opacity:"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(27, 112); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(82, 24); + this.button1.TabIndex = 19; + this.button1.Text = "Watermark"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // wPictureBox + // + this.wPictureBox.Image = global::FModel.Properties.Resources.wTemplate; + this.wPictureBox.Location = new System.Drawing.Point(389, 69); + this.wPictureBox.Name = "wPictureBox"; + this.wPictureBox.Size = new System.Drawing.Size(165, 165); + this.wPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.wPictureBox.TabIndex = 18; + this.wPictureBox.TabStop = false; + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { + "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)", + "displayName (i.e. Recruit)"}); + this.comboBox1.Location = new System.Drawing.Point(69, 42); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(485, 21); + this.comboBox1.TabIndex = 16; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(6, 45); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(57, 13); + this.label7.TabIndex = 15; + this.label7.Text = "File Name:"; + // // checkBox6 // this.checkBox6.AutoSize = true; @@ -277,31 +396,11 @@ this.label6.TabIndex = 0; this.label6.Text = "Supported Folders:"; // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(6, 45); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(57, 13); - this.label7.TabIndex = 15; - this.label7.Text = "File Name:"; - // - // comboBox1 - // - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Items.AddRange(new object[] { - "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)", - "displayName (i.e. Recruit)"}); - this.comboBox1.Location = new System.Drawing.Point(69, 42); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(485, 21); - this.comboBox1.TabIndex = 16; - // // OptionsWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(584, 277); + this.ClientSize = new System.Drawing.Size(584, 448); this.Controls.Add(this.groupBox4); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); @@ -323,6 +422,9 @@ this.groupBox3.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.wPictureBox)).EndInit(); this.ResumeLayout(false); } @@ -351,5 +453,13 @@ private System.Windows.Forms.CheckBox checkBox6; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.Label label7; + private System.Windows.Forms.TrackBar trackBar1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.PictureBox wPictureBox; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TrackBar trackBar2; + private System.Windows.Forms.Label filenameLabel; + private System.Windows.Forms.CheckBox checkBox7; } } \ No newline at end of file diff --git a/FModel/Options.cs b/FModel/Options.cs index a59fb76c..4a635a32 100644 --- a/FModel/Options.cs +++ b/FModel/Options.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Text; @@ -15,6 +17,66 @@ namespace FModel { private static string PAKBefore; private static string OutputBefore; + private static string docPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() + "\\FModel"; + + public static Bitmap ResizeImage(Image image, int width, int height) + { + var destRect = new Rectangle(0, 0, width, height); + var destImage = new Bitmap(width, height); + + destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution); + + using (var graphics = Graphics.FromImage(destImage)) + { + graphics.CompositingMode = CompositingMode.SourceCopy; + graphics.CompositingQuality = CompositingQuality.HighQuality; + graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; + graphics.SmoothingMode = SmoothingMode.HighQuality; + graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; + + using (var wrapMode = new ImageAttributes()) + { + wrapMode.SetWrapMode(WrapMode.TileFlipXY); + graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode); + } + } + + return destImage; + } + public Image SetImageOpacity(Image image, float opacity) + { + try + { + //create a Bitmap the size of the image provided + Bitmap bmp = new Bitmap(image.Width, image.Height); + + //create a graphics object from the image + using (Graphics gfx = Graphics.FromImage(bmp)) + { + + //create a color matrix object + ColorMatrix matrix = new ColorMatrix(); + + //set the opacity + matrix.Matrix33 = opacity; + + //create image attributes + ImageAttributes attributes = new ImageAttributes(); + + //set the color(opacity) of the image + attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); + + //now draw the image + gfx.DrawImage(image, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes); + } + return bmp; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + return null; + } + } public OptionsWindow() { @@ -30,7 +92,32 @@ namespace FModel checkBox3.Checked = Properties.Settings.Default.createIconForConsumablesWeapons; checkBox4.Checked = Properties.Settings.Default.createIconForTraps; checkBox6.Checked = Properties.Settings.Default.createIconForChallenges; + checkBox7.Checked = Properties.Settings.Default.isWatermark; comboBox1.SelectedItem = Properties.Settings.Default.IconName; + if (Properties.Settings.Default.wSize == 0) + { + Properties.Settings.Default.wSize = 1; + } + trackBar2.Value = Properties.Settings.Default.wSize; + trackBar1.Value = Properties.Settings.Default.wOpacity; + + button1.Enabled = Properties.Settings.Default.isWatermark; + trackBar1.Enabled = Properties.Settings.Default.isWatermark; + trackBar2.Enabled = Properties.Settings.Default.isWatermark; + + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + filenameLabel.Text = "File Name: " + Path.GetFileName(Properties.Settings.Default.wFilename); + + Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); + Graphics g = Graphics.FromImage(bmp); + + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)Properties.Settings.Default.wOpacity / 100); + g.DrawImage(ResizeImage(opacityImage, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize), (522 - Properties.Settings.Default.wSize) / 2, (522 - Properties.Settings.Default.wSize) / 2, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize); + + wPictureBox.Image = bmp; + } PAKBefore = Properties.Settings.Default.FortnitePAKs; OutputBefore = Properties.Settings.Default.ExtractOutput; @@ -86,6 +173,14 @@ namespace FModel { Properties.Settings.Default.createIconForChallenges = false; } + if (checkBox7.Checked == true) + { + Properties.Settings.Default.isWatermark = true; + } + if (checkBox7.Checked == false) + { + Properties.Settings.Default.isWatermark = false; + } if (comboBox1.SelectedItem == null) { Properties.Settings.Default.IconName = "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)"; @@ -99,6 +194,8 @@ namespace FModel Properties.Settings.Default.FortnitePAKs = textBox2.Text; Properties.Settings.Default.mergerFileName = textBox3.Text; Properties.Settings.Default.mergerImagesRow = Decimal.ToInt32(imgsPerRow.Value); + Properties.Settings.Default.wSize = trackBar2.Value; + Properties.Settings.Default.wOpacity = trackBar1.Value; if (!Directory.Exists(Properties.Settings.Default.ExtractOutput)) Directory.CreateDirectory(Properties.Settings.Default.ExtractOutput); @@ -118,5 +215,79 @@ namespace FModel Properties.Settings.Default.Save(); Close(); } + + private void button1_Click(object sender, EventArgs e) + { + OpenFileDialog theDialog = new OpenFileDialog(); + theDialog.Title = "Choose your watermark"; + theDialog.Multiselect = false; + theDialog.Filter = "PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|DDS Files (*.dds)|*.dds|All Files (*.*)|*.*"; + + if (theDialog.ShowDialog() == DialogResult.OK) + { + Properties.Settings.Default.wFilename = theDialog.FileName; + Properties.Settings.Default.Save(); + filenameLabel.Text = "File Name: " + Path.GetFileName(Properties.Settings.Default.wFilename); + + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); + Graphics g = Graphics.FromImage(bmp); + + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + g.DrawImage(ResizeImage(watermark, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + + wPictureBox.Image = bmp; + } + } + } + + private void trackBar2_ValueChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); + Graphics g = Graphics.FromImage(bmp); + + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + + wPictureBox.Image = bmp; + wPictureBox.Refresh(); + } + } + + private void trackBar1_ValueChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); + Graphics g = Graphics.FromImage(bmp); + + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + + wPictureBox.Image = bmp; + wPictureBox.Refresh(); + } + } + + private void checkBox7_CheckedChanged(object sender, EventArgs e) + { + if (checkBox7.Checked == false) + { + button1.Enabled = false; + trackBar1.Enabled = false; + trackBar2.Enabled = false; + } + if (checkBox7.Checked == true) + { + button1.Enabled = true; + trackBar1.Enabled = true; + trackBar2.Enabled = true; + } + } } } diff --git a/FModel/PAKWindow.cs b/FModel/PAKWindow.cs index 781bd500..0b50d167 100644 --- a/FModel/PAKWindow.cs +++ b/FModel/PAKWindow.cs @@ -5,11 +5,9 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; -using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; -using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Text; using System.IO; @@ -18,9 +16,7 @@ using System.Net; using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows.Forms; -using System.Threading; -using System.Text.RegularExpressions; -using System.Text; +using System.Drawing.Drawing2D; namespace FModel { @@ -100,6 +96,64 @@ namespace FModel fileopener.StartInfo.Arguments = "\"" + path + "\""; fileopener.Start(); } + public static Bitmap ResizeImage(Image image, int width, int height) + { + var destRect = new Rectangle(0, 0, width, height); + var destImage = new Bitmap(width, height); + + destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution); + + using (var graphics = Graphics.FromImage(destImage)) + { + graphics.CompositingMode = CompositingMode.SourceCopy; + graphics.CompositingQuality = CompositingQuality.HighQuality; + graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; + graphics.SmoothingMode = SmoothingMode.HighQuality; + graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; + + using (var wrapMode = new ImageAttributes()) + { + wrapMode.SetWrapMode(WrapMode.TileFlipXY); + graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode); + } + } + + return destImage; + } + public Image SetImageOpacity(Image image, float opacity) + { + try + { + //create a Bitmap the size of the image provided + Bitmap bmp = new Bitmap(image.Width, image.Height); + + //create a graphics object from the image + using (Graphics gfx = Graphics.FromImage(bmp)) + { + + //create a color matrix object + ColorMatrix matrix = new ColorMatrix(); + + //set the opacity + matrix.Matrix33 = opacity; + + //create image attributes + ImageAttributes attributes = new ImageAttributes(); + + //set the color(opacity) of the image + attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); + + //now draw the image + gfx.DrawImage(image, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes); + } + return bmp; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + return null; + } + } string BackupFilename = string.Empty; private void PAKWindow_Load(object sender, EventArgs e) @@ -236,6 +290,15 @@ namespace FModel scintilla1.Styles[ScintillaNET.Style.Json.String].ForeColor = Color.OrangeRed; scintilla1.Styles[ScintillaNET.Style.Json.StringEol].BackColor = Color.OrangeRed; scintilla1.Styles[ScintillaNET.Style.Json.Operator].ForeColor = Color.Black; + scintilla1.Styles[ScintillaNET.Style.LineNumber].ForeColor = Color.DarkGray; + var nums = scintilla1.Margins[1]; + nums.Width = 30; + nums.Type = ScintillaNET.MarginType.Number; + nums.Sensitive = true; + nums.Mask = 0; + + scintilla1.ClearCmdKey(Keys.Control | Keys.F); + scintilla1.ClearCmdKey(Keys.Control | Keys.Z); scintilla1.Lexer = ScintillaNET.Lexer.Json; } //EVERYTHING TO SET WHEN APP IS STARTING private void PAKWindow_FormClosing(object sender, FormClosingEventArgs e) @@ -1742,6 +1805,13 @@ namespace FModel g.DrawImage(ItemIcon, new Point(0, 0)); } + if (Properties.Settings.Default.isWatermark == true && !string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)Properties.Settings.Default.wOpacity / 100); + g.DrawImage(ResizeImage(opacityImage, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize), (522 - Properties.Settings.Default.wSize) / 2, (522 - Properties.Settings.Default.wSize) / 2, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize); + } + Image bg512 = Properties.Resources.BG512; g.DrawImage(bg512, new Point(5, 383)); @@ -2039,6 +2109,13 @@ namespace FModel g.DrawImage(ItemIcon, new Point(0, 0)); } + if (Properties.Settings.Default.isWatermark == true && !string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)Properties.Settings.Default.wOpacity / 100); + g.DrawImage(ResizeImage(opacityImage, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize), (522 - Properties.Settings.Default.wSize) / 2, (522 - Properties.Settings.Default.wSize) / 2, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize); + } + Image bg512 = Properties.Resources.BG512; g.DrawImage(bg512, new Point(5, 383)); @@ -2341,6 +2418,13 @@ namespace FModel g.DrawImage(ItemIcon, new Point(0, 0)); } + if (Properties.Settings.Default.isWatermark == true && !string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)Properties.Settings.Default.wOpacity / 100); + g.DrawImage(ResizeImage(opacityImage, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize), (522 - Properties.Settings.Default.wSize) / 2, (522 - Properties.Settings.Default.wSize) / 2, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize); + } + Image bg512 = Properties.Resources.BG512; g.DrawImage(bg512, new Point(5, 383)); @@ -2607,6 +2691,13 @@ namespace FModel g.DrawImage(ItemIcon, new Point(0, 0)); } + if (Properties.Settings.Default.isWatermark == true && !string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)Properties.Settings.Default.wOpacity / 100); + g.DrawImage(ResizeImage(opacityImage, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize), (522 - Properties.Settings.Default.wSize) / 2, (522 - Properties.Settings.Default.wSize) / 2, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize); + } + Image bg512 = Properties.Resources.BG512; g.DrawImage(bg512, new Point(5, 383)); diff --git a/FModel/Properties/Resources.Designer.cs b/FModel/Properties/Resources.Designer.cs index a5f0442d..23f3d847 100644 --- a/FModel/Properties/Resources.Designer.cs +++ b/FModel/Properties/Resources.Designer.cs @@ -209,5 +209,15 @@ namespace FModel.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap wTemplate { + get { + object obj = ResourceManager.GetObject("wTemplate", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/FModel/Properties/Resources.resx b/FModel/Properties/Resources.resx index 47177aac..c8c2f391 100644 --- a/FModel/Properties/Resources.resx +++ b/FModel/Properties/Resources.resx @@ -118,49 +118,52 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\E512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\R512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\BurbankBigCondensed-Bold.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\FNTools_Logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\C512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\unknown512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\M512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Quest.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\BG512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\I512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\U512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\T512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\L512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\R512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\C512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\FNTools_Logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\BurbankBigCondensed-Black.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\Quest.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\FNTools_Logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\I512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\M512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\unknown512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\BurbankBigCondensed-Bold.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\E512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\T512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\U512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\wTemplate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/FModel/Properties/Settings.Designer.cs b/FModel/Properties/Settings.Designer.cs index 5742c303..18d3e1dc 100644 --- a/FModel/Properties/Settings.Designer.cs +++ b/FModel/Properties/Settings.Designer.cs @@ -84,7 +84,7 @@ namespace FModel.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool createIconForCosmetics { get { return ((bool)(this["createIconForCosmetics"])); @@ -96,7 +96,7 @@ namespace FModel.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool createIconForConsumablesWeapons { get { return ((bool)(this["createIconForConsumablesWeapons"])); @@ -108,7 +108,7 @@ namespace FModel.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool createIconForTraps { get { return ((bool)(this["createIconForTraps"])); @@ -120,7 +120,7 @@ namespace FModel.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool createIconForVariants { get { return ((bool)(this["createIconForVariants"])); @@ -132,7 +132,7 @@ namespace FModel.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool createIconForChallenges { get { return ((bool)(this["createIconForChallenges"])); @@ -153,5 +153,53 @@ namespace FModel.Properties { this["IconName"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int wSize { + get { + return ((int)(this["wSize"])); + } + set { + this["wSize"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int wOpacity { + get { + return ((int)(this["wOpacity"])); + } + set { + this["wOpacity"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string wFilename { + get { + return ((string)(this["wFilename"])); + } + set { + this["wFilename"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool isWatermark { + get { + return ((bool)(this["isWatermark"])); + } + set { + this["isWatermark"] = value; + } + } } } diff --git a/FModel/Properties/Settings.settings b/FModel/Properties/Settings.settings index d53b67f4..916c47f2 100644 --- a/FModel/Properties/Settings.settings +++ b/FModel/Properties/Settings.settings @@ -18,22 +18,34 @@ 0 - False + True - False + True - False + True - False + True - False + True + + 0 + + + 0 + + + + + + False + \ No newline at end of file diff --git a/FModel/Resources/wTemplate.png b/FModel/Resources/wTemplate.png new file mode 100644 index 00000000..76c6eea5 Binary files /dev/null and b/FModel/Resources/wTemplate.png differ