Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Update Modular Features plugin + Create new settings class + Start ad…
Browse files Browse the repository at this point in the history
…apting the project to MF Extra Features next changes
  • Loading branch information
lucoiso committed Nov 6, 2022
1 parent f2e09d4 commit 19f9d24
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 10 deletions.
5 changes: 5 additions & 0 deletions Config/DefaultGame.ini
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,8 @@ MetaDataTagsForAssetRegistry=()
[/Script/GameFeatures.GameFeaturesSubsystemSettings]
GameFeaturesManagerClassName=/Script/GameFeatures.DefaultGameFeaturesProjectPolicies

[/Script/ModularFeatures_ExtraActions.MFEA_Settings]
bUseInputEnumeration=True
bEnableAbilityAutoBinding=False
InputIDEnumeration=/Game/Main/Data/GAS/EN_AbilityInputID.EN_AbilityInputID

Binary file not shown.
Binary file modified Plugins/GameFeatures/Weapons/Content/Data/DA_Pistol.uasset
Binary file not shown.
5 changes: 3 additions & 2 deletions ProjectElementus.uproject
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine"
"Engine",
"DeveloperSettings"
]
}
],
Expand Down Expand Up @@ -46,7 +47,7 @@
{
"Name": "EOSSDKHandler",
"Enabled": true
},
}
],
"TargetPlatforms": [
"Linux",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "ElementusInventoryFunctions.h"
#include "Management/Data/PEGlobalTags.h"
#include "Management/Functions/PEPlayerLibrary.h"
#include "MFEA_Settings.h"

constexpr float BaseTurnRate = 45.f;
constexpr float BaseLookUpRate = 45.f;
Expand All @@ -32,10 +33,10 @@ APEPlayerController::APEPlayerController(const FObjectInitializer& ObjectInitial
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true;

static const ConstructorHelpers::FObjectFinder<UEnum> InputIDEnum_ObjRef(TEXT("/Game/Main/Data/GAS/EN_AbilityInputID"));
if (InputIDEnum_ObjRef.Succeeded())
if (const UMFEA_Settings* MF_Settings = GetDefault<UMFEA_Settings>();
!MF_Settings->InputIDEnumeration.IsNull())
{
InputEnumHandle = InputIDEnum_ObjRef.Object;
InputEnumHandle = MF_Settings->InputIDEnumeration.LoadSynchronous();
}

static ConstructorHelpers::FClassFinder<UUserWidget> InventoryWidget_ClassRef(TEXT("/Game/Main/Blueprints/Widgets/Inventory/WB_Inventory_Example"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
#include "Actors/Character/PECharacter.h"
#include "GAS/System/PEAbilitySystemComponent.h"
#include "GAS/System/PEAbilityFunctions.h"
#include "MFEA_Settings.h"

UPEInventoryComponent::UPEInventoryComponent(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
PrimaryComponentTick.bCanEverTick = false;
PrimaryComponentTick.bStartWithTickEnabled = false;

static const ConstructorHelpers::FObjectFinder<UEnum> InputIDEnum_ObjRef(TEXT("/Game/Main/Data/GAS/EN_AbilityInputID"));
if (InputIDEnum_ObjRef.Succeeded())
if (const UMFEA_Settings* MF_Settings = GetDefault<UMFEA_Settings>();
!MF_Settings->InputIDEnumeration.IsNull())
{
InputEnumHandle = InputIDEnum_ObjRef.Object;
InputEnumHandle = MF_Settings->InputIDEnumeration.LoadSynchronous();
}
}

Expand Down
9 changes: 9 additions & 0 deletions Source/ProjectElementus/Private/Management/PEDevSettings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Author: Lucas Vilas-Boas
// Year: 2022
// Repo: https://github.com/lucoiso/UEProject_Elementus

#include "Management/PEDevSettings.h"

UPEDevSettings::UPEDevSettings(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class PROJECTELEMENTUS_API APEPlayerController final : public APlayerController,
/* This function came from IAbilityInputBinding interface,
* provided by GameFeatures_ExtraActions plugin to manage ability bindings */
UFUNCTION(Client, Reliable)
virtual void SetupAbilityInputBinding_Implementation(UInputAction* Action, const int32 InputID) override;
virtual void SetupAbilityInputBinding_Implementation(UInputAction* Action, const int32 InputID = -1) override;

/* This function came from IAbilityInputBinding interface,
* provided by GameFeatures_ExtraActions plugin to manage ability bindings */
Expand Down
21 changes: 21 additions & 0 deletions Source/ProjectElementus/Public/Management/PEDevSettings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Author: Lucas Vilas-Boas
// Year: 2022
// Repo: https://github.com/lucoiso/UEProject_Elementus

#pragma once

#include "CoreMinimal.h"
#include "Engine/DeveloperSettings.h"
#include "PEDevSettings.generated.h"

/**
*
*/
UCLASS(Config = Game, DefaultConfig, Meta = (DisplayName = "Project Elementus Settings"))
class PROJECTELEMENTUS_API UPEDevSettings : public UDeveloperSettings
{
GENERATED_BODY()

public:
explicit UPEDevSettings(const FObjectInitializer& ObjectInitializer);
};

0 comments on commit 19f9d24

Please sign in to comment.