7
7
using System . Linq ;
8
8
using System . Media ;
9
9
using System . Net ;
10
+ using System . Net . Http ;
10
11
using System . Reflection ;
11
12
using System . Text ;
12
13
using System . Text . RegularExpressions ;
@@ -76,6 +77,7 @@ public MainForm()
76
77
private void Form1_Load ( object sender , EventArgs e )
77
78
{
78
79
InitData ( ) ;
80
+ CheckIfObsolote ( ) ;
79
81
DownloadCurrentLanguage ( ) ;
80
82
81
83
GetPatchList ( ) ;
@@ -85,6 +87,7 @@ private void Form1_Load(object sender, EventArgs e)
85
87
86
88
LogConfiguration ( ) ;
87
89
}
90
+
88
91
private void MainForm_Activated ( object sender , EventArgs e ) => FillJumpList ( ) ;
89
92
private void MainForm_KeyUp ( object sender , KeyEventArgs e )
90
93
{
@@ -263,6 +266,12 @@ private void NotifyIcon1_MouseClick(object sender, MouseEventArgs e)
263
266
}
264
267
}
265
268
269
+ private void TryNewLauncherLabel_Click ( object sender , EventArgs e )
270
+ {
271
+ TryNewLauncherLabel . Visible = false ;
272
+ TryNewLauncherLabel . Enabled = false ;
273
+ }
274
+
266
275
#region Sorting/Filtering Button Click Methods
267
276
268
277
private void sortAZButton1_Click ( object sender , EventArgs e )
@@ -724,6 +733,23 @@ public void UpdateConfigFile()
724
733
725
734
#region Methods Related to GUI
726
735
736
+ private void CheckIfObsolote ( )
737
+ {
738
+ var url = ( @"https://api.github.com/repos/thpatch/Universal-THCRAP-Launcher" ) ;
739
+
740
+ HttpClient client = new HttpClient ( ) ;
741
+ client . DefaultRequestHeaders . Add ( "User-Agent" , "request" ) ;
742
+ string response = client . GetStringAsync ( url ) . Result ;
743
+
744
+ dynamic json = JsonConvert . DeserializeObject ( response ) ;
745
+
746
+ if ( json . archived == "true" )
747
+ {
748
+ TryNewLauncherLabel . Visible = true ;
749
+ TryNewLauncherLabel . Enabled = true ;
750
+ }
751
+ }
752
+
727
753
public void PopulateGames ( )
728
754
{
729
755
gameListBox . Items . Clear ( ) ;
0 commit comments