@@ -36,7 +36,7 @@ class Dummy
3636 virtual ~Dummy () = 0 ;
3737};
3838
39- // Gets the RTII type name from the passed pointer
39+ // Gets the RTTI type name from the passed pointer
4040static std::string GetTypeName (uintptr_t * ptr)
4141{
4242 if (ptr == nullptr )
@@ -146,13 +146,13 @@ void ScriptDebug::DrawScriptDebug(cdc::ScriptObject* object)
146146 auto data = script->m_streamData ;
147147
148148 ImGui::Text (" %p" , object);
149- ImGui::Text (" %d states, %d enums, %d structs, %d members, %d start functions , %d prototypes , %d dependencies" ,
149+ ImGui::Text (" %d states, %d enums, %d structs, %d members, %d prototypes , %d functions , %d dependencies" ,
150150 data->m_states .size (),
151151 data->m_enums .size (),
152152 data->m_structs .size (),
153153 data->m_members .size (),
154- data->m_startFunctionList .size (),
155154 data->m_prototypes .size (),
155+ data->m_functions .size (),
156156 data->m_dependencies .size ());
157157
158158 if (ImGui::CollapsingHeader (" Members" ))
@@ -169,6 +169,36 @@ void ScriptDebug::DrawScriptDebug(cdc::ScriptObject* object)
169169 DrawDataMember (object, member);
170170 }
171171 }
172+
173+ if (ImGui::CollapsingHeader (" Functions" ))
174+ {
175+ for (unsigned int i = 0 ; i < data->m_functions .size (); i++)
176+ {
177+ auto func = &data->m_functions .m_data [i];
178+ auto proto = func->m_prototype ;
179+
180+ std::string args;
181+ for (unsigned int j = 0 ; j < proto->m_args .size (); j++)
182+ {
183+ auto arg = &proto->m_args .m_data [j];
184+
185+ if (j > 0 ) args += " , " ;
186+ args += s_dataTypes[arg->m_type .m_type ];
187+ }
188+
189+ ImGui::PushID (i);
190+
191+ // INT sub_12(INT, INT, STRING)
192+ ImGui::Text (" %s sub_%02d(%s)" , s_dataTypes[proto->m_retType .m_type ], i, args.c_str ());
193+
194+ if (ImGui::Button (" Call" ))
195+ {
196+ object->CallFunction (func, 0 , nullptr , nullptr );
197+ }
198+
199+ ImGui::PopID ();
200+ }
201+ }
172202}
173203
174204void ScriptDebug::DrawDataMember (cdc::ScriptObject* object, cdc::DataMember* member)
0 commit comments