From ec4bdfe611af31bc9f54d103d30c4c082174358e Mon Sep 17 00:00:00 2001 From: truebrain Date: Tue, 13 Jan 2009 18:26:58 +0000 Subject: (svn r15068) -Add [NoAI]: introducing 'step_size' for AIConfig, for future AIGUI (Yexo) --- src/ai/ai_info.cpp | 8 +++++++- src/ai/ai_info.hpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp index c67059f20..b2c653826 100644 --- a/src/ai/ai_info.cpp +++ b/src/ai/ai_info.cpp @@ -153,7 +153,7 @@ void AIFileInfo::CheckMethods(SQInteger *res, const char *name) AIConfigItem config; 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.max_value = AI::START_NEXT_MAX; 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.custom_value = AI::START_NEXT_MEDIUM; config.random_deviation = AI::START_NEXT_DEVIATION; + config.step_size = 30; config.flags = AICONFIG_NONE; info->config_list.push_back(config); @@ -208,6 +209,7 @@ SQInteger AIInfo::AddSetting(HSQUIRRELVM vm) AIConfigItem config; memset(&config, 0, sizeof(config)); config.max_value = 1; + config.step_size = 1; uint items = 0; /* Read the table, and find all properties we care about */ @@ -267,6 +269,10 @@ SQInteger AIInfo::AddSetting(HSQUIRRELVM vm) sq_getinteger(vm, -1, &res); config.custom_value = res; 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) { SQInteger res; sq_getinteger(vm, -1, &res); diff --git a/src/ai/ai_info.hpp b/src/ai/ai_info.hpp index ce48a6f35..71691ae3a 100644 --- a/src/ai/ai_info.hpp +++ b/src/ai/ai_info.hpp @@ -24,6 +24,7 @@ struct AIConfigItem { int medium_value; //!< The default value on medium difficulty setting. int hard_value; //!< The default value on hard difficulty setting. 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. }; -- cgit v1.2.3-54-g00ecf