1 #ifndef CORE_CONFIG_H
2 #define CORE_CONFIG_H
3 
4 #define CONFIG_STRING_VALUE_MAX 64
5 
6 typedef enum {
7     CONFIG_GENERAL_ENABLE_AUDIO,
8     CONFIG_GENERAL_MASTER_VOLUME,
9     CONFIG_GENERAL_ENABLE_VIDEO_SOUND,
10     CONFIG_GENERAL_VIDEO_VOLUME,
11     CONFIG_UI_WALKER_WAYPOINTS,
12     CONFIG_GP_FIX_IMMIGRATION_BUG,
13     CONFIG_GP_FIX_100_YEAR_GHOSTS,
14     CONFIG_SCREEN_DISPLAY_SCALE,
15     CONFIG_SCREEN_CURSOR_SCALE,
16     CONFIG_SCREEN_COLOR_CURSORS,
17     CONFIG_UI_SIDEBAR_INFO,
18     CONFIG_UI_SHOW_INTRO_VIDEO,
19     CONFIG_UI_SMOOTH_SCROLLING,
20     CONFIG_UI_DISABLE_MOUSE_EDGE_SCROLLING,
21     CONFIG_UI_VISUAL_FEEDBACK_ON_DELETE,
22     CONFIG_UI_ALLOW_CYCLING_TEMPLES,
23     CONFIG_UI_SHOW_WATER_STRUCTURE_RANGE,
24     CONFIG_UI_SHOW_CONSTRUCTION_SIZE,
25     CONFIG_UI_ZOOM,
26     CONFIG_UI_HIGHLIGHT_LEGIONS,
27     CONFIG_UI_SHOW_MILITARY_SIDEBAR,
28     CONFIG_UI_DISABLE_RIGHT_CLICK_MAP_DRAG,
29     CONFIG_UI_SHOW_MAX_PROSPERITY,
30     CONFIG_UI_DIGIT_SEPARATOR,
31     CONFIG_GP_CH_MAX_GRAND_TEMPLES,
32     CONFIG_GP_CH_JEALOUS_GODS,
33     CONFIG_GP_CH_GLOBAL_LABOUR,
34     CONFIG_GP_CH_RETIRE_AT_60,
35     CONFIG_GP_CH_FIXED_WORKERS,
36     CONFIG_GP_CH_WOLVES_BLOCK,
37     CONFIG_GP_CH_NO_SUPPLIER_DISTRIBUTION,
38     CONFIG_GP_CH_GETTING_GRANARIES_GO_OFFROAD,
39     CONFIG_GP_CH_GRANARIES_GET_DOUBLE,
40     CONFIG_GP_CH_ALLOW_EXPORTING_FROM_GRANARIES,
41     CONFIG_GP_CH_TOWER_SENTRIES_GO_OFFROAD,
42     CONFIG_GP_CH_FARMS_DELIVER_CLOSE,
43     CONFIG_GP_CH_DELIVER_ONLY_TO_ACCEPTING_GRANARIES,
44     CONFIG_GP_CH_ALL_HOUSES_MERGE,
45     CONFIG_GP_CH_RANDOM_COLLAPSES_TAKE_MONEY,
46     CONFIG_GP_CH_MULTIPLE_BARRACKS,
47     CONFIG_GP_CH_WAREHOUSES_DONT_ACCEPT,
48     CONFIG_GP_CH_HOUSES_DONT_EXPAND_INTO_GARDENS,
49     CONFIG_GP_CH_MONUMENTS_BOOST_CULTURE_RATING,
50     CONFIG_GP_CH_DISABLE_INFINITE_WOLVES_SPAWNING,
51     CONFIG_GP_CH_ROAMERS_DONT_SKIP_CORNERS,
52     CONFIG_MAX_ENTRIES
53 } config_key;
54 
55 typedef enum {
56     CONFIG_STRING_UI_LANGUAGE_DIR,
57     CONFIG_STRING_MAX_ENTRIES
58 } config_string_key;
59 
60 /**
61  * Get an integer config value
62  * @param key Integer key
63  * @return Config value
64  */
65 int config_get(config_key key);
66 
67 /**
68  * Set an integer config value
69  * @param key Integer key
70  * @param value Value to set
71  */
72 void config_set(config_key key, int value);
73 
74 /**
75  * Get a string config value
76  * @param key String key
77  * @return Config value, is always non-NULL but may be an empty string
78  */
79 const char *config_get_string(config_string_key key);
80 
81 /**
82  * Set a string config value
83  * @param key String key
84  * @param value Value to set
85  */
86 void config_set_string(config_string_key key, const char *value);
87 
88 /**
89  * Set a default config value
90  * @param key Integer key
91  * @return Default config value
92  */
93 int config_get_default_value(config_key key);
94 
95 /**
96  * Get a string default config value
97  * @param key String key
98  * @return Default config value, is always non-NULL but may be an empty string
99  */
100 const char *config_get_default_string_value(config_string_key key);
101 
102 /**
103  * Load config from file
104  */
105 void config_load(void);
106 
107 /**
108  * Save config to file
109  */
110 void config_save(void);
111 
112 #endif // CORE_CONFIG_H
113