Add permissive mode for menu parsing that accepts unknown script tokens as long as they can be put into the script

This commit is contained in:
Jan
2021-11-28 17:55:26 +01:00
parent e94c48338c
commit b082e471e7
24 changed files with 200 additions and 72 deletions

View File

@ -70,6 +70,12 @@ const CommandLineOption* const OPTION_LOAD =
.Reusable()
.Build();
const CommandLineOption* const OPTION_MENU_PERMISSIVE =
CommandLineOption::Builder::Create()
.WithLongName("menu-permissive")
.WithDescription("Allows the usage of unknown script commands that can be compiled.")
.Build();
const CommandLineOption* const COMMAND_LINE_OPTIONS[]
{
OPTION_HELP,
@ -79,7 +85,8 @@ const CommandLineOption* const COMMAND_LINE_OPTIONS[]
OPTION_ASSET_SEARCH_PATH,
OPTION_GDT_SEARCH_PATH,
OPTION_SOURCE_SEARCH_PATH,
OPTION_LOAD
OPTION_LOAD,
OPTION_MENU_PERMISSIVE
};
LinkerArgs::LinkerArgs()
@ -257,6 +264,10 @@ bool LinkerArgs::ParseArgs(const int argc, const char** argv)
if (m_argument_parser.IsOptionSpecified(OPTION_LOAD))
m_zones_to_load = m_argument_parser.GetParametersForOption(OPTION_LOAD);
// --menu-permissive
if (m_argument_parser.IsOptionSpecified(OPTION_MENU_PERMISSIVE))
ObjLoading::Configuration.PermissiveMenuParsing = true;
return true;
}