mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
@@ -51,6 +51,7 @@ namespace hex {
|
||||
static std::vector<std::string> read(std::string_view unlocalizedCategory, std::string_view unlocalizedName, const std::vector<std::string>& defaultValue = { });
|
||||
|
||||
static std::map<std::string, std::vector<Entry>>& getEntries();
|
||||
static std::optional<nlohmann::json> getSetting(std::string_view unlocalizedCategory, std::string_view unlocalizedName);
|
||||
static nlohmann::json& getSettingsData();
|
||||
};
|
||||
|
||||
|
||||
@@ -109,6 +109,15 @@ namespace hex {
|
||||
return SharedData::settingsEntries;
|
||||
}
|
||||
|
||||
std::optional<nlohmann::json> ContentRegistry::Settings::getSetting(std::string_view unlocalizedCategory, std::string_view unlocalizedName) {
|
||||
auto &settings = getSettingsData();
|
||||
|
||||
if (!settings.contains(unlocalizedCategory)) return { };
|
||||
if (!settings[unlocalizedCategory.data()].contains(unlocalizedName)) return { };
|
||||
|
||||
return settings[unlocalizedCategory.data()][unlocalizedName.data()];
|
||||
}
|
||||
|
||||
nlohmann::json& ContentRegistry::Settings::getSettingsData() {
|
||||
return SharedData::settingsJson;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user