Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Jan 15, 2021
1 parent 9d0892b commit 08d064d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions crates/injected/cxx/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ HRESULT __stdcall hkPresent(IDXGISwapChain *pSwapChain, UINT SyncInterval, UINT
}
float lastwidth = 0;
float lastheight = 0;
float toolwidth = 0.125*ImGui::GetIO().DisplaySize.x*ImGui::GetIO().FontGlobalScale;
float toolwidth = 0.128*ImGui::GetIO().DisplaySize.x*ImGui::GetIO().FontGlobalScale;
if (!hidegui)
{
if(reset_windows_vertical)
Expand Down Expand Up @@ -2156,7 +2156,7 @@ HRESULT __stdcall hkPresent(IDXGISwapChain *pSwapChain, UINT SyncInterval, UINT

if(!hidedebug)
{
ImGui::SetNextWindowSize({toolwidth, ImGui::GetIO().DisplaySize.y}, win_condition);
ImGui::SetNextWindowSize({toolwidth, -1}, win_condition);
ImGui::SetNextWindowPos({ImGui::GetIO().DisplaySize.x-toolwidth*2, 0}, win_condition);
ImGui::Begin(windows["tool_debug"].c_str());
render_debug();
Expand Down Expand Up @@ -2184,13 +2184,6 @@ HRESULT __stdcall hkPresent(IDXGISwapChain *pSwapChain, UINT SyncInterval, UINT
if(!file_written)
write_file();

if(true || ImGui::GetFrameCount() > g_last_frame + ImGui::GetIO().Framerate)
{
force_zoom();
force_hud_flags();
force_time();
g_last_frame = ImGui::GetFrameCount();
}
if(disable_input && capture_last == false && ImGui::GetIO().WantCaptureKeyboard && (active("tool_entity") || active("tool_door") || active("tool_camera") || active("tool_entity_properties") || active("tool_game_properties") || active("tool_debug")))
{
HID_RegisterDevice(window, HID_KEYBOARD);
Expand All @@ -2214,6 +2207,11 @@ HRESULT __stdcall hkPresent(IDXGISwapChain *pSwapChain, UINT SyncInterval, UINT

pContext->OMSetRenderTargets(1, &mainRenderTargetView, NULL);
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());

force_zoom();
force_hud_flags();
force_time();

return oPresent(pSwapChain, SyncInterval, Flags);
}

Expand Down

0 comments on commit 08d064d

Please sign in to comment.