Skip to content

Commit

Permalink
keyboard fix
Browse files Browse the repository at this point in the history
ermaccer committed Mar 20, 2022
1 parent a1d3c94 commit bf19cf0
Showing 6 changed files with 54 additions and 8 deletions.
7 changes: 5 additions & 2 deletions I2Hook/code/MKCharacter.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "MKCharacter.h"
#include "dcf2.h"
#include "unreal/FName.h"


void MKCharacter::SetLife(float life)
{
@@ -65,3 +63,8 @@ void MKCharacter::ExecuteScript(MKScript* script, int function)
{
((void(__thiscall*)(MKCharacter*, MKScript*, int, int))_addr(0x14097A140))(this, script, function, 1);
}

void MKCharacter::BloodEffect(int type, FName name, float x, float y, float z, float unk, float size, float speed, bool attach)
{
((void(__thiscall*)(MKCharacter*, int, FName, float, float, float, float, float, float, int))_addr(0x1409BDEA0))(this, type, name, x, y, z, unk, size, speed, attach);
}
3 changes: 3 additions & 0 deletions I2Hook/code/MKCharacter.h
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
#include "MKStructs.h"
#include "mk10utils.h"
#include "unreal/FVector.h"
#include "unreal/FName.h"
#include "GameInfo.h"

class MKCharacter {
@@ -25,5 +26,7 @@ class MKCharacter {


void ExecuteScript(MKScript* script, int function);

void BloodEffect(int type, FName name, float x, float y, float z, float unk, float size, float speed, bool attach);
};

45 changes: 42 additions & 3 deletions I2Hook/code/dcf2menu.cpp
Original file line number Diff line number Diff line change
@@ -463,7 +463,6 @@ void DCF2Menu::DrawModifiersTab()
{
if (ImGui::BeginTabBar("##modifiers"))
{

if (ImGui::BeginTabItem("Abilities"))
{
ImGui::Checkbox("Player 1 Custom Abilities", &m_bP1CustomAbilities);
@@ -540,7 +539,8 @@ void DCF2Menu::DrawModifiersTab()
{
if (GetObj(PLAYER1) && GetObj(PLAYER2))
{
ImGui::TextColored(ImVec4(1.f, 0.3f, 0.3f, 1.f), "Enable 'Disable Head Tracking' in Misc. section before editing head data! Restart match after enabling it.");
if (!m_bDisableHeadTracking)
ImGui::TextColored(ImVec4(1.f, 0.3f, 0.3f, 1.f), "Enable 'Disable Head Tracking' in Misc. section before editing head data!\nRestart match after enabling it.");
ImGui::TextWrapped("Player 1");
ImGui::Separator();
if (ImGui::BeginCombo("Bone##p1", szPlayer1Bone))
@@ -570,7 +570,7 @@ void DCF2Menu::DrawModifiersTab()
ImGui::TextWrapped("Player 2");
ImGui::Separator();

if (ImGui::BeginCombo("Bone##p1", szPlayer1Bone))
if (ImGui::BeginCombo("Bone##p2", szPlayer2Bone))
{
for (int n = 0; n < IM_ARRAYSIZE(szBones); n++)
{
@@ -640,6 +640,45 @@ void DCF2Menu::DrawModifiersTab()

ImGui::EndTabItem();
}
/*if (ImGui::BeginTabItem("Blood"))
{
if (GetObj(PLAYER1) && GetObj(PLAYER2))
{
static int bloodType = 0;
static FVector bloodPos = {};
static bool bloodBoneAttach = false;
static float bloodAngle = 0, bloodSize = 0, bloodSpeed = 0;
ImGui::TextWrapped("Blood FX Params");
ImGui::InputInt("Type", &bloodType);
ImGui::InputFloat3("Position", &bloodPos.X);
ImGui::InputFloat("Angle", &bloodAngle);
ImGui::InputFloat("Size", &bloodSize);
ImGui::InputFloat("Speed", &bloodSpeed);
static char bloodName[64] = {};
ImGui::InputText("Bone Name", bloodName, sizeof(bloodName));
ImGui::Checkbox("Bone Attach", &bloodBoneAttach);
static int bloodForWho = 0;
ImGui::RadioButton("Player1", &bloodForWho, 0); ImGui::SameLine();
ImGui::RadioButton("Player2", &bloodForWho, 1);
if (ImGui::Button("Spawn"))
{
FName bone(bloodName, FNAME_Add, 1);
if (bloodForWho)
GetObj(PLAYER2)->BloodEffect(bloodType, bone, bloodPos.X, bloodPos.Y,bloodPos.Z, bloodAngle, bloodSize, bloodSpeed, bloodBoneAttach);
else
GetObj(PLAYER1)->BloodEffect(bloodType, bone, bloodPos.X, bloodPos.Y, bloodPos.Z, bloodAngle, bloodSize, bloodSpeed, bloodBoneAttach);
}
}
else
ImGui::TextWrapped("Blood options are only available in-game!");
ImGui::EndTabItem();
}
*/
ImGui::EndTabBar();
}
}
4 changes: 2 additions & 2 deletions I2Hook/code/eSettingsManager.cpp
Original file line number Diff line number Diff line change
@@ -129,10 +129,10 @@ void eSettingsManager::SaveSettings()
void eSettingsManager::ResetKeys()
{
iHookMenuOpenKey = VK_F1;
iToggleCustomCamKey = 255;
iToggleCustomCamKey = 0;
iToggleSlowMoKey = VK_F5;
iToggleFreezeWorldKey = VK_F2;
iResetStageInteractablesKey = 255;
iResetStageInteractablesKey = 0;
iFreeCameraKeyXPlus = 104;
iFreeCameraKeyXMinus = 98;
iFreeCameraKeyYPlus = 102;
2 changes: 1 addition & 1 deletion I2Hook/code/helper/eKeyboardMan.cpp
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

eVKKeyCode eKeyboardMan::GetLastKey()
{
eVKKeyCode key = VK_KEY_NONE;
eVKKeyCode key = VK_KEY_NULL;
for (int i = 0; i < VK_KEY_MAX; i++)
{
if (GetAsyncKeyState(i) & 0x8000)
1 change: 1 addition & 0 deletions I2Hook/code/helper/eKeyboardMan.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

enum eVKKeyCode {
VK_KEY_NULL,
VK_KEY_NONE = 254,
VK_KEY_0 = 48,
VK_KEY_1,

0 comments on commit bf19cf0

Please sign in to comment.