@@ -34,6 +34,7 @@ def __init__(self):
3434 self .error = errorUi ()
3535 self .diag = dialogUi ()
3636 self .game_path = None
37+ self .not_updated_dlc = []
3738 self .path_change ()
3839 self .kill_process ('Paradox Launcher.exe' )
3940 self .kill_process ('stellaris.exe' )
@@ -57,7 +58,7 @@ def __init__(self):
5758 self .creamapidone = False
5859
5960 self .GITHUB_REPO = "https://api.github.com/repos/seuyh/stellaris-dlc-unlocker/releases/latest"
60- self .current_version = '2.2 '
61+ self .current_version = '2.21 '
6162 self .version_label .setText (f'Ver. { str (self .current_version )} ' )
6263
6364 self .copy_files_radio .setVisible (False )
@@ -70,6 +71,7 @@ def __init__(self):
7071 self .current_dlc_progress_bar .setVisible (False )
7172 self .lauch_game_checkbox .setVisible (False )
7273 self .done_button .setVisible (False )
74+
7375 self .speed_label .setVisible (False )
7476 self .update_dlc_button .setVisible (False )
7577 self .old_dlc_text .setVisible (False )
@@ -87,7 +89,12 @@ def __init__(self):
8789 self .bn_bug .clicked .connect (lambda : self .stackedWidget .setCurrentIndex (2 ))
8890 self .path_choose_button .clicked .connect (self .browse_folder )
8991 self .next_button .clicked .connect (
90- lambda : (setattr (self , 'continued' , True ) or self .stackedWidget .setCurrentIndex (1 )))
92+ lambda : (
93+ setattr (self , 'continued' , True ),
94+ self .stackedWidget .setCurrentIndex (1 ),
95+ self .old_dlc_show ()
96+ )
97+ )
9198 self .bn_home .clicked .connect (lambda : self .stackedWidget .setCurrentIndex (1 if self .continued else 0 ))
9299 self .unlock_button .clicked .connect (self .unlock )
93100 self .done_button .clicked .connect (self .finish )
@@ -100,14 +107,6 @@ def __init__(self):
100107 self .logger = Logger ('unlocker.log' , self .log_widget )
101108 self .log_widget = self .log_widget
102109 self .log_widget .clear ()
103- print ('GUI initialization complete' )
104- print ('Checking dlc updates...' )
105- if self .not_updated_dlc :
106- print (f"Not updated DLCs: { self .not_updated_dlc } " )
107- self .update_dlc_button .setVisible (True )
108- self .old_dlc_text .setVisible (True )
109- else :
110- print ("All DlCs is up to date or server return error" )
111110
112111 def showEvent (self , event ):
113112 super (MainWindow , self ).showEvent (event )
@@ -182,7 +181,6 @@ def path_change(self):
182181 print (f'Auto detected game path: { path } ' )
183182 self .game_path_line .setText (path )
184183 self .game_path = path .replace ("/" , "\\ " )
185- self .not_updated_dlc = self .checkDLCUpdate ()
186184 self .loadDLCNames ()
187185 else :
188186 print (f'Cant detect game path' )
@@ -212,6 +210,15 @@ def path_check(self):
212210 self .errorexec (self .tr ("Please choose game path" ), self .tr ("Ok" ))
213211 return False
214212
213+ def old_dlc_show (self ):
214+ if self .not_updated_dlc :
215+ print (f"Not updated DLCs: { self .not_updated_dlc } " )
216+ self .update_dlc_button .setVisible (True )
217+ self .old_dlc_text .setVisible (True )
218+ else :
219+ self .update_dlc_button .setChecked (False )
220+ print ("All DlCs is up to date or server return error" )
221+
215222 def check_for_updates (self , current_version ):
216223 try :
217224 response = requests .get (self .GITHUB_REPO )
@@ -248,6 +255,7 @@ def handle_github_status(self, status):
248255 self .errorexec (self .tr ("Can't establish connection with GitHub. Check internet" ), self .tr ("Ok" ),
249256 exitApp = True )
250257
258+
251259 def handle_server_status (self , status ):
252260 if status :
253261 self .server_status .setChecked (True )
@@ -264,13 +272,15 @@ def handle_server_status(self, status):
264272
265273 def loadDLCNames (self ):
266274 self .dlc_status_widget .clear ()
275+ self .not_updated_dlc = self .checkDLCUpdate ()
267276
268277 for dlc in dlc_data :
269278 dlc_name = dlc .get ('dlc_name' , '' ).strip ()
270279 if not dlc_name :
271280 continue
272281
273282 item = QListWidgetItem (dlc_name )
283+
274284 status_color = self .checkDLCStatus (dlc .get ('dlc_folder' , '' ))
275285
276286 if status_color != 'black' :
0 commit comments