Delay imgui initialization
This commit is contained in:
parent
54c7d0f5e5
commit
1f2025d75e
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "scheduler.hpp"
|
#include "scheduler.hpp"
|
||||||
#include "gui.hpp"
|
#include "gui.hpp"
|
||||||
|
#include "console.hpp"
|
||||||
|
|
||||||
#include <utils/string.hpp>
|
#include <utils/string.hpp>
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
@ -175,8 +176,14 @@ namespace gui
|
|||||||
|
|
||||||
void gui_on_frame()
|
void gui_on_frame()
|
||||||
{
|
{
|
||||||
|
if (!game::Sys_IsDatabaseReady2())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
|
console::info("[ImGui] Initializing\n");
|
||||||
initialize_gui_context();
|
initialize_gui_context();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -212,7 +219,7 @@ namespace gui
|
|||||||
a.mov(r8d, esi);
|
a.mov(r8d, esi);
|
||||||
a.mov(edx, r15d);
|
a.mov(edx, r15d);
|
||||||
a.mov(rcx, rdi);
|
a.mov(rcx, rdi);
|
||||||
a.call_aligned(rbx);
|
a.call(rbx);
|
||||||
a.mov(ecx, eax);
|
a.mov(ecx, eax);
|
||||||
|
|
||||||
a.jmp(0x1407A14D1);
|
a.jmp(0x1407A14D1);
|
||||||
@ -308,7 +315,8 @@ namespace gui
|
|||||||
|
|
||||||
void post_unpack() override
|
void post_unpack() override
|
||||||
{
|
{
|
||||||
utils::hook::jump(0x1407A14C4, utils::hook::assemble(dxgi_swap_chain_present_stub), true);
|
utils::hook::nop(0x1407A14BB, 9);
|
||||||
|
utils::hook::call(0x1407A14BE, gui_on_frame);
|
||||||
wnd_proc_hook.create(0x140650F10, wnd_proc_stub);
|
wnd_proc_hook.create(0x140650F10, wnd_proc_stub);
|
||||||
|
|
||||||
on_frame([]()
|
on_frame([]()
|
||||||
|
@ -215,6 +215,17 @@ namespace loadscreen
|
|||||||
class component final : public component_interface
|
class component final : public component_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
void post_start() override
|
||||||
|
{
|
||||||
|
scheduler::loop([]()
|
||||||
|
{
|
||||||
|
if (in_loadscreen())
|
||||||
|
{
|
||||||
|
draw_loadscreen();
|
||||||
|
}
|
||||||
|
}, scheduler::pipeline::renderer);
|
||||||
|
}
|
||||||
|
|
||||||
void post_unpack() override
|
void post_unpack() override
|
||||||
{
|
{
|
||||||
// not registered, used in CL_StartLoading
|
// not registered, used in CL_StartLoading
|
||||||
@ -231,14 +242,6 @@ namespace loadscreen
|
|||||||
cl_loadscreen_obj = dvars::register_string("cl_loadscreenObj", "", 0, "Loadscreen mission objective");
|
cl_loadscreen_obj = dvars::register_string("cl_loadscreenObj", "", 0, "Loadscreen mission objective");
|
||||||
cl_loadscreen_obj_icon = dvars::register_string("cl_loadscreenObjIcon", "", 0, "Loadscreen mission objective icon");
|
cl_loadscreen_obj_icon = dvars::register_string("cl_loadscreenObjIcon", "", 0, "Loadscreen mission objective icon");
|
||||||
}, scheduler::pipeline::main);
|
}, scheduler::pipeline::main);
|
||||||
|
|
||||||
scheduler::loop([]()
|
|
||||||
{
|
|
||||||
if (in_loadscreen())
|
|
||||||
{
|
|
||||||
draw_loadscreen();
|
|
||||||
}
|
|
||||||
}, scheduler::pipeline::renderer);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user