File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed
Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -9,20 +9,22 @@ using namespace geode::prelude;
99
1010std::string getNodeName (CCObject* node) {
1111#ifdef GEODE_IS_WINDOWS
12- return typeid (*node).name () + 6 ;
13- #else
14- {
15- std::string ret;
12+ std::string_view sv = typeid (*node).name ();
13+ if (sv.starts_with (" class " )) sv.remove_prefix (6 );
14+ if (sv.starts_with (" struct " )) sv.remove_prefix (7 );
1615
17- int status = 0 ;
18- auto demangle = abi::__cxa_demangle (typeid (*node).name (), 0 , 0 , &status);
19- if (status == 0 ) {
20- ret = demangle;
21- }
22- free (demangle);
16+ return std::string (sv);
17+ #else
18+ std::string ret;
2319
24- return ret;
20+ int status = 0 ;
21+ auto demangle = abi::__cxa_demangle (typeid (*node).name (), 0 , 0 , &status);
22+ if (status == 0 ) {
23+ ret = demangle;
2524 }
25+ free (demangle);
26+
27+ return ret;
2628#endif
2729}
2830
@@ -54,11 +56,11 @@ void DevTools::drawTreeBranch(CCNode* node, size_t index) {
5456 }
5557 // The order here is unusual due to imgui weirdness; see the second-to-last paragraph in https://kahwei.dev/2022/06/20/imgui-tree-node/
5658 bool expanded = ImGui::TreeNodeEx (node, flags, " %s" , name.str ().c_str ());
57- if (ImGui::IsItemClicked ()) {
59+ if (ImGui::IsItemClicked ()) {
5860 DevTools::get ()->selectNode (node);
5961 selected = true ;
6062 }
61- if (ImGui::IsItemHovered () && (m_settings.alwaysHighlight || ImGui::IsKeyDown (ImGuiMod_Shift))) {
63+ if (ImGui::IsItemHovered () && (m_settings.alwaysHighlight || ImGui::IsKeyDown (ImGuiMod_Shift))) {
6264 DevTools::get ()->highlightNode (node, HighlightMode::Hovered);
6365 }
6466 if (expanded) {
You can’t perform that action at this time.
0 commit comments