summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-11-18 22:24:10 +0000
committerrubidium <rubidium@openttd.org>2010-11-18 22:24:10 +0000
commitc7f0518f162645e4bccdea64387b8fe63009af2a (patch)
treed95fd7120f3cd3bda657b829996adbe0f8ca561b /src
parent94c45d9cc34afca7b66e1cf4595bff816123b055 (diff)
downloadopenttd-c7f0518f162645e4bccdea64387b8fe63009af2a.tar.xz
(svn r21246) -Fix: upon rescanning AIs the new AIs would (after some time) show up in the AI list but you could not select all
Diffstat (limited to 'src')
-rw-r--r--src/ai/ai_gui.cpp5
-rw-r--r--src/console_cmds.cpp1
-rw-r--r--src/network/network_content_gui.cpp1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index b956582d4..a29c169eb 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -187,6 +187,11 @@ struct AIListWindow : public Window {
this->vscroll->SetCapacity(nwi->current_y / this->line_height);
nwi->widget_data = (this->vscroll->GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START);
}
+
+ virtual void OnInvalidateData(int data)
+ {
+ this->vscroll->SetCount((int)this->ai_info_list->size() + 1);
+ }
};
/** Widgets for the AI list window. */
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 89680fde5..f29e315e0 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -1158,6 +1158,7 @@ DEF_CONSOLE_CMD(ConRescanAI)
}
AI::Rescan();
+ InvalidateWindowData(WC_AI_LIST, 0, 1);
return true;
}
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index be99a338b..b48781ea0 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -94,6 +94,7 @@ public:
case CONTENT_TYPE_AI_LIBRARY:
AI::Rescan();
SetWindowClassesDirty(WC_AI_DEBUG);
+ InvalidateWindowData(WC_AI_LIST, 0, 1);
break;
case CONTENT_TYPE_BASE_GRAPHICS: