(svn r7621) -Codechange: Rework ShowQuery into a general modal popup window. It gets passed

a parent pointer which will be blocked as long as the popup is open. This
 applies to newgrf-apply, heightmap warning, genworld progress.
This commit is contained in:
Darkvater
2006-12-29 17:54:47 +00:00
parent 324e805d51
commit a7f2b8095f
6 changed files with 110 additions and 73 deletions

View File

@@ -278,10 +278,9 @@ static void SetupNewGRFWindow(Window *w)
/** Callback function for the newgrf 'apply changes' confirmation window
* @param yes_clicked boolean value, true when yes was clicked, false otherwise */
static void NewGRFConfirmationCallback(bool yes_clicked)
static void NewGRFConfirmationCallback(Window *w, bool confirmed)
{
if (yes_clicked) {
Window *w = FindWindowById(WC_GAME_OPTIONS, 0);
if (confirmed) {
newgrf_d *nd = &WP(w, newgrf_d);
CopyGRFConfigList(nd->orig_list, *nd->list);
@@ -424,9 +423,8 @@ static void NewGRFWndProc(Window *w, WindowEvent *e)
ShowQuery(
STR_POPUP_CAUTION_CAPTION,
STR_NEWGRF_CONFIRMATION_TEXT,
NewGRFConfirmationCallback,
w->window_class,
w->window_number
w,
NewGRFConfirmationCallback
);
} else {
CopyGRFConfigList(WP(w, newgrf_d).orig_list, *WP(w, newgrf_d).list);