You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx #rb none #ROBOMERGE-OWNER: ryan.durand #ROBOMERGE-AUTHOR: ryan.durand #ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900 #ROBOMERGE-BOT: (v613-10869866) [CL 10870549 by ryan durand in Main branch]
212 lines
7.2 KiB
C++
212 lines
7.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/ObjectMacros.h"
|
|
#include "UObject/Object.h"
|
|
#include "UObject/SoftObjectPath.h"
|
|
#include "GameMapsSettings.generated.h"
|
|
|
|
/** Ways the screen can be split with two players. */
|
|
UENUM()
|
|
namespace ETwoPlayerSplitScreenType
|
|
{
|
|
enum Type
|
|
{
|
|
Horizontal,
|
|
Vertical
|
|
};
|
|
}
|
|
|
|
|
|
/** Ways the screen can be split with three players. */
|
|
UENUM()
|
|
namespace EThreePlayerSplitScreenType
|
|
{
|
|
enum Type
|
|
{
|
|
FavorTop,
|
|
FavorBottom,
|
|
Vertical,
|
|
Horizontal
|
|
};
|
|
}
|
|
|
|
UENUM()
|
|
enum class EFourPlayerSplitScreenType : uint8
|
|
{
|
|
Grid,
|
|
Vertical,
|
|
Horizontal
|
|
};
|
|
|
|
/** Helper structure, used to associate GameModes with shortcut names. */
|
|
USTRUCT()
|
|
struct FGameModeName
|
|
{
|
|
GENERATED_USTRUCT_BODY()
|
|
|
|
/** Abbreviation/prefix that can be used as an alias for the class name */
|
|
UPROPERTY(EditAnywhere, Category = DefaultModes, meta = (MetaClass = "GameModeBase"))
|
|
FString Name;
|
|
|
|
/** GameMode class to load */
|
|
UPROPERTY(EditAnywhere, Category = DefaultModes, meta = (MetaClass = "GameModeBase"))
|
|
FSoftClassPath GameMode;
|
|
};
|
|
|
|
UENUM()
|
|
enum class ESubLevelStripMode : uint8
|
|
{
|
|
// The class of the sub level actor must be exactly this class
|
|
ExactClass,
|
|
|
|
// Any child class of this class will be stripped, this is more expensive than ExactClass
|
|
IsChildOf
|
|
};
|
|
|
|
UCLASS(config=Engine, defaultconfig)
|
|
class ENGINESETTINGS_API UGameMapsSettings
|
|
: public UObject
|
|
{
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
/**
|
|
* Get the default map specified in the settings.
|
|
* Makes a choice based on running as listen server/client vs dedicated server
|
|
*
|
|
* @return the default map specified in the settings
|
|
*/
|
|
static FString GetGameDefaultMap( );
|
|
|
|
/**
|
|
* Get the global default game type specified in the configuration
|
|
* Makes a choice based on running as listen server/client vs dedicated server
|
|
*
|
|
* @return the proper global default game type
|
|
*/
|
|
static FString GetGlobalDefaultGameMode( );
|
|
|
|
/**
|
|
* Searches the GameModeClassAliases list for a named game mode, if not found will return passed in string
|
|
*
|
|
* @return the proper game type class path to load
|
|
*/
|
|
static FString GetGameModeForName( const FString& GameModeName );
|
|
|
|
/**
|
|
* Searches the GameModeMapPrefixes list for a named game mode, if not found will return passed in string
|
|
*
|
|
* @return the proper game type class path to load, or empty if not found
|
|
*/
|
|
static FString GetGameModeForMapName( const FString& MapName );
|
|
|
|
/**
|
|
* Set the default map to use (see GameDefaultMap below)
|
|
*
|
|
* @param NewMap name of valid map to use
|
|
*/
|
|
static void SetGameDefaultMap( const FString& NewMap );
|
|
|
|
/**
|
|
* Set the default game type (see GlobalDefaultGameMode below)
|
|
*
|
|
* @param NewGameMode name of valid map to use
|
|
*/
|
|
static void SetGlobalDefaultGameMode( const FString& NewGameMode );
|
|
|
|
virtual void PostInitProperties() override;
|
|
virtual void PostReloadConfig( class FProperty* PropertyThatWasLoaded ) override;
|
|
|
|
public:
|
|
|
|
#if WITH_EDITORONLY_DATA
|
|
/** If set, this map will be loaded when the Editor starts up. */
|
|
UPROPERTY(config, EditAnywhere, Category=DefaultMaps, meta=(AllowedClasses="World"))
|
|
FSoftObjectPath EditorStartupMap;
|
|
#endif
|
|
|
|
/** The default options that will be appended to a map being loaded. */
|
|
UPROPERTY(config, EditAnywhere, Category=DefaultMaps, AdvancedDisplay)
|
|
FString LocalMapOptions;
|
|
|
|
/** The map loaded when transition from one map to another. */
|
|
UPROPERTY(config, EditAnywhere, Category=DefaultMaps, AdvancedDisplay, meta=(AllowedClasses="World"))
|
|
FSoftObjectPath TransitionMap;
|
|
|
|
/** Whether the screen should be split or not when multiple local players are present */
|
|
UPROPERTY(config, EditAnywhere, Category=LocalMultiplayer)
|
|
bool bUseSplitscreen;
|
|
|
|
/** The viewport layout to use if the screen should be split and there are two local players */
|
|
UPROPERTY(config, EditAnywhere, Category=LocalMultiplayer, meta=(editcondition="bUseSplitScreen"))
|
|
TEnumAsByte<ETwoPlayerSplitScreenType::Type> TwoPlayerSplitscreenLayout;
|
|
|
|
/** The viewport layout to use if the screen should be split and there are three local players */
|
|
UPROPERTY(config, EditAnywhere, Category=LocalMultiplayer, meta=(editcondition="bUseSplitScreen"))
|
|
TEnumAsByte<EThreePlayerSplitScreenType::Type> ThreePlayerSplitscreenLayout;
|
|
|
|
/** The viewport layout to use if the screen should be split and there are three local players */
|
|
UPROPERTY(config, EditAnywhere, Category=LocalMultiplayer, meta=(editcondition="bUseSplitScreen"))
|
|
EFourPlayerSplitScreenType FourPlayerSplitscreenLayout;
|
|
|
|
/**
|
|
* If enabled, this will make so that gamepads start being assigned to the second controller ID in local multiplayer games.
|
|
* In PIE sessions with multiple windows, this has the same effect as enabling "Route 1st Gamepad to 2nd Client"
|
|
*/
|
|
UPROPERTY(config, EditAnywhere, Category=LocalMultiplayer, meta=(DisplayName="Skip Assigning Gamepad to Player 1"))
|
|
bool bOffsetPlayerGamepadIds;
|
|
|
|
/** The class to use when instantiating the transient GameInstance class */
|
|
UPROPERTY(config, noclear, EditAnywhere, Category=GameInstance, meta=(MetaClass="GameInstance"))
|
|
FSoftClassPath GameInstanceClass;
|
|
|
|
private:
|
|
|
|
/** The map that will be loaded by default when no other map is loaded. */
|
|
UPROPERTY(config, EditAnywhere, Category=DefaultMaps, meta=(AllowedClasses="World"))
|
|
FSoftObjectPath GameDefaultMap;
|
|
|
|
/** The map that will be loaded by default when no other map is loaded (DEDICATED SERVER). */
|
|
UPROPERTY(config, EditAnywhere, Category=DefaultMaps, AdvancedDisplay, meta=(AllowedClasses="World"))
|
|
FSoftObjectPath ServerDefaultMap;
|
|
|
|
/** GameMode to use if not specified in any other way. (e.g. per-map DefaultGameMode or on the URL). */
|
|
UPROPERTY(config, noclear, EditAnywhere, Category=DefaultModes, meta=(MetaClass="GameModeBase", DisplayName="Default GameMode"))
|
|
FSoftClassPath GlobalDefaultGameMode;
|
|
|
|
/**
|
|
* GameMode to use if not specified in any other way. (e.g. per-map DefaultGameMode or on the URL) (DEDICATED SERVERS)
|
|
* If not set, the GlobalDefaultGameMode value will be used.
|
|
*/
|
|
UPROPERTY(config, EditAnywhere, Category=DefaultModes, meta=(MetaClass="GameModeBase"), AdvancedDisplay)
|
|
FSoftClassPath GlobalDefaultServerGameMode;
|
|
|
|
/** Overrides the GameMode to use when loading a map that starts with a specific prefix */
|
|
UPROPERTY(config, EditAnywhere, Category = DefaultModes, AdvancedDisplay)
|
|
TArray<FGameModeName> GameModeMapPrefixes;
|
|
|
|
/** List of GameModes to load when game= is specified in the URL (e.g. "DM" could be an alias for "MyProject.MyGameModeMP_DM") */
|
|
UPROPERTY(config, EditAnywhere, Category = DefaultModes, AdvancedDisplay)
|
|
TArray<FGameModeName> GameModeClassAliases;
|
|
|
|
public:
|
|
|
|
/** Returns the game local maps settings */
|
|
UFUNCTION(BlueprintPure, Category = Settings, meta=(DisplayName="Get Game Maps and Modes Settings"))
|
|
static UGameMapsSettings* GetGameMapsSettings();
|
|
|
|
/**
|
|
* Modify "Skip Assigning Gamepad to Player 1" GameMapsSettings option
|
|
* @param bSkipFirstPlayer If set connected game pads will only be assigned to the second and subsequent players
|
|
* @note This value is saved to local config when changed.
|
|
*/
|
|
UFUNCTION(BlueprintCallable, Category = "Utilities")
|
|
void SetSkipAssigningGamepadToPlayer1(bool bSkipFirstPlayer = true);
|
|
|
|
UFUNCTION(BlueprintPure, Category = "Utilities")
|
|
bool GetSkipAssigningGamepadToPlayer1() const;
|
|
|
|
};
|