diff --git a/source/util/theme.cpp b/source/util/theme.cpp new file mode 100644 index 0000000..5749280 --- /dev/null +++ b/source/util/theme.cpp @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include +#include "util/theme.hpp" +#include "util/config.hpp" + +namespace Theme { + json theme; + + void Load() { + std::ifstream ifs2; + std::string ThemePath = inst::config::appDir + "/theme/theme.json"; + if (std::filesystem::exists(ThemePath)) { + ifs2 = std::ifstream(ThemePath); + theme = json::parse(ifs2); + ifs2.close(); + } + else { + std::cout << "[FAILED TO LOAD Theme FILE]" << std::endl; + return; + } + } + + std::string ThemeEntry(std::string key) { + json j = GetRelativeJson(theme, key); + if (j == nullptr) { + return "Json object: " + key + " does not exist!"; + } + return j.get(); + } +} \ No newline at end of file