Skip to content

Commit 65cfd04

Browse files
authored
Merge pull request #8 from TheIndra55/docs
Update documentation
2 parents ff122ee + d5eed80 commit 65cfd04

File tree

7 files changed

+348
-788
lines changed

7 files changed

+348
-788
lines changed

README.md

Lines changed: 23 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,40 @@
1-
# TRAE-menu-hook
1+
# TRLAU-menu-hook
22

3-
Reverse engineering project for Tomb Raider LAU games, this repo contains the code for TRAE-menu-hook menu for Tomb Raider Anniversary, Legend and Underworld.
3+
Reverse engineering project for Tomb Raider LAU games, this repo contains the code for TRLAU-menu-hook menu for Tomb Raider Anniversary, Legend and Underworld.
44

55
[![](https://github.com/TheIndra55/TRAE-menu-hook/actions/workflows/build.yml/badge.svg)](https://github.com/TheIndra55/TRAE-menu-hook/actions/workflows/build.yml)
66

7-
## Videos
8-
9-
(screenshots at bottom of readme)
10-
11-
| [![](https://i.imgur.com/RMnCPck.png)](https://www.youtube.com/watch?v=orv2mYjBNhM) | [![](https://i.imgur.com/qgDQuio.png)](https://www.youtube.com/watch?v=k1FIa8Pel3E&t) | [![](https://i.imgur.com/cJe3pYa.png)](https://www.youtube.com/watch?v=RwU80Pj0PR8) | [![](https://i.imgur.com/MEPYZBD.png)](https://www.youtube.com/watch?v=BfUCcC6z1jo) | [![](https://i.imgur.com/8HvLmPG.png)](https://www.youtube.com/watch?v=JvH0RPbaUI0) |
12-
|----|----|----|----|----|
13-
| Menu in Underworld | Playtrough with level debug prints | Instance viewer showcase | Loading .drm files without bigfile | Menu in Anniversary |
7+
## Screenshots and videos
148

9+
| [![](https://github.com/TheIndra55/TRAE-menu-hook/assets/15322107/bfcdb1a3-b0da-4775-8807-e08f3ae3d622)](https://youtube.com/watch?v=KvwopN8GoEw) | [![](https://github.com/TheIndra55/TRAE-menu-hook/assets/15322107/2bb63cc7-6a39-49c6-bbc8-3537a3b1b26e)](https://tombraidermodding.com/img/media/2d3c437d-ec46-4987-ba69-baa8c3d323ed.png) | [![](https://github.com/TheIndra55/TRAE-menu-hook/assets/15322107/aaaf1df4-4bbb-4e85-b5f1-c7ebbcaf768a)](https://tombraidermodding.com/img/media/894d4df8-370a-4715-85ad-05479c0c5dba.png) |
10+
|---|---|---|
11+
| Menu in Legend and Anniversary | Anniversary screenshot | Underworld screenshot |
1512
## Features
1613

1714
* Skew/flight cheat
1815
* Free camera
19-
* Switch player character
20-
* Load files from outside the bigfile
21-
* View and manipulate instances
16+
* Mod loader
17+
* Instance viewer
2218
* Spawn instances
23-
* Level debug restored
24-
* Switch levels
25-
* Show level collisions, markup, portals, triggers (signals), enemy navigation
26-
* Disable death fade/respawn
27-
* Disable cinematic bars
28-
* Slow down game (slow motion)
29-
* Wireframe rendering
30-
31-
## Fixes/improvements
32-
33-
* Game no longer crashes while DEP is enabled
34-
* Game legal screen can be skipped
35-
36-
## Build
37-
38-
Make sure you have [premake5](https://premake.github.io/) installed and in your PATH.
39-
40-
1. Clone the repository and all submodules
41-
2. Include [MinHook.x86.lib](https://github.com/TsudaKageyu/minhook/releases) in the folder.
42-
3. Run `premake5 vs2019` in your terminal.
43-
4. Open the generated solution (.sln) and build for the right game.
44-
45-
## FAQ
19+
* Level select
20+
* Restored debug
21+
* Collision, markup, signals and portal drawing
22+
* Render options
4623

47-
### How to load files outside bigfile
24+
See [features](docs/features.md) for a full list of all features.
4825

49-
Create a folder named 'mods' in your game folder, inside any files can be placed the game should load as replacement. The folder structure in the 'mods' folder is the same as in the PC-W folder in the bigfile.
50-
51-
### How to add new objects
52-
53-
Start by adding the .drm file of your object to the mods folder, next copy the orginal objectlist.txt to mods\(game codename)\pc-w\ and open it in notepad.
54-
Now add a new line with your object name and the new number.
55-
```
56-
959,yourobjectwithoutdotdrm
57-
```
58-
59-
Go back to the start of the file and increase the first number and save the file.
60-
61-
**Note** objectlist.txt must always end with a line ending (empty line) else the game will crash on start.
62-
63-
### Controls
64-
65-
<kbd>F7</kbd> Hide the menu \
66-
<kbd>F8</kbd> Toggle menu focus, this allows you to interact with the menu \
67-
<kbd>F9</kbd> Switch player character \
68-
<kbd>F11</kbd> Instant ragdoll death
69-
70-
<kbd>F2</kbd> Toggle skew/flight cheat \
71-
<kbd>F3</kbd> Freeze the game \
72-
<kbd>Shift</kbd> + <kbd>F3</kbd> Cycle Slow motion \
73-
<kbd>F4</kbd> Toggle free camera \
74-
<kbd>F5</kbd> Toggle player control \
75-
<kbd>Insert/Ins</kbd> Toggle hud
76-
77-
<kbd>Q</kbd> \/ <kbd>A</kbd> Flight up \
78-
<kbd>Z</kbd> \/ <kbd>W</kbd> Flight down
26+
## Fixes/improvements
7927

80-
Flight controls depend on QWERTY/AZERTY keyboard layout
28+
* Fix game crash with DEP enabled
29+
* Allow skipping legal screen and intros
30+
* Disable cinematic bars
8131

82-
## Thanks to
32+
## Installation
8333

84-
* SunBeam906
85-
* Xwilarg
34+
1. Head to the [releases](https://github.com/TheIndra55/TRAE-menu-hook/releases) and look for the latest release.
35+
2. Download the ZIP file for the correct game.
36+
3. Extract all files to the game folder, overwriting any existing files.
8637

87-
## Screenshots
38+
## Build
8839

89-
![image](https://user-images.githubusercontent.com/15322107/111395421-1e496700-86bd-11eb-997b-b73f2a3ec244.png)
90-
![image](https://user-images.githubusercontent.com/15322107/113633351-19992280-966d-11eb-9924-27cb87a3830f.png)
91-
![image](https://user-images.githubusercontent.com/15322107/112666334-5ccce780-8e5c-11eb-8592-4ccc47627dba.png)
40+
Please see [development](docs/development.md) for instructions on building and more.

docs/development.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Development
2+
3+
## Prerequisites
4+
5+
- [Premake](https://premake.github.io/download)
6+
7+
## Building
8+
9+
Clone the repository with all submodules.
10+
11+
```bash
12+
git clone https://github.com/TheIndra55/TRAE-menu-hook
13+
cd TRAE-menu-hook
14+
git submodule update --init
15+
```
16+
17+
Next generate the project files with Premake, for example for Visual Studio:
18+
19+
```bash
20+
premake5 vs2022
21+
```
22+
23+
Now open the solution (.sln) and build for the preferred game.
24+
25+
## Modules
26+
27+
The codebase uses modules for adding new functionality or menus. Modules are implemented by inheriting the `Module` class.
28+
29+
### Adding a module
30+
31+
To add a new module create a class inheriting `Module`. You can
32+
33+
```cpp
34+
#include "Module.h"
35+
36+
class MyModule : public Module
37+
{
38+
}
39+
```
40+
41+
Then register the module in `Hook.cpp` in `RegisterModules`.
42+
43+
```cpp
44+
void Hook::RegisterModules()
45+
{
46+
...
47+
48+
RegisterModule<MyModule>();
49+
}
50+
```
51+
52+
### Getting a module
53+
54+
In case you want to interact with a module somewhere else in the code, you can get the module instance.
55+
56+
```cpp
57+
auto log = Hook::GetInstance().GetModule<Log>();
58+
59+
log->WriteLine("Hello, World!");
60+
```
61+
62+
### Abstract methods
63+
64+
Modules can implement some abstract methods to be called during a stage.
65+
66+
```cpp
67+
class MyModule : public Module
68+
{
69+
public:
70+
void OnFrame()
71+
{
72+
auto font = Font::GetMainFont();
73+
74+
font->SetCursor(0.f, 0.f);
75+
font->Print("Hello, World!");
76+
}
77+
}
78+
```
79+
80+
#### OnMenu
81+
82+
Called while the main menu is being drawn, this can be used for adding new menu items.
83+
84+
```cpp
85+
void MyModule::OnMenu()
86+
{
87+
if (ImGui::BeginMenu("Your menu"))
88+
{
89+
ImGui::MenuItem("Your menu item");
90+
91+
ImGui::EndMenu();
92+
}
93+
}
94+
```
95+
96+
#### OnDraw
97+
98+
Called during an ImGui frame, use this to draw your menus.
99+
100+
#### OnFrame
101+
102+
Called just before a frame ends, use this to use font or draw functions.
103+
104+
#### OnLoop
105+
106+
Called every frame before the game loop.
107+
108+
#### OnInput
109+
110+
Called for every message from the window procedure.
111+
112+
```cpp
113+
void MyModule::OnInput(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
114+
{
115+
if (msg == WM_KEYUP && wParam == VK_F1)
116+
{
117+
// F1 pressed!
118+
}
119+
}
120+
```
121+
122+
#### OnPostInitialize
123+
124+
Called on post initialization after the device has been obtained

0 commit comments

Comments
 (0)