Allow to set commandline arguments on android
This commit is contained in:
parent
e823babb90
commit
90f3a2389e
@ -994,6 +994,10 @@ namespace UserConfigParams
|
||||
PARAM_PREFIX BoolUserConfigParam m_everything_unlocked
|
||||
PARAM_DEFAULT( BoolUserConfigParam(false, "everything_unlocked",
|
||||
"Enable all karts and tracks") );
|
||||
|
||||
PARAM_PREFIX StringUserConfigParam m_commandline
|
||||
PARAM_DEFAULT( StringUserConfigParam("", "commandline",
|
||||
"Allows to set commandline args in config file") );
|
||||
|
||||
// TODO? implement blacklist for new irrlicht device and GUI
|
||||
PARAM_PREFIX std::vector<std::string> m_blacklist_res;
|
||||
|
@ -1737,6 +1737,8 @@ int main(int argc, char *argv[] )
|
||||
// handle all command line options that do not need (or must
|
||||
// not have) other managers initialised:
|
||||
initUserConfig();
|
||||
|
||||
CommandLine::addArgsFromUserConfig();
|
||||
|
||||
handleCmdLinePreliminary();
|
||||
|
||||
|
@ -32,12 +32,28 @@ std::string CommandLine::m_exec_name="";
|
||||
void CommandLine::init(unsigned int argc, char *argv[])
|
||||
{
|
||||
if (argc > 0)
|
||||
{
|
||||
m_exec_name = argv[0];
|
||||
}
|
||||
|
||||
for(unsigned int i=1; i<argc; i++)
|
||||
for (unsigned int i = 1; i < argc; i++)
|
||||
{
|
||||
m_argv.push_back(argv[i]);
|
||||
}
|
||||
} // CommandLine
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void CommandLine::addArgsFromUserConfig()
|
||||
{
|
||||
std::vector<std::string> config_args;
|
||||
config_args = StringUtils::split(UserConfigParams::m_commandline, ' ');
|
||||
|
||||
for (std::string config_arg : config_args)
|
||||
{
|
||||
m_argv.push_back(config_arg);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool CommandLine::has(const std::string &option)
|
||||
{
|
||||
|
@ -79,6 +79,7 @@ private:
|
||||
|
||||
public:
|
||||
static void init(unsigned int argc, char *argv[]);
|
||||
static void addArgsFromUserConfig();
|
||||
static void reportInvalidParameters();
|
||||
static bool has(const std::string &option);
|
||||
// ------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user