Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.

Add AlwaysOnTop, Hide titlebar and opacity options #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 46 additions & 23 deletions Overlay.Designer.cs

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

44 changes: 43 additions & 1 deletion Overlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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)
Expand All @@ -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;
}
}
}
38 changes: 37 additions & 1 deletion Properties/Settings.Designer.cs

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

9 changes: 9 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,14 @@
<Setting Name="skin" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="alwaysOnTop" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="hideTitleBar" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="opacity" Type="System.Int32" Scope="User">
<Value Profile="(Default)">100</Value>
</Setting>
</Settings>
</SettingsFile>
Loading