Skip to content

Commit

Permalink
Remove old index stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ninXout committed May 27, 2024
1 parent 20285bb commit 05cc5b2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 62 deletions.
7 changes: 0 additions & 7 deletions src/DevTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 0 additions & 3 deletions src/DevTools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
52 changes: 0 additions & 52 deletions src/pages/Advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
#include "../ImGui.hpp"
#include <misc/cpp/imgui_stdlib.h>
#include <Geode/modify/AppDelegate.hpp>
#include <Geode/loader/Index.hpp>

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();
}

Expand Down Expand Up @@ -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<void*>(reinterpret_cast<uintptr_t>(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<void*>(reinterpret_cast<uintptr_t>(item) + 6), "tags")) {
auto tags = item->getTags();
static std::string current;
ImGui::InputText("", &current);
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();
}

0 comments on commit 05cc5b2

Please sign in to comment.