Skip to content

Commit

Permalink
Hide HUD, Quit message removal and time multiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIndra55 committed Jan 24, 2024
1 parent 096e963 commit 24bd4b8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "modules/Level.h"
#include "modules/ModLoader.h"
#include "modules/Patches.h"
#include "modules/Frontend.h"

#include "cdc/render/PCDeviceManager.h"

Expand Down Expand Up @@ -122,6 +123,7 @@ void Hook::RegisterModules()

#ifndef TR8
RegisterModule<LevelModule>();
RegisterModule<Frontend>();
//RegisterModule<Render>();
//RegisterModule<Draw>();
#else
Expand Down
8 changes: 8 additions & 0 deletions src/game/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ struct GameTracker
char pad1[60];

float timeMult;
float unmodifiedActualTimeMult;
float actualTimeMult;
float globalTimeMult;

float scrollProgress;
float timeDilation;

int debugTimeMult;
};
#else
struct GameTracker
Expand Down
8 changes: 8 additions & 0 deletions src/modules/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ void MainMenu::OnDraw()
BirthObject(object);
}

// Time
if (ImGui::CollapsingHeader("Time"))
{
auto gameTracker = Game::GetGameTracker();

ImGui::SliderFloat("Time multiplier", &gameTracker->timeDilation, 0.f, 10.f, "%.2f");
}

ImGui::End();
}

Expand Down
11 changes: 11 additions & 0 deletions src/modules/Patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,15 @@ void Patches::RemoveIntro()
// mov [mainState], 6
Hooking::Patch(match.get_first(), { 0xC7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00 });
Hooking::Patch(match.get_first(2), mainState);
}

void Patches::OnInput(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Remove the quit message
#ifdef TRAE
if (msg == WM_CLOSE)
{
PostQuitMessage(0);
}
#endif
}
5 changes: 4 additions & 1 deletion src/modules/Patches.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

class Patches : public Module
{
private:
void RemoveIntro();

public:
Patches();

void RemoveIntro();
void OnInput(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
};

0 comments on commit 24bd4b8

Please sign in to comment.