Save a GRF configuration to the given group name */
| 1250 | |
| 1251 | /* Save a GRF configuration to the given group name */ |
| 1252 | static void GRFSaveConfig(IniFile &ini, std::string_view grpname, const GRFConfigList &list) |
| 1253 | { |
| 1254 | IniGroup &group = ini.GetOrCreateGroup(grpname); |
| 1255 | group.Clear(); |
| 1256 | |
| 1257 | for (const auto &c : list) { |
| 1258 | std::string key = fmt::format("{:08X}|{}|{}", std::byteswap(c->ident.grfid), |
| 1259 | FormatArrayAsHex(c->ident.md5sum), c->filename); |
| 1260 | group.GetOrCreateItem(key).SetValue(GRFBuildParamList(*c)); |
| 1261 | } |
| 1262 | } |
| 1263 | |
| 1264 | /* Common handler for saving/loading variables to the configuration file */ |
| 1265 | static void HandleSettingDescs(IniFile &generic_ini, IniFile &private_ini, IniFile &secrets_ini, SettingDescProc *proc, SettingDescProcList *proc_list, bool only_startup = false) |
no test coverage detected