add open team immediately

open team without waiting
This commit is contained in:
Miya 2022-08-25 12:16:29 +08:00
parent 793888ee68
commit df3ee8464c
5 changed files with 86 additions and 0 deletions

View File

@ -102,6 +102,7 @@
<ClInclude Include="src\user\cheat\world\FreezeEnemies.h" />
<ClInclude Include="src\user\cheat\world\KillAura.h" />
<ClInclude Include="src\user\cheat\world\MobVacuum.h" />
<ClInclude Include="src\user\cheat\world\OpenTeamImmediately.h" />
<ClInclude Include="src\user\cheat\world\VacuumLoot.h" />
<ClInclude Include="src\user\main.h" />
</ItemGroup>
@ -194,6 +195,7 @@
<ClCompile Include="src\user\cheat\world\FreezeEnemies.cpp" />
<ClCompile Include="src\user\cheat\world\KillAura.cpp" />
<ClCompile Include="src\user\cheat\world\MobVacuum.cpp" />
<ClCompile Include="src\user\cheat\world\OpenTeamImmediately.cpp" />
<ClCompile Include="src\user\cheat\world\VacuumLoot.cpp" />
<ClCompile Include="src\user\main.cpp" />
</ItemGroup>

View File

@ -261,6 +261,9 @@
<ClInclude Include="src\user\cheat\world\AutoChallenge.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\user\cheat\world\OpenTeamImmediately.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Font Include="res\Ruda-Bold.ttf" />
@ -480,6 +483,9 @@
<ClCompile Include="src\user\cheat\world\AutoChallenge.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\user\cheat\world\OpenTeamImmediately.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\res.rc">

View File

@ -44,6 +44,7 @@
#include <cheat/world/AutoCook.h>
#include <cheat/world/AutoChallenge.h>
#include <cheat/world/CustomWeather.h>
#include <cheat/world/OpenTeamImmediately.h>
#include <cheat/visuals/NoFog.h>
#include <cheat/visuals/FPSUnlock.h>
@ -94,6 +95,7 @@ namespace cheat
FEAT_INST(AutoTreeFarm),
FEAT_INST(AutoDestroy),
FEAT_INST(AutoSeelie),
FEAT_INST(OpenTeamImmediately),
FEAT_INST(VacuumLoot),
FEAT_INST(DialogSkip),
FEAT_INST(DumbEnemies),

View File

@ -0,0 +1,52 @@
#include "pch-il2cpp.h"
#include "OpenTeamImmediately.h"
#include <helpers.h>
namespace cheat::feature
{
static bool MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook(app::InLevelMainPageContext_DoTeamCountDown_Iterator* __this, MethodInfo* method);
OpenTeamImmediately::OpenTeamImmediately() : Feature(),
NF(f_Enabled, "Enable Open Team Immediately", "Open Team", false)
{
HookManager::install(app::MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext, MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook);
}
const FeatureGUIInfo& OpenTeamImmediately::GetGUIInfo() const
{
static const FeatureGUIInfo info{ "", "World", false };
return info;
}
void OpenTeamImmediately::DrawMain()
{
ConfigWidget("Open Team Immediately", f_Enabled, "Open team immediately without waiting for count down.");
}
bool OpenTeamImmediately::NeedStatusDraw() const
{
return f_Enabled;
}
void OpenTeamImmediately::DrawStatus()
{
ImGui::Text("OpenTeamImmediately");
}
OpenTeamImmediately& OpenTeamImmediately::GetInstance()
{
static OpenTeamImmediately instance;
return instance;
}
static bool MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook(app::InLevelMainPageContext_DoTeamCountDown_Iterator* __this, MethodInfo* method)
{
auto& openTeamImmediately = OpenTeamImmediately::GetInstance();
if (openTeamImmediately.f_Enabled)
{
__this->fields._levelMainPageContext->fields._countDownTime = __this->fields._levelMainPageContext->fields.EnterCountDown + 1.f;
}
return CALL_ORIGIN(MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook, __this, method);
}
}

View File

@ -0,0 +1,24 @@
#include <cheat-base/cheat/Feature.h>
#include <cheat-base/config/config.h>
namespace cheat::feature
{
class OpenTeamImmediately : public Feature
{
public:
config::Field<config::Toggle<Hotkey>> f_Enabled;
static OpenTeamImmediately& GetInstance();
const FeatureGUIInfo& GetGUIInfo() const override;
void DrawMain() override;
virtual bool NeedStatusDraw() const override;
void DrawStatus() override;
private:
OpenTeamImmediately();
};
}