mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-09 19:10:38 +00:00
(svn r15068) -Add [NoAI]: introducing 'step_size' for AIConfig, for future AIGUI (Yexo)
This commit is contained in:
parent
afb94c252d
commit
ec4bdfe611
@ -153,7 +153,7 @@ void AIFileInfo::CheckMethods(SQInteger *res, const char *name)
|
|||||||
|
|
||||||
AIConfigItem config;
|
AIConfigItem config;
|
||||||
config.name = strdup("start_date");
|
config.name = strdup("start_date");
|
||||||
config.description = strdup("The amount of months after the start of the last AI, this AI will start (give or take).");
|
config.description = strdup("The amount of days after the start of the last AI, this AI will start (give or take).");
|
||||||
config.min_value = AI::START_NEXT_MIN;
|
config.min_value = AI::START_NEXT_MIN;
|
||||||
config.max_value = AI::START_NEXT_MAX;
|
config.max_value = AI::START_NEXT_MAX;
|
||||||
config.easy_value = AI::START_NEXT_EASY;
|
config.easy_value = AI::START_NEXT_EASY;
|
||||||
@ -161,6 +161,7 @@ void AIFileInfo::CheckMethods(SQInteger *res, const char *name)
|
|||||||
config.hard_value = AI::START_NEXT_HARD;
|
config.hard_value = AI::START_NEXT_HARD;
|
||||||
config.custom_value = AI::START_NEXT_MEDIUM;
|
config.custom_value = AI::START_NEXT_MEDIUM;
|
||||||
config.random_deviation = AI::START_NEXT_DEVIATION;
|
config.random_deviation = AI::START_NEXT_DEVIATION;
|
||||||
|
config.step_size = 30;
|
||||||
config.flags = AICONFIG_NONE;
|
config.flags = AICONFIG_NONE;
|
||||||
info->config_list.push_back(config);
|
info->config_list.push_back(config);
|
||||||
|
|
||||||
@ -208,6 +209,7 @@ SQInteger AIInfo::AddSetting(HSQUIRRELVM vm)
|
|||||||
AIConfigItem config;
|
AIConfigItem config;
|
||||||
memset(&config, 0, sizeof(config));
|
memset(&config, 0, sizeof(config));
|
||||||
config.max_value = 1;
|
config.max_value = 1;
|
||||||
|
config.step_size = 1;
|
||||||
uint items = 0;
|
uint items = 0;
|
||||||
|
|
||||||
/* Read the table, and find all properties we care about */
|
/* Read the table, and find all properties we care about */
|
||||||
@ -267,6 +269,10 @@ SQInteger AIInfo::AddSetting(HSQUIRRELVM vm)
|
|||||||
sq_getinteger(vm, -1, &res);
|
sq_getinteger(vm, -1, &res);
|
||||||
config.custom_value = res;
|
config.custom_value = res;
|
||||||
items |= 0x080;
|
items |= 0x080;
|
||||||
|
} else if (strcmp(key, "step_size") == 0) {
|
||||||
|
SQInteger res;
|
||||||
|
sq_getinteger(vm, -1, &res);
|
||||||
|
config.step_size = res;
|
||||||
} else if (strcmp(key, "flags") == 0) {
|
} else if (strcmp(key, "flags") == 0) {
|
||||||
SQInteger res;
|
SQInteger res;
|
||||||
sq_getinteger(vm, -1, &res);
|
sq_getinteger(vm, -1, &res);
|
||||||
|
@ -24,6 +24,7 @@ struct AIConfigItem {
|
|||||||
int medium_value; //!< The default value on medium difficulty setting.
|
int medium_value; //!< The default value on medium difficulty setting.
|
||||||
int hard_value; //!< The default value on hard difficulty setting.
|
int hard_value; //!< The default value on hard difficulty setting.
|
||||||
int random_deviation; //!< The maximum random deviation from the default value.
|
int random_deviation; //!< The maximum random deviation from the default value.
|
||||||
|
int step_size; //!< The step size in the gui.
|
||||||
AIConfigFlags flags; //!< Flags for the configuration setting.
|
AIConfigFlags flags; //!< Flags for the configuration setting.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user