Switch sides & add arrow buttons

This commit is contained in:
Pepe20129 2025-01-11 22:48:29 +01:00
commit 1e33244fbf

View file

@ -122,8 +122,8 @@ void ModMenuWindow::DrawElement() {
} }
if (ImGui::BeginTable("tableMods", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { if (ImGui::BeginTable("tableMods", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
ImGui::TableSetupColumn("Enabled Mods", ImGuiTableColumnFlags_WidthStretch, 200.0f);
ImGui::TableSetupColumn("Disabled Mods", ImGuiTableColumnFlags_WidthStretch, 200.0f); ImGui::TableSetupColumn("Disabled Mods", ImGuiTableColumnFlags_WidthStretch, 200.0f);
ImGui::TableSetupColumn("Enabled Mods", ImGuiTableColumnFlags_WidthStretch, 200.0f);
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
ImGui::TableHeadersRow(); ImGui::TableHeadersRow();
ImGui::PopItemFlag(); ImGui::PopItemFlag();
@ -131,13 +131,13 @@ void ModMenuWindow::DrawElement() {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
if (ImGui::BeginChild("Enabled Mods", ImVec2(0, -8))) { if (ImGui::BeginChild("Disabled Mods", ImVec2(0, -8))) {
std::vector<std::string> enabledMods = GetEnabledModFiles(); std::vector<std::string> disabledMods = GetDisabledModFiles();
if (!enabledMods.empty()) { if (!disabledMods.empty()) {
for (std::string file : enabledMods) { for (std::string file : disabledMods) {
if (ImGui::Button(("Disable##" + file).c_str())) { if (ImGui::ArrowButton(file.c_str(), ImGuiDir_Right)) {
modFiles[file] = false; modFiles[file] = true;
GetArchiveManager()->RemoveArchive(file); GetArchiveManager()->AddArchive(file);
AfterModChange(); AfterModChange();
} }
ImGui::SameLine(); ImGui::SameLine();
@ -152,13 +152,13 @@ void ModMenuWindow::DrawElement() {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
if (ImGui::BeginChild("Disabled Mods", ImVec2(0, -8))) { if (ImGui::BeginChild("Enabled Mods", ImVec2(0, -8))) {
std::vector<std::string> disabledMods = GetDisabledModFiles(); std::vector<std::string> enabledMods = GetEnabledModFiles();
if (!disabledMods.empty()) { if (!enabledMods.empty()) {
for (std::string file : disabledMods) { for (std::string file : enabledMods) {
if (ImGui::Button(("Enable##" + file).c_str())) { if (ImGui::ArrowButton(file.c_str(), ImGuiDir_Left)) {
modFiles[file] = true; modFiles[file] = false;
GetArchiveManager()->AddArchive(file); GetArchiveManager()->RemoveArchive(file);
AfterModChange(); AfterModChange();
} }
ImGui::SameLine(); ImGui::SameLine();