Skip to content

Commit 268ac42

Browse files
committed
Merge branch 'main' of https://github.com/geode-sdk/DevTools into main
2 parents 1d5aba2 + 7a3f7a2 commit 268ac42

7 files changed

Lines changed: 42 additions & 5 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
# Workspace files are user-specific
3+
*.sublime-project
34
*.sublime-workspace
45

56
# I need to find a way to automatically remove this
@@ -17,4 +18,5 @@ Source/Geode/pkg/uber-apk-signer.jar
1718
imgui/**
1819
imgui
1920

21+
**/.DS_Store
2022
.cache/

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"geode": "v2.0.0",
3-
"version": "v1.3.0",
3+
"version": "v1.5.0",
44
"gd": "*",
55
"id": "geode.devtools",
66
"name": "DevTools",

src/DevTools.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void DevTools::highlightNode(CCNode* node, HighlightMode mode) {
4545
}
4646

4747
void DevTools::drawPage(const char* name, void(DevTools::*pageFun)()) {
48-
if (ImGui::Begin(name)) {
48+
if (ImGui::Begin(name, nullptr, ImGuiWindowFlags_HorizontalScrollbar)) {
4949
(this->*pageFun)();
5050
}
5151
ImGui::End();
@@ -188,8 +188,9 @@ void DevTools::setup() {
188188
this->setupPlatform();
189189

190190
#ifdef GEODE_IS_MOBILE
191-
ImGui::GetIO().FontGlobalScale = 3.f;
191+
ImGui::GetIO().FontGlobalScale = 2.f;
192192
ImGui::GetStyle().ScrollbarSize = 60.f;
193+
// ImGui::GetStyle().TabBarBorderSize = 60.f;
193194
#endif
194195
}
195196

@@ -199,6 +200,10 @@ void DevTools::show(bool visible) {
199200

200201
void DevTools::toggle() {
201202
this->show(!m_visible);
203+
if (!m_visible) {
204+
ImGui::GetIO().WantCaptureMouse = false;
205+
ImGui::GetIO().WantCaptureKeyboard = false;
206+
}
202207
}
203208

204209
void DevTools::sceneChanged() {

src/pages/Attributes.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,21 @@ void DevTools::drawNodeAttributes(CCNode* node) {
217217
}
218218
}
219219

220+
ImGui::NewLine();
221+
ImGui::Separator();
222+
ImGui::NewLine();
223+
224+
if (auto delegate = typeinfo_cast<CCTouchDelegate*>(node)) {
225+
if (auto handler = CCTouchDispatcher::get()->findHandler(delegate)) {
226+
auto priority = handler->getPriority();
227+
228+
if (ImGui::DragInt("Touch Priority", &priority, .03f)) {
229+
CCTouchDispatcher::get()->setPriority(priority, handler->getDelegate());
230+
}
231+
}
232+
}
233+
234+
220235
ImGui::NewLine();
221236
ImGui::Separator();
222237
ImGui::NewLine();

src/pages/Settings.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,22 @@ static float RAINBOW_HUE = 0.f;
1313

1414
void DevTools::drawSettings() {
1515
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, { 1.f, 1.f });
16+
17+
#ifdef GEODE_IS_MOBILE
18+
ImGui::Dummy({0.f, 60.f});
19+
#endif
20+
1621
// TODO: fix this option as it hasnt worked in a while lol
1722
#if 0
1823
ImGui::Checkbox("GD in Window", &m_GDInWindow);
1924
if (ImGui::IsItemHovered()) {
2025
ImGui::SetTooltip("Show GD inside a window when DevTools are open");
2126
}
22-
#endif
2327
ImGui::Checkbox("Attributes in Tree", &m_attributesInTree);
2428
if (ImGui::IsItemHovered()) {
2529
ImGui::SetTooltip("Show node attributes in the Tree");
2630
}
31+
#endif
2732
ImGui::Checkbox("Highlight Nodes", &m_alwaysHighlight);
2833
if (ImGui::IsItemHovered()) {
2934
ImGui::SetTooltip(
@@ -62,6 +67,10 @@ void DevTools::drawSettings() {
6267

6368
ImGui::Separator();
6469

70+
ImGui::DragFloat("Font Size", &ImGui::GetIO().FontGlobalScale, 0.01f, 1.0f, 3.0f);
71+
72+
ImGui::Separator();
73+
6574
ImGui::Text("GD Window");
6675

6776
// TODO: undo later

src/pages/Tree.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,9 @@ void DevTools::drawTreeBranch(CCNode* node, size_t index) {
7474
}
7575

7676
void DevTools::drawTree() {
77+
#ifdef GEODE_IS_MOBILE
78+
ImGui::Dummy({0.f, 60.f});
79+
#endif
80+
7781
this->drawTreeBranch(CCDirector::get()->getRunningScene(), 0);
7882
}

src/platform/Android.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ using namespace geode::prelude;
77
#include "utils.hpp"
88

99
std::string formatAddressIntoOffsetImpl(uintptr_t addr) {
10-
return fmt::format("idk + {:#x}", addr);
10+
if (addr > base::get() && addr - 0x1000000 < base::get())
11+
return fmt::format("libcocos2d.so + {:#x}", addr - base::get());
12+
return fmt::format("{:#x}", addr);
1113
}
1214

1315
#endif

0 commit comments

Comments
 (0)