Feature: [UI] Split AI/Game Script configuration windows and add them to world gen window (#10058)

This commit is contained in:
Artin Alavi
2022-11-10 12:39:09 -08:00
committed by GitHub
parent fd4f148c62
commit cbac243216
15 changed files with 679 additions and 162 deletions

View File

@@ -33,6 +33,7 @@
#include "console_gui.h"
#include "news_gui.h"
#include "ai/ai_gui.hpp"
#include "game/game_gui.hpp"
#include "tilehighlight_func.h"
#include "smallmap_gui.h"
#include "graph_gui.h"
@@ -292,7 +293,8 @@ static CallBackFunction ToolbarFastForwardClick(Window *w)
enum OptionMenuEntries {
OME_GAMEOPTIONS,
OME_SETTINGS,
OME_SCRIPT_SETTINGS,
OME_AI_SETTINGS,
OME_GAMESCRIPT_SETTINGS,
OME_NEWGRFSETTINGS,
OME_TRANSPARENCIES,
OME_SHOW_TOWNNAMES,
@@ -320,7 +322,10 @@ static CallBackFunction ToolbarOptionsClick(Window *w)
/* Changes to the per-AI settings don't get send from the server to the clients. Clients get
* the settings once they join but never update it. As such don't show the window at all
* to network clients. */
if (!_networking || _network_server) list.emplace_back(new DropDownListStringItem(STR_SETTINGS_MENU_SCRIPT_SETTINGS, OME_SCRIPT_SETTINGS, false));
if (!_networking || _network_server) {
list.emplace_back(new DropDownListStringItem(STR_SETTINGS_MENU_AI_SETTINGS, OME_AI_SETTINGS, false));
list.emplace_back(new DropDownListStringItem(STR_SETTINGS_MENU_GAMESCRIPT_SETTINGS, OME_GAMESCRIPT_SETTINGS, false));
}
list.emplace_back(new DropDownListStringItem(STR_SETTINGS_MENU_NEWGRF_SETTINGS, OME_NEWGRFSETTINGS, false));
list.emplace_back(new DropDownListStringItem(STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS, OME_TRANSPARENCIES, false));
list.emplace_back(new DropDownListItem(-1, false));
@@ -350,7 +355,8 @@ static CallBackFunction MenuClickSettings(int index)
switch (index) {
case OME_GAMEOPTIONS: ShowGameOptions(); return CBF_NONE;
case OME_SETTINGS: ShowGameSettings(); return CBF_NONE;
case OME_SCRIPT_SETTINGS: ShowAIConfigWindow(); return CBF_NONE;
case OME_AI_SETTINGS: ShowAIConfigWindow(); return CBF_NONE;
case OME_GAMESCRIPT_SETTINGS: ShowGSConfigWindow(); return CBF_NONE;
case OME_NEWGRFSETTINGS: ShowNewGRFSettings(!_networking && _settings_client.gui.UserIsAllowedToChangeNewGRFs(), true, true, &_grfconfig); return CBF_NONE;
case OME_TRANSPARENCIES: ShowTransparencyToolbar(); break;