@@ -63,6 +63,11 @@ def __init__(self) -> None:
6363 self .root .geometry ("530x700" )
6464 self .load_theme ()
6565
66+ try :
67+ ttk .Style (self .root ).theme_use ("vista" )
68+ except TclError :
69+ pass
70+
6671 self .root .bind ("<Control-Shift-S>" , lambda * args : self .save_project_as ())
6772 self .root .bind ("<Control-s>" , lambda * args : self .save_project ())
6873 self .root .bind ("<Control-o>" , lambda * args : self .load_project ())
@@ -185,12 +190,72 @@ def build_game(self) -> None:
185190
186191 logger ("Build Tools: Starting build" )
187192
188- build (Path (GP_BASE_PATH ), ENGINE_DATA_PATH = ENGINE_DATA_PATH )
193+ process = build (
194+ name = self .project_name_input .get (),
195+ directory = Path (GP_BASE_PATH ),
196+ ENGINE_DATA_PATH = ENGINE_DATA_PATH ,
197+ )
198+
199+ if process is None :
200+ return
201+
202+ progress_popup = tk .Toplevel (self .root )
203+ progress_popup .wm_title ("Building Game" )
204+ progress_popup .resizable (False , False )
205+ progress_popup .protocol ("WM_DELETE_WINDOW" , lambda : None )
206+ progress_popup .transient (self .root )
207+
208+ progress_content = ttk .Frame (progress_popup , padding = (24 , 20 ))
209+ progress_content .pack (fill = "both" , expand = True )
210+
211+ ttk .Label (
212+ progress_content , text = "Building Game" , font = ("Segoe UI" , 12 , "bold" )
213+ ).pack (anchor = "w" )
214+
215+ ttk .Label (
216+ progress_content ,
217+ text = "This may take a few moments, please wait..." ,
218+ foreground = "#666666" ,
219+ ).pack (anchor = "w" , pady = (2 , 14 ))
220+
221+ progress_bar = ttk .Progressbar (progress_content , mode = "indeterminate" , length = 300 )
222+ progress_bar .pack (fill = "x" )
223+ progress_bar .start (10 )
224+
225+ ttk .Label (
226+ progress_content ,
227+ text = "See the console for detailed logs." ,
228+ foreground = "#999999" ,
229+ font = ("Segoe UI" , 8 ),
230+ ).pack (anchor = "w" , pady = (12 , 0 ))
231+
232+ progress_popup .update_idletasks ()
233+ popup_x = self .root .winfo_x () + (self .root .winfo_width () - progress_popup .winfo_width ()) // 2
234+ popup_y = self .root .winfo_y () + (self .root .winfo_height () - progress_popup .winfo_height ()) // 2
235+ progress_popup .geometry (f"+{ popup_x } +{ popup_y } " )
236+
237+ progress_popup .grab_set ()
238+
239+ def poll_build () -> None :
240+ if process .is_alive ():
241+ self .root .after (200 , poll_build )
242+ return
243+
244+ progress_bar .stop ()
245+ progress_popup .grab_release ()
246+ progress_popup .destroy ()
247+
248+ if process .exitcode == 0 :
249+ logger ("Build Tools: Build completed" )
250+ messagebox .showinfo ("Build Tools | ABS Engine" , "The build has been completed." )
251+ else :
252+ logger ("Build Tools: Build failed" , status = LoggerStatus .WARNING )
253+ messagebox .showerror (
254+ "Build Tools | ABS Engine" ,
255+ "The build failed. Check the console/log output for details." ,
256+ )
189257
190- logger ("Build Tools: Waiting for root" )
191- self .root .after (3000 , lambda : None )
192- logger ("Build Tools: Build completed" )
193- messagebox .showinfo ("Build Tools | ABS Engine" , "The build has been completed." )
258+ self .root .after (200 , poll_build )
194259
195260 def game_settings (self ) -> None :
196261 self .game_settings_popup = tk .Toplevel (self .root , height = 150 )
0 commit comments