Skip to content

Commit 8355e0e

Browse files
committed
Merge branch 'main' of https://github.com/geode-sdk/DevTools into drag-button
2 parents 8c75c92 + 8e36e13 commit 8355e0e

11 files changed

+994
-162
lines changed

mod.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.3.1",
2+
"geode": "4.4.0",
33
"version": "v1.8.0",
44
"gd": {
55
"win": "*",

src/DevTools.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ struct matjson::Serialize<Settings> {
2424
.orderChildren = value["order_children"].asBool().unwrapOr(std::move(defaults.orderChildren)),
2525
.advancedSettings = value["advanced_settings"].asBool().unwrapOr(std::move(defaults.advancedSettings)),
2626
.showMemoryViewer = value["show_memory_viewer"].asBool().unwrapOr(std::move(defaults.showMemoryViewer)),
27+
.showModGraph = value["show_mod_graph"].asBool().unwrapOr(std::move(defaults.showModGraph)),
2728
.theme = value["theme"].asString().unwrapOr(std::move(defaults.theme)),
29+
.themeColor = value["theme_color"].as<ccColor4B>().isOk() ? value["theme_color"].as<ccColor4B>().unwrap() : std::move(defaults.themeColor)
2830
});
2931
}
3032

@@ -38,7 +40,9 @@ struct matjson::Serialize<Settings> {
3840
{ "order_children", settings.orderChildren },
3941
{ "advanced_settings", settings.advancedSettings },
4042
{ "show_memory_viewer", settings.showMemoryViewer },
43+
{ "show_mod_graph", settings.showModGraph },
4144
{ "theme", settings.theme },
45+
{ "theme_color", settings.themeColor },
4246
});
4347
}
4448
};
@@ -52,6 +56,7 @@ DevTools* DevTools::get() {
5256

5357
void DevTools::loadSettings() { m_settings = Mod::get()->getSavedValue<Settings>("settings"); }
5458
void DevTools::saveSettings() { Mod::get()->setSavedValue("settings", m_settings); }
59+
Settings DevTools::getSettings() { return m_settings; }
5560

5661
bool DevTools::shouldPopGame() const {
5762
return m_visible && m_settings.GDInWindow;
@@ -126,12 +131,15 @@ void DevTools::drawPages() {
126131
&DevTools::drawSettings
127132
);
128133

134+
// if advanced ever has more than one option, add it back
135+
#if 0
129136
if (m_settings.advancedSettings) {
130137
this->drawPage(
131138
U8STR(FEATHER_SETTINGS " Advanced Settings###devtools/advanced/settings"),
132139
&DevTools::drawAdvancedSettings
133140
);
134141
}
142+
#endif
135143

136144
this->drawPage(
137145
U8STR(FEATHER_TOOL " Attributes###devtools/attributes"),
@@ -146,15 +154,18 @@ void DevTools::drawPages() {
146154
);
147155
#endif
148156

149-
if (m_showModGraph) {
157+
if (m_settings.showModGraph) {
150158
this->drawPage(
151159
U8STR(FEATHER_SHARE_2 " Mod Graph###devtools/advanced/mod-graph"),
152160
&DevTools::drawModGraph
153161
);
154162
}
155163

156164
if (m_settings.showMemoryViewer) {
157-
this->drawPage("Memory viewer", &DevTools::drawMemory);
165+
this->drawPage(
166+
U8STR(FEATHER_TERMINAL " Memory viewer"),
167+
&DevTools::drawMemory
168+
);
158169
}
159170
}
160171

src/DevTools.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ struct Settings {
2626
bool orderChildren = true;
2727
bool advancedSettings = false;
2828
bool showMemoryViewer = false;
29+
bool showModGraph = false;
2930
std::string theme = DARK_THEME;
31+
ccColor4B themeColor = {2, 119, 189, 255};
3032
};
3133

3234
class DevTools {
@@ -81,7 +83,7 @@ class DevTools {
8183
static DevTools* get();
8284
void loadSettings();
8385
void saveSettings();
84-
86+
Settings getSettings();
8587
bool shouldUseGDWindow() const;
8688

8789
bool shouldPopGame() const;

src/pages/Advanced.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ using namespace geode::prelude;
77

88
void DevTools::drawAdvancedSettings() {
99
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, { 1.f, 1.f });
10-
ImGui::Checkbox("Show Mod Graph", &m_showModGraph);
1110
ImGui::PopStyleVar();
1211
}
1312

0 commit comments

Comments
 (0)