Giter VIP home page Giter VIP logo

Comments (1)

FinalSparkGamestudios avatar FinalSparkGamestudios commented on August 19, 2024

I'm not sure if this fixed everything. But here you have a dirty solution.
Replace your LoadingScreenModule.cpp with

This:


#include "LoadingScreenPrivatePCH.h"
#include "ILoadingScreenModule.h"

#include "LoadingScreenSettings.h"
#include "MoviePlayer.h"

#include "SSimpleLoadingScreen.h"

#define LOCTEXT_NAMESPACE "LoadingScreen"

class FLoadingScreenModule : public ILoadingScreenModule
{
public:
    FLoadingScreenModule();

    /** IModuleInterface implementation */
    virtual void StartupModule() override;
    virtual void ShutdownModule() override;
    virtual bool IsGameModule() const override

    {
        return true;
    }

private:
    void HandlePrepareLoadingScreen();

    void BeginLoadingScreen(const FLoadingScreenDescription& ScreenDescription);


};

IMPLEMENT_MODULE(FLoadingScreenModule, LoadingScreen)

FLoadingScreenModule::FLoadingScreenModule()
{

}

void FLoadingScreenModule::StartupModule()
{
    if ( !IsRunningDedicatedServer() && FSlateApplication::IsInitialized() )
    {



        // Load for cooker reference
        const ULoadingScreenSettings* Settings = GetDefault<ULoadingScreenSettings>();
        for ( const FStringAssetReference& Ref : Settings->StartupScreen.Images )
        {
            Ref.TryLoad();
        }
        for ( const FStringAssetReference& Ref : Settings->DefaultScreen.Images )
        {
            Ref.TryLoad();
        }

        if ( IsMoviePlayerEnabled() )
        {

            GetMoviePlayer()->OnPrepareLoadingScreen().AddRaw(this, &FLoadingScreenModule::HandlePrepareLoadingScreen);
        }

        // Prepare the startup screen, the PrepareLoadingScreen callback won't be called
        // if we've already explictly setup the loading screen.
        BeginLoadingScreen(Settings->DefaultScreen);
    }
}

void FLoadingScreenModule::ShutdownModule()
{
    if ( !IsRunningDedicatedServer() )
    {

        GetMoviePlayer()->StopMovie();
    }
}

void FLoadingScreenModule::HandlePrepareLoadingScreen()
{
    UE_LOG(LogTemp, Warning, TEXT("Preparing loading screen...."));
    const ULoadingScreenSettings* Settings = GetDefault<ULoadingScreenSettings>();
    BeginLoadingScreen(Settings->DefaultScreen);
}

void FLoadingScreenModule::BeginLoadingScreen(const FLoadingScreenDescription& ScreenDescription)
{
    FLoadingScreenAttributes LoadingScreen;
    LoadingScreen.MinimumLoadingScreenDisplayTime = ScreenDescription.MinimumLoadingScreenDisplayTime;
    LoadingScreen.bAutoCompleteWhenLoadingCompletes = ScreenDescription.bAutoCompleteWhenLoadingCompletes;
    LoadingScreen.bMoviesAreSkippable = ScreenDescription.bMoviesAreSkippable;
    LoadingScreen.bWaitForManualStop = ScreenDescription.bWaitForManualStop;
    LoadingScreen.MoviePaths = ScreenDescription.MoviePaths;
    LoadingScreen.PlaybackType = EMoviePlaybackType::MT_LoadingLoop;

    if ( ScreenDescription.bShowUIOverlay )
    {
        LoadingScreen.WidgetLoadingScreen = SNew(SSimpleLoadingScreen, ScreenDescription);
    }


        GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);









}


#undef LOCTEXT_NAMESPACE

from loadingscreen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.