Skip to content

Commit

Permalink
feat(loading-screens): add 'loadscreen_cursor' option
Browse files Browse the repository at this point in the history
Fixes \!25.
  • Loading branch information
blattersturm committed Apr 30, 2021
1 parent 7ce0554 commit 517c63e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions code/components/loading-screens-five/src/LoadingScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,17 @@ static InitFunction initFunction([] ()
{
autoShutdownNui = false;
}

static ConVar<bool> uiLoadingCursor("ui_loadingCursor", ConVar_None, false);
auto useCursor = mdComponent->GetEntries("loadscreen_cursor");
if (useCursor.begin() != useCursor.end())
{
uiLoadingCursor.GetHelper()->SetRawValue(true);
}
else
{
uiLoadingCursor.GetHelper()->SetRawValue(false);
}
}
});

Expand Down
8 changes: 8 additions & 0 deletions code/components/nui-core/src/CefInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <ReverseGameData.h>

#include <windowsx.h>
#include <console/Console.VariableHelpers.h>

extern nui::GameInterface* g_nuiGi;

Expand All @@ -26,6 +27,8 @@ static bool g_hasOverriddenFocus = false;
extern bool g_mainUIFlag;
POINT g_cursorPos;

static ConVar<bool> uiLoadingCursor("ui_loadingCursor", ConVar_None, false);

bool isKeyDown(WPARAM wparam)
{
return (GetKeyState(wparam) & 0x8000) != 0;
Expand Down Expand Up @@ -176,6 +179,11 @@ namespace nui
}

g_hasOverriddenFocus = hasFocus;

if (uiLoadingCursor.GetValue())
{
g_hasCursor = hasFocus;
}
}

void KeepInput(bool keepInput)
Expand Down

0 comments on commit 517c63e

Please sign in to comment.