35TConfig
LoadConfig(
Runtime& runtime, TConfig config = {},
const LoadConfigOptions& options = {})
37 const std::string path = runtime.
PluginFile(options.SettingsFile);
39 if constexpr (
requires { config.LoadSettings(path); })
41 return config.LoadSettings(path);
45 return config.Load(path);
49 if (!status && !status.error().Detail.starts_with(path))
51 status.error().Detail = std::format(
"{}: {}", path, status.error().Detail);
58 if (options.Translations)
61 if constexpr (
requires { translations.SetLanguage(config.Get().plugin.locale); })
63 translations.SetLanguage(config.Get().plugin.locale);
TConfig LoadConfig(Runtime &runtime, TConfig config={}, const LoadConfigOptions &options={})
Load the plugin's settings, then its translations, and return config.