Skip to content

Commit

Permalink
feat(loading-screens-five): option to hide busy spinner in loading sc…
Browse files Browse the repository at this point in the history
…reen
  • Loading branch information
tens0rfl0w committed Feb 26, 2025
1 parent 0dec7bf commit 71c56e6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
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

0 comments on commit 71c56e6

Please sign in to comment.