summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-06-10 19:26:04 +0000
committersmatz <smatz@openttd.org>2009-06-10 19:26:04 +0000
commit8563b77feea253e1cb1491520cc9dfd3019dd580 (patch)
tree6e1043a5be86e6d38bd43b17ac5eab4bd0bd781d /src/ai
parent83e2df5b724f5ca9daa49990c5baf192d0ccef96 (diff)
downloadopenttd-8563b77feea253e1cb1491520cc9dfd3019dd580.tar.xz
(svn r16557) -Feature(tte) [NoAI][FS#2892]: mark dead AIs by red background in the AIDebug window
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_gui.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index 8849dede0..bf12ce6ba 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -22,6 +22,7 @@
#include "ai.hpp"
#include "api/ai_log.hpp"
#include "ai_config.hpp"
+#include "ai_instance.hpp"
#include "table/strings.h"
@@ -692,6 +693,9 @@ struct AIDebugWindow : public Window {
/* Paint the company icons */
for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) {
+ /* Background is grey by default, will be changed to red for dead AIs */
+ this->widget[i + AID_WIDGET_COMPANY_BUTTON_START].colour = COLOUR_GREY;
+
Company *c = Company::GetIfValid(i);
if (c == NULL || !c->is_ai) {
/* Check if we have the company as an active company */
@@ -705,6 +709,11 @@ struct AIDebugWindow : public Window {
continue;
}
+ /* Mark dead AIs by red background */
+ if (c->ai_instance->IsDead()) {
+ this->widget[i + AID_WIDGET_COMPANY_BUTTON_START].colour = COLOUR_RED;
+ }
+
/* Check if we have the company marked as inactive */
if (this->IsWidgetDisabled(i + AID_WIDGET_COMPANY_BUTTON_START)) {
/* New AI! Yippie :p */