12 #ifndef SCRIPT_CONFIG_HPP 13 #define SCRIPT_CONFIG_HPP 17 #include "../core/smallmap_type.hpp" 18 #include "../core/string_compare_type.hpp" 19 #include "../company_type.h" 20 #include "../textfile_gui.h" 88 void Change(
const char *
name,
int version = -1,
bool force_exact_match =
false,
bool is_random =
false);
118 void AnchorUnchangeableSettings();
127 virtual int GetSetting(
const char *name)
const;
132 virtual void SetSetting(
const char *name,
int value);
137 void ResetSettings();
142 void AddRandomDeviation();
148 bool HasScript()
const;
153 bool IsRandom()
const;
169 void StringToSettings(
const char *value);
175 void SettingsToString(
char *
string,
const char *last)
const;
202 virtual void ClearConfigList();
208 virtual ScriptInfo *FindInfo(
const char *name,
int version,
bool force_exact_match) = 0;
int GetVersion() const
Get the version of the script.
This setting will only be visible when the Script development tools are active.
int random_deviation
The maximum random deviation from the default value.
const ScriptConfigItemList * GetConfigList() const
Get the config list for this Script.
int min_value
The minimal value this configuration setting can have.
const char * GetName() const
Get the Name of the script.
std::list< ScriptConfigItem > ScriptConfigItemList
List of ScriptConfig items.
Implementation of simple mapping class.
ScriptConfigItem _start_date_config
Configuration for AI start date, every AI has this setting.
LabelMapping * labels
Text labels for the integer values.
SettingValueList settings
List with all setting=>value pairs that are configure for this Script.
int max_value
The maximal value this configuration setting can have.
bool is_random
True if the AI in this slot was randomly chosen.
int medium_value
The default value on medium difficulty setting.
ScriptConfigItemList * config_list
List with all settings defined by this Script.
Get the Script config from the current game mode.
ScriptConfigFlags
Bitmask of flags for Script settings.
std::map< const char *, int, StringCompare > SettingValueList
List with name=>value pairs of all script-specific settings.
bool complete_labels
True if all values have a label.
All static information from an Script like name, version, etc.
ScriptSettingSource
Where to get the config from, either default (depends on current game mode) or force either newgame o...
int easy_value
The default value on easy difficulty setting.
When randomizing the Script, pick any value between min_value and max_value when on custom difficulty...
int custom_value
The default value on custom difficulty setting.
TextfileType
Additional text files accompanying Tar archives.
SmallMap< int, char * > LabelMapping
Map-type used to map the setting numbers to labels.
This value is a boolean (either 0 (false) or 1 (true) ).
const char * description
The description of the configuration setting.
ScriptConfigFlags flags
Flags for the configuration setting.
Info about a single Script setting.
int version
Version of the Script.
Get the newgame Script config.
This setting can be changed while the Script is running.
class ScriptInfo * info
ScriptInfo object for related to this Script version.
int hard_value
The default value on hard difficulty setting.
const char * name
Name of the Script.
Owner
Enum for all companies/owners.
const char * GetTextfile(TextfileType type, Subdirectory dir, const char *filename)
Search a textfile file next to the given content.
int step_size
The step size in the gui.
Get the Script config from the current game.
virtual void PushExtraConfigList()
In case you have mandatory non-Script-definable config entries in your list, add them to this functio...
const char * name
The name of the configuration setting.