(svn r15175) -Feature: Add the option to select the AIs to start in a new game and configure them via the gui.

This commit is contained in:
Yexo
2009-01-20 16:49:10 +00:00
parent 8d3f0dee85
commit 593f380462
12 changed files with 581 additions and 36 deletions

View File

@@ -17,6 +17,20 @@
#include "../settings_type.h"
#include "../openttd.h"
AIConfigItem _start_date_config = {
"start_date",
"The amount of days after the start of the last AI, this AI will start (give or take).",
AI::START_NEXT_MIN,
AI::START_NEXT_MAX,
AI::START_NEXT_MEDIUM,
AI::START_NEXT_EASY,
AI::START_NEXT_MEDIUM,
AI::START_NEXT_HARD,
AI::START_NEXT_DEVIATION,
30,
AICONFIG_NONE
};
AIFileInfo::~AIFileInfo()
{
this->engine->ReleaseObject(this->SQ_instance);
@@ -160,18 +174,9 @@ void AIFileInfo::CheckMethods(SQInteger *res, const char *name)
SQInteger res = AIFileInfo::Constructor(vm, info, false);
if (res != 0) return res;
AIConfigItem config;
config.name = strdup("start_date");
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;
config.medium_value = AI::START_NEXT_MEDIUM;
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;
AIConfigItem config = _start_date_config;
config.name = strdup(config.name);
config.description = strdup(config.description);
info->config_list.push_back(config);
/* Check if we have settings */