Codechange: move windows common to AI and GS out of ai_gui

This commit is contained in:
glx22
2023-02-04 04:17:55 +01:00
committed by Loïc Guilloux
parent 78e3c93a25
commit b080f24bd8
26 changed files with 1391 additions and 1374 deletions

View File

@@ -13,10 +13,6 @@
#include "../script/api/script_event_types.hpp"
#include "../core/string_compare_type.hpp"
#include "ai_scanner.hpp"
#include <map>
/** A list that maps AI names to their AIInfo object. */
typedef std::map<const char *, class ScriptInfo *, StringCompare> ScriptInfoList;
/**
* Main AI class. Contains all functions needed to start, stop, save and load AIs.

View File

@@ -62,7 +62,7 @@
cur_company.Restore();
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
InvalidateWindowData(WC_SCRIPT_DEBUG, 0, -1);
return;
}
@@ -113,8 +113,8 @@
cur_company.Restore();
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
CloseWindowById(WC_AI_SETTINGS, company);
InvalidateWindowData(WC_SCRIPT_DEBUG, 0, -1);
CloseWindowById(WC_SCRIPT_SETTINGS, company);
}
/* static */ void AI::Pause(CompanyID company)
@@ -338,9 +338,9 @@
AI::scanner_library->RescanDir();
ResetConfig();
InvalidateWindowData(WC_AI_LIST, 0, 1);
SetWindowClassesDirty(WC_AI_DEBUG);
InvalidateWindowClassesData(WC_AI_SETTINGS);
InvalidateWindowData(WC_SCRIPT_LIST, 0, 1);
SetWindowClassesDirty(WC_SCRIPT_DEBUG);
InvalidateWindowClassesData(WC_SCRIPT_SETTINGS);
}
/**

File diff suppressed because it is too large Load Diff

View File

@@ -10,13 +10,6 @@
#ifndef AI_GUI_HPP
#define AI_GUI_HPP
#include "../company_type.h"
void ShowAIListWindow(CompanyID slot);
Window* ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY);
void ShowAIConfigWindow();
void ShowScriptTextfileWindow(TextfileType file_type, CompanyID slot);
void ShowAIDebugWindowIfAIError();
void InitializeAIGui();
#endif /* AI_GUI_HPP */

View File

@@ -14,11 +14,11 @@
#include "../script/squirrel_class.hpp"
#include "ai_config.hpp"
#include "ai_gui.hpp"
#include "ai.hpp"
#include "../script/script_storage.hpp"
#include "../script/script_cmd.h"
#include "../script/script_gui.h"
#include "ai_info.hpp"
#include "ai_instance.hpp"
@@ -64,7 +64,7 @@ void AIInstance::Died()
/* Intro is not supposed to use AI, but it may have 'dummy' AI which instant dies. */
if (_game_mode == GM_MENU) return;
ShowAIDebugWindow(_current_company);
ShowScriptDebugWindow(_current_company);
const AIInfo *info = AIConfig::GetConfig(_current_company, AIConfig::SSS_FORCE_GAME)->GetInfo();
if (info != nullptr) {