mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r16557) -Feature(tte) [NoAI][FS#2892]: mark dead AIs by red background in the AIDebug window
This commit is contained in:
parent
83e2df5b72
commit
8563b77fee
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue