Skip to content

Commit

Permalink
Start fixing overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegmd committed Sep 23, 2023
1 parent 8516e99 commit 63a59f2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
3 changes: 2 additions & 1 deletion src/overlay/Overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ void Overlay::Update()

auto& d3d12 = CET::Get().GetD3D12();
d3d12.DelayedSetTrapInputInImGui(m_enabled);
ClipToCenter(RED4ext::CGameEngine::Get()->unkC0);
auto* pEngine = RED4ext::CGameEngine::Get();
ClipToCenter(pEngine->unkC0);
m_toggled = false;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/overlay/widgets/TweakDBEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <RED4ext/Scripting/Natives/Generated/Vector2.hpp>
#include <RED4ext/Scripting/Natives/Generated/Vector3.hpp>

#include "RED4ext/Scripting/Utils.hpp"

bool TweakDBEditor::s_recordsFilterIsRegex = false;
bool TweakDBEditor::s_flatsFilterIsRegex = false;
char TweakDBEditor::s_recordsFilterBuffer[256]{};
Expand Down
2 changes: 2 additions & 0 deletions src/reverse/RTTIExtender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <RED4ext/Scripting/Natives/Generated/ent/Entity.hpp>
#include <RED4ext/Scripting/Natives/Generated/ent/EntityID.hpp>

#include "RED4ext/Scripting/Utils.hpp"

template <typename T> struct GameCall
{
GameCall(uintptr_t aAddress, const int32_t acOffset = 0)
Expand Down
18 changes: 3 additions & 15 deletions src/scripting/LuaVM_Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,25 +309,13 @@ void LuaVM::HookTDBIDToStringDEBUG(RED4ext::IScriptable*, RED4ext::CStackFrame*
}
}

uintptr_t LuaVM::HookSetLoadingState(uintptr_t aThis, int aState)
{
static std::once_flag s_initBarrier;

if (aState == 2)
{
// std::call_once(s_initBarrier, [] { s_vm->PostInitializeMods(); });
}

return s_vm->m_realSetLoadingState(aThis, aState);
}

bool LuaVM::HookTranslateBytecode(uintptr_t aBinder, uintptr_t aData)
{
const auto ret = s_vm->m_realTranslateBytecode(aBinder, aData);

if (ret)
{
// s_vm->PostInitializeScripting();
s_vm->PostInitializeScripting();
}

return ret;
Expand All @@ -337,8 +325,8 @@ uint64_t LuaVM::HookPlayerSpawned(uint64_t a1, uint64_t a2, uint64_t a3, uint64_
{
const auto ret = s_vm->m_realPlayerSpawned(a1, a2, a3, a4);

//if (!s_vm->m_initialized)
// s_vm->PostInitializeMods();
if (!s_vm->m_initialized)
s_vm->PostInitializeMods();

return ret;
}
Expand Down

0 comments on commit 63a59f2

Please sign in to comment.