diff options
author | Darkvater <darkvater@openttd.org> | 2006-12-29 17:54:47 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-12-29 17:54:47 +0000 |
commit | 18524958aa3372ad8a720e560270f69c20526149 (patch) | |
tree | 74ccb73656b5133e8ffcd6d610d5fd1ff7615e4a /newgrf_gui.c | |
parent | 0ca54b8ecfa5831972ff9245d40f344e9df6a972 (diff) | |
download | openttd-18524958aa3372ad8a720e560270f69c20526149.tar.xz |
(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.
Diffstat (limited to 'newgrf_gui.c')
-rw-r--r-- | newgrf_gui.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/newgrf_gui.c b/newgrf_gui.c index 9babf017e..ad9aa5916 100644 --- a/newgrf_gui.c +++ b/newgrf_gui.c @@ -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); |