Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
- Added hotkey support for Show Replay
Browse files Browse the repository at this point in the history
- Switch hotkey for "Repair Sabotage" to "Page Down" and "Show Replay" to "End"
  • Loading branch information
v0idp committed Feb 20, 2022
1 parent 6759c5d commit e346b59
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Will automatically be loaded by the Game itself if the dll is in the game direct
- Show Menu - DELETE
- Show Radar - INSERT
- Show Console - HOME
- Repair Sabotage - END
- Show Replay - END
- Repair Sabotage - PAGE DOWN (PgDn)

## Screenshot
<p align="center">
Expand Down
5 changes: 5 additions & 0 deletions gui/tabs/replay_tab.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "pch-il2cpp.h"
#include "replay_tab.h"
#include "gui-helpers.hpp"
#include "state.hpp"
#include <chrono>

Expand All @@ -10,6 +11,10 @@ namespace ReplayTab {
if (ImGui::Checkbox("Show Replay", &State.ShowReplay)) {
State.Save();
}
ImGui::SameLine();
if (HotKey(State.KeyBinds.Toggle_Replay)) {
State.Save();
}
if (ImGui::Checkbox("Show only last", &State.Replay_ShowOnlyLastSeconds))
{
State.Save();
Expand Down
1 change: 1 addition & 0 deletions hooks/DirectX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ LRESULT __stdcall dWndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (KeyBinds::IsKeyPressed(State.KeyBinds.Toggle_Zoom) && IsInGame()) State.EnableZoom = !State.EnableZoom;
if (KeyBinds::IsKeyPressed(State.KeyBinds.Toggle_Freecam) && IsInGame()) State.FreeCam = !State.FreeCam;
if (KeyBinds::IsKeyPressed(State.KeyBinds.Close_Current_Room_Door) && IsInGame()) State.rpcQueue.push(new RpcCloseDoorsOfType(GetSystemTypes(GetTrueAdjustedPosition(*Game::pLocalPlayer)), false));
if (KeyBinds::IsKeyPressed(State.KeyBinds.Toggle_Replay)) State.ShowReplay = !State.ShowReplay;

return CallWindowProc(oWndProc, hWnd, uMsg, wParam, lParam);
}
Expand Down
4 changes: 3 additions & 1 deletion user/keybinds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ void KeyBinds::to_json(nlohmann::ordered_json& j, KeyBinds::Config value)
{"Close_All_Doors", value.Close_All_Doors},
{"Toggle_Zoom", value.Toggle_Zoom},
{"Toggle_Freecam", value.Toggle_Freecam},
{"Close_Current_Room_Door", value.Close_Current_Room_Door}
{"Close_Current_Room_Door", value.Close_Current_Room_Door},
{"Toggle_Replay", value.Toggle_Replay},
};
}

Expand All @@ -205,4 +206,5 @@ void KeyBinds::from_json(const nlohmann::ordered_json& j, KeyBinds::Config& valu
j.at("Toggle_Zoom").get_to(value.Toggle_Zoom);
j.at("Toggle_Freecam").get_to(value.Toggle_Freecam);
j.at("Close_Current_Room_Door").get_to(value.Close_Current_Room_Door);
j.at("Toggle_Replay").get_to(value.Toggle_Replay);
}
1 change: 1 addition & 0 deletions user/keybinds.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace KeyBinds {
uint8_t Toggle_Zoom;
uint8_t Toggle_Freecam;
uint8_t Close_Current_Room_Door;
uint8_t Toggle_Replay;
};

void WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
Expand Down
5 changes: 3 additions & 2 deletions user/state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ class Settings {
VK_DELETE,
VK_INSERT,
VK_HOME,
VK_END,
VK_NEXT,
0x00,
0x00,
0x00,
0x00,
0x00
0x00,
VK_END
};

bool ImGuiInitialized = false;
Expand Down

0 comments on commit e346b59

Please sign in to comment.