1#include "Misc/OSLiscences.h"
10#include "Utils/Utils.h"
11#include "Data/ApplicationState.h"
13namespace fs = std::filesystem;
15OSLiscences::~OSLiscences()
23 std::string path = appState->constants.liscensesDir;
25 for (
const auto &entry : fs::directory_iterator(path))
27 std::string path{ entry.path().u8string() };
28 std::string name{ entry.path().filename().u8string()};
30 name = name.substr(0, name.size() - 3);
31 osls.push_back(std::make_pair(name, ReadShaderSourceFile(path, &tmp)));
35void OSLiscences::ShowLisc(std::string &name, std::string &content,
int id)
37 bool state = ImGui::CollapsingHeader((
"##LiscItem" + std::to_string(
id)).c_str());
39 ImGui::Text(name.c_str());
43 ImGui::Text(content.c_str());
48void OSLiscences::ShowSettings(
bool *pOpen)
50 ImGui::Begin(
"Open Source LICENSES", pOpen);
53 for (
auto &item : osls)
55 ShowLisc(item.first, item.second,
id++);