Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Final changed Fixes #168
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Pearson committed May 8, 2018
1 parent d5fa357 commit 2e9d35b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ class UUIHelperLibrary : public UBlueprintFunctionLibrary
// returns a string with the key combination for a particular input action
UFUNCTION(BlueprintCallable, Category = "HUD|Keys", meta = (WorldContext = "WorldContextObject"))
static FText GetDisplayStringForAction(UObject* WorldContextObject, const FName& ActionName);

};
2 changes: 1 addition & 1 deletion ParkourGame/Source/ParkourGame/Private/Utils/GameVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "GameVersion.generated.h"

#define GAME_VERSION_MAJOR 0
#define GAME_VERSION_MINOR 10
#define GAME_VERSION_MINOR 11
#define GAME_VERSION_PATCH 0

USTRUCT(BlueprintType)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ParkourHelperLibrary.h"
#include "ParkourFNames.h"
#include "Regex.h"

FName UParkourHelperLibrary::GetRootBoneForBodyPart(EBodyPart Part)
{
Expand Down Expand Up @@ -44,3 +45,17 @@ void UParkourHelperLibrary::GetBoneChainForBodyPart(EBodyPart Part, TArray<FName
break;
}
}


bool UParkourHelperLibrary::IsValidPlayerName(const FString& Name)
{
if (Name.IsEmpty()) return false;

const FRegexPattern myPattern(TEXT("^[a-z,A-Z,0-9,_]+"));
FRegexMatcher myMatcher(myPattern, *Name);

myMatcher.FindNext();

return myMatcher.GetMatchBeginning() == 0 && (myMatcher.GetMatchEnding() == Name.Len());

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ class UParkourHelperLibrary : public UBlueprintFunctionLibrary
// Returns the set of (one or more) bones that make up a body part
UFUNCTION(BlueprintPure, Category = "Parkour|Skeleton")
static void GetBoneChainForBodyPart(EBodyPart Part, TArray<FName>& outChain);




UFUNCTION(BlueprintPure, Category = "Lobby")
static bool IsValidPlayerName(const FString& Name);
};

0 comments on commit 2e9d35b

Please sign in to comment.