add: testing stuff with PlayRandomSound

this thing is an absolute pain fr, i miss melon loader so much, gonna play planet fishing
This commit is contained in:
ALittlePatate
2022-10-02 16:08:07 +02:00
parent eac5dd5021
commit 661c3a2da0
2 changed files with 22 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
#include "../dllmain.hpp"
#include "../Utils/Settings/Settings.hpp"
#include "../Utils/Dumper/Dumper.hpp"
#include "Misc/Misc.hpp"
#include <string>
@@ -309,7 +310,7 @@ void DrawMiscTab() {
ImGui::Checkbox("Fly", &settings::fly);
if (ImGui::Button("Make random noise")) {
//call make random noise
Misc::PlayRandomSound();
}
ImGui::Checkbox("EXP modifier", &settings::exp_modifier);

View File

@@ -72,7 +72,7 @@ void Misc::PlayRandomSound() {
return;
}
srand(time(NULL));
srand((unsigned int)time(0));
int num = 1;// rand() % 10 + 1;
switch (num)
{
@@ -81,6 +81,25 @@ void Misc::PlayRandomSound() {
if (!yesClips) {
return;
}
yesClips->SetMemberValue<float>("delay", 0.f);
yesClips->SetMemberValue<bool>("useGoatBurnCount", false);
yesClips->SetMemberValue<bool>("noDuplicateSelection", false);
std::vector<Unity::il2cppMethodInfo*> methods;
std::vector<Unity::il2cppFieldInfo*> fields;
yesClips->FetchMethods(&methods);
yesClips->FetchFields(&fields);
for (Unity::il2cppMethodInfo* method : methods) {
print("--> %s\n", method->m_pName);
}
print("\n\n\n");
for (Unity::il2cppFieldInfo* field : fields) {
print("--> %s\n", field->m_pName);
}
yesClips->CallMethodSafe<void*>("Play");
break;
}