Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(loading-screens-five): option to hide busy spinner in loading screen #3198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/components/loading-screens-five/include/LoadingScreens.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

extern bool showBusySpinner;
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <nutsnbolts.h>
#include <CefOverlay.h>
#include <DrawCommands.h>
#include "LoadingScreens.h"

#include <mmsystem.h>

Expand Down Expand Up @@ -479,7 +480,7 @@ static InitFunction initFunction([] ()
{
OnLookAliveFrame.Connect([]()
{
if (nui::HasFrame("loadingScreen"))
if (nui::HasFrame("loadingScreen") && showBusySpinner)
{
if (*g_scaleformMgr)
{
Expand Down
13 changes: 9 additions & 4 deletions code/components/loading-screens-five/src/LoadingScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@

#include <CfxRect.h>
#include <DrawCommands.h>

#include <CrossBuildRuntime.h>

#include <Error.h>
#include "LoadingScreens.h"

static std::shared_ptr<ConVar<bool>> g_loadProfileConvar;
static std::map<uint64_t, std::chrono::milliseconds> g_loadTiming;
Expand Down Expand Up @@ -117,6 +114,7 @@ class LoadsThread : public GtaThread
static LoadsThread loadsThread;

static bool autoShutdownNui = true;
bool showBusySpinner = true;
static fx::TNativeHandler g_origShutdown;

#include <nutsnbolts.h>
Expand Down Expand Up @@ -195,6 +193,7 @@ static HookFunction hookFunction([]()
{
endedLoadingScreens = false;
autoShutdownNui = true;
showBusySpinner = true;
});

{
Expand Down Expand Up @@ -557,6 +556,12 @@ static InitFunction initFunction([] ()
autoShutdownNui = false;
}

entriesTwo = mdComponent->GetEntries("loadscreen_hide_busyspinner");
if (entriesTwo.begin() != entriesTwo.end())
{
showBusySpinner = false;
}

static ConVar<bool> uiLoadingCursor("ui_loadingCursor", ConVar_None, false);
auto useCursor = mdComponent->GetEntries("loadscreen_cursor");
if (useCursor.begin() != useCursor.end())
Expand Down
Loading