Merge pull request #538 from hellomykami/fix-open-team

fix #536
This commit is contained in:
Taiga 2022-08-27 15:48:27 -06:00 committed by GitHub
commit 4615749eb7
2 changed files with 26 additions and 2 deletions

View File

@ -6,11 +6,17 @@
namespace cheat::feature namespace cheat::feature
{ {
static bool MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook(app::InLevelMainPageContext_DoTeamCountDown_Iterator* __this, MethodInfo* method); static bool MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook(app::InLevelMainPageContext_DoTeamCountDown_Iterator* __this, MethodInfo* method);
static void MoleMole_InLevelPlayerProfilePageContext_ClearView_Hook(void* __this, MethodInfo* method);
static void MoleMole_InLevelPlayerProfilePageContext_SetupView_Hook(void* __this, MethodInfo* method);
OpenTeamImmediately::OpenTeamImmediately() : Feature(), OpenTeamImmediately::OpenTeamImmediately() : Feature(),
NF(f_Enabled, "Enable Open Team Immediately", "Open Team", false) NF(f_Enabled, "Enable Open Team Immediately", "Open Team", false),
InLevelPlayerProfilePageContext(nullptr)
{ {
HookManager::install(app::MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext, MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook); HookManager::install(app::MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext, MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook);
HookManager::install(app::MoleMole_InLevelPlayerProfilePageContext_ClearView, MoleMole_InLevelPlayerProfilePageContext_ClearView_Hook);
HookManager::install(app::MoleMole_InLevelPlayerProfilePageContext_SetupView, MoleMole_InLevelPlayerProfilePageContext_SetupView_Hook);
} }
const FeatureGUIInfo& OpenTeamImmediately::GetGUIInfo() const const FeatureGUIInfo& OpenTeamImmediately::GetGUIInfo() const
@ -43,10 +49,26 @@ namespace cheat::feature
static bool MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook(app::InLevelMainPageContext_DoTeamCountDown_Iterator* __this, MethodInfo* method) static bool MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook(app::InLevelMainPageContext_DoTeamCountDown_Iterator* __this, MethodInfo* method)
{ {
auto& openTeamImmediately = OpenTeamImmediately::GetInstance(); auto& openTeamImmediately = OpenTeamImmediately::GetInstance();
if (openTeamImmediately.f_Enabled)
// if paimon menu open, team ui will not open
if (openTeamImmediately.f_Enabled && !openTeamImmediately.InLevelPlayerProfilePageContext)
{ {
__this->fields._levelMainPageContext->fields._countDownTime = __this->fields._levelMainPageContext->fields.EnterCountDown + 1.f; __this->fields._levelMainPageContext->fields._countDownTime = __this->fields._levelMainPageContext->fields.EnterCountDown + 1.f;
} }
return CALL_ORIGIN(MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook, __this, method); return CALL_ORIGIN(MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook, __this, method);
} }
static void MoleMole_InLevelPlayerProfilePageContext_SetupView_Hook(void* __this, MethodInfo* method)
{
auto& openTeamImmediately = OpenTeamImmediately::GetInstance();
openTeamImmediately.InLevelPlayerProfilePageContext = __this;
CALL_ORIGIN(MoleMole_InLevelPlayerProfilePageContext_SetupView_Hook, __this, method);
}
static void MoleMole_InLevelPlayerProfilePageContext_ClearView_Hook(void* __this, MethodInfo* method)
{
auto& openTeamImmediately = OpenTeamImmediately::GetInstance();
CALL_ORIGIN(MoleMole_InLevelPlayerProfilePageContext_ClearView_Hook, __this, method);
openTeamImmediately.InLevelPlayerProfilePageContext = nullptr;
}
} }

View File

@ -8,6 +8,8 @@ namespace cheat::feature
{ {
public: public:
config::Field<config::Toggle<Hotkey>> f_Enabled; config::Field<config::Toggle<Hotkey>> f_Enabled;
//MoleMole_InLevelPlayerProfilePageContext*
void* InLevelPlayerProfilePageContext;
static OpenTeamImmediately& GetInstance(); static OpenTeamImmediately& GetInstance();