Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCoding/Private/LiveCodingModule.h
Ben Marsh 504e281f9e LiveCoding: Expose a Tick() function so that systems that don't use fire EndFrame() callbacks can still tick the live coding module. Also add a -LiveCoding command line argument to force it on.
Also fix an issue where a compile is triggered before the system has been started.

#rb none
#jira

[CL 5340479 by Ben Marsh in 4.22 branch]
2019-03-07 15:20:57 -05:00

52 lines
1.3 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ILiveCodingModule.h"
#include "Delegates/Delegate.h"
#include "Modules/ModuleManager.h"
struct IConsoleCommand;
class IConsoleVariable;
class FLiveCodingModule final : public ILiveCodingModule
{
public:
FLiveCodingModule();
// IModuleInterface implementation
virtual void StartupModule() override;
virtual void ShutdownModule() override;
// ILiveCodingModule implementation
virtual void Enable(bool bInEnabled) override;
virtual bool IsEnabled() const override;
virtual void ShowConsole() override;
virtual void TriggerRecompile() override;
virtual void Tick() override;
private:
bool bEnabled;
bool bShouldStart;
bool bStarted;
TSet<FString> EnabledModules;
IConsoleCommand* EnableCommand;
IConsoleVariable* ConsolePathVariable;
FDelegateHandle EndFrameDelegateHandle;
FDelegateHandle ModulesChangedDelegateHandle;
bool StartLiveCoding();
void OnEndFrame();
void OnModulesChanged(FName ModuleName, EModuleChangeReason Reason);
void UpdateModules();
void EnableModule(const FString& FullFilePath);
void DisableModule(const FString& FullFilePath);
void ConfigureModule(const FName& Name, bool bIsProjectModule, const FString& FullFilePath);
bool ShouldEnableModule(const FName& Name, bool bIsProjectModule, const FString& FilePath) const;
};