From 05cc5b288f00f8fa2827c1e55f1144c12c09ae50 Mon Sep 17 00:00:00 2001 From: shloakmenon <58670749+ninXout@users.noreply.github.com> Date: Mon, 27 May 2024 15:02:14 -0400 Subject: [PATCH] Remove old index stuff --- src/DevTools.cpp | 7 ------ src/DevTools.hpp | 3 --- src/pages/Advanced.cpp | 52 ------------------------------------------ 3 files changed, 62 deletions(-) diff --git a/src/DevTools.cpp b/src/DevTools.cpp index fd73f90..3abe812 100644 --- a/src/DevTools.cpp +++ b/src/DevTools.cpp @@ -120,13 +120,6 @@ void DevTools::drawPages() { &DevTools::drawModGraph ); } - - if (m_showModIndex) { - this->drawPage( - U8STR(FEATHER_LIST " Mod Index###devtools/advanced/mod-index"), - &DevTools::drawModIndex - ); - } } void DevTools::draw(GLRenderCtx* ctx) { diff --git a/src/DevTools.hpp b/src/DevTools.hpp index b3ebdbf..2043a73 100644 --- a/src/DevTools.hpp +++ b/src/DevTools.hpp @@ -29,7 +29,6 @@ class DevTools { bool m_arrowExpand = false; bool m_advancedSettings = false; bool m_showModGraph = false; - bool m_showModIndex = false; bool m_pauseGame = false; bool m_orderChildren = true; std::string m_theme = DARK_THEME; @@ -58,8 +57,6 @@ class DevTools { void drawModGraph(); void drawModGraphNode(Mod* node); ModMetadata inputMetadata(void* treePtr, ModMetadata metadata); - void drawModIndex(); - void drawIndexItem(IndexItemHandle const& node); void drawPage(const char* name, void(DevTools::* fun)()); void drawPages(); void draw(GLRenderCtx* ctx); diff --git a/src/pages/Advanced.cpp b/src/pages/Advanced.cpp index 3890d87..d52d4fc 100644 --- a/src/pages/Advanced.cpp +++ b/src/pages/Advanced.cpp @@ -2,14 +2,12 @@ #include "../ImGui.hpp" #include #include -#include using namespace geode::prelude; void DevTools::drawAdvancedSettings() { ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, { 1.f, 1.f }); ImGui::Checkbox("Show Mod Graph", &m_showModGraph); - ImGui::Checkbox("Show Mod Index", &m_showModIndex); ImGui::PopStyleVar(); } @@ -188,53 +186,3 @@ void DevTools::drawModGraphNode(Mod* node) { ImGui::TreePop(); } - -void DevTools::drawModIndex() { - for (auto const& item : Index::get()->getItems()) { - drawIndexItem(item); - } -} - -void DevTools::drawIndexItem(IndexItemHandle const& node) { - auto* item = node.get(); - if (!item || !ImGui::TreeNode(item, "%s", item->getMetadata().getID().c_str())) - return; - item->setMetadata(this->inputMetadata(item, item->getMetadata())); - item->setDownloadURL(inputText("downloadURL", item->getDownloadURL())); - item->setPackageHash(inputText("packageHash", item->getPackageHash())); - if (ImGui::TreeNode(reinterpret_cast(reinterpret_cast(item) + 5), "availablePlatforms")) { - auto platforms = item->getAvailablePlatforms(); - for (PlatformID::Type type = PlatformID::Type::Unknown; type <= PlatformID::Type::Linux; (*(int*)&type)++) { - bool contains = platforms.contains({type}); - if (!ImGui::Checkbox(PlatformID::toString(type), &contains)) - continue; - if (contains) - platforms.insert({type}); - else - platforms.erase({type}); - } - item->setAvailablePlatforms(platforms); - ImGui::TreePop(); - } - item->setIsFeatured(inputBool("isFeatured", item->isFeatured())); - if (ImGui::TreeNode(reinterpret_cast(reinterpret_cast(item) + 6), "tags")) { - auto tags = item->getTags(); - static std::string current; - ImGui::InputText("", ¤t); - ImGui::SameLine(); - if (ImGui::Button("Add")) { - tags.insert(current); - current = ""; - } - for (auto const& tag : item->getTags()) { - ImGui::Text("%s", tag.c_str()); - ImGui::SameLine(); - if (ImGui::Button("Remove")) - tags.erase(tag); - } - item->setTags(tags); - ImGui::TreePop(); - } - ImGui::Text("isInstalled: %s", item->isInstalled() ? "true" : "false"); - ImGui::TreePop(); -}