2014-03-14 14:13:41 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "ModuleInterface.h"
|
|
|
|
|
|
|
|
|
|
/**
|
2014-05-01 10:58:35 -04:00
|
|
|
* Game Project Generation module
|
2014-03-14 14:13:41 -04:00
|
|
|
*/
|
|
|
|
|
class FGameProjectGenerationModule : public IModuleInterface
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called right after the plugin DLL has been loaded and the plugin object has been created
|
|
|
|
|
*/
|
|
|
|
|
virtual void StartupModule();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called before the plugin is unloaded, right before the plugin object is destroyed.
|
|
|
|
|
*/
|
|
|
|
|
virtual void ShutdownModule();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Singleton-like access to this module's interface. This is just for convenience!
|
|
|
|
|
* Beware of calling this during the shutdown phase, though. Your module might have been unloaded already.
|
|
|
|
|
*
|
|
|
|
|
* @return Returns singleton instance, loading the module on demand if needed
|
|
|
|
|
*/
|
|
|
|
|
static inline FGameProjectGenerationModule& Get()
|
|
|
|
|
{
|
|
|
|
|
return FModuleManager::LoadModuleChecked< FGameProjectGenerationModule >( "GameProjectGeneration" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Creates the game project dialog */
|
|
|
|
|
virtual TSharedRef<class SWidget> CreateGameProjectDialog(bool bAllowProjectOpening, bool bAllowProjectCreate);
|
|
|
|
|
|
|
|
|
|
/** Creates a new class dialog for creating classes based on the passed-in class. */
|
|
|
|
|
virtual TSharedRef<class SWidget> CreateNewClassDialog(class UClass* InClass);
|
|
|
|
|
|
|
|
|
|
/** Opens a dialog to adds code files to the current project. */
|
|
|
|
|
virtual void OpenAddCodeToProjectDialog();
|
|
|
|
|
|
|
|
|
|
/** Delegate for when the AddCodeToProject dialog is opened */
|
|
|
|
|
DECLARE_EVENT(FGameProjectGenerationModule, FAddCodeToProjectDialogOpenedEvent);
|
|
|
|
|
FAddCodeToProjectDialogOpenedEvent& OnAddCodeToProjectDialogOpened() { return AddCodeToProjectDialogOpenedEvent; }
|
|
|
|
|
|
2014-06-27 15:23:15 -04:00
|
|
|
/** Tries to make the project file writable. Prompts to check out as necessary. */
|
2014-07-22 15:58:02 -04:00
|
|
|
virtual void TryMakeProjectFileWriteable(const FString& ProjectFile);
|
2014-06-27 15:23:15 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
/** Prompts the user to update his project file, if necessary. */
|
|
|
|
|
virtual void CheckForOutOfDateGameProjectFile();
|
|
|
|
|
|
|
|
|
|
/** Updates the currently loaded project. Returns true if the project was updated successfully or if no update was needed */
|
2014-07-22 15:58:02 -04:00
|
|
|
virtual bool UpdateGameProject(const FString& ProjectFile, const FString& EngineIdentifier, FText& OutFailReason);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/** Updates the current code project */
|
|
|
|
|
virtual bool UpdateCodeProject(FText& OutFailReason);
|
|
|
|
|
|
|
|
|
|
/** Gets the current projects source file count */
|
|
|
|
|
virtual int32 GetProjectCodeFileCount();
|
|
|
|
|
|
|
|
|
|
/** Update code resource files */
|
|
|
|
|
virtual bool UpdateCodeResourceFiles(TArray<FString>& OutCreatedFiles, FText& OutFailReason);
|
|
|
|
|
|
2014-05-01 10:58:35 -04:00
|
|
|
/** Warn the user if the project filename is invalid in case they renamed it outside the editor */
|
|
|
|
|
virtual void CheckAndWarnProjectFilenameValid();
|
|
|
|
|
|
2014-05-29 17:37:19 -04:00
|
|
|
/**
|
|
|
|
|
* Update the list of supported target platforms based upon the parameters provided
|
|
|
|
|
* This will take care of checking out and saving the updated .uproject file automatically
|
|
|
|
|
*
|
|
|
|
|
* @param InPlatformName Name of the platform to target (eg, WindowsNoEditor)
|
|
|
|
|
* @param bIsSupported true if the platform should be supported by this project, false if it should not
|
|
|
|
|
*/
|
|
|
|
|
virtual void UpdateSupportedTargetPlatforms(const FName& InPlatformName, const bool bIsSupported);
|
|
|
|
|
|
2014-06-05 12:13:44 -04:00
|
|
|
/** Clear the list of supported target platforms */
|
|
|
|
|
virtual void ClearSupportedTargetPlatforms();
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
private:
|
|
|
|
|
FAddCodeToProjectDialogOpenedEvent AddCodeToProjectDialogOpenedEvent;
|
|
|
|
|
|
|
|
|
|
};
|