Skip to content

Commit

Permalink
V2.0.1 Fullscreen by Izoyo
Browse files Browse the repository at this point in the history
  • Loading branch information
Just2good committed Jul 24, 2019
1 parent 7269f77 commit a8af27b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 4 deletions.
50 changes: 48 additions & 2 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ namespace TFT_Overlay
/// </summary>
public partial class MainWindow : Window
{
[System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, ExactSpelling = true)]
public static extern IntPtr GetForegroundWindow();
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SetForegroundWindow")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
public IntPtr myHandle;
private System.Timers.Timer tTop;

private readonly Cursor LoLNormal = CustomCursor.FromByteArray(Properties.Resources.LoLNormal);
private readonly Cursor LoLPointer = CustomCursor.FromByteArray(Properties.Resources.LoLPointer);
private readonly Cursor LoLHover = CustomCursor.FromByteArray(Properties.Resources.LoLHover);
Expand All @@ -37,6 +44,17 @@ public MainWindow()
InitializeComponent();
LoadStringResource(Settings.Default.Language);
this.Cursor = LoLNormal;

this.WindowState = System.Windows.WindowState.Normal;
this.ShowInTaskbar = false;
this.Topmost = OnTop;
myHandle = new System.Windows.Interop.WindowInteropHelper(this).Handle;
//...
tTop = new System.Timers.Timer(15000);//set Timer
tTop.Elapsed += new System.Timers.ElapsedEventHandler(theout);
tTop.AutoReset = true;
tTop.Enabled = true;

CanDrag = !Settings.Default.Lock;

if (Settings.Default.AutoDim == true)
Expand All @@ -50,6 +68,34 @@ public MainWindow()
}
}

public void theout(object source, System.Timers.ElapsedEventArgs e)
{
if (OnTop)
{
if (myHandle != GetForegroundWindow()) //let the win always on focus
{
SetForegroundWindow(myHandle);
}
try
{
this.Dispatcher.Invoke(
new Action(
delegate
{
this.Topmost = false;
this.Topmost = true;

}
)
);
}
catch (System.Threading.Tasks.TaskCanceledException errMsg)
{
tTop.Stop();
}
}
}

private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
Settings.Default.Save();
Expand All @@ -62,12 +108,12 @@ private void MenuItem_Click(object sender, RoutedEventArgs e)

private void MenuItem_Click_About(object sender, RoutedEventArgs e)
{
MessageBox.Show("TFT Information Overlay V" + CurrentVersion + " by J2GKaze/Jinsoku#4019\n\nDM me on Discord if you have any questions\n\nLast Updated: July 23rd, 2019 @ 5:45PM PST", "About");
MessageBox.Show("TFT Information Overlay V" + CurrentVersion + " by J2GKaze/Jinsoku#4019\n\nDM me on Discord if you have any questions\n\nLast Updated: July 24th, 2019 @ 4:25 PST", "About");
}

private void MenuItem_Click_Credits(object sender, RoutedEventArgs e)
{
MessageBox.Show("Big thanks to:\nChaoticoz: Lock Window, Always on Top, and Mouseover\nAsemco/Asemco#7390: Adding Origins and Classes\nAthenyx#9406: Designs\nTenebris: Auto-Updater\nOBJECT#3031: Items/Origins/Classes Strings Base\nJpgdev: Readme format\nKbphan\nEerilai\nꙅꙅɘᴎTqAbɘbᴎɘld#1175: Window Position/Size Saving, CPU Threading Fix\nNarcolic#6374: Item Builder\n\nShoutout to:\nAlexander321#7153 for the Discord Nitro Gift!\nAnonymous for Reddit Gold\nu/test01011 for Reddit Gold\n\nmac#0001 & bNatural#0001(Feel free to bug these 2 on Discord) ;)\nShamish#4895 (Make sure you bug this guy a lot)\nDekinosai#7053 (Buy this man tons of drinks)", "Credits");
MessageBox.Show("Big thanks to:\nChaoticoz: Lock Window, Always on Top, and Mouseover\nAsemco/Asemco#7390: Adding Origins and Classes\nAthenyx#9406: Designs\nTenebris: Auto-Updater\nOBJECT#3031: Items/Origins/Classes Strings Base\nJpgdev: Readme format\nKbphan\nEerilai\nꙅꙅɘᴎTqAbɘbᴎɘld#1175: Window Position/Size Saving, CPU Threading Fix\nNarcolic#6374: Item Builder\nIzoyo: Fullscreen\n\nShoutout to:\nAlexander321#7153 for the Discord Nitro Gift!\nAnonymous for Reddit Gold\nu/test01011 for Reddit Gold\n\nmac#0001 & bNatural#0001(Feel free to bug these 2 on Discord) ;)\nShamish#4895 (Make sure you bug this guy a lot)\nDekinosai#7053 (Buy this man tons of drinks)", "Credits");
}

private void MenuItem_Click_Lock(object sender, RoutedEventArgs e)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
- [Click Here for instructions](https://github.com/Just2good/TFT-Overlay/blob/master/Localization.md)

## Version History
- **7.24.2019**
-[2.0.1](https://github.com/Just2good/TFT-Overlay/releases/tag/V2.0.1)
- Fullscreen by Izoyo
- Updated for 9.14B
- IT & FR Updated

- **7.23.2019**
- [1.9.9](https://github.com/Just2good/TFT-Overlay/releases/tag/V1.9.9)
- Added Player Damage Chart
Expand Down
2 changes: 1 addition & 1 deletion Utilities/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
class Version
{
public static string version = "1.9.9";
public static string version = "2.0.1";
}
}
2 changes: 1 addition & 1 deletion Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
class Version
{
public static string version = "1.9.9";
public static string version = "2.0.1";
}
}

0 comments on commit a8af27b

Please sign in to comment.