From 5d6cdf438551e8bd4ddde1db71052183c61a7aef Mon Sep 17 00:00:00 2001 From: Artin Alavi <1361714+Arastais@users.noreply.github.com> Date: Fri, 11 Nov 2022 14:48:07 -0800 Subject: [PATCH] Feature: Allow AI/GS to be fully modified in scenario editor (#10152) --- src/ai/ai_gui.cpp | 7 ++++--- src/game/game_gui.cpp | 5 ++++- src/settings_type.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 8bf05b0192..a1cfade002 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -575,9 +575,10 @@ private: bool IsEditableItem(const ScriptConfigItem &config_item) const { return _game_mode == GM_MENU - || ((this->slot != OWNER_DEITY) && !Company::IsValidID(this->slot)) - || (config_item.flags & SCRIPTCONFIG_INGAME) != 0 - || _settings_client.gui.ai_developer_tools; + || _game_mode == GM_EDITOR + || ((this->slot != OWNER_DEITY) && !Company::IsValidID(this->slot)) + || (config_item.flags & SCRIPTCONFIG_INGAME) != 0 + || _settings_client.gui.ai_developer_tools; } void SetValue(int value) diff --git a/src/game/game_gui.cpp b/src/game/game_gui.cpp index 88dc4f0c4e..6b9dad8071 100644 --- a/src/game/game_gui.cpp +++ b/src/game/game_gui.cpp @@ -442,7 +442,10 @@ struct GSConfigWindow : public Window { private: bool IsEditableItem(const ScriptConfigItem &config_item) const { - return _game_mode == GM_MENU || (config_item.flags & SCRIPTCONFIG_INGAME) != 0; + return _game_mode == GM_MENU + || _game_mode == GM_EDITOR + || (config_item.flags & SCRIPTCONFIG_INGAME) != 0 + || _settings_client.gui.ai_developer_tools; } void SetValue(int value) diff --git a/src/settings_type.h b/src/settings_type.h index 2c3dea7b92..c53763ee36 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -187,7 +187,7 @@ struct GUISettings { uint8 developer; ///< print non-fatal warnings in console (>= 1), copy debug output to console (== 2) bool show_date_in_logs; ///< whether to show dates in console logs bool newgrf_developer_tools; ///< activate NewGRF developer tools and allow modifying NewGRFs in an existing game - bool ai_developer_tools; ///< activate AI developer tools + bool ai_developer_tools; ///< activate AI/GS developer tools bool scenario_developer; ///< activate scenario developer: allow modifying NewGRFs in an existing game uint8 settings_restriction_mode; ///< selected restriction mode in adv. settings GUI. @see RestrictionMode bool newgrf_show_old_versions; ///< whether to show old versions in the NewGRF list