newgrf_gui.c
changeset 5669 ea25407ffa55
parent 5552 8463cf69909c
child 5682 eeddbbacd4ac
equal deleted inserted replaced
5668:76262aa5075d 5669:ea25407ffa55
   276 }
   276 }
   277 
   277 
   278 
   278 
   279 /** Callback function for the newgrf 'apply changes' confirmation window
   279 /** Callback function for the newgrf 'apply changes' confirmation window
   280  * @param yes_clicked boolean value, true when yes was clicked, false otherwise */
   280  * @param yes_clicked boolean value, true when yes was clicked, false otherwise */
   281 static void NewGRFConfirmationCallback(bool yes_clicked)
   281 static void NewGRFConfirmationCallback(Window *w, bool confirmed)
   282 {
   282 {
   283 	if (yes_clicked) {
   283 	if (confirmed) {
   284 		Window *w = FindWindowById(WC_GAME_OPTIONS, 0);
       
   285 		newgrf_d *nd = &WP(w, newgrf_d);
   284 		newgrf_d *nd = &WP(w, newgrf_d);
   286 
   285 
   287 		CopyGRFConfigList(nd->orig_list, *nd->list);
   286 		CopyGRFConfigList(nd->orig_list, *nd->list);
   288 		ReloadNewGRFData();
   287 		ReloadNewGRFData();
   289 	}
   288 	}
   422 				case SNGRFS_APPLY_CHANGES: /* Apply changes made to GRF list */
   421 				case SNGRFS_APPLY_CHANGES: /* Apply changes made to GRF list */
   423 					if (WP(w, newgrf_d).execute) {
   422 					if (WP(w, newgrf_d).execute) {
   424 						ShowQuery(
   423 						ShowQuery(
   425 							STR_POPUP_CAUTION_CAPTION,
   424 							STR_POPUP_CAUTION_CAPTION,
   426 							STR_NEWGRF_CONFIRMATION_TEXT,
   425 							STR_NEWGRF_CONFIRMATION_TEXT,
   427 							NewGRFConfirmationCallback,
   426 							w,
   428 							w->window_class,
   427 							NewGRFConfirmationCallback
   429 							w->window_number
       
   430 						);
   428 						);
   431 					} else {
   429 					} else {
   432 						CopyGRFConfigList(WP(w, newgrf_d).orig_list, *WP(w, newgrf_d).list);
   430 						CopyGRFConfigList(WP(w, newgrf_d).orig_list, *WP(w, newgrf_d).list);
   433 					}
   431 					}
   434 					break;
   432 					break;