diff --git a/Overlay.Designer.cs b/Overlay.Designer.cs index 28d4575..fcbcc87 100644 --- a/Overlay.Designer.cs +++ b/Overlay.Designer.cs @@ -41,6 +41,7 @@ private void InitializeComponent() this.backgroundPic = new System.Windows.Forms.PictureBox(); this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.settingsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.closeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.rankIconBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.backgroundPic)).BeginInit(); @@ -58,19 +59,20 @@ private void InitializeComponent() this.panel1.Controls.Add(this.backgroundPic); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(398, 143); + this.panel1.Size = new System.Drawing.Size(455, 191); this.panel1.TabIndex = 0; // // recentGame3 // this.recentGame3.AutoSize = true; this.recentGame3.BackColor = System.Drawing.Color.Black; - this.recentGame3.Font = new System.Drawing.Font("Anton", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.recentGame3.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.recentGame3.ForeColor = System.Drawing.Color.White; - this.recentGame3.Location = new System.Drawing.Point(346, 86); + this.recentGame3.Location = new System.Drawing.Point(395, 115); this.recentGame3.Name = "recentGame3"; - this.recentGame3.Size = new System.Drawing.Size(48, 36); + this.recentGame3.Size = new System.Drawing.Size(66, 36); this.recentGame3.TabIndex = 6; this.recentGame3.Text = "+00"; // @@ -78,11 +80,11 @@ private void InitializeComponent() // this.recentGame2.AutoSize = true; this.recentGame2.BackColor = System.Drawing.Color.Black; - this.recentGame2.Font = new System.Drawing.Font("Anton", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.recentGame2.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.recentGame2.ForeColor = System.Drawing.Color.White; - this.recentGame2.Location = new System.Drawing.Point(285, 86); + this.recentGame2.Location = new System.Drawing.Point(326, 115); this.recentGame2.Name = "recentGame2"; - this.recentGame2.Size = new System.Drawing.Size(48, 36); + this.recentGame2.Size = new System.Drawing.Size(66, 36); this.recentGame2.TabIndex = 5; this.recentGame2.Text = "+00"; // @@ -90,11 +92,11 @@ private void InitializeComponent() // this.recentGame1.AutoSize = true; this.recentGame1.BackColor = System.Drawing.Color.Black; - this.recentGame1.Font = new System.Drawing.Font("Anton", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.recentGame1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.recentGame1.ForeColor = System.Drawing.Color.White; - this.recentGame1.Location = new System.Drawing.Point(225, 86); + this.recentGame1.Location = new System.Drawing.Point(257, 115); this.recentGame1.Name = "recentGame1"; - this.recentGame1.Size = new System.Drawing.Size(48, 36); + this.recentGame1.Size = new System.Drawing.Size(66, 36); this.recentGame1.TabIndex = 4; this.recentGame1.Text = "+00"; // @@ -102,9 +104,10 @@ private void InitializeComponent() // this.rankIconBox.BackColor = System.Drawing.Color.Transparent; this.rankIconBox.Image = ((System.Drawing.Image)(resources.GetObject("rankIconBox.Image"))); - this.rankIconBox.Location = new System.Drawing.Point(12, 67); + this.rankIconBox.Location = new System.Drawing.Point(14, 89); + this.rankIconBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.rankIconBox.Name = "rankIconBox"; - this.rankIconBox.Size = new System.Drawing.Size(65, 65); + this.rankIconBox.Size = new System.Drawing.Size(74, 87); this.rankIconBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.rankIconBox.TabIndex = 3; this.rankIconBox.TabStop = false; @@ -112,11 +115,11 @@ private void InitializeComponent() // rankPointsElo // this.rankPointsElo.AutoSize = true; - this.rankPointsElo.Font = new System.Drawing.Font("Anton", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.rankPointsElo.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.rankPointsElo.ForeColor = System.Drawing.Color.White; - this.rankPointsElo.Location = new System.Drawing.Point(216, 9); + this.rankPointsElo.Location = new System.Drawing.Point(247, 12); this.rankPointsElo.Name = "rankPointsElo"; - this.rankPointsElo.Size = new System.Drawing.Size(182, 36); + this.rankPointsElo.Size = new System.Drawing.Size(275, 36); this.rankPointsElo.TabIndex = 2; this.rankPointsElo.Text = "000 RP | 0000 ELO"; this.rankPointsElo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -126,11 +129,11 @@ private void InitializeComponent() this.rankingLabel.AutoSize = true; this.rankingLabel.BackColor = System.Drawing.Color.Transparent; this.rankingLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.rankingLabel.Font = new System.Drawing.Font("Anton", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.rankingLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.rankingLabel.ForeColor = System.Drawing.Color.White; this.rankingLabel.Location = new System.Drawing.Point(0, 0); this.rankingLabel.Name = "rankingLabel"; - this.rankingLabel.Size = new System.Drawing.Size(125, 56); + this.rankingLabel.Size = new System.Drawing.Size(205, 54); this.rankingLabel.TabIndex = 1; this.rankingLabel.Text = "INVALID"; this.rankingLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -143,39 +146,58 @@ private void InitializeComponent() this.backgroundPic.BackColor = System.Drawing.Color.White; this.backgroundPic.Image = ((System.Drawing.Image)(resources.GetObject("backgroundPic.Image"))); this.backgroundPic.Location = new System.Drawing.Point(0, 0); + this.backgroundPic.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.backgroundPic.Name = "backgroundPic"; - this.backgroundPic.Size = new System.Drawing.Size(398, 143); + this.backgroundPic.Size = new System.Drawing.Size(455, 191); this.backgroundPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.backgroundPic.TabIndex = 0; this.backgroundPic.TabStop = false; + this.backgroundPic.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ValorantOverStream_MouseDown); + this.backgroundPic.MouseMove += new System.Windows.Forms.MouseEventHandler(this.ValorantOverStream_MouseMove); + this.backgroundPic.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ValorantOverStream_MouseUp); // // contextMenu // + this.contextMenu.ImageScalingSize = new System.Drawing.Size(20, 20); this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.settingsMenuItem}); + this.settingsMenuItem, + this.closeMenuItem}); this.contextMenu.Name = "contextMenuStrip1"; - this.contextMenu.Size = new System.Drawing.Size(117, 26); + this.contextMenu.Size = new System.Drawing.Size(132, 52); // // settingsMenuItem // this.settingsMenuItem.CheckOnClick = true; this.settingsMenuItem.Name = "settingsMenuItem"; - this.settingsMenuItem.Size = new System.Drawing.Size(116, 22); + this.settingsMenuItem.Size = new System.Drawing.Size(131, 24); this.settingsMenuItem.Text = "Settings"; this.settingsMenuItem.Click += new System.EventHandler(this.settingsMenuItem_Click); // + // closeMenuItem + // + this.closeMenuItem.CheckOnClick = true; + this.closeMenuItem.Name = "closeMenuItem"; + this.closeMenuItem.Size = new System.Drawing.Size(131, 24); + this.closeMenuItem.Text = "Close"; + this.closeMenuItem.Click += new System.EventHandler(this.closeMenuItem_Click); + // // ValorantOverStream // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))); - this.ClientSize = new System.Drawing.Size(398, 143); + this.ClientSize = new System.Drawing.Size(455, 191); this.Controls.Add(this.panel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Name = "ValorantOverStream"; this.Text = "Valorant Overlay"; this.Load += new System.EventHandler(this.ValorantOverStream_Load); + this.Shown += new System.EventHandler(this.ValorantOverStream_Shown); + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ValorantOverStream_MouseDown); + this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.ValorantOverStream_MouseMove); + this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ValorantOverStream_MouseUp); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.rankIconBox)).EndInit(); @@ -197,6 +219,7 @@ private void InitializeComponent() private System.Windows.Forms.ContextMenuStrip contextMenu; public System.Windows.Forms.ToolStripMenuItem settingsMenuItem; public System.Windows.Forms.PictureBox backgroundPic; + private System.Windows.Forms.ToolStripMenuItem closeMenuItem; } } diff --git a/Overlay.cs b/Overlay.cs index 281fe20..c310f07 100644 --- a/Overlay.cs +++ b/Overlay.cs @@ -14,7 +14,9 @@ namespace ValorantStreamOverlay { public partial class ValorantOverStream : Form { - + //https://stackoverflow.com/a/24561946/908 + private bool mouseDown; + private Point lastLocation; public ValorantOverStream() { @@ -53,11 +55,26 @@ private void ValorantOverStream_Load(object sender, EventArgs e) rankPointsElo.Parent = backgroundPic; rankPointsElo.Font = new Font(pfc.Families[0], 18); + + if (Properties.Settings.Default.hideTitleBar) + { + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + } + var opacity = Properties.Settings.Default.opacity; + this.Opacity = (double)opacity / 100; + ValorantOverStream local = this; LogicHandler logic = new LogicHandler(local); + } + private void ValorantOverStream_Shown(object sender, EventArgs e) + { + if (Properties.Settings.Default.alwaysOnTop) + { + this.TopMost = true; + } } private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) @@ -71,5 +88,30 @@ private void settingsMenuItem_Click(object sender, EventArgs e) settingsPage.ShowDialog(); } + private void closeMenuItem_Click(object sender, EventArgs e) + { + this.Close(); + } + private void ValorantOverStream_MouseDown(object sender, MouseEventArgs e) + { + mouseDown = true; + lastLocation = e.Location; + } + + private void ValorantOverStream_MouseMove(object sender, MouseEventArgs e) + { + if(mouseDown) + { + this.Location = new Point( + (this.Location.X - lastLocation.X) + e.X, (this.Location.Y - lastLocation.Y) + e.Y); + + this.Update(); + } + } + + private void ValorantOverStream_MouseUp(object sender, MouseEventArgs e) + { + mouseDown = false; + } } } diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index 96b5412..0f78e99 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace ValorantStreamOverlay.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -82,5 +82,41 @@ public int skin { this["skin"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool alwaysOnTop { + get { + return ((bool)(this["alwaysOnTop"])); + } + set { + this["alwaysOnTop"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool hideTitleBar { + get { + return ((bool)(this["hideTitleBar"])); + } + set { + this["hideTitleBar"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("100")] + public int opacity { + get { + return ((int)(this["opacity"])); + } + set { + this["opacity"] = value; + } + } } } diff --git a/Properties/Settings.settings b/Properties/Settings.settings index 2a3d25a..ff3d3d2 100644 --- a/Properties/Settings.settings +++ b/Properties/Settings.settings @@ -17,5 +17,14 @@ 0 + + False + + + False + + + 100 + \ No newline at end of file diff --git a/Settings.Designer.cs b/Settings.Designer.cs index 9f83bb2..d2f238b 100644 --- a/Settings.Designer.cs +++ b/Settings.Designer.cs @@ -40,44 +40,54 @@ private void InitializeComponent() this.skinDrop = new System.Windows.Forms.ComboBox(); this.label3 = new System.Windows.Forms.Label(); this.refreshDrop = new System.Windows.Forms.ComboBox(); + this.alwaysOnTopCheckbox = new System.Windows.Forms.CheckBox(); + this.hideTitleBarCheckbox = new System.Windows.Forms.CheckBox(); + this.opacityTrackBar = new System.Windows.Forms.TrackBar(); + this.label4 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.opacityTrackBar)).BeginInit(); this.SuspendLayout(); // // usernameTextBox // - this.usernameTextBox.Location = new System.Drawing.Point(12, 12); + this.usernameTextBox.Location = new System.Drawing.Point(15, 15); + this.usernameTextBox.Margin = new System.Windows.Forms.Padding(4); this.usernameTextBox.Name = "usernameTextBox"; this.usernameTextBox.PlaceholderText = "Riot Games Username"; - this.usernameTextBox.Size = new System.Drawing.Size(199, 23); + this.usernameTextBox.Size = new System.Drawing.Size(248, 27); this.usernameTextBox.TabIndex = 0; // // cancelButton // - this.cancelButton.Location = new System.Drawing.Point(108, 161); + this.cancelButton.Location = new System.Drawing.Point(168, 349); + this.cancelButton.Margin = new System.Windows.Forms.Padding(4); this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 23); - this.cancelButton.TabIndex = 1; + this.cancelButton.Size = new System.Drawing.Size(94, 29); + this.cancelButton.TabIndex = 10; this.cancelButton.Text = "Cancel"; this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); // // applyButton // this.applyButton.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.applyButton.Location = new System.Drawing.Point(27, 161); + this.applyButton.Location = new System.Drawing.Point(15, 349); + this.applyButton.Margin = new System.Windows.Forms.Padding(4); this.applyButton.Name = "applyButton"; - this.applyButton.Size = new System.Drawing.Size(75, 23); - this.applyButton.TabIndex = 2; + this.applyButton.Size = new System.Drawing.Size(94, 29); + this.applyButton.TabIndex = 9; this.applyButton.Text = "APPLY"; this.applyButton.UseVisualStyleBackColor = true; this.applyButton.Click += new System.EventHandler(this.applyButton_Click); // // passwordTextBox // - this.passwordTextBox.Location = new System.Drawing.Point(12, 41); + this.passwordTextBox.Location = new System.Drawing.Point(15, 51); + this.passwordTextBox.Margin = new System.Windows.Forms.Padding(4); this.passwordTextBox.Name = "passwordTextBox"; this.passwordTextBox.PasswordChar = '*'; this.passwordTextBox.PlaceholderText = "Riot Games Password"; - this.passwordTextBox.Size = new System.Drawing.Size(199, 23); - this.passwordTextBox.TabIndex = 3; + this.passwordTextBox.Size = new System.Drawing.Size(248, 27); + this.passwordTextBox.TabIndex = 2; this.passwordTextBox.UseSystemPasswordChar = true; // // regionDrop @@ -88,18 +98,20 @@ private void InitializeComponent() "Europe", "Korea", "Asia Pacific"}); - this.regionDrop.Location = new System.Drawing.Point(77, 70); + this.regionDrop.Location = new System.Drawing.Point(96, 88); + this.regionDrop.Margin = new System.Windows.Forms.Padding(4); this.regionDrop.Name = "regionDrop"; - this.regionDrop.Size = new System.Drawing.Size(134, 23); - this.regionDrop.TabIndex = 4; + this.regionDrop.Size = new System.Drawing.Size(166, 28); + this.regionDrop.TabIndex = 3; // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label1.Location = new System.Drawing.Point(12, 70); + this.label1.Location = new System.Drawing.Point(15, 88); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(59, 20); + this.label1.Size = new System.Drawing.Size(74, 25); this.label1.TabIndex = 5; this.label1.Text = "Region:"; // @@ -107,9 +119,10 @@ private void InitializeComponent() // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label2.Location = new System.Drawing.Point(12, 101); + this.label2.Location = new System.Drawing.Point(15, 126); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(39, 20); + this.label2.Size = new System.Drawing.Size(51, 25); this.label2.TabIndex = 6; this.label2.Text = "Skin:"; // @@ -118,7 +131,7 @@ private void InitializeComponent() this.ski.FormattingEnabled = true; this.ski.Location = new System.Drawing.Point(137, 129); this.ski.Name = "ski"; - this.ski.Size = new System.Drawing.Size(134, 23); + this.ski.Size = new System.Drawing.Size(134, 28); this.ski.TabIndex = 7; // // skinDrop @@ -132,18 +145,20 @@ private void InitializeComponent() "Purple", "Gray", "Custom"}); - this.skinDrop.Location = new System.Drawing.Point(77, 101); + this.skinDrop.Location = new System.Drawing.Point(96, 126); + this.skinDrop.Margin = new System.Windows.Forms.Padding(4); this.skinDrop.Name = "skinDrop"; - this.skinDrop.Size = new System.Drawing.Size(134, 23); - this.skinDrop.TabIndex = 7; + this.skinDrop.Size = new System.Drawing.Size(166, 28); + this.skinDrop.TabIndex = 4; // // label3 // this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label3.Location = new System.Drawing.Point(12, 132); + this.label3.Location = new System.Drawing.Point(15, 165); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(61, 20); + this.label3.Size = new System.Drawing.Size(78, 25); this.label3.TabIndex = 8; this.label3.Text = "Refresh:"; // @@ -153,16 +168,64 @@ private void InitializeComponent() this.refreshDrop.Items.AddRange(new object[] { "30 Seconds", "60 Seconds"}); - this.refreshDrop.Location = new System.Drawing.Point(77, 132); + this.refreshDrop.Location = new System.Drawing.Point(96, 165); + this.refreshDrop.Margin = new System.Windows.Forms.Padding(4); this.refreshDrop.Name = "refreshDrop"; - this.refreshDrop.Size = new System.Drawing.Size(134, 23); - this.refreshDrop.TabIndex = 9; + this.refreshDrop.Size = new System.Drawing.Size(166, 28); + this.refreshDrop.TabIndex = 4; + // + // alwaysOnTopCheckbox + // + this.alwaysOnTopCheckbox.AutoSize = true; + this.alwaysOnTopCheckbox.Location = new System.Drawing.Point(15, 279); + this.alwaysOnTopCheckbox.Name = "alwaysOnTopCheckbox"; + this.alwaysOnTopCheckbox.Size = new System.Drawing.Size(132, 24); + this.alwaysOnTopCheckbox.TabIndex = 7; + this.alwaysOnTopCheckbox.Text = "Always on top?"; + this.alwaysOnTopCheckbox.UseVisualStyleBackColor = true; + // + // hideTitleBarCheckbox + // + this.hideTitleBarCheckbox.AutoSize = true; + this.hideTitleBarCheckbox.Location = new System.Drawing.Point(15, 309); + this.hideTitleBarCheckbox.Name = "hideTitleBarCheckbox"; + this.hideTitleBarCheckbox.Size = new System.Drawing.Size(126, 24); + this.hideTitleBarCheckbox.TabIndex = 8; + this.hideTitleBarCheckbox.Text = "Hide title bar?"; + this.hideTitleBarCheckbox.UseVisualStyleBackColor = true; + // + // opacityTrackBar + // + this.opacityTrackBar.LargeChange = 10; + this.opacityTrackBar.Location = new System.Drawing.Point(97, 212); + this.opacityTrackBar.Maximum = 100; + this.opacityTrackBar.Name = "opacityTrackBar"; + this.opacityTrackBar.Size = new System.Drawing.Size(166, 56); + this.opacityTrackBar.TabIndex = 6; + this.opacityTrackBar.TickFrequency = 10; + this.opacityTrackBar.Value = 100; + this.opacityTrackBar.Scroll += new System.EventHandler(this.opacityTrackBar_Scroll); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label4.Location = new System.Drawing.Point(15, 212); + this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(80, 25); + this.label4.TabIndex = 8; + this.label4.Text = "Opacity:"; // // Settings // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(229, 199); + this.ClientSize = new System.Drawing.Size(286, 390); + this.Controls.Add(this.label4); + this.Controls.Add(this.opacityTrackBar); + this.Controls.Add(this.hideTitleBarCheckbox); + this.Controls.Add(this.alwaysOnTopCheckbox); this.Controls.Add(this.refreshDrop); this.Controls.Add(this.label3); this.Controls.Add(this.skinDrop); @@ -173,9 +236,12 @@ private void InitializeComponent() this.Controls.Add(this.applyButton); this.Controls.Add(this.cancelButton); this.Controls.Add(this.usernameTextBox); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "Settings"; this.Text = "Settings"; this.Load += new System.EventHandler(this.Settings_Load); + this.Shown += new System.EventHandler(this.Settings_Shown); + ((System.ComponentModel.ISupportInitialize)(this.opacityTrackBar)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -194,5 +260,9 @@ private void InitializeComponent() private System.Windows.Forms.ComboBox skinDrop; private System.Windows.Forms.Label label3; private System.Windows.Forms.ComboBox refreshDrop; + private System.Windows.Forms.CheckBox alwaysOnTopCheckbox; + private System.Windows.Forms.CheckBox hideTitleBarCheckbox; + private System.Windows.Forms.TrackBar opacityTrackBar; + private System.Windows.Forms.Label label4; } } \ No newline at end of file diff --git a/Settings.cs b/Settings.cs index 82d34fc..efc38d6 100644 --- a/Settings.cs +++ b/Settings.cs @@ -23,6 +23,11 @@ private void applyButton_Click(object sender, EventArgs e) ApplySettings(); } + private void cancelButton_Click(object sender, EventArgs e) + { + this.Close(); + } + void ApplySettings() { @@ -31,6 +36,9 @@ void ApplySettings() Properties.Settings.Default.region = regionDrop.SelectedIndex; Properties.Settings.Default.skin = skinDrop.SelectedIndex; Properties.Settings.Default.refresh = refreshDrop.SelectedIndex; + Properties.Settings.Default.alwaysOnTop = alwaysOnTopCheckbox.Checked; + Properties.Settings.Default.hideTitleBar = hideTitleBarCheckbox.Checked; + Properties.Settings.Default.opacity = opacityTrackBar.Value; Properties.Settings.Default.Save(); //After Setting user inputs to settings, ask user to reboot program :) DialogResult dialogResult = @@ -53,6 +61,26 @@ private void Settings_Load(object sender, EventArgs e) regionDrop.SelectedIndex = Properties.Settings.Default.region; skinDrop.SelectedIndex = Properties.Settings.Default.skin; refreshDrop.SelectedIndex = Properties.Settings.Default.refresh; + alwaysOnTopCheckbox.Checked = Properties.Settings.Default.alwaysOnTop; + hideTitleBarCheckbox.Checked = Properties.Settings.Default.hideTitleBar; + opacityTrackBar.Value = Properties.Settings.Default.opacity; + } + + private void Settings_Shown(object sender, EventArgs e) + { + if (Properties.Settings.Default.alwaysOnTop) + { + this.TopMost = true; + } + } + + private void opacityTrackBar_Scroll(object sender, EventArgs e) + { + if (opacityTrackBar.Value < 20) + { + opacityTrackBar.Value = 20; + } + } } }