Skip to content

Commit

Permalink
Add freeze game and ragdoll
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIndra55 committed Jan 25, 2024
1 parent a4e4b1f commit 5c413bd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct GameTracker
int field_24;
int field_28;
int field_2C;
int field_30;
int streamFlags;
int field_34;

char baseAreaName[128];
Expand Down
21 changes: 21 additions & 0 deletions src/modules/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,25 @@ void MainMenu::OnFrame()
font->SetCursor(5.f, 430.f);
font->Print("TRLAU-Menu-Hook");
}
}

void MainMenu::OnInput(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
auto gameTracker = Game::GetGameTracker();

// Freeze the game
if (msg == WM_KEYUP && wParam == VK_F3)
{
gameTracker->streamFlags ^= 0x1000;
}

// Ragdoll death
if (msg == WM_KEYUP && wParam == VK_F11)
{
#ifndef TR8
INSTANCE_Post(gameTracker->playerInstance, 262167, 3);
#else
INSTANCE_Post(gameTracker->playerInstance, 4, 3);
#endif
}
}
1 change: 1 addition & 0 deletions src/modules/MainMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ class MainMenu : public Module
public:
void OnDraw();
void OnFrame();
void OnInput(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
};

0 comments on commit 5c413bd

Please sign in to comment.