Skip to content

Commit

Permalink
Fix default clientbrand not showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
Lefraudeur committed May 10, 2024
1 parent ae38a4b commit 4455f5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
19 changes: 6 additions & 13 deletions Ripterms/Modules/ClientBrandChanger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,21 @@ void Ripterms::Modules::ClientBrandChanger::renderGUI()
static bool runonce = true;
if (runonce)
{
std::strcpy(name, getClientModName().toStdString().c_str());
std::strcpy(client_name, getClientModName().toStdString().c_str());
runonce = false;
}
ImGui::Text("Client Brand Changer:");
ImGui::InputText("name", name, sizeof(name));
if (ImGui::Button("change"))
{
enabled = true;
}
ImGui::SameLine();
ImGui::Text("Client brand:");
ImGui::InputText("name", client_name, sizeof(client_name));
if (ImGui::Button("reset"))
{
enabled = false;
std::strcpy(name, getClientModName().toStdString().c_str());
std::strcpy(client_name, getClientModName().toStdString().c_str());
}
}

void Ripterms::Modules::ClientBrandChanger::onGetClientModName(JNIEnv* env, bool* cancel)
{
if (!enabled)
return;
jobject new_name = env->NewStringUTF(name);
if (!enabled || client_name[0] == '\0') return;
jobject new_name = env->NewStringUTF(client_name);
Ripterms::JavaHook::set_return_value<void*>(cancel, *(void**)new_name);
*cancel = true;
}
Expand Down
4 changes: 2 additions & 2 deletions Ripterms/Modules/Modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace Ripterms
void renderGUI() override;
void onGetClientModName(JNIEnv* env, bool* cancel) override;
private:
char name[128] = { 0 };
char client_name[256] = { '\0' };
String getClientModName();
};

Expand Down Expand Up @@ -212,7 +212,7 @@ namespace Ripterms
class Sprint : public IModule
{
public:
Sprint() : IModule("Sprint", "Same as contantly holding your sprint key") {}
Sprint() : IModule("Sprint", "Same as constantly holding your sprint key") {}
void run() override;
};

Expand Down

0 comments on commit 4455f5f

Please sign in to comment.