mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Starting work on colour schemes config settings
This commit is contained in:
51
src/config.c
51
src/config.c
@@ -221,6 +221,7 @@ interface_configuration gConfigInterface;
|
||||
sound_configuration gConfigSound;
|
||||
cheat_configuration gConfigCheat;
|
||||
twitch_configuration gConfigTwitch;
|
||||
colour_schemes_configuration gConfigColourSchemes;
|
||||
|
||||
bool config_open(const utf8string path);
|
||||
bool config_save(const utf8string path);
|
||||
@@ -379,6 +380,23 @@ bool config_save(const utf8string path)
|
||||
fputc('\n', file);
|
||||
}
|
||||
|
||||
fputc('[', file);
|
||||
fwrite("colour_schemes", "colour_schemes", 1, file);
|
||||
fputc(']', file);
|
||||
fputc('\n', file);
|
||||
for (i = 0; i < gNumColourSchemeWindows; i++) {
|
||||
window_colour_scheme colour_scheme = gColourSchemes[i];
|
||||
for (j = 0; j < colour_scheme.num_colours; j++) {
|
||||
|
||||
fwrite(colour_scheme.ini_name, strlen(colour_scheme.ini_name), 1, file);
|
||||
fprintf(file, "_%d", j);
|
||||
fwrite(" = ", 3, 1, file);
|
||||
fprintf(file, "%u", colour_scheme.colours[j]);
|
||||
fputc('\n', file);
|
||||
}
|
||||
fputc('\n', file);
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
return true;
|
||||
}
|
||||
@@ -993,3 +1011,36 @@ bool config_shortcut_keys_save()
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
|
||||
#pragma region Colour Schemes
|
||||
|
||||
|
||||
void colour_schemes_set_default()
|
||||
{
|
||||
gConfigColourSchemes.num_presets = 2;
|
||||
|
||||
gConfigColourSchemes.presets = malloc(sizeof(colour_schemes_setting*) * gConfigColourSchemes.num_presets);
|
||||
|
||||
gConfigColourSchemes.presets[0].colour_schemes = malloc(sizeof(window_colours) * gNumColourSchemeWindows);
|
||||
|
||||
for (int j = 0; j < gNumColourSchemeWindows; j++) {
|
||||
for (int k = 0; k < 6; k++)
|
||||
gConfigColourSchemes.presets[0].colour_schemes[j].colours[k] = gColourSchemes[j].colours[k];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool colour_schemes_open_default()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool colour_schemes_save_default()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
Reference in New Issue
Block a user