else if (tab == 4)
{
ImGui::SetCursorPos({ 132, 5 });
ImGui::BeginChild("##1", { 166,276 });
{
float group_w = ImGui::GetCurrentWindow()->Size.x - ImGui::GetStyle().FramePadding.x * 2;
static int selected = 0;
static char cfgName[32];
std::vector<std::string> cfgList;
ReadDirectory(g_Options.folder, cfgList);
ImGui::PushItemWidth(150.f);
if (!cfgList.empty())
{
ImGui::Spacing();
ImGui::SameLine();
ImGui::InputText("##configname", cfgName, 24);
//ImGui::SameLine();
if (ImGui::Button("Create Config", ImVec2(160, 20)))
{
if (strlen(cfgName))
g_Options.SaveSettings(cfgName + std::string(".ini"));
}
if (ImGui::Button("Save", ImVec2(160, 20)))
{
g_Options.SaveSettings(cfgList[selected]);
}
//ImGui::SameLine();
if (ImGui::Button("Load", ImVec2(160, 20))) {
g_Options.LoadSettings(cfgList[selected]);
}
if (ImGui::Button("Unload", ImVec2(160, 20))) {
g_Unload = true;
}
if (ImGui::Button("Delete Config", ImVec2(160, 20))) {
g_Options.DeleteSettings(cfgList[selected]);
selected = 0;
}
ImGui::Separator();
}
ImGui::PopItemWidth();
}
ImGui::EndChild();
ImGui::SetCursorPos({ 302, 5 });
ImGui::BeginChild("##2", { 166,276 });
{
static int selected = 0;
static char cfgName[64];
std::vector<std::string> cfgList;
ReadDirectory(g_Options.folder, cfgList);
ImGui::PushItemWidth(150.f);
if (!cfgList.empty())
{
ImGui::ListBoxHeader("##SelectConfig", ImVec2(-1, 505)); cfgList[selected].c_str();
{
for (size_t i = 0; i < cfgList.size(); i++)
{
if (ImGui::Selectable(cfgList[i].c_str(), i == selected)) {
selected = i;
}
}
ImGui::ListBoxFooter();
ImGui::Spacing();
}
}
ImGui::EndChild();
}
}