changeset 5635:9beef9076349 draft

(svn r8094) -Feature/Fix (r7523): Show the activated status of the GRF list after pressing 'apply' in the newgrf window, instead of the local list.
author Darkvater <Darkvater@openttd.org>
date Sat, 13 Jan 2007 14:01:05 +0000
parents 395bfe9e1f77
children 3af2c7ad8c2f
files src/newgrf_gui.cpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -278,9 +278,19 @@
 {
 	if (confirmed) {
 		newgrf_d *nd = &WP(w, newgrf_d);
+		GRFConfig *c;
+		int i = 0;
 
 		CopyGRFConfigList(nd->orig_list, *nd->list);
 		ReloadNewGRFData();
+
+		/* Show new, updated list */
+		for (c = *nd->list; c != NULL && c != nd->sel; c = c->next, i++);
+		CopyGRFConfigList(nd->list, *nd->orig_list);
+		for (c = *nd->list; c != NULL && i > 0; c = c->next, i--);
+		nd->sel = c;
+
+		SetWindowDirty(w);
 	}
 }