diff --git a/MK11Hook/MK11Hook.rc b/MK11Hook/MK11Hook.rc index 7eacb58..caea4d1 100644 Binary files a/MK11Hook/MK11Hook.rc and b/MK11Hook/MK11Hook.rc differ diff --git a/MK11Hook/MK11Hook.vcxproj b/MK11Hook/MK11Hook.vcxproj index b9b7267..3a54895 100644 --- a/MK11Hook/MK11Hook.vcxproj +++ b/MK11Hook/MK11Hook.vcxproj @@ -100,10 +100,11 @@ + - + @@ -142,10 +143,11 @@ + - + diff --git a/MK11Hook/MK11Hook.vcxproj.filters b/MK11Hook/MK11Hook.vcxproj.filters index a5461cf..b5b77a2 100644 --- a/MK11Hook/MK11Hook.vcxproj.filters +++ b/MK11Hook/MK11Hook.vcxproj.filters @@ -126,9 +126,6 @@ Header Files\code - - Header Files\code - Header Files\code @@ -159,6 +156,12 @@ Header Files\code\unreal + + Header Files\code\helper + + + Header Files\code + @@ -224,9 +227,6 @@ Header Files\code - - Header Files\code - Header Files\code @@ -251,6 +251,12 @@ Header Files\code + + Header Files\code\helper + + + Header Files\code + diff --git a/MK11Hook/code/MKCharacter.cpp b/MK11Hook/code/MKCharacter.cpp index 30b8967..1246b70 100644 --- a/MK11Hook/code/MKCharacter.cpp +++ b/MK11Hook/code/MKCharacter.cpp @@ -40,7 +40,6 @@ FVector MKCharacter::GetScale() void MKCharacter::SetAbility(unsigned int id) { *(int*)(this + 64304) = id; - //((void(__fastcall*)(MKCharacter*, unsigned int))_addr(0x1404C3340))(this, id); } void MKCharacter::ClearAbilities() diff --git a/MK11Hook/code/eNotifManager.cpp b/MK11Hook/code/eNotifManager.cpp index cafe995..c6bb190 100644 --- a/MK11Hook/code/eNotifManager.cpp +++ b/MK11Hook/code/eNotifManager.cpp @@ -26,12 +26,10 @@ void eNotificationManager::UpdateAlpha() if (eDirectX11Hook::ms_bInit) delta = 1.0f / ImGui::GetIO().Framerate; - float alphaSpeed = 0.8f; m_fNotifAlpha = max(m_fNotifAlpha - delta * alphaSpeed, 0.0f); - if (m_fNotifAlpha <= 0) m_bIsNotificationActive = false; diff --git a/MK11Hook/code/eSettingsManager.cpp b/MK11Hook/code/eSettingsManager.cpp index 9b40835..eeb07ef 100644 --- a/MK11Hook/code/eSettingsManager.cpp +++ b/MK11Hook/code/eSettingsManager.cpp @@ -6,46 +6,125 @@ eSettingsManager* SettingsMgr = new eSettingsManager; void eSettingsManager::Init() { CIniReader ini(""); - bEnableConsoleWindow = ini.ReadBoolean("Settings", "bEnableConsoleWindow", true); + CIniReader user("mk11hook_user.ini"); + - iHookMenuOpenKey = ini.ReadInteger("Settings", "iHookMenuOpenKey", VK_F1); - bEnableGamepadSupport = ini.ReadBoolean("Settings", "bEnableGamepadSupport", true); - bUseLegacyCharacterModifier = ini.ReadBoolean("Settings", "bUseLegacyCharacterModifier", false); - bMakeAllAbilities1Slot = ini.ReadBoolean("Settings", "bMakeAllAbilities1Slot", false); - iFreeCameraKeyXPlus = ini.ReadInteger("Settings", "iFreeCameraKeyXPlus", 0); - iFreeCameraKeyXMinus = ini.ReadInteger("Settings", "iFreeCameraKeyXMinus", 0); + // user first + iToggleCustomCamKey = user.ReadInteger("Settings", "iToggleCustomCamKey", 0); + + iHookMenuOpenKey = user.ReadInteger("Settings", "iHookMenuOpenKey", 0xFF); + if (iHookMenuOpenKey == 0xFF) + iHookMenuOpenKey = ini.ReadInteger("Settings", "iHookMenuOpenKey", VK_F1); - iFreeCameraKeyYPlus = ini.ReadInteger("Settings", "iFreeCameraKeyYPlus", 0); - iFreeCameraKeyYMinus = ini.ReadInteger("Settings", "iFreeCameraKeyYMinus", 0); - iFreeCameraKeyZPlus = ini.ReadInteger("Settings", "iFreeCameraKeyZPlus", 0); - iFreeCameraKeyZMinus = ini.ReadInteger("Settings", "iFreeCameraKeyZMinus", 0); + iToggleFreezeWorldKey = user.ReadInteger("Settings", "iToggleFreezeWorldKey", 0xFF); + if (iToggleFreezeWorldKey == 0xFF) + iToggleFreezeWorldKey = VK_F2; + iToggleSlowMoKey = user.ReadInteger("Settings", "iToggleSlowMoKey", 0xFF); + if (iToggleSlowMoKey == 0xFF) + iToggleSlowMoKey = VK_F5; - iFreeCameraKeyYawPlus = ini.ReadInteger("Settings", "iFreeCameraKeyYawPlus", 0); - iFreeCameraKeyYawMinus = ini.ReadInteger("Settings", "iFreeCameraKeyYawMinus", 0); + iResetStageInteractablesKey = user.ReadInteger("Settings", "iResetStageInteractablesKey", 0xFF); + if (iResetStageInteractablesKey == 0xFF) + iResetStageInteractablesKey = 0xFF; - iFreeCameraKeyRollPlus = ini.ReadInteger("Settings", "iFreeCameraKeyRollPlus", 0); - iFreeCameraKeyRollMinus = ini.ReadInteger("Settings", "iFreeCameraKeyRollMinus", 0); + iFreeCameraKeyFOVPlus = user.ReadInteger("Settings", "iFreeCameraKeyFOVPlus", 0xFF); + if (iFreeCameraKeyFOVPlus == 0xFF) + iFreeCameraKeyFOVPlus = ini.ReadInteger("Settings", "iFreeCameraKeyFOVPlus", 0); - iFreeCameraKeyPitchPlus = ini.ReadInteger("Settings", "iFreeCameraKeyPitchPlus", 0); - iFreeCameraKeyPitchMinus = ini.ReadInteger("Settings", "iFreeCameraKeyPitchMinus", 0); + iFreeCameraKeyFOVMinus = user.ReadInteger("Settings", "iFreeCameraKeyFOVMinus", 0xFF); + if (iFreeCameraKeyFOVMinus == 0xFF) + iFreeCameraKeyFOVMinus = ini.ReadInteger("Settings", "iFreeCameraKeyFOVMinus", 0); + + iFreeCameraKeyXPlus = user.ReadInteger("Settings", "iFreeCameraKeyXPlus", 0xFF); + if (iFreeCameraKeyXPlus == 0xFF) + iFreeCameraKeyXPlus = ini.ReadInteger("Settings", "iFreeCameraKeyXPlus", 0); + + iFreeCameraKeyXMinus = user.ReadInteger("Settings", "iFreeCameraKeyXMinus", 0xFF); + if (iFreeCameraKeyXMinus == 0xFF) + iFreeCameraKeyXMinus = ini.ReadInteger("Settings", "iFreeCameraKeyXMinus", 0); + + + iFreeCameraKeyYPlus = user.ReadInteger("Settings", "iFreeCameraKeyYPlus", 0xFF); + if (iFreeCameraKeyYPlus == 0xFF) + iFreeCameraKeyYPlus = ini.ReadInteger("Settings", "iFreeCameraKeyYPlus", 0); + + iFreeCameraKeyYMinus = user.ReadInteger("Settings", "iFreeCameraKeyYMinus", 0xFF); + if (iFreeCameraKeyYMinus == 0xFF) + iFreeCameraKeyYMinus = ini.ReadInteger("Settings", "iFreeCameraKeyYMinus", 0); + + iFreeCameraKeyZPlus = user.ReadInteger("Settings", "iFreeCameraKeyZPlus", 0xFF); + if (iFreeCameraKeyZPlus == 0xFF) + iFreeCameraKeyZPlus = ini.ReadInteger("Settings", "iFreeCameraKeyZPlus", 0); + + iFreeCameraKeyZMinus = user.ReadInteger("Settings", "iFreeCameraKeyZMinus", 0xFF); + if (iFreeCameraKeyZMinus == 0xFF) + iFreeCameraKeyZMinus = ini.ReadInteger("Settings", "iFreeCameraKeyZMinus", 0); + + iFreeCameraKeyYawPlus = user.ReadInteger("Settings", "iFreeCameraKeyYawPlus", 0xFF); + if (iFreeCameraKeyYawPlus == 0xFF) + iFreeCameraKeyYawPlus = ini.ReadInteger("Settings", "iFreeCameraKeyYawPlus", 0); + + iFreeCameraKeyYawMinus = user.ReadInteger("Settings", "iFreeCameraKeyYawMinus", 0xFF); + if (iFreeCameraKeyYawMinus == 0xFF) + iFreeCameraKeyYawMinus = ini.ReadInteger("Settings", "iFreeCameraKeyYawMinus", 0); + + iFreeCameraKeyRollPlus = user.ReadInteger("Settings", "iFreeCameraKeyRollPlus", 0xFF); + if (iFreeCameraKeyRollPlus == 0xFF) + iFreeCameraKeyRollPlus = ini.ReadInteger("Settings", "iFreeCameraKeyRollPlus", 0); + + iFreeCameraKeyRollMinus = user.ReadInteger("Settings", "iFreeCameraKeyRollMinus", 0xFF); + if (iFreeCameraKeyRollMinus == 0xFF) + iFreeCameraKeyRollMinus = ini.ReadInteger("Settings", "iFreeCameraKeyRollMinus", 0); + + + iFreeCameraKeyPitchPlus = user.ReadInteger("Settings", "iFreeCameraKeyPitchPlus", 0xFF); + if (iFreeCameraKeyPitchPlus == 0xFF) + iFreeCameraKeyPitchPlus = ini.ReadInteger("Settings", "iFreeCameraKeyPitchPlus", 0); + + iFreeCameraKeyPitchMinus = user.ReadInteger("Settings", "iFreeCameraKeyPitchMinus", 0xFF); + if (iFreeCameraKeyPitchMinus == 0xFF) + iFreeCameraKeyPitchMinus = ini.ReadInteger("Settings", "iFreeCameraKeyPitchMinus", 0); - iFreeCameraKeyFOVPlus = ini.ReadInteger("Settings", "iFreeCameraKeyFOVPlus", 0); - iFreeCameraKeyFOVMinus = ini.ReadInteger("Settings", "iFreeCameraKeyFOVMinus", 0); - CIniReader user("mk11hook_user.ini"); fMenuScale = user.ReadFloat("MenuSettings", "fMenuScale", 1.0f); if (fMenuScale < 1.0f) fMenuScale = 1.0f; + + bEnableConsoleWindow = ini.ReadBoolean("Settings", "bEnableConsoleWindow", true); + bEnableGamepadSupport = ini.ReadBoolean("Settings", "bEnableGamepadSupport", true); + bUseLegacyCharacterModifier = ini.ReadBoolean("Settings", "bUseLegacyCharacterModifier", false); + bMakeAllAbilities1Slot = ini.ReadBoolean("Settings", "bMakeAllAbilities1Slot", false); + } + + void eSettingsManager::SaveSettings() { CIniReader user("mk11hook_user.ini"); user.WriteFloat("MenuSettings", "fMenuScale", fMenuScale); + user.WriteInteger("Settings", "iHookMenuOpenKey", iHookMenuOpenKey); + user.WriteInteger("Settings", "iToggleFreezeWorldKey", iToggleFreezeWorldKey); + user.WriteInteger("Settings", "iToggleCustomCamKey", iToggleCustomCamKey); + user.WriteInteger("Settings", "iFreeCameraKeyXMinus", iFreeCameraKeyXMinus); + user.WriteInteger("Settings", "iFreeCameraKeyYPlus", iFreeCameraKeyYPlus); + user.WriteInteger("Settings", "iFreeCameraKeyYMinus", iFreeCameraKeyYMinus); + user.WriteInteger("Settings", "iFreeCameraKeyZPlus", iFreeCameraKeyZPlus); + user.WriteInteger("Settings", "iFreeCameraKeyZMinus", iFreeCameraKeyZMinus); + user.WriteInteger("Settings", "iFreeCameraKeyYawPlus", iFreeCameraKeyYawPlus); + user.WriteInteger("Settings", "iFreeCameraKeyYawMinus", iFreeCameraKeyYawMinus); + user.WriteInteger("Settings", "iFreeCameraKeyRollPlus", iFreeCameraKeyRollPlus); + user.WriteInteger("Settings", "iFreeCameraKeyRollMinus", iFreeCameraKeyRollMinus); + user.WriteInteger("Settings", "iFreeCameraKeyPitchPlus", iFreeCameraKeyPitchPlus); + user.WriteInteger("Settings", "iFreeCameraKeyPitchMinus", iFreeCameraKeyPitchMinus); + user.WriteInteger("Settings", "iFreeCameraKeyFOVPlus", iFreeCameraKeyFOVPlus); + user.WriteInteger("Settings", "iFreeCameraKeyFOVMinus", iFreeCameraKeyFOVMinus); + user.WriteInteger("Settings", "iResetStageInteractablesKey", iResetStageInteractablesKey); + CIniReader ini(""); ini.WriteBoolean("Settings", "bEnableGamepadSupport", bEnableGamepadSupport); ini.WriteBoolean("Settings", "bEnableConsoleWindow", bEnableConsoleWindow); diff --git a/MK11Hook/code/eSettingsManager.h b/MK11Hook/code/eSettingsManager.h index 3d9c2cf..2a01c4c 100644 --- a/MK11Hook/code/eSettingsManager.h +++ b/MK11Hook/code/eSettingsManager.h @@ -1,4 +1,5 @@ #pragma once +#include // as usual, pluginmh/mugenhook @@ -7,12 +8,18 @@ class eSettingsManager { void Init(); bool bEnableConsoleWindow; - int iHookMenuOpenKey; + bool bUseLegacyCharacterModifier; bool bMakeAllAbilities1Slot; bool bEnableGamepadSupport; + // generic + int iHookMenuOpenKey; + int iToggleCustomCamKey; + int iToggleSlowMoKey = VK_F5; + int iToggleFreezeWorldKey = VK_F2; + int iResetStageInteractablesKey; // free camera keys int iFreeCameraKeyXPlus; int iFreeCameraKeyXMinus; @@ -21,12 +28,17 @@ class eSettingsManager { int iFreeCameraKeyZPlus; int iFreeCameraKeyZMinus; + int iFreeCameraKeyYawPlus; int iFreeCameraKeyYawMinus; + int iFreeCameraKeyPitchPlus; int iFreeCameraKeyPitchMinus; - int iFreeCameraKeyRollPlus; + int iFreeCameraKeyRollMinus; + int iFreeCameraKeyRollPlus; + + int iFreeCameraKeyFOVPlus; int iFreeCameraKeyFOVMinus; diff --git a/MK11Hook/code/helper/eAbilityNames.cpp b/MK11Hook/code/helper/eAbilityNames.cpp index 8485b2d..f5c1f83 100644 --- a/MK11Hook/code/helper/eAbilityNames.cpp +++ b/MK11Hook/code/helper/eAbilityNames.cpp @@ -381,6 +381,7 @@ void eAbiltityNames::Init() ent.abNames[6] = "Lightning Storm"; ent.abNames[7] = "Electric Current"; ent.abNames[8] = "Lightning Rod"; + ent.abNames[9] = "Sparkport"; m_aAbilityNames.push_back(ent); ent = {}; @@ -565,11 +566,12 @@ void eAbiltityNames::Init() ent.abNames[1] = "Ground Ice"; ent.abNames[2] = "Cold Shoulder"; ent.abNames[3] = "Rising Ice"; - ent.abNames[4] = "Frigid Storm"; - ent.abNames[5] = "Death-Cicle Barrage"; - ent.abNames[6] = "Air Polar Axe"; - ent.abNames[7] = "Arctic Trap"; - ent.abNames[8] = "Deep Freeze"; + ent.abNames[4] = "Unused"; + ent.abNames[5] = "Frigid Storm"; + ent.abNames[6] = "Death-Cicle Barrage"; + ent.abNames[7] = "Air Polar Axe"; + ent.abNames[8] = "Arctic Trap"; + ent.abNames[9] = "Deep Freeze"; m_aAbilityNames.push_back(ent); ent = {}; diff --git a/MK11Hook/code/helper/eKeyboardMan.cpp b/MK11Hook/code/helper/eKeyboardMan.cpp new file mode 100644 index 0000000..0adbec2 --- /dev/null +++ b/MK11Hook/code/helper/eKeyboardMan.cpp @@ -0,0 +1,39 @@ +#include "eKeyboardMan.h" +#include +#include + + +eVKKeyCode eKeyboardMan::GetLastKey() +{ + eVKKeyCode key = VK_KEY_NONE; + for (int i = 0; i < VK_KEY_MAX; i++) + { + if (GetAsyncKeyState(i) & 0x8000) + { + key = (eVKKeyCode)i; + break; + } + } + return key; +} + +const char * eKeyboardMan::KeyToString(int code) +{ + static char buff[128] = {}; + UINT key = MapVirtualKey(code, MAPVK_VK_TO_VSC); + + int result = GetKeyNameTextA((key << 16), buff, sizeof(buff)); + + if (code == VK_UP) + return "Up"; + else if (code == VK_DOWN) + return "Down"; + else if (code == VK_LEFT) + return "Left"; + else if (code == VK_RIGHT) + return "Right"; + else if (result) + return buff; + else + return "Unknown"; +} diff --git a/MK11Hook/code/helper/eKeyboardMan.h b/MK11Hook/code/helper/eKeyboardMan.h new file mode 100644 index 0000000..07e0a1f --- /dev/null +++ b/MK11Hook/code/helper/eKeyboardMan.h @@ -0,0 +1,88 @@ +#pragma once + +enum eVKKeyCode { + VK_KEY_NONE = 254, + VK_KEY_0 = 48, + VK_KEY_1, + VK_KEY_2, + VK_KEY_3, + VK_KEY_4, + VK_KEY_5, + VK_KEY_6, + VK_KEY_7, + VK_KEY_8, + VK_KEY_9, + VK_KEY_A = 65, + VK_KEY_B, + VK_KEY_C, + VK_KEY_D, + VK_KEY_E, + VK_KEY_F, + VK_KEY_G, + VK_KEY_H, + VK_KEY_I, + VK_KEY_J, + VK_KEY_K, + VK_KEY_L, + VK_KEY_M, + VK_KEY_N, + VK_KEY_O, + VK_KEY_P, + VK_KEY_Q, + VK_KEY_R, + VK_KEY_S, + VK_KEY_T, + VK_KEY_U, + VK_KEY_V, + VK_KEY_W, + VK_KEY_X, + VK_KEY_Y, + VK_KEY_Z, + + VK_NUMPAD_0 = 96, + VK_NUMPAD_1, + VK_NUMPAD_2, + VK_NUMPAD_3, + VK_NUMPAD_4, + VK_NUMPAD_5, + VK_NUMPAD_6, + VK_NUMPAD_7, + VK_NUMPAD_8, + VK_NUMPAD_9, + + VK_BACKSPACE = 8, + VK_ENTER = 13, + VK_CTRL = 17, + VK_ALT = 18, + VK_CAPS_LOCK = 20, + VK_PAGE_UP = 33, + VK_PAGE_DOWN = 34, + VK_LEFT_ARROW = 37, + VK_UP_ARROW = 38, + VK_RIGHT_ARROW = 39, + VK_DOWN_ARROW = 40, + VK_LEFT_META = 91, + VK_RIGHT_META = 92, + VK_NUM_LOCK = 144, + VK_SCROLL_LOCK = 145, + VK_SEMICOLON = 186, + VK_EQUALS = 187, + VK_COMMA = 188, + VK_DASH = 189, + VK_PERIOD = 190, + VK_FORWARD_SLASH = 191, + VK_GRAVE_ACCENT = 192, + VK_OPEN_BRACKET = 219, + VK_BACK_SLASH = 220, + VK_CLOSE_BRACKET = 221, + VK_SINGLE_QUOTE = 222, + + VK_KEY_MAX = 255 +}; + + +class eKeyboardMan { +public: + static eVKKeyCode GetLastKey(); + static const char* KeyToString(int code); +}; \ No newline at end of file diff --git a/MK11Hook/code/mk11.cpp b/MK11Hook/code/mk11.cpp index 847e958..0e89daa 100644 --- a/MK11Hook/code/mk11.cpp +++ b/MK11Hook/code/mk11.cpp @@ -104,7 +104,6 @@ void __fastcall MK11Hooks::HookProcessStuff() } } - if (GetObj(PLAYER1)) { if (TheMenu->m_bInfiniteHealthP1) @@ -536,8 +535,10 @@ char * GetCharacterName(PLAYER_NUM plr) { int64 info = GetInfo(plr); character_info* chr = *(character_info**)(info + 216); - - return chr->name; + if (chr) + return chr->name; + else + return "null"; } @@ -547,6 +548,17 @@ void SlowGameTimeForXTicks(float speed, int ticks) ((void(__fastcall*)(float, int, int))_addr(0x1405C0280))(speed, ticks, 0); } +void ResetStageInteractables() +{ + int64 gameinfo = *(__int64*)_addr(GFG_GAME_INFO); + int64 bgndinfo = *(int64*)(gameinfo + 0x50); + + ((void(__fastcall*)(int64))_addr(0x14045BE30))(bgndinfo); + ((void(__fastcall*)(int64))_addr(0x14045C370))(bgndinfo); + ((void(__fastcall*)(int64))_addr(0x14045BDA0))(bgndinfo); + +} + void SetCharacterEnergy(int64 obj, int type, float energy) { ((void(__fastcall*)(int64, int, float))_addr(0x1405FA450))(obj, type, energy); diff --git a/MK11Hook/code/mk11.h b/MK11Hook/code/mk11.h index e59b463..08fed9a 100644 --- a/MK11Hook/code/mk11.h +++ b/MK11Hook/code/mk11.h @@ -6,7 +6,7 @@ #define GFG_GAME_INFO 0x1434990A0 -#define MK11HOOK_VERSION "0.4.8" +#define MK11HOOK_VERSION "0.4.9" #define TOTAL_ABILITIES 20 @@ -62,6 +62,7 @@ char* GetCharacterName(PLAYER_NUM plr); void SlowGameTimeForXTicks(float speed, int ticks); +void ResetStageInteractables(); void SetCharacterEnergy(int64 obj,int type, float energy); diff --git a/MK11Hook/code/mk11menu.cpp b/MK11Hook/code/mk11menu.cpp index f09c5d2..6b37636 100644 --- a/MK11Hook/code/mk11menu.cpp +++ b/MK11Hook/code/mk11menu.cpp @@ -10,11 +10,14 @@ #include "MKCamera.h" #include #include "helper/eAbilityNames.h" +#include "helper/eKeyboardMan.h" #include "..\eDirectX11Hook.h" static int64 timer = GetTickCount64(); static int64 func_timer = GetTickCount64(); char textBuffer[260] = {}; + + const char* szCharacters[] = { // place npcs first for easy access "CHAR_Cyrax", @@ -742,74 +745,9 @@ static void ShowHelpMarker(const char* desc) void MK11Menu::Initialize() { - m_bIsActive = false; - m_bPlayer1Modifier = false; - m_bPlayer2Modifier = false; - m_bNoHealthP1 = false; - m_bNoHealthP1 = false; - m_bOneHealthP1 = false; - m_bOneHealthP2 = false; - m_bCustomCameraPos = false; - m_bCustomCameraRot = false; - m_bCustomCameraFOV = false; - m_bYObtained = false; - m_bCustomCameras = false; - m_bFreeCamMouseInvertY = true; - m_bFreezeWorld = false; - m_bIsFocused = false; - m_bChangePlayerSpeed = false; - m_bChangePlayerScale = false; - m_bInfiniteHealthP1 = false; - m_bInfiniteHealthP2 = false; - m_bInfiniteAttackP1 = false; - m_bInfiniteDefendP1 = false; - m_bInfiniteAttackP2 = false; - m_bInfiniteDefendP2 = false; - m_bKryptModifier = false; - m_bAutoHideHUD = false; - m_bDisableGearLoadouts = false; - m_bDisableHUD = false; - m_bHookDispatch = false; - m_bForceCameraUpdate = false; - m_bTagAssist = false; - m_bTagAssistP2 = false; - m_bSlowMotion = false; - m_bP1CustomAbilities = false; - m_bP2CustomAbilities = false; - m_bSmoothScaleChange = false; - m_bDontFlipCamera = false; - m_bDisableHeadTracking = false; - m_bUsePlayerTwoAsTracker = false; - - m_nCurrentCharModifier = MODIFIER_SCREEN; - m_nFreeCameraRotationSpeed = 120; - m_nCurrentCustomCamera = -1; - m_nP1Abilities = 0; - m_nP2Abilities = 0; - mouseSpeedX = 0; - mouseSpeedY = 0; - mouseSens = 5; orgMouse.x = GetSystemMetrics(SM_CXSCREEN) / 2; orgMouse.y = GetSystemMetrics(SM_CYSCREEN) / 2; - m_fSlowMotionSpeed = 0.5f; - m_fFreeCameraSpeed = 5.25f; - m_fAdjustCustomCameraZ = 161.0f; - m_fAdjustCustomCameraX = -10.0f; - m_fAdjustCustomCameraThirdPersonY = 0; - m_fAdjustCustomCameraThirdPersonX = 0; - m_fAdjustCustomCameraThirdPersonZ = 0; - m_fAdjustCustomCameraCrouch = 120.0f; - m_fP1Speed = 1.0f; - m_fP2Speed = 1.0f; - m_vP1Scale = { 1.0f,1.0f,1.0f }; - m_vP2Scale = { 1.0f,1.0f,1.0f }; - m_fSmoothScalingUpdate = 0.01f; - camFov = 0; - - - - sprintf(szCurrentCameraOption, szCameraModes[0]); sprintf(szCurrentModifier, szModifierModes[0]); sprintf(szPlayer1ModifierCharacter, szCharacters[0]); @@ -822,10 +760,6 @@ void MK11Menu::Initialize() sprintf(szAbilityReferenceChararacter, szKryptCharacters[0]); sprintf(szPlayer1Bone, szBones[0]); sprintf(szPlayer2Bone, szBones[0]); - - m_fAdjustCustomHeadCameraX = 0.0f; - m_fAdjustCustomHeadCameraY = 1600.0f; - m_fAdjustCustomHeadCameraZ = 0.0f; } void MK11Menu::Draw() @@ -852,724 +786,764 @@ void MK11Menu::Draw() if (ImGui::BeginTabBar("##tabs")) { - if (ImGui::BeginTabItem("Character Modifier")) { + DrawCharacterTab(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Stage Modifier")) + { + DrawStageTab(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Modifiers")) + { + DrawModifiersTab(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Player Control")) + { + DrawPlayerTab(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Speed Modifier")) + { + DrawSpeedTab(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Camera Control")) + { + DrawCameraTab(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Cheats")) + { + DrawCheatsTab(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Krypt Modifier")) + { + DrawKryptTab(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Misc.")) + { + DrawMiscTab(); + ImGui::EndTabItem(); + } + ImGui::EndTabBar(); + } + ImGui::End(); - ImGui::Text("Select a method for replacing characters.\nSelect Screen - replaces character during selection, works with normal gamemodes\n" - "Fight Init - Replaces character during game loading, allows to change characters\nin story mode, attract, practice.\n"); - if (m_nCurrentCharModifier == MODIFIER_FIGHT) - ImGui::Text("NOTE: Game modes with intros crash in fight init modifier!\n"); - if (ImGui::BeginCombo("Modifier Mode", szCurrentModifier)) - { - for (int n = 0; n < IM_ARRAYSIZE(szModifierModes); n++) - { - bool is_selected = (szCurrentModifier == szModifierModes[n]); - if (ImGui::Selectable(szModifierModes[n], is_selected)) - sprintf(szCurrentModifier, szModifierModes[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); + if (m_bSubmenuActive[SUBMENU_ABILITY_REFERENCE]) + DrawAbilityReference(); - } - ImGui::EndCombo(); - } - m_nCurrentCharModifier = GetModifierMode(szCurrentModifier); + if (m_bSubmenuActive[SUBMENU_SETTINGS]) + DrawSettings(); +} +void MK11Menu::Process() +{ + UpdateControls(); + if (m_bIsFocused && m_bFreeCamMouseControl) + UpdateMouse(); - ImGui::Separator(); +} +void MK11Menu::UpdateControls() +{ - ImGui::Checkbox("Enable Player 1 Modifier", &m_bPlayer1Modifier); + if (GetAsyncKeyState(SettingsMgr->iHookMenuOpenKey)) + { + if (GetTickCount64() - timer <= 150) return; + timer = GetTickCount64(); + m_bIsActive ^= 1; + } - if (m_nCurrentCharModifier == MODIFIER_SCREEN) - { - ImGui::SameLine(); - ShowHelpMarker("Should work in all game modes. You'll most likely need a gamepad for tower modes when playing as NPCs."); - } + if (GetAsyncKeyState(SettingsMgr->iToggleCustomCamKey)) + { + if (GetTickCount64() - timer <= 150) return; + timer = GetTickCount64(); + if (GetObj(PLAYER1) && GetObj(PLAYER2)) + m_bCustomCameras ^= 1; + else + { + Notifications->SetNotificationTime(2500); + Notifications->PushNotification("Custom cameras can only be activated in game!"); + } + } + if (GetAsyncKeyState(SettingsMgr->iResetStageInteractablesKey)) + { + if (GetTickCount64() - timer <= 150) return; + timer = GetTickCount64(); + if (GetObj(PLAYER1) && GetObj(PLAYER2)) + ResetStageInteractables(); + else + { + Notifications->SetNotificationTime(2500); + Notifications->PushNotification("Stage objects can only be reset in game!"); + } + } + if (GetAsyncKeyState(SettingsMgr->iToggleSlowMoKey)) + { + if (GetTickCount64() - timer <= 150) return; + timer = GetTickCount64(); + m_bSlowMotion ^= 1; + } - if (ImGui::BeginCombo("Player 1 Character", szPlayer1ModifierCharacter)) - { - for (int n = 0; n < IM_ARRAYSIZE(szCharacters); n++) - { - bool is_selected = (szPlayer1ModifierCharacter == szCharacters[n]); - if (ImGui::Selectable(szCharacters[n], is_selected)) - sprintf(szPlayer1ModifierCharacter, szCharacters[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); + if (GetAsyncKeyState(SettingsMgr->iToggleFreezeWorldKey)) + { + if (m_bHookDispatch) + { + if (GetTickCount64() - timer <= 150) return; + timer = GetTickCount64(); + m_bFreezeWorld ^= 1; + } - } - ImGui::EndCombo(); - } - ImGui::Separator(); - ImGui::Checkbox("Enable Player 2 Modifier", &m_bPlayer2Modifier); + } - if (ImGui::BeginCombo("Player 2 Character", szPlayer2ModifierCharacter)) - { - for (int n = 0; n < IM_ARRAYSIZE(szCharacters); n++) - { - bool is_selected = (szPlayer2ModifierCharacter == szCharacters[n]); - if (ImGui::Selectable(szCharacters[n], is_selected)) - sprintf(szPlayer2ModifierCharacter, szCharacters[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); - } - ImGui::EndCombo(); - } - ImGui::Separator(); +} - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Stage Modifier")) +void MK11Menu::UpdateMouse() +{ + if (m_bIsActive) return; + + GetCursorPos(&curMouse); + mouseSpeedX = curMouse.x - orgMouse.x; + mouseSpeedY = curMouse.y - orgMouse.y; + + + if (m_bIsFocused) + { + if (TheMenu->m_bFreeCam) { + int newVal = TheMenu->camRot.Yaw; + newVal += mouseSpeedX / mouseSens; + TheMenu->camRot.Yaw = newVal; - ImGui::Checkbox("Enable Stage Modifier", &m_bStageModifier); + int newValY = TheMenu->camRot.Pitch; - if (ImGui::BeginCombo("Stage", szStageModifierStage)) - { - for (int n = 0; n < IM_ARRAYSIZE(szStageNames); n++) - { - bool is_selected = (szStageModifierStage == szCameraModes[n]); - if (ImGui::Selectable(szStageNames[n], is_selected)) - sprintf(szStageModifierStage, szStageNames[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); + if (m_bFreeCamMouseInvertY) mouseSpeedY *= -1; - } - ImGui::EndCombo(); - } - ImGui::EndTabItem(); + newValY += mouseSpeedY / mouseSens; + TheMenu->camRot.Pitch = newValY; } - if (ImGui::BeginTabItem("Modifiers")) - { - if (ImGui::BeginTabBar("##modifiers")) - { - if (ImGui::BeginTabItem("Tag Assists")) - { - ImGui::Checkbox("Player 1 Tag Assist Modifier", &m_bTagAssist); + } +} - if (ImGui::BeginCombo("Player 1 Tag Assist Character", szPlayer1TagAssistCharacter)) - { - for (int n = 0; n < IM_ARRAYSIZE(szKryptCharacters); n++) - { - bool is_selected = (szPlayer1TagAssistCharacter == szKryptCharacters[n]); - if (ImGui::Selectable(szKryptCharacters[n], is_selected)) - sprintf(szPlayer1TagAssistCharacter, szKryptCharacters[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); - - } - ImGui::EndCombo(); - } - ImGui::Separator(); - ImGui::Checkbox("Player 2 Tag Assist Modifier", &m_bTagAssistP2); +void MK11Menu::DrawCharacterTab() +{ + ImGui::TextWrapped("Select a method for replacing characters.\nSelect Screen - replaces character during selection, works with normal gamemodes.\n" + "Fight Init - Replaces character during game loading, allows to change characters in story mode, attract, practice."); + if (m_nCurrentCharModifier == MODIFIER_FIGHT) + ImGui::Text("NOTE: Game modes with intros crash in fight init modifier!\n"); + if (ImGui::BeginCombo("Modifier Mode", szCurrentModifier)) + { + for (int n = 0; n < IM_ARRAYSIZE(szModifierModes); n++) + { + bool is_selected = (szCurrentModifier == szModifierModes[n]); + if (ImGui::Selectable(szModifierModes[n], is_selected)) + sprintf(szCurrentModifier, szModifierModes[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); - if (ImGui::BeginCombo("Player 2 Tag Assist Character", szPlayer2TagAssistCharacter)) - { - for (int n = 0; n < IM_ARRAYSIZE(szKryptCharacters); n++) - { - bool is_selected = (szPlayer2TagAssistCharacter == szKryptCharacters[n]); - if (ImGui::Selectable(szKryptCharacters[n], is_selected)) - sprintf(szPlayer2TagAssistCharacter, szKryptCharacters[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); - - } - ImGui::EndCombo(); - } - ImGui::Separator(); + } + ImGui::EndCombo(); + } + m_nCurrentCharModifier = GetModifierMode(szCurrentModifier); - ImGui::Text("NOTE: Scorpion will not work unless previously loaded (eg. P2).\nIf you get load crashes enable modifier in-game then restart or rematch (when online)."); - ImGui::Text("Restart match when you toggle these in game!"); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Abilities")) - { - ImGui::Checkbox("Player 1 Custom Abilities", &m_bP1CustomAbilities); - ImGui::SameLine(); ShowHelpMarker("Set these on select screen! Changing these in game might make moves locked. Hold L SHIFT to view numeric value."); - ImGui::Separator(); - - for (int i = 0; i < sizeof(m_P1Abilities) / sizeof(m_P1Abilities[0]); i++) - { - int val = pow(2, i); - if (GetAsyncKeyState(VK_LSHIFT)) - sprintf(textBuffer, "Ability %d (%d)", i + 1, val); - else - sprintf(textBuffer, "Ability %d", i + 1); + ImGui::Separator(); - ImGui::Checkbox(textBuffer, &m_P1Abilities[i]); - if (i % 2 == 0) - ImGui::SameLine(); - } + ImGui::Checkbox("Enable Player 1 Modifier", &m_bPlayer1Modifier); + if (m_nCurrentCharModifier == MODIFIER_SCREEN) + { + ImGui::SameLine(); + ShowHelpMarker("Should work in all game modes. You'll most likely need a gamepad for tower modes when playing as NPCs."); + } - if (GetObj(PLAYER1)) - { - if (ImGui::Button("Get##p1")) - { - int abilities = GetObj(PLAYER1)->GetAbility(); - for (int i = 0; i < sizeof(m_P1Abilities) / sizeof(m_P1Abilities[0]); i++) - { - int id = pow(2, i); - m_P1Abilities[i] = abilities & id; - } - } + if (ImGui::BeginCombo("Player 1 Character", szPlayer1ModifierCharacter)) + { + for (int n = 0; n < IM_ARRAYSIZE(szCharacters); n++) + { + bool is_selected = (szPlayer1ModifierCharacter == szCharacters[n]); + if (ImGui::Selectable(szCharacters[n], is_selected)) + sprintf(szPlayer1ModifierCharacter, szCharacters[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); - } - ImGui::Separator(); - ImGui::Checkbox("Player 2 Custom Abilities", &m_bP2CustomAbilities); - ImGui::Separator(); + } + ImGui::EndCombo(); + } + ImGui::Separator(); + ImGui::Checkbox("Enable Player 2 Modifier", &m_bPlayer2Modifier); - for (int i = 0; i < sizeof(m_P2Abilities) / sizeof(m_P2Abilities[0]); i++) - { - int val = pow(2, i); - if (GetAsyncKeyState(VK_LSHIFT)) - sprintf(textBuffer, "Ability %d (%d)##p2", i + 1, val); - else - sprintf(textBuffer, "Ability %d##p2", i + 1); + if (ImGui::BeginCombo("Player 2 Character", szPlayer2ModifierCharacter)) + { + for (int n = 0; n < IM_ARRAYSIZE(szCharacters); n++) + { + bool is_selected = (szPlayer2ModifierCharacter == szCharacters[n]); + if (ImGui::Selectable(szCharacters[n], is_selected)) + sprintf(szPlayer2ModifierCharacter, szCharacters[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); + } + ImGui::EndCombo(); + } + ImGui::Separator(); - ImGui::Checkbox(textBuffer, &m_P2Abilities[i]); +} - if (i % 2 == 0) - ImGui::SameLine(); - } +void MK11Menu::DrawStageTab() +{ + ImGui::Checkbox("Enable Stage Modifier", &m_bStageModifier); - if (GetObj(PLAYER2)) - { - if (ImGui::Button("Get##p2")) - { - int abilities = GetObj(PLAYER2)->GetAbility(); + if (ImGui::BeginCombo("Stage", szStageModifierStage)) + { + for (int n = 0; n < IM_ARRAYSIZE(szStageNames); n++) + { + bool is_selected = (szStageModifierStage == szCameraModes[n]); + if (ImGui::Selectable(szStageNames[n], is_selected)) + sprintf(szStageModifierStage, szStageNames[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); - for (int i = 0; i < sizeof(m_P2Abilities) / sizeof(m_P2Abilities[0]); i++) - { - int id = pow(2, i); - m_P2Abilities[i] = abilities & id; - } - } + } + ImGui::EndCombo(); + } - } + if (ImGui::Button("Reset Stage Objects")) + ResetStageInteractables(); +} - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Skeleton")) - { - if (GetObj(PLAYER1) && GetObj(PLAYER2)) - { - ImGui::TextWrapped("Player 1"); - ImGui::Separator(); - if (ImGui::BeginCombo("Bone##p1", szPlayer1Bone)) - { - for (int n = 0; n < IM_ARRAYSIZE(szBones); n++) - { - bool is_selected = (szPlayer1Bone == szBones[n]); - if (ImGui::Selectable(szBones[n], is_selected)) - sprintf(szPlayer1Bone, szBones[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); - - } - ImGui::EndCombo(); - } - static float boneSizeP1 = 0.0f; - ImGui::InputFloat("Size##p1", &boneSizeP1); - - - if (ImGui::Button("Change Bone", { -FLT_MIN, 0 })) - { - Notifications->SetNotificationTime(2500); - Notifications->PushNotification("Changed %s", szPlayer1Bone); - GetObj(PLAYER1)->SetBoneSize(szPlayer1Bone, boneSizeP1); - } - - ImGui::TextWrapped("Player 2"); - ImGui::Separator(); - - if (ImGui::BeginCombo("Bone##p1", szPlayer1Bone)) - { - for (int n = 0; n < IM_ARRAYSIZE(szBones); n++) - { - bool is_selected = (szPlayer2Bone == szBones[n]); - if (ImGui::Selectable(szBones[n], is_selected)) - sprintf(szPlayer2Bone, szBones[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); - - } - ImGui::EndCombo(); - } - static float boneSizeP2 = 0.0f; - ImGui::InputFloat("Size##p2", &boneSizeP2); - - - if (ImGui::Button("Change Bone##p2", { -FLT_MIN, 0 })) - { - Notifications->SetNotificationTime(2500); - Notifications->PushNotification("Changed %s", szPlayer1Bone); - GetObj(PLAYER2)->SetBoneSize(szPlayer2Bone, boneSizeP2); - } - - ImGui::Separator(); - ImGui::TextWrapped("Presets"); - if (ImGui::Button("Big Heads", { -FLT_MIN, 0 })) - { - Notifications->SetNotificationTime(2500); - GetObj(PLAYER1)->SetBoneSize("Head", 1.5f); - GetObj(PLAYER2)->SetBoneSize("Head", 1.5f); - GetObj(PLAYER1)->SetBoneSize("Neck", 1.5f); - GetObj(PLAYER2)->SetBoneSize("Neck", 1.5f); - } - if (ImGui::Button("Big Fists", { -FLT_MIN, 0 })) - { - GetObj(PLAYER1)->SetBoneSize("LeftHand", 3.0f); - GetObj(PLAYER1)->SetBoneSize("RightHand", 3.0f); - GetObj(PLAYER2)->SetBoneSize("LeftHand", 3.0f); - GetObj(PLAYER2)->SetBoneSize("RightHand", 3.0f); - } - if (ImGui::Button("Googly Eyes", { -FLT_MIN, 0 })) - { - GetObj(PLAYER1)->SetBoneSize("LeftEye", 2.0f); - GetObj(PLAYER1)->SetBoneSize("RightEye", 2.0f); - GetObj(PLAYER2)->SetBoneSize("LeftEye", 2.0f); - GetObj(PLAYER2)->SetBoneSize("RightEye", 2.0f); - } - if (ImGui::Button("Large Feet", { -FLT_MIN, 0 })) - { - GetObj(PLAYER1)->SetBoneSize("LeftFoot", 2.0f); - GetObj(PLAYER1)->SetBoneSize("RightFoot", 2.0f); - GetObj(PLAYER2)->SetBoneSize("LeftFoot", 2.0f); - GetObj(PLAYER2)->SetBoneSize("RightFoot", 2.0f); - } - if (ImGui::Button("Reset All", { -FLT_MIN, 0 })) - { - for (int i = 0; i < sizeof(szBones) / sizeof(szBones[0]); i++) - { - GetObj(PLAYER1)->SetBoneSize(szBones[i], 1.0f); - GetObj(PLAYER2)->SetBoneSize(szBones[i], 1.0f); - } - } - ImGui::Separator(); - } - else - ImGui::TextWrapped("Skeleton options are only available in-game!"); - - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); - } - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Player Control")) +void MK11Menu::DrawModifiersTab() +{ + if (ImGui::BeginTabBar("##modifiers")) + { + if (ImGui::BeginTabItem("Tag Assists")) { - if (GetObj(PLAYER1) && GetObj(PLAYER2)) - { - ImGui::Checkbox("Change Player Speed", &m_bChangePlayerSpeed); - ImGui::SliderFloat("Player 1", &m_fP1Speed, 0.0, 10.0f); - ImGui::SliderFloat("Player 2", &m_fP2Speed, 0.0, 10.0f); - if (ImGui::Button("Reset Speed")) - { - m_fP1Speed = 1.0f; - m_fP2Speed = 1.0f; - if (GetObj(PLAYER1)) - GetObj(PLAYER1)->SetSpeed(m_fP1Speed); - if (GetObj(PLAYER2)) - GetObj(PLAYER2)->SetSpeed(m_fP1Speed); - } - ImGui::Separator(); - ImGui::Checkbox("Change Player Scale", &m_bChangePlayerScale); - ImGui::InputFloat3("Player 1 ", &m_vP1Scale.X); - ImGui::InputFloat3("Player 2 ", &m_vP2Scale.X); - - ImGui::Checkbox("Smooth Player Scale", &m_bSmoothScaleChange); - ImGui::InputFloat("Smooth Scale Value", &m_fSmoothScalingUpdate); + ImGui::Checkbox("Player 1 Tag Assist Modifier", &m_bTagAssist); - if (ImGui::Button("Reset Scale")) + if (ImGui::BeginCombo("Player 1 Tag Assist Character", szPlayer1TagAssistCharacter)) + { + for (int n = 0; n < IM_ARRAYSIZE(szKryptCharacters); n++) { - m_vP1Scale = { 1.0f,1.0f,1.0f }; - m_vP2Scale = { 1.0f,1.0f,1.0f }; - if (GetObj(PLAYER1)) - GetObj(PLAYER1)->SetScale(&m_vP1Scale); - if (GetObj(PLAYER2)) - GetObj(PLAYER2)->SetScale(&m_vP2Scale); - } + bool is_selected = (szPlayer1TagAssistCharacter == szKryptCharacters[n]); + if (ImGui::Selectable(szKryptCharacters[n], is_selected)) + sprintf(szPlayer1TagAssistCharacter, szKryptCharacters[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); + } + ImGui::EndCombo(); + } + ImGui::Separator(); + ImGui::Checkbox("Player 2 Tag Assist Modifier", &m_bTagAssistP2); - ImGui::Separator(); - if (GetObj(PLAYER1) && GetObj(PLAYER2)) + if (ImGui::BeginCombo("Player 2 Tag Assist Character", szPlayer2TagAssistCharacter)) + { + for (int n = 0; n < IM_ARRAYSIZE(szKryptCharacters); n++) { + bool is_selected = (szPlayer2TagAssistCharacter == szKryptCharacters[n]); + if (ImGui::Selectable(szKryptCharacters[n], is_selected)) + sprintf(szPlayer2TagAssistCharacter, szKryptCharacters[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); - ImGui::Text("Position"); - ImGui::SameLine(); ShowHelpMarker("Read only!"); - GetCharacterPosition(&plrPos, PLAYER1); - ImGui::InputFloat3("X | Y | Z", &plrPos.X); - GetCharacterPosition(&plrPos2, PLAYER2); - ImGui::InputFloat3("X | Y | Z", &plrPos2.X); } - + ImGui::EndCombo(); } - else - ImGui::Text("Player options are only available in-game!"); + ImGui::Separator(); + ImGui::Text("NOTE: Scorpion will not work unless previously loaded (eg. P2).\nIf you get load crashes enable modifier in-game then restart or rematch (when online)."); + ImGui::Text("Restart match when you toggle these in game!"); ImGui::EndTabItem(); } - if (ImGui::BeginTabItem("Speed Modifier")) + if (ImGui::BeginTabItem("Abilities")) { - ImGui::Text("Gamespeed Control"); - ImGui::InputFloat("", &m_fSlowMotionSpeed, 0.1); + ImGui::Checkbox("Player 1 Custom Abilities", &m_bP1CustomAbilities); + ImGui::SameLine(); ShowHelpMarker("Set these on select screen! Changing these in game might make moves locked. Hold L SHIFT to view numeric value."); + ImGui::Separator(); - if (m_fSlowMotionSpeed > 2.0f) m_fSlowMotionSpeed = 2.0f; - if (m_fSlowMotionSpeed < 0.0f) m_fSlowMotionSpeed = 0.0f; - ImGui::Checkbox("Enable", &m_bSlowMotion); - ImGui::SameLine(); - ShowHelpMarker("Hotkey - F5"); + for (int i = 0; i < sizeof(m_P1Abilities) / sizeof(m_P1Abilities[0]); i++) + { + int val = pow(2, i); + if (GetAsyncKeyState(VK_LSHIFT)) + sprintf(textBuffer, "Ability %d (%d)", i + 1, val); + else + sprintf(textBuffer, "Ability %d", i + 1); - ImGui::Separator(); - ImGui::Text("Tick this checkbox if you want to freeze game with a button, this might cause\nissues with pause menus and stuff so enable only when needed!"); - ImGui::Checkbox("Hook Freeze World", &m_bHookDispatch); + ImGui::Checkbox(textBuffer, &m_P1Abilities[i]); - if (m_bHookDispatch) - { - ImGui::Checkbox("Freeze World", &m_bFreezeWorld); - ImGui::SameLine(); - ShowHelpMarker("Hotkey - F2"); + if (i % 2 == 0) + ImGui::SameLine(); } - ImGui::Separator(); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Camera Control")) - { - ImGui::Checkbox("Set Camera Position", &m_bCustomCameraPos); - ImGui::InputFloat3("X | Y | Z", &camPos.X); - ImGui::Checkbox("Set Camera Rotation", &m_bCustomCameraRot); - ImGui::InputInt3("Pitch | Yaw | Roll", &camRot.Pitch); + if (GetObj(PLAYER1)) + { + if (ImGui::Button("Get##p1")) + { + int abilities = GetObj(PLAYER1)->GetAbility(); - ImGui::Checkbox("Set FOV", &m_bCustomCameraFOV); - ImGui::InputFloat("FOV", &camFov); + for (int i = 0; i < sizeof(m_P1Abilities) / sizeof(m_P1Abilities[0]); i++) + { + int id = pow(2, i); + m_P1Abilities[i] = abilities & id; + } + } + } + ImGui::Separator(); + ImGui::Checkbox("Player 2 Custom Abilities", &m_bP2CustomAbilities); ImGui::Separator(); - ImGui::Checkbox("Enable Freecam", &m_bFreeCam); - ImGui::SameLine(); ShowHelpMarker("Allows to move camera with certain keys.\nRequires all toggles enabled!\nYou can configure keys in .ini file."); - if (m_bFreeCam) + for (int i = 0; i < sizeof(m_P2Abilities) / sizeof(m_P2Abilities[0]); i++) { - if (!m_bCustomCameraPos || !m_bCustomCameraRot || !m_bCustomCameraFOV) - ImGui::TextColored(ImVec4(1.f, 0.3f, 0.3f, 1.f), "Check rest of the Set Camera options!"); + int val = pow(2, i); + if (GetAsyncKeyState(VK_LSHIFT)) + sprintf(textBuffer, "Ability %d (%d)##p2", i + 1, val); + else + sprintf(textBuffer, "Ability %d##p2", i + 1); - ImGui::InputFloat("Freecam Speed", &m_fFreeCameraSpeed); - ImGui::InputInt("Freecam Rotation Speed", &m_nFreeCameraRotationSpeed); + ImGui::Checkbox(textBuffer, &m_P2Abilities[i]); - ImGui::Separator(); - ImGui::Checkbox("Mouse Control", &m_bFreeCamMouseControl); + if (i % 2 == 0) + ImGui::SameLine(); + } - if (m_bFreeCamMouseControl) + if (GetObj(PLAYER2)) + { + if (ImGui::Button("Get##p2")) { - ImGui::SameLine(); ImGui::TextColored(ImVec4(1.f, 0.3f, 0.3f, 1.f), "This feature is not yet finished!"); - ImGui::Checkbox("Invert Y", &m_bFreeCamMouseInvertY); - ImGui::SliderInt("Mouse Smoothness", &mouseSens, 1, 15); - } - } + int abilities = GetObj(PLAYER2)->GetAbility(); + for (int i = 0; i < sizeof(m_P2Abilities) / sizeof(m_P2Abilities[0]); i++) + { + int id = pow(2, i); + m_P2Abilities[i] = abilities & id; + } + } + } + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Skeleton")) + { + if (GetObj(PLAYER1) && GetObj(PLAYER2)) + { + ImGui::TextWrapped("Player 1"); + ImGui::Separator(); + if (ImGui::BeginCombo("Bone##p1", szPlayer1Bone)) + { + for (int n = 0; n < IM_ARRAYSIZE(szBones); n++) + { + bool is_selected = (szPlayer1Bone == szBones[n]); + if (ImGui::Selectable(szBones[n], is_selected)) + sprintf(szPlayer1Bone, szBones[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); - ImGui::Separator(); - ImGui::Checkbox("Force Camera To Move", &m_bForceCameraUpdate); - ImGui::SameLine(); ShowHelpMarker("Check this option if you can't move camera anymore in win poses and some cinematics."); + } + ImGui::EndCombo(); + } + static float boneSizeP1 = 0.0f; + ImGui::InputFloat("Size##p1", &boneSizeP1); - ImGui::Separator(); - ImGui::Checkbox("Custom Cameras", &m_bCustomCameras); + if (ImGui::Button("Change Bone", { -FLT_MIN, 0 })) + { + Notifications->SetNotificationTime(2500); + Notifications->PushNotification("Changed %s", szPlayer1Bone); + GetObj(PLAYER1)->SetBoneSize(szPlayer1Bone, boneSizeP1); + } - if (GetObj(PLAYER1) && GetObj(PLAYER2)) - { + ImGui::TextWrapped("Player 2"); + ImGui::Separator(); - if (ImGui::BeginCombo("Mode", szCurrentCameraOption)) + if (ImGui::BeginCombo("Bone##p1", szPlayer1Bone)) { - for (int n = 0; n < IM_ARRAYSIZE(szCameraModes); n++) + for (int n = 0; n < IM_ARRAYSIZE(szBones); n++) { - bool is_selected = (szCurrentCameraOption == szCameraModes[n]); - if (ImGui::Selectable(szCameraModes[n], is_selected)) - sprintf(szCurrentCameraOption, szCameraModes[n]); + bool is_selected = (szPlayer2Bone == szBones[n]); + if (ImGui::Selectable(szBones[n], is_selected)) + sprintf(szPlayer2Bone, szBones[n]); if (is_selected) ImGui::SetItemDefaultFocus(); } ImGui::EndCombo(); } - m_nCurrentCustomCamera = GetCamMode(szCurrentCameraOption); - if (m_nCurrentCustomCamera == CAMERA_1STPERSON || m_nCurrentCustomCamera == CAMERA_1STPERSON_MID) + static float boneSizeP2 = 0.0f; + ImGui::InputFloat("Size##p2", &boneSizeP2); + + + if (ImGui::Button("Change Bone##p2", { -FLT_MIN, 0 })) { - ImGui::InputFloat("FPS Camera Offset", &m_fAdjustCustomCameraY); - ImGui::InputFloat("FPS Up/Down Offset", &m_fAdjustCustomCameraZ); - ImGui::InputFloat("FPS Left/Right Offset", &m_fAdjustCustomCameraX); + Notifications->SetNotificationTime(2500); + Notifications->PushNotification("Changed %s", szPlayer1Bone); + GetObj(PLAYER2)->SetBoneSize(szPlayer2Bone, boneSizeP2); } - else if (m_nCurrentCustomCamera == CAMERA_3RDPERSON) + + ImGui::Separator(); + ImGui::TextWrapped("Presets"); + if (ImGui::Button("Big Heads", { -FLT_MIN, 0 })) { - ImGui::InputFloat("TPP Camera Offset", &m_fAdjustCustomCameraThirdPersonY); - ImGui::InputFloat("TPP Up/Down Offset", &m_fAdjustCustomCameraThirdPersonZ); - ImGui::InputFloat("TPP Left/Right Offset", &m_fAdjustCustomCameraThirdPersonX); + Notifications->SetNotificationTime(2500); + GetObj(PLAYER1)->SetBoneSize("Head", 1.5f); + GetObj(PLAYER2)->SetBoneSize("Head", 1.5f); + GetObj(PLAYER1)->SetBoneSize("Neck", 1.5f); + GetObj(PLAYER2)->SetBoneSize("Neck", 1.5f); } - else if (m_nCurrentCustomCamera == CAMERA_HEAD_TRACKING) + if (ImGui::Button("Big Fists", { -FLT_MIN, 0 })) { - ImGui::InputFloat("Up/Down Angle Offset", &m_fAdjustCustomHeadCameraY); - ImGui::InputFloat("Up/Down Offset", &m_fAdjustCustomHeadCameraZ); - ImGui::InputFloat("Left/Right Offset", &m_fAdjustCustomHeadCameraX); - - ImGui::Checkbox("Don't Flip Camera", &m_bDontFlipCamera); - ImGui::SameLine(); ShowHelpMarker("Use this option for head tracked cinematics."); - ImGui::Checkbox("Use Player Two As Source", &m_bUsePlayerTwoAsTracker); - - ImGui::TextWrapped("Recommended to set FOV value to at least 110 to make this mode look right!"); + GetObj(PLAYER1)->SetBoneSize("LeftHand", 3.0f); + GetObj(PLAYER1)->SetBoneSize("RightHand", 3.0f); + GetObj(PLAYER2)->SetBoneSize("LeftHand", 3.0f); + GetObj(PLAYER2)->SetBoneSize("RightHand", 3.0f); + } + if (ImGui::Button("Googly Eyes", { -FLT_MIN, 0 })) + { + GetObj(PLAYER1)->SetBoneSize("LeftEye", 2.0f); + GetObj(PLAYER1)->SetBoneSize("RightEye", 2.0f); + GetObj(PLAYER2)->SetBoneSize("LeftEye", 2.0f); + GetObj(PLAYER2)->SetBoneSize("RightEye", 2.0f); + } + if (ImGui::Button("Large Feet", { -FLT_MIN, 0 })) + { + GetObj(PLAYER1)->SetBoneSize("LeftFoot", 2.0f); + GetObj(PLAYER1)->SetBoneSize("RightFoot", 2.0f); + GetObj(PLAYER2)->SetBoneSize("LeftFoot", 2.0f); + GetObj(PLAYER2)->SetBoneSize("RightFoot", 2.0f); + } + if (ImGui::Button("Reset All", { -FLT_MIN, 0 })) + { + for (int i = 0; i < sizeof(szBones) / sizeof(szBones[0]); i++) + { + GetObj(PLAYER1)->SetBoneSize(szBones[i], 1.0f); + GetObj(PLAYER2)->SetBoneSize(szBones[i], 1.0f); + } } + ImGui::Separator(); } else - ImGui::Text("Custom cameras will appear once in-game!"); + ImGui::TextWrapped("Skeleton options are only available in-game!"); ImGui::EndTabItem(); + } + ImGui::EndTabBar(); + } +} +void MK11Menu::DrawPlayerTab() +{ + if (GetObj(PLAYER1) && GetObj(PLAYER2)) + { + ImGui::Checkbox("Change Player Speed", &m_bChangePlayerSpeed); + ImGui::SliderFloat("Player 1", &m_fP1Speed, 0.0, 10.0f); + ImGui::SliderFloat("Player 2", &m_fP2Speed, 0.0, 10.0f); + if (ImGui::Button("Reset Speed")) + { + m_fP1Speed = 1.0f; + m_fP2Speed = 1.0f; + if (GetObj(PLAYER1)) + GetObj(PLAYER1)->SetSpeed(m_fP1Speed); + if (GetObj(PLAYER2)) + GetObj(PLAYER2)->SetSpeed(m_fP1Speed); } - if (ImGui::BeginTabItem("Cheats")) + ImGui::Separator(); + ImGui::Checkbox("Change Player Scale", &m_bChangePlayerScale); + ImGui::InputFloat3("Player 1 ", &m_vP1Scale.X); + ImGui::InputFloat3("Player 2 ", &m_vP2Scale.X); + + ImGui::Checkbox("Smooth Player Scale", &m_bSmoothScaleChange); + ImGui::InputFloat("Smooth Scale Value", &m_fSmoothScalingUpdate); + + + if (ImGui::Button("Reset Scale")) { + m_vP1Scale = { 1.0f,1.0f,1.0f }; + m_vP2Scale = { 1.0f,1.0f,1.0f }; + if (GetObj(PLAYER1)) + GetObj(PLAYER1)->SetScale(&m_vP1Scale); + if (GetObj(PLAYER2)) + GetObj(PLAYER2)->SetScale(&m_vP2Scale); + } + ImGui::Separator(); + ImGui::Text("Position"); + ImGui::SameLine(); ShowHelpMarker("Read only!"); + GetCharacterPosition(&plrPos, PLAYER1); + ImGui::InputFloat3("X | Y | Z", &plrPos.X); + GetCharacterPosition(&plrPos2, PLAYER2); + ImGui::InputFloat3("X | Y | Z", &plrPos2.X); + + } + else + ImGui::Text("Player options are only available in-game!"); - ImGui::Separator(); - ImGui::Columns(2); - ImGui::SetColumnWidth(0, 220); +} - ImGui::Text("Infinite Health"); - ImGui::NextColumn(); - ImGui::Checkbox("P1##infhealth", &m_bInfiniteHealthP1); - ImGui::SameLine(); - ImGui::Checkbox("P2##infhealth", &m_bInfiniteHealthP2); - ImGui::NextColumn(); +void MK11Menu::DrawSpeedTab() +{ + ImGui::Text("Gamespeed Control"); + ImGui::InputFloat("", &m_fSlowMotionSpeed, 0.1); + if (m_fSlowMotionSpeed > 2.0f) m_fSlowMotionSpeed = 2.0f; + if (m_fSlowMotionSpeed < 0.0f) m_fSlowMotionSpeed = 0.0f; + ImGui::Checkbox("Enable", &m_bSlowMotion); + ImGui::SameLine(); + ShowHelpMarker("Hotkey - F5"); - ImGui::Text("Zero Health\n"); - ImGui::NextColumn(); - ImGui::Checkbox("P1##0health", &m_bNoHealthP1); - ImGui::SameLine(); - ImGui::Checkbox("P2##0health", &m_bNoHealthP2); - ImGui::NextColumn(); + ImGui::Separator(); + ImGui::Text("Tick this checkbox if you want to freeze game with a button, this might cause\nissues with pause menus and stuff so enable only when needed!"); + ImGui::Checkbox("Hook Freeze World", &m_bHookDispatch); + if (m_bHookDispatch) + { + ImGui::Checkbox("Freeze World", &m_bFreezeWorld); + ImGui::SameLine(); + ShowHelpMarker("Hotkey - F2"); + } - ImGui::Text("1 Health\n"); - ImGui::NextColumn(); - ImGui::Checkbox("P1##1health", &m_bOneHealthP1); - ImGui::SameLine(); - ImGui::Checkbox("P2##1health", &m_bOneHealthP2); - ImGui::NextColumn(); + ImGui::Separator(); +} - ImGui::Text("Infinite Offensive Bar\n"); - ImGui::NextColumn(); - ImGui::Checkbox("P1##atk", &m_bInfiniteAttackP1); - ImGui::SameLine(); - ImGui::Checkbox("P2##atk", &m_bInfiniteAttackP2); - ImGui::NextColumn(); +void MK11Menu::DrawCameraTab() +{ + ImGui::Checkbox("Set Camera Position", &m_bCustomCameraPos); + ImGui::InputFloat3("X | Y | Z", &camPos.X); + ImGui::Checkbox("Set Camera Rotation", &m_bCustomCameraRot); + ImGui::InputInt3("Pitch | Yaw | Roll", &camRot.Pitch); - ImGui::Text("Infinite Defensive Bar\n"); - ImGui::NextColumn(); - ImGui::Checkbox("P1##def", &m_bInfiniteDefendP1); - ImGui::SameLine(); - ImGui::Checkbox("P2##def", &m_bInfiniteDefendP2); - ImGui::NextColumn(); + ImGui::Checkbox("Set FOV", &m_bCustomCameraFOV); + ImGui::InputFloat("FOV", &camFov); + ImGui::Separator(); + ImGui::Checkbox("Enable Freecam", &m_bFreeCam); + ImGui::SameLine(); ShowHelpMarker("Allows to move camera with certain keys.\nRequires all toggles enabled!\nYou can configure keys in .ini file."); - ImGui::Columns(1); - ImGui::Separator(); - if (GetObj(PLAYER1) && GetObj(PLAYER2)) - ImGui::Text("Easy Krushing Blows"); + if (m_bFreeCam) + { + if (!m_bCustomCameraPos || !m_bCustomCameraRot || !m_bCustomCameraFOV) + ImGui::TextColored(ImVec4(1.f, 0.3f, 0.3f, 1.f), "Check rest of the Set Camera options!"); - if (GetObj(PLAYER1)) - { - if (ImGui::Button("Enable P1")) - GetObj(PLAYER1)->SetEasyKrushingBlows(true); - ImGui::SameLine(); - if (ImGui::Button("Disable P1")) - GetObj(PLAYER1)->SetEasyKrushingBlows(false); - } - if (GetObj(PLAYER1)) - { - if (ImGui::Button("Enable P2")) - GetObj(PLAYER1)->SetEasyKrushingBlows(true); - ImGui::SameLine(); - if (ImGui::Button("Disable P2")) - GetObj(PLAYER1)->SetEasyKrushingBlows(false); - } - ImGui::Separator(); + ImGui::InputFloat("Freecam Speed", &m_fFreeCameraSpeed); + ImGui::InputInt("Freecam Rotation Speed", &m_nFreeCameraRotationSpeed); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Krypt Modifier")) + ImGui::Separator(); + ImGui::Checkbox("Mouse Control", &m_bFreeCamMouseControl); + + if (m_bFreeCamMouseControl) { + ImGui::SameLine(); ImGui::TextColored(ImVec4(1.f, 0.3f, 0.3f, 1.f), "This feature is not yet finished!"); + ImGui::Checkbox("Invert Y", &m_bFreeCamMouseInvertY); + ImGui::SliderInt("Mouse Smoothness", &mouseSens, 1, 15); + } + } - ImGui::Text("Make sure you match the character class! It's trial & error if a character doesn't work."); - ImGui::Text("Normal characters use Base class, while Sektor/Cyrax use NPCs. Some might not work at all."); - ImGui::Separator(); - ImGui::Checkbox("Change Krypt Character", &m_bKryptModifier); - if (ImGui::BeginCombo("Character Class", szCurrentKryptCharacterClass)) - { - for (int n = 0; n < IM_ARRAYSIZE(szCharClasses); n++) - { - bool is_selected = (szCurrentKryptCharacterClass == szCharClasses[n]); - if (ImGui::Selectable(szCharClasses[n], is_selected)) - sprintf(szCurrentKryptCharacterClass, szCharClasses[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); - } - ImGui::EndCombo(); - } + ImGui::Separator(); + ImGui::Checkbox("Force Camera To Move", &m_bForceCameraUpdate); + ImGui::SameLine(); ShowHelpMarker("Check this option if you can't move camera anymore in win poses and some cinematics."); - if (ImGui::BeginCombo("Krypt Character", szCurrentKryptCharacter)) - { - for (int n = 0; n < IM_ARRAYSIZE(szCharacters); n++) - { - bool is_selected = (szCurrentKryptCharacter == szKryptCharacters[n]); - if (ImGui::Selectable(szKryptCharacters[n], is_selected)) - sprintf(szCurrentKryptCharacter, szKryptCharacters[n]); - if (is_selected) - ImGui::SetItemDefaultFocus(); + ImGui::Separator(); - } - ImGui::EndCombo(); - } + ImGui::Checkbox("Custom Cameras", &m_bCustomCameras); + if (GetObj(PLAYER1) && GetObj(PLAYER2)) + { - ImGui::Separator(); - ImGui::Text("NOTE: This only changes character during krypt load!"); + if (ImGui::BeginCombo("Mode", szCurrentCameraOption)) + { + for (int n = 0; n < IM_ARRAYSIZE(szCameraModes); n++) + { + bool is_selected = (szCurrentCameraOption == szCameraModes[n]); + if (ImGui::Selectable(szCameraModes[n], is_selected)) + sprintf(szCurrentCameraOption, szCameraModes[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); - ImGui::EndTabItem(); + } + ImGui::EndCombo(); } - if (ImGui::BeginTabItem("Misc.")) + m_nCurrentCustomCamera = GetCamMode(szCurrentCameraOption); + if (m_nCurrentCustomCamera == CAMERA_1STPERSON || m_nCurrentCustomCamera == CAMERA_1STPERSON_MID) { - if (ImGui::Button("Hide FightHUD")) - HideHUD(); - ImGui::SameLine(); - if (ImGui::Button("Show FightHUD")) - ShowHUD(); - - ImGui::Checkbox("Hide FightHUD In Game", &m_bAutoHideHUD); - ImGui::Checkbox("Disable HUD Completely", &m_bDisableHUD); - ImGui::SameLine(); - ShowHelpMarker("You'll need to go in-game/back to menu for this option to take effect."); - - ImGui::Checkbox("Disable Nondefault Gear Loadouts", &m_bDisableGearLoadouts); - ImGui::SameLine(); - ShowHelpMarker("Only default loadouts will be used. Do not toggle this option when models are on screen."); - - ImGui::Checkbox("Disable Head Tracking", &m_bDisableHeadTracking); - ImGui::SameLine(); - ShowHelpMarker("Disables P1 head looking at P2. Automatically enabled with 'Head Perspective' custom camera."); - ImGui::EndTabItem(); + ImGui::InputFloat("FPS Camera Offset", &m_fAdjustCustomCameraY); + ImGui::InputFloat("FPS Up/Down Offset", &m_fAdjustCustomCameraZ); + ImGui::InputFloat("FPS Left/Right Offset", &m_fAdjustCustomCameraX); + } + else if (m_nCurrentCustomCamera == CAMERA_3RDPERSON) + { + ImGui::InputFloat("TPP Camera Offset", &m_fAdjustCustomCameraThirdPersonY); + ImGui::InputFloat("TPP Up/Down Offset", &m_fAdjustCustomCameraThirdPersonZ); + ImGui::InputFloat("TPP Left/Right Offset", &m_fAdjustCustomCameraThirdPersonX); + } + else if (m_nCurrentCustomCamera == CAMERA_HEAD_TRACKING) + { + ImGui::InputFloat("Up/Down Angle Offset", &m_fAdjustCustomHeadCameraY); + ImGui::InputFloat("Up/Down Offset", &m_fAdjustCustomHeadCameraZ); + ImGui::InputFloat("Left/Right Offset", &m_fAdjustCustomHeadCameraX); + ImGui::Checkbox("Don't Flip Camera", &m_bDontFlipCamera); + ImGui::SameLine(); ShowHelpMarker("Use this option for head tracked cinematics."); + ImGui::Checkbox("Use Player Two As Source", &m_bUsePlayerTwoAsTracker); + ImGui::TextWrapped("Recommended to set FOV value to at least 110 to make this mode look right!"); } - ImGui::EndTabBar(); } - ImGui::End(); - + else + ImGui::Text("Custom cameras will appear once in-game!"); - if (m_bSubmenuActive[SUBMENU_ABILITY_REFERENCE]) - DrawAbilityReference(); - - if (m_bSubmenuActive[SUBMENU_SETTINGS]) - DrawSettings(); } -void MK11Menu::Process() +void MK11Menu::DrawCheatsTab() { - UpdateControls(); - if (m_bIsFocused && m_bFreeCamMouseControl) - UpdateMouse(); + ImGui::Separator(); + ImGui::Columns(2); + ImGui::SetColumnWidth(0, 220); -} + ImGui::Text("Infinite Health"); + ImGui::NextColumn(); + ImGui::Checkbox("P1##infhealth", &m_bInfiniteHealthP1); + ImGui::SameLine(); + ImGui::Checkbox("P2##infhealth", &m_bInfiniteHealthP2); + ImGui::NextColumn(); -void MK11Menu::UpdateControls() -{ - if (GetAsyncKeyState(SettingsMgr->iHookMenuOpenKey)) - { - if (GetTickCount64() - timer <= 150) return; - timer = GetTickCount64(); - m_bIsActive ^= 1; - } + ImGui::Text("Zero Health\n"); + ImGui::NextColumn(); + ImGui::Checkbox("P1##0health", &m_bNoHealthP1); + ImGui::SameLine(); + ImGui::Checkbox("P2##0health", &m_bNoHealthP2); + ImGui::NextColumn(); - if (GetAsyncKeyState(VK_F5)) - { - if (GetTickCount64() - timer <= 150) return; - timer = GetTickCount64(); - m_bSlowMotion ^= 1; - } - if (GetAsyncKeyState(VK_F2)) - { - if (m_bHookDispatch) - { - if (GetTickCount64() - timer <= 150) return; - timer = GetTickCount64(); - m_bFreezeWorld ^= 1; - } + ImGui::Text("1 Health\n"); + ImGui::NextColumn(); + ImGui::Checkbox("P1##1health", &m_bOneHealthP1); + ImGui::SameLine(); + ImGui::Checkbox("P2##1health", &m_bOneHealthP2); + ImGui::NextColumn(); - } - if (m_bSlowMotion) + ImGui::Text("Infinite Offensive Bar\n"); + ImGui::NextColumn(); + ImGui::Checkbox("P1##atk", &m_bInfiniteAttackP1); + ImGui::SameLine(); + ImGui::Checkbox("P2##atk", &m_bInfiniteAttackP2); + ImGui::NextColumn(); + + ImGui::Text("Infinite Defensive Bar\n"); + ImGui::NextColumn(); + ImGui::Checkbox("P1##def", &m_bInfiniteDefendP1); + ImGui::SameLine(); + ImGui::Checkbox("P2##def", &m_bInfiniteDefendP2); + ImGui::NextColumn(); + + + ImGui::Columns(1); + ImGui::Separator(); + if (GetObj(PLAYER1) && GetObj(PLAYER2)) + ImGui::Text("Easy Krushing Blows"); + + if (GetObj(PLAYER1)) { - if (GetAsyncKeyState(VK_F6)) - { - if (GetTickCount64() - timer <= 150) return; - timer = GetTickCount64(); - m_fSlowMotionSpeed += 0.1f; - } - if (GetAsyncKeyState(VK_F7)) - { - if (GetTickCount64() - timer <= 150) return; - timer = GetTickCount64(); - m_fSlowMotionSpeed -= 0.1f; - } + if (ImGui::Button("Enable P1")) + GetObj(PLAYER1)->SetEasyKrushingBlows(true); + ImGui::SameLine(); + if (ImGui::Button("Disable P1")) + GetObj(PLAYER1)->SetEasyKrushingBlows(false); + } + if (GetObj(PLAYER1)) + { + if (ImGui::Button("Enable P2")) + GetObj(PLAYER1)->SetEasyKrushingBlows(true); + ImGui::SameLine(); + if (ImGui::Button("Disable P2")) + GetObj(PLAYER1)->SetEasyKrushingBlows(false); } + ImGui::Separator(); } -void MK11Menu::UpdateMouse() +void MK11Menu::DrawKryptTab() { - if (m_bIsActive) return; - - GetCursorPos(&curMouse); - mouseSpeedX = curMouse.x - orgMouse.x; - mouseSpeedY = curMouse.y - orgMouse.y; - + ImGui::Text("Make sure you match the character class! It's trial & error if a character doesn't work."); + ImGui::Text("Normal characters use Base class, while Sektor/Cyrax use NPCs. Some might not work at all."); + ImGui::Separator(); + ImGui::Checkbox("Change Krypt Character", &m_bKryptModifier); - if (m_bIsFocused) + if (ImGui::BeginCombo("Character Class", szCurrentKryptCharacterClass)) { - if (TheMenu->m_bFreeCam) + for (int n = 0; n < IM_ARRAYSIZE(szCharClasses); n++) { - int newVal = TheMenu->camRot.Yaw; - newVal += mouseSpeedX / mouseSens; - TheMenu->camRot.Yaw = newVal; + bool is_selected = (szCurrentKryptCharacterClass == szCharClasses[n]); + if (ImGui::Selectable(szCharClasses[n], is_selected)) + sprintf(szCurrentKryptCharacterClass, szCharClasses[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); + } + ImGui::EndCombo(); + } - int newValY = TheMenu->camRot.Pitch; - if (m_bFreeCamMouseInvertY) mouseSpeedY *= -1; + if (ImGui::BeginCombo("Krypt Character", szCurrentKryptCharacter)) + { + for (int n = 0; n < IM_ARRAYSIZE(szCharacters); n++) + { + bool is_selected = (szCurrentKryptCharacter == szKryptCharacters[n]); + if (ImGui::Selectable(szKryptCharacters[n], is_selected)) + sprintf(szCurrentKryptCharacter, szKryptCharacters[n]); + if (is_selected) + ImGui::SetItemDefaultFocus(); - newValY += mouseSpeedY / mouseSens; - TheMenu->camRot.Pitch = newValY; } + ImGui::EndCombo(); } + + ImGui::Separator(); + ImGui::Text("NOTE: This only changes character during krypt load!"); + +} + +void MK11Menu::DrawMiscTab() +{ + if (ImGui::Button("Hide FightHUD")) + HideHUD(); + ImGui::SameLine(); + if (ImGui::Button("Show FightHUD")) + ShowHUD(); + + ImGui::Checkbox("Hide FightHUD In Game", &m_bAutoHideHUD); + ImGui::Checkbox("Disable HUD Completely", &m_bDisableHUD); + ImGui::SameLine(); + ShowHelpMarker("You'll need to go in-game/back to menu for this option to take effect."); + + ImGui::Checkbox("Disable Nondefault Gear Loadouts", &m_bDisableGearLoadouts); + ImGui::SameLine(); + ShowHelpMarker("Only default loadouts will be used. Do not toggle this option when models are on screen."); + + ImGui::Checkbox("Disable Head Tracking", &m_bDisableHeadTracking); + ImGui::SameLine(); + ShowHelpMarker("Disables P1 head looking at P2. Automatically enabled with 'Head Perspective' custom camera."); } void MK11Menu::DrawSettings() @@ -1581,12 +1555,14 @@ void MK11Menu::DrawSettings() static int settingID = 0; static const char* settingNames[] = { "Menu", - "INI" + "INI", + "Keys" }; enum eSettings { MENU, INI, + KEYS, }; ImGui::BeginChild("##settings", { 12 * ImGui::GetFontSize(), 0 }, true); @@ -1617,6 +1593,56 @@ void MK11Menu::DrawSettings() ImGui::Checkbox("Debug Console", &SettingsMgr->bEnableConsoleWindow); ImGui::Checkbox("Gamepad Support", &SettingsMgr->bEnableGamepadSupport); break; + case KEYS: + if (m_bPressingKey) + ImGui::TextColored(ImVec4(0.f, 1.f, 0.3f, 1.f), "Press a key!"); + ImGui::Separator(); + ImGui::LabelText("", "Core"); + ImGui::Separator(); + KeyBind(&SettingsMgr->iHookMenuOpenKey, "Open/Close Menu", "menu"); + KeyBind(&SettingsMgr->iToggleSlowMoKey, "Toggle Gamespeed/Slow Motion", "slomo"); + KeyBind(&SettingsMgr->iToggleFreezeWorldKey, "Freeze World", "freeze"); + ImGui::Separator(); + ImGui::LabelText("","Camera"); + ImGui::Separator(); + + KeyBind(&SettingsMgr->iFreeCameraKeyFOVPlus, "FOV+", "fov_plus"); + KeyBind(&SettingsMgr->iFreeCameraKeyFOVMinus, "FOV-", "fov_minus"); + + KeyBind(&SettingsMgr->iFreeCameraKeyYawPlus, "Yaw+", "ya_plus"); + KeyBind(&SettingsMgr->iFreeCameraKeyYawMinus, "Yaw-", "ya_minus"); + KeyBind(&SettingsMgr->iFreeCameraKeyPitchPlus, "Pitch+", "pi_plus"); + KeyBind(&SettingsMgr->iFreeCameraKeyPitchMinus, "Pitch-", "pi_minus"); + KeyBind(&SettingsMgr->iFreeCameraKeyRollPlus, "Roll+", "r_plus"); + KeyBind(&SettingsMgr->iFreeCameraKeyRollMinus, "Roll-", "r_minus"); + + KeyBind(&SettingsMgr->iFreeCameraKeyXPlus, "X+", "x_plus"); + KeyBind(&SettingsMgr->iFreeCameraKeyXMinus, "X-", "x_minus"); + KeyBind(&SettingsMgr->iFreeCameraKeyYPlus, "Y+", "y_plus"); + KeyBind(&SettingsMgr->iFreeCameraKeyYMinus, "Y-", "y_minus"); + KeyBind(&SettingsMgr->iFreeCameraKeyZPlus, "Z+", "z_plus"); + KeyBind(&SettingsMgr->iFreeCameraKeyZMinus, "Z-", "z_minus"); + + + ImGui::Separator(); + ImGui::LabelText("", "Misc"); + ImGui::Separator(); + KeyBind(&SettingsMgr->iToggleCustomCamKey, "Toggle Custom Cameras", "ccam"); + KeyBind(&SettingsMgr->iResetStageInteractablesKey, "Reset Stage Objects", "r_stage"); + ImGui::Separator(); + + if (m_bPressingKey) + { + ImGui::Text("%x", m_pCurrentVarToChange); + eVKKeyCode result = eKeyboardMan::GetLastKey(); + + if (result >= VK_BACKSPACE && result < VK_KEY_NONE) + { + *m_pCurrentVarToChange = result; + m_bPressingKey = false; + } + + } default: break; } @@ -1676,6 +1702,47 @@ void MK11Menu::DrawAbilityReference() ImGui::End(); } +void MK11Menu::DrawKeyBind(char* name, int* var) +{ + ImGui::SameLine(); + + static char butName[256] = {}; + sprintf(butName, "%s##key%s", eKeyboardMan::KeyToString(*var), name); + if (ImGui::Button(butName)) + { + m_bPressingKey = true; + m_pCurrentVarToChange = var; + } + +} + +#ifdef _DEBUG +void MK11Menu::DrawDebug() +{ + ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.95); + ImGui::SetNextWindowPos(ImVec2(10, 5)); + ImGui::Begin("devtext", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove | + ImGuiWindowFlags_NoInputs |ImGuiWindowFlags_NoSavedSettings |ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_AlwaysAutoResize); + + ImGui::PopStyleVar(1); + ImGui::Text("MK11Hook %s Debug (%.2f FPS)", MK11HOOK_VERSION, ImGui::GetIO().Framerate); + ImGui::Text(""); + ImGui::Text("Player 1 Object: 0x%X Info: 0x%X",GetObj(PLAYER1), GetInfo(PLAYER1)); + ImGui::Text("Player 2 Object: 0x%X Info: 0x%X", GetObj(PLAYER2), GetInfo(PLAYER2)); + ImGui::Text("P1: %s", GetCharacterName(PLAYER1)); + ImGui::Text("P2: %s", GetCharacterName(PLAYER2)); + ImGui::End(); + + +} +#endif + +void MK11Menu::KeyBind(int* var, char * bindName, char * name) +{ + ImGui::LabelText("", bindName); + DrawKeyBind(name, var); +} + bool MK11Menu::GetActiveState() { return m_bIsActive; @@ -1688,6 +1755,7 @@ char * GetMK11HookVersion() return buffer; } + void PushNotification() { } diff --git a/MK11Hook/code/mk11menu.h b/MK11Hook/code/mk11menu.h index d3bca86..3dcfe17 100644 --- a/MK11Hook/code/mk11menu.h +++ b/MK11Hook/code/mk11menu.h @@ -1,6 +1,7 @@ #pragma once #include "mk11.h" #include +#include "helper/eKeyboardMan.h" // as usual, based on mh2 debug menu @@ -21,7 +22,6 @@ enum eCHRModifierModes { TOTAL_MODES }; - enum eMenuSubMenus { SUBMENU_ABILITY_REFERENCE, SUBMENU_NPC_MOVELIST, @@ -31,81 +31,84 @@ enum eMenuSubMenus { class MK11Menu { public: - bool m_bIsActive; + bool m_bIsActive = false; bool m_bSubmenuActive[TOTAL_SUBMENUS] = {}; - bool m_bSlowMotion; - bool m_bFreezeWorld; - bool m_bIsFocused; - bool m_bHookDispatch; - bool m_bForceCameraUpdate; - bool m_bCustomCameraPos; - bool m_bCustomCameraRot; - bool m_bCustomCameraFOV; - bool m_bFreeCamMouseControl; - bool m_bFreeCamMouseInvertY; - bool m_bFreeCam; - bool m_bCustomCameras; - bool m_bDontFlipCamera; - bool m_bDisableHeadTracking; - bool m_bUsePlayerTwoAsTracker; - bool m_bYObtained; - bool m_bStageModifier; - bool m_bDisableHUD; - bool m_bAutoHideHUD; + bool m_bPressingKey = false; + bool m_bSlowMotion = false; + bool m_bFreezeWorld = false; + bool m_bIsFocused = false; + bool m_bHookDispatch = false; + bool m_bForceCameraUpdate = false; + bool m_bCustomCameraPos = false; + bool m_bCustomCameraRot = false; + bool m_bCustomCameraFOV = false; + bool m_bFreeCamMouseControl = false; + bool m_bFreeCamMouseInvertY = false; + bool m_bFreeCam = false; + bool m_bCustomCameras = false; + bool m_bDontFlipCamera = false; + bool m_bDisableHeadTracking = false; + bool m_bUsePlayerTwoAsTracker = false; + bool m_bYObtained = false; + bool m_bStageModifier = false; + bool m_bDisableHUD = false; + bool m_bAutoHideHUD = false; // cheats - bool m_bInfiniteHealthP1; - bool m_bInfiniteHealthP2; - bool m_bNoHealthP1; - bool m_bNoHealthP2; - bool m_bZeroMeterP1; - bool m_bZeroMeterP2; - bool m_bInfiniteAttackP1; - bool m_bInfiniteAttackP2; - bool m_bInfiniteDefendP1; - bool m_bInfiniteDefendP2; - bool m_bOneHealthP1; - bool m_bOneHealthP2; - - bool m_bChangePlayerSpeed; - bool m_bChangePlayerScale; - bool m_bSmoothScaleChange; - bool m_bPlayer1Modifier; - bool m_bPlayer2Modifier; - - bool m_bKryptModifier; - bool m_bTagAssist; - bool m_bTagAssistP2; - bool m_bDisableGearLoadouts; - - float m_fSlowMotionSpeed; - float m_fP1Speed; - float m_fP2Speed; - float m_fAdjustCustomCameraX; - float m_fAdjustCustomCameraY; - float m_fAdjustCustomCameraZ; - float m_fAdjustCustomCameraCrouch; - float m_fAdjustCustomCameraThirdPersonX; - float m_fAdjustCustomCameraThirdPersonY; - float m_fAdjustCustomCameraThirdPersonZ; - float m_fAdjustCustomHeadCameraX; - float m_fAdjustCustomHeadCameraY; - float m_fAdjustCustomHeadCameraZ; - float m_fFreeCameraSpeed; - float m_fSmoothScalingUpdate; - - int m_nFreeCameraRotationSpeed; - int m_nCurrentCustomCamera; - int m_nCurrentCharModifier; - int m_nP1Abilities; - int m_nP2Abilities; - - bool m_bP1CustomAbilities; + bool m_bInfiniteHealthP1 = false; + bool m_bInfiniteHealthP2 = false; + bool m_bNoHealthP1 = false; + bool m_bNoHealthP2 = false; + bool m_bZeroMeterP1 = false; + bool m_bZeroMeterP2 = false; + bool m_bInfiniteAttackP1 = false; + bool m_bInfiniteAttackP2 = false; + bool m_bInfiniteDefendP1 = false; + bool m_bInfiniteDefendP2 = false; + bool m_bOneHealthP1 = false; + bool m_bOneHealthP2 = false; + + bool m_bChangePlayerSpeed = false; + bool m_bChangePlayerScale = false; + bool m_bSmoothScaleChange = false; + bool m_bPlayer1Modifier = false; + bool m_bPlayer2Modifier = false; + + bool m_bKryptModifier = false; + bool m_bTagAssist = false; + bool m_bTagAssistP2 = false; + bool m_bDisableGearLoadouts = false; + + float m_fSlowMotionSpeed = 0.5f; + float m_fP1Speed = 1.0f; + float m_fP2Speed = 1.0f; + float m_fAdjustCustomCameraX = -10.0f; + float m_fAdjustCustomCameraY = 0.0f; + float m_fAdjustCustomCameraZ = 161.0f; + float m_fAdjustCustomCameraCrouch = 120.0f; + float m_fAdjustCustomCameraThirdPersonX = 0.0f; + float m_fAdjustCustomCameraThirdPersonY = 0.0f; + float m_fAdjustCustomCameraThirdPersonZ = 0.0f; + float m_fAdjustCustomHeadCameraX = 0.0f; + float m_fAdjustCustomHeadCameraY = 1600.0f; + float m_fAdjustCustomHeadCameraZ = 0.0f; + float m_fFreeCameraSpeed = 5.25f; + float m_fSmoothScalingUpdate = 0.01f; + + int m_nFreeCameraRotationSpeed = 120; + int m_nCurrentCustomCamera = CAMERA_3RDPERSON; + int m_nCurrentCharModifier = MODIFIER_SCREEN; + int m_nP1Abilities = 0; + int m_nP2Abilities = 0; + + int* m_pCurrentVarToChange = nullptr; + + bool m_bP1CustomAbilities = false; bool m_P1Abilities[20] = {}; - bool m_bP2CustomAbilities; + bool m_bP2CustomAbilities = false ; bool m_P2Abilities[20] = {}; - FVector m_vP1Scale; - FVector m_vP2Scale; + FVector m_vP1Scale = { 1.0f, 1.0f, 1.0f }; + FVector m_vP2Scale = { 1.0f, 1.0f, 1.0f }; char szCurrentModifier[128] = {}; @@ -122,9 +125,9 @@ class MK11Menu { char szPlayer2Bone[128] = {}; // camera - FVector camPos; - FRotator camRot; - float camFov; + FVector camPos = {}; + FRotator camRot = {}; + float camFov = 0; // player FVector plrPos; @@ -134,9 +137,9 @@ class MK11Menu { POINT orgMouse; POINT curMouse; - int mouseSpeedX; - int mouseSpeedY; - int mouseSens; + int mouseSpeedX = 0; + int mouseSpeedY = 0; + int mouseSens = 5; void Initialize(); void Draw(); @@ -144,12 +147,31 @@ class MK11Menu { void UpdateControls(); void UpdateMouse(); + + void DrawCharacterTab(); + void DrawStageTab(); + void DrawModifiersTab(); + void DrawPlayerTab(); + void DrawSpeedTab(); + void DrawCameraTab(); + void DrawCheatsTab(); + void DrawKryptTab(); + void DrawMiscTab(); + void DrawSettings(); void DrawAbilityReference(); + void DrawKeyBind(char* name, int* var); + +#ifdef _DEBUG + static void DrawDebug(); +#endif + + void KeyBind(int* var, char* bindName, char* name); bool GetActiveState(); }; char* GetMK11HookVersion(); extern MK11Menu* TheMenu; + diff --git a/MK11Hook/code/mkcamera.h b/MK11Hook/code/mkcamera.h index 90090a6..628acb0 100644 --- a/MK11Hook/code/mkcamera.h +++ b/MK11Hook/code/mkcamera.h @@ -1,6 +1,7 @@ #pragma once #include "mk11.h" // generic layer for other plugins too + class MKCamera { private: char pad[0x6BC]; diff --git a/MK11Hook/dllmain.cpp b/MK11Hook/dllmain.cpp index 0afc5b7..e2577a9 100644 --- a/MK11Hook/dllmain.cpp +++ b/MK11Hook/dllmain.cpp @@ -21,6 +21,7 @@ int64 __fastcall GenericFalseReturn() { return 0; } void __fastcall GenericDummy() { } + void OnInitializeHook() { if (SettingsMgr->bEnableConsoleWindow) diff --git a/MK11Hook/eDirectX11Hook.cpp b/MK11Hook/eDirectX11Hook.cpp index 6539fa3..dd55712 100644 --- a/MK11Hook/eDirectX11Hook.cpp +++ b/MK11Hook/eDirectX11Hook.cpp @@ -147,7 +147,7 @@ void eDirectX11Hook::InitImGui() ImGui::CreateContext(); ImGui::GetIO().ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange; ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; - ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; + ImGui_ImplWin32_Init(ms_hWindow); ImGui_ImplDX11_Init(pDevice, pContext); if (SettingsMgr->bEnableGamepadSupport) @@ -162,9 +162,13 @@ void eDirectX11Hook::ReloadImGuiFont() float fontSize = 13.0f; ImGuiStyle * style = &ImGui::GetStyle(); ImGuiIO io = ImGui::GetIO(); - io.Fonts->Clear(); - io.Fonts->AddFontFromMemoryCompressedTTF(Font_compressed_data, Font_compressed_size, fontSize * SettingsMgr->fMenuScale); - io.Fonts->Build(); + + if (!io.Fonts->Locked && !bInitShared) + { + io.Fonts->Clear(); + io.Fonts->AddFontFromMemoryCompressedTTF(Font_compressed_data, Font_compressed_size, fontSize * SettingsMgr->fMenuScale); + io.Fonts->Build(); + } style->WindowPadding = ms_localStyleCopy.WindowPadding; style->WindowRounding = ms_localStyleCopy.WindowRounding; @@ -242,6 +246,12 @@ HRESULT __stdcall eDirectX11Hook::Present(IDXGISwapChain * pSwapChain, UINT Sync if (TheMenu->GetActiveState()) TheMenu->Draw(); + +#ifdef _DEBUG + MK11Menu::DrawDebug(); +#endif // _DEBUG + + ImGui::EndFrame(); ImGui::Render();