From a91ff2d5e8b0a65da160b93f2aa293d3c54c2ae3 Mon Sep 17 00:00:00 2001 From: yexo Date: Sun, 19 Apr 2009 15:14:23 +0000 Subject: (svn r16093) -Feature [FS#2808]: Add GetURL() as possible function to info.nut. If AIs implement it, that url is shown when the AI crashes and also in the AI selection window. --- src/ai/ai_gui.cpp | 5 +++++ src/ai/ai_instance.cpp | 7 +++++++ 2 files changed, 12 insertions(+) (limited to 'src/ai') diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index b534d89cd..90e7b6394 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -101,6 +101,11 @@ struct AIListWindow : public Window { SetDParam(0, selected_info->GetVersion()); DrawString(4, this->widget[AIL_WIDGET_INFO_BG].right - 4, y, STR_AI_VERSION, TC_BLACK); y += 13; + if (selected_info->GetURL() != NULL) { + SetDParamStr(0, selected_info->GetURL()); + DrawString(4, this->widget[AIL_WIDGET_INFO_BG].right - 4, y, STR_AI_URL, TC_BLACK); + y += 13; + } SetDParamStr(0, selected_info->GetDescription()); DrawStringMultiLine(4, this->width - 8, y, this->widget[AIL_WIDGET_INFO_BG].bottom, STR_JUST_RAW_STRING); } diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index 03f6b67ba..dcd68410b 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -19,6 +19,7 @@ #define DEFINE_SCRIPT_FILES #include "ai_info.hpp" +#include "ai_config.hpp" #include "ai_storage.hpp" #include "ai_instance.hpp" #include "ai_gui.hpp" @@ -258,6 +259,12 @@ void AIInstance::Died() if (strcmp(GetCompany(_current_company)->ai_info->GetMainScript(), "%_dummy") != 0) { ShowErrorMessage(INVALID_STRING_ID, STR_AI_PLEASE_REPORT_CRASH, 0, 0); } + + const AIInfo *info = AIConfig::GetConfig(_current_company)->GetInfo(); + if (info->GetURL() != NULL) { + AILog::Info("Please report the error to the following URL:"); + AILog::Info(info->GetURL()); + } } void AIInstance::GameLoop() -- cgit v1.2.3-70-g09d2