Skip to content

Commit

Permalink
notif fix, gamepad
Browse files Browse the repository at this point in the history
  • Loading branch information
ermaccer committed Sep 24, 2021
1 parent 10335ee commit 2b17d89
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 26 deletions.
4 changes: 2 additions & 2 deletions MK11Hook/code/mk11menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,9 +1121,9 @@ void MK11Menu::Draw()

ImGui::Text("Infinite Defensive Bar\n");
ImGui::NextColumn();
ImGui::Checkbox("P1##atk", &m_bInfiniteDefendP1);
ImGui::Checkbox("P1##def", &m_bInfiniteDefendP1);
ImGui::SameLine();
ImGui::Checkbox("P2##atk", &m_bInfiniteDefendP2);
ImGui::Checkbox("P2##def", &m_bInfiniteDefendP2);
ImGui::NextColumn();


Expand Down
18 changes: 3 additions & 15 deletions MK11Hook/eDirectX11Hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ void __stdcall SharedPresent()
}
}



inline bool ShouldHookDX(float timeout = 2.5f)
{
auto start = std::chrono::system_clock::now();
Expand All @@ -56,19 +54,12 @@ inline bool ShouldHookDX(float timeout = 2.5f)
}


void eDirectX11Hook::HandleScaling()
{
unsigned int dpiX = 0;
unsigned int dpiY = 0;

}

void eDirectX11Hook::Init()
{
m_pPresent = 0;
pDevice = 0;
pContext = 0;
ms_bFirstDraw = false;
ms_bFirstDraw = true;
ms_bInit = false;
ms_hWindow = 0;
}
Expand Down Expand Up @@ -139,7 +130,8 @@ void eDirectX11Hook::InitImGui()
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
ImGui_ImplWin32_Init(ms_hWindow);
ImGui_ImplDX11_Init(pDevice, pContext);
CreateThread(nullptr, 0, reinterpret_cast<LPTHREAD_START_ROUTINE>(GamepadThread), nullptr, 0, nullptr);
if (SettingsMgr->bEnableGamepadSupport)
CreateThread(nullptr, 0, reinterpret_cast<LPTHREAD_START_ROUTINE>(GamepadThread), nullptr, 0, nullptr);
SharedStyle();
}

Expand All @@ -161,7 +153,6 @@ HRESULT __stdcall eDirectX11Hook::Present(IDXGISwapChain * pSwapChain, UINT Sync
InitImGui();
ms_bInit = true;
}

else
return m_pPresent(pSwapChain, SyncInterval, Flags);
}
Expand Down Expand Up @@ -218,9 +209,6 @@ LRESULT __stdcall eDirectX11Hook::WndProc(const HWND hWnd, UINT uMsg, WPARAM wPa
return CallWindowProc(ms_pWndProc, hWnd, uMsg, wParam, lParam);
}




DWORD __stdcall DirectXHookThread(LPVOID lpReserved)
{
if (ShouldHookDX(2.5f))
Expand Down
2 changes: 0 additions & 2 deletions MK11Hook/eDirectX11Hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class eDirectX11Hook {
static bool ms_bInit;
static bool ms_bFirstDraw;

static void HandleScaling();

static void Init();
static void SetImGuiStyle();
static void InitImGui();
Expand Down
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ Archive breakdown:
- MK11Hook.asi
- MK11Hook.ini - configuration file

# Usage

If installed correctly, a notification will appear informing that the plugin was installed
and is ready to use. By default **F1** will open or close in-game menu.

![Preview](https://raw.githubusercontent.com/ermaccer/ermaccer.github.io/gh-pages/assets/mods/mk11/mk11hook/menu.jpg)


# Controller Support
Any XInput compatible gamepad should work.
Expand All @@ -39,6 +32,14 @@ Any XInput compatible gamepad should work.

Gamepad support can be disabled in the .ini file by setting **bEnableGamepadSupport** to false.

# Usage

If installed correctly, a notification will appear informing that the plugin was installed
and is ready to use. By default **F1** will open or close in-game menu.

![Preview](https://raw.githubusercontent.com/ermaccer/ermaccer.github.io/gh-pages/assets/mods/mk11/mk11hook/menu.jpg)


## Features
| Feature | Description |
| --- | --- |
Expand All @@ -58,6 +59,14 @@ Gamepad support can be disabled in the .ini file by setting **bEnableGamepadSupp
![Preview](https://raw.githubusercontent.com/ermaccer/ermaccer.github.io/gh-pages/assets/mods/mk11/mk11hook/1.jpg)
![Preview](https://raw.githubusercontent.com/ermaccer/ermaccer.github.io/gh-pages/assets/mods/mk11/mk11hook/2.jpg)

## Online Compatibility
Needless to say, any cheats will **NOT** work online.

Playing as NPCs or using modifiers online is possible only if both players
have the plugin installed and synchronize settings with each other on select
screen before selecting anyone. In short, do everything on select screen
and do it in private games only. You cannot use any menu stuff against
random players.

# Building

Expand Down

0 comments on commit 2b17d89

Please sign in to comment.