mirror of
https://github.com/Theaninova/BeatLanguageMapper.git
synced 2026-01-21 09:23:02 +00:00
Initial Commit!
いきますよ!
This commit is contained in:
@@ -0,0 +1,265 @@
|
||||
/*
|
||||
By TK-Master
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
//For the Anchor Conversion
|
||||
#include "Runtime/UMG/Public/UMG.h"
|
||||
|
||||
#include "TKMathFunctionLibrary.generated.h"
|
||||
|
||||
/* Speed Units Enum. */
|
||||
UENUM()
|
||||
enum ESpeedUnit
|
||||
{
|
||||
/* Centimeter / second (cm/s). This is default unreal velocity unit. */
|
||||
CentimeterPerSecond,
|
||||
|
||||
/* Foot / second (ft/s). */
|
||||
FootPerSecond,
|
||||
|
||||
/* Meter / second (m/s). */
|
||||
MeterPerSecond,
|
||||
|
||||
/* Meter / minute (m/min). */
|
||||
MeterPerMinute,
|
||||
|
||||
/* Kilometer / second (km/s). */
|
||||
KilometerPerSecond,
|
||||
|
||||
/* Kilometer / minute (km/min). */
|
||||
KilometerPerMinute,
|
||||
|
||||
/*Kilometer / hour (km/h). */
|
||||
KilometerPerHour,
|
||||
|
||||
/* Mile / hour (mph). */
|
||||
MilePerHour,
|
||||
|
||||
/* Knot (kn). Nautical mile per hour. */
|
||||
Knot,
|
||||
|
||||
/* Mach (speed of sound) (M) at standard atm. */
|
||||
Mach,
|
||||
|
||||
/* Speed of light. */
|
||||
SpeedOfLight,
|
||||
|
||||
/* Yard / second. */
|
||||
YardPerSecond
|
||||
};
|
||||
|
||||
|
||||
UCLASS()
|
||||
class VICTORYBPLIBRARY_API UTKMathFunctionLibrary : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Console")
|
||||
static float GetConsoleVariableFloat(FString VariableName);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Console")
|
||||
static int32 GetConsoleVariableInt(FString VariableName);
|
||||
|
||||
//Reverses the sign (- or +) of a float.
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Float")
|
||||
static float NegateFloat(float A);
|
||||
|
||||
//Reverses the sign (- or +) of an integer.
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer")
|
||||
static int32 NegateInt(int32 A);
|
||||
|
||||
//Reverses the sign (- or +) of a Vector2D.
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector2D")
|
||||
static FVector2D NegateVector2D(FVector2D A);
|
||||
|
||||
//Changes the size (length) of a Vector to the given size (normalized vector * size).
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static FVector SetVectorLength(FVector A, float size);
|
||||
|
||||
//Converts radians to degrees.
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static FVector VectorRadiansToDegrees(FVector RadVector);
|
||||
|
||||
//Converts degrees to radians.
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static FVector VectorDegreesToRadians(FVector DegVector);
|
||||
|
||||
/**
|
||||
* Rounds an integer to the lower multiple of the given number.
|
||||
* If Skip Self is set to True it will skip to the previous multiple if the integer rounds to itself.
|
||||
* @param Multiple - The multiple number to round to.
|
||||
* @param skipSelf - Skip to the previous multiple if the integer rounds to itself.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer")
|
||||
static int32 RoundToLowerMultiple(int32 A, int32 Multiple = 32, bool skipSelf = false);
|
||||
|
||||
/**
|
||||
* Rounds an integer to the upper multiple of the given number.
|
||||
* If Skip Self is set to True it will skip to the next multiple if the integer rounds to itself.
|
||||
* @param Multiple - The multiple number to round to.
|
||||
* @param skipSelf - Skip to the next multiple if the integer rounds to itself.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer")
|
||||
static int32 RoundToUpperMultiple(int32 A, int32 Multiple = 32, bool skipSelf = false);
|
||||
|
||||
/** Rounds an integer to the nearest multiple of the given number. */
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer")
|
||||
static int32 RoundToNearestMultiple(int32 A, int32 Multiple = 32);
|
||||
|
||||
/** Returns true if the integer is a power of two number. */
|
||||
UFUNCTION(BlueprintPure, meta = (CompactNodeTitle = "PwrOf2"), Category = "Victory BP Library|TK-Master Math|Integer")
|
||||
static bool IsPowerOfTwo(int32 x);
|
||||
|
||||
/** Returns true if the integer is a multiple of the given number. */
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer")
|
||||
static bool IsMultipleOf(int32 A, int32 Multiple);
|
||||
|
||||
/** Returns true if the number is even (false if it's odd). */
|
||||
UFUNCTION(BlueprintPure, meta = (CompactNodeTitle = "isEven"), Category = "Victory BP Library|TK-Master Math|Float")
|
||||
static bool IsEvenNumber(float A);
|
||||
|
||||
/**
|
||||
* Find closest point on a Sphere to a Line.
|
||||
* When line intersects Sphere, then closest point to LineOrigin is returned.
|
||||
* @param SphereOrigin Origin of Sphere
|
||||
* @param SphereRadius Radius of Sphere
|
||||
* @param LineOrigin Origin of line
|
||||
* @param LineDir Direction of line.
|
||||
* @return Closest point on sphere to given line.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static FVector ClosestPointOnSphereToLine(FVector SphereOrigin, float SphereRadius, FVector LineOrigin, FVector LineDir);
|
||||
|
||||
/** Find the point on line segment from LineStart to LineEnd which is closest to Point. */
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static FVector ClosestPointOnLineSeqment(FVector Point, FVector LineStart, FVector LineEnd);
|
||||
|
||||
/** Returns true if the given Point vector is within a box (defined by BoxOrigin and BoxExtent). */
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection")
|
||||
static bool IsPointInsideBox(FVector Point, FVector BoxOrigin, FVector BoxExtent);
|
||||
|
||||
/** Determines whether a line intersects a sphere. */
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection")
|
||||
static bool IsLineInsideSphere(FVector LineStart, FVector LineDir, float LineLength, FVector SphereOrigin, float SphereRadius);
|
||||
|
||||
/**
|
||||
* Swept-Box vs Box test.
|
||||
* Sweps a box defined by Extend from Start to End points and returns whether it hit a box or not plus the hit location and hit normal if successful.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection")
|
||||
static bool LineExtentBoxIntersection(FBox inBox, FVector Start, FVector End, FVector Extent, FVector& HitLocation, FVector& HitNormal, float& HitTime);
|
||||
|
||||
/**
|
||||
* Get the shortest distance between a point and a plane.
|
||||
* The output is signed so it holds information as to which side of the plane normal the point is.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static float SignedDistancePlanePoint(FVector planeNormal, FVector planePoint, FVector point);
|
||||
|
||||
/**
|
||||
* Returns a vector point which is a projection from a point to a line (defined by the vector couple LineOrigin, LineDirection).
|
||||
* The line is infinite (in both directions).
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static FVector ProjectPointOnLine(FVector LineOrigin, FVector LineDirection, FVector Point);
|
||||
|
||||
/**
|
||||
* Performs a sphere vs box intersection test.
|
||||
* @param SphereOrigin the center of the sphere being tested against the box.
|
||||
* @param SphereRadius the size of the sphere being tested.
|
||||
* @param BoxOrigin the box origin being tested against.
|
||||
* @param BoxExtent the box extend (width, depth, height).
|
||||
* @return Whether the sphere/box intersect or not.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection")
|
||||
static bool SphereBoxIntersection(FVector SphereOrigin, float SphereRadius, FVector BoxOrigin, FVector BoxExtent);
|
||||
|
||||
/**
|
||||
* Find closest points between 2 line segments.
|
||||
* @param (Line1Start, Line1End) defines the first line segment.
|
||||
* @param (Line2Start, Line2End) defines the second line segment.
|
||||
* @param LinePoint1 Closest point on segment 1 to segment 2.
|
||||
* @param LinePoint2 Closest point on segment 2 to segment 1.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection")
|
||||
static void ClosestPointsOfLineSegments(FVector Line1Start, FVector Line1End, FVector Line2Start, FVector Line2End, FVector& LinePoint1, FVector& LinePoint2);
|
||||
|
||||
/**
|
||||
* Calculate the intersection point of two infinitely long lines. Returns true if lines intersect, otherwise false.
|
||||
* Note that in 3d, two lines do not intersect most of the time.
|
||||
* So if the two lines are not in the same plane, use Closest Points On Two Lines instead.
|
||||
* @param IntersectionPoint The intersection point of the lines. Returns zero if the lines do not intersect or the operation fails.
|
||||
* @param LinePoint1 Line point of the first line.
|
||||
* @param LineDir1 Line direction (normal) of the first line. Should be a normalized vector.
|
||||
* @param LinePoint2 Line point of the second line.
|
||||
* @param LineDir2 Line direction (normal) of the second line. Should be a normalized vector.
|
||||
* @return true if lines intersect, otherwise false.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection")
|
||||
static bool LineToLineIntersection(FVector& IntersectionPoint, FVector LinePoint1, FVector LineDir1, FVector LinePoint2, FVector LineDir2);
|
||||
|
||||
/*
|
||||
* Calculate the closest points between two infinitely long lines.
|
||||
* If lines are intersecting (not parallel) it will return false! Use Line To Line Intersection instead.
|
||||
* @param closestPointLine1 The closest point of line1 to line2. Returns zero if the lines intersect.
|
||||
* @param closestPointLine2 The closest point of line2 to line1. Returns zero if the lines intersect.
|
||||
* @param linePoint1 Line point of the first line.
|
||||
* @param lineVec1 Line direction (normal) of the first line. Should be a normalized vector.
|
||||
* @param linePoint2 Line point of the second line.
|
||||
* @param lineVec2 Line direction (normal) of the second line. Should be a normalized vector.
|
||||
* @return true if lines are parallel, false otherwise.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static bool ClosestPointsOnTwoLines(FVector& closestPointLine1, FVector& closestPointLine2, FVector linePoint1, FVector lineVec1, FVector linePoint2, FVector lineVec2);
|
||||
|
||||
/*
|
||||
* Returns 0 if point is on the line segment.
|
||||
* Returns 1 if point is not on the line segment and it is on the side of linePoint1.
|
||||
* Returns 2 if point is not on the line segment and it is on the side of linePoint2.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static int32 PointOnWhichSideOfLineSegment(FVector linePoint1, FVector linePoint2, FVector point);
|
||||
|
||||
/*
|
||||
* Returns true if the two line segments are intersecting and not parallel.
|
||||
* If you need the intersection point, use Closest Points On Two Lines.
|
||||
*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection")
|
||||
static bool AreLineSegmentsCrossing(FVector pointA1, FVector pointA2, FVector pointB1, FVector pointB2);
|
||||
|
||||
/*Snaps vector to nearest grid multiple.*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static FVector GridSnap(FVector A, float Grid);
|
||||
|
||||
/*Converts UMG layout offsets to another anchor.*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Anchor", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
|
||||
static void ConvertAnchorToAnchor(UObject* WorldContextObject, FAnchors CurrentAnchor, FMargin Offsets, FAnchors TargetAnchor, FMargin& ConvertedOffsets);
|
||||
|
||||
/*Converts Physics Linear Velocity to a more useful speed unit.*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector")
|
||||
static float ConvertPhysicsLinearVelocity(FVector Velocity, TEnumAsByte<enum ESpeedUnit> SpeedUnit);
|
||||
|
||||
//------------------------------------------------------------
|
||||
//Physics functions! (why aren't these exposed by Epic yet?!)
|
||||
|
||||
/**
|
||||
* Get the current world velocity of a point on a physics-enabled component.
|
||||
* @param Point - Point in world space.
|
||||
* @param DrawDebugInfo - Draw debug point & string.
|
||||
* @param BoneName - If a SkeletalMeshComponent, name of body to get velocity of. 'None' indicates root body.
|
||||
* @return The velocity of the point in world space.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Physics")
|
||||
static FVector GetVelocityAtPoint(UPrimitiveComponent* Target, FVector Point, FName BoneName = NAME_None, bool DrawDebugInfo = false);
|
||||
|
||||
/*
|
||||
* Set the physx center of mass offset.
|
||||
* Note: this offsets the physx-calculated center of mass (it is not an offset from the pivot point).
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Physics")
|
||||
static void SetCenterOfMassOffset(UPrimitiveComponent* Target, FVector Offset, FName BoneName = NAME_None);
|
||||
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
By Rama
|
||||
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Runtime/Engine/Classes/Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "VictoryBPHTML.generated.h"
|
||||
|
||||
// BP Library for You
|
||||
//
|
||||
// Written by Rama
|
||||
|
||||
//note about UBlueprintFunctionLibrary
|
||||
// This class is a base class for any function libraries exposed to blueprints.
|
||||
// Methods in subclasses are expected to be static, and no methods should be added to the base class.
|
||||
|
||||
|
||||
UCLASS()
|
||||
class VICTORYBPLIBRARY_API UVictoryBPHTML : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
|
||||
/** Is the current OS HTML5? This code will only run in games packaged for HTML5, it will not run in Editor builds :) Use this to customize particle FX for HTML5 vs PC builds! Or for any custom HTML5-specific game logic! <3 Rama*/
|
||||
UFUNCTION(BlueprintPure, Category = "Victory BP Library|HTML5")
|
||||
static bool IsHTML();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|HTML5")
|
||||
static void VictoryHTML5_SetCursorVisible(bool MakeVisible);
|
||||
|
||||
};
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
By Rama
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ModuleManager.h"
|
||||
|
||||
class FVictoryBPLibraryModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
|
||||
/** IModuleInterface implementation */
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
|
||||
By Rama
|
||||
|
||||
*/
|
||||
#include "VictoryBPLibraryPrivatePCH.h"
|
||||
#include "VictoryISM.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// VictoryISM
|
||||
|
||||
AVictoryISM::AVictoryISM(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
RootComponent = Mesh = ObjectInitializer.CreateDefaultSubobject<UInstancedStaticMeshComponent>(this, "VictoryInstancedMesh");
|
||||
}
|
||||
|
||||
void AVictoryISM::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
//~~~~~~~~~
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
|
||||
By Rama
|
||||
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h"
|
||||
#include "VictoryISM.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class AVictoryISM : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
|
||||
AVictoryISM(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
UPROPERTY(Category = "Joy ISM", VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
|
||||
UInstancedStaticMeshComponent* Mesh;
|
||||
|
||||
//~~~~~~~~~~~~~
|
||||
// ISM
|
||||
//~~~~~~~~~~~~~
|
||||
public:
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
};
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
|
||||
By Rama
|
||||
|
||||
*/
|
||||
|
||||
#include "VictoryBPLibraryPrivatePCH.h"
|
||||
#include "VictoryPC.h"
|
||||
|
||||
#include "Runtime/Engine/Classes/Kismet/GameplayStatics.h"
|
||||
|
||||
DEFINE_LOG_CATEGORY(VictoryPCLog)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AVictoryPC
|
||||
|
||||
AVictoryPC::AVictoryPC(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
UAudioComponent* AVictoryPC::VictoryPlaySpeechSound(
|
||||
USoundBase* Sound
|
||||
,float VolumeMultiplier
|
||||
,float PitchMultiplier
|
||||
, float StartTime)
|
||||
{
|
||||
|
||||
UAudioComponent* Audio = UGameplayStatics::SpawnSound2D(this,Sound,VolumeMultiplier,PitchMultiplier,StartTime);
|
||||
if(Audio)
|
||||
{
|
||||
//Subtitle Delegate for You!
|
||||
// <3 Rama
|
||||
Audio->OnQueueSubtitles.BindDynamic(this, &AVictoryPC::Subtitles_CPPDelegate);
|
||||
}
|
||||
|
||||
/*
|
||||
Note that the OnAudioFinished is BP assignable off of return of this node!
|
||||
|
||||
//called when we finish playing audio, either because it played to completion or because a Stop() call turned it off early
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FOnAudioFinished OnAudioFinished;
|
||||
*/
|
||||
|
||||
return Audio;
|
||||
}
|
||||
|
||||
void AVictoryPC::Subtitles_CPPDelegate(const TArray<struct FSubtitleCue>& Subtitles, float CueDuration)
|
||||
{
|
||||
TArray<FVictorySubtitleCue> VictorySubtitles;
|
||||
for(const FSubtitleCue& Each : Subtitles)
|
||||
{
|
||||
VictorySubtitles.Add(FVictorySubtitleCue(Each.Text,Each.Time));
|
||||
}
|
||||
|
||||
OnVictorySubtitlesQueued(VictorySubtitles,CueDuration);
|
||||
}
|
||||
|
||||
//~~~
|
||||
|
||||
bool AVictoryPC::VictoryPC_GetMyIP_SendRequest()
|
||||
{
|
||||
FHttpModule* Http = &FHttpModule::Get();
|
||||
|
||||
if(!Http)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!Http->IsHttpEnabled())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
FString TargetHost = "http://api.ipify.org";
|
||||
TSharedRef < IHttpRequest > Request = Http->CreateRequest();
|
||||
Request->SetVerb("GET");
|
||||
Request->SetURL(TargetHost);
|
||||
Request->SetHeader("User-Agent", "VictoryBPLibrary/1.0");
|
||||
Request->SetHeader("Content-Type" ,"text/html");
|
||||
|
||||
Request->OnProcessRequestComplete().BindUObject(this, &AVictoryPC::HTTPOnResponseReceived);
|
||||
if (!Request->ProcessRequest())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AVictoryPC::HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
|
||||
{
|
||||
FString ResponseStr = "AVictoryPC::HTTPOnResponseReceived>>> Connection Error";
|
||||
if(bWasSuccessful)
|
||||
{
|
||||
ResponseStr = Response->GetContentAsString();
|
||||
}
|
||||
|
||||
this->VictoryPC_GetMyIP_DataReceived(ResponseStr);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
|
||||
By Rama
|
||||
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
//HTTP
|
||||
#include "Http.h"
|
||||
|
||||
#include "Runtime/Engine/Classes/GameFramework/PlayerController.h"
|
||||
#include "VictoryPC.generated.h"
|
||||
|
||||
DECLARE_LOG_CATEGORY_EXTERN(VictoryPCLog, Log, All);
|
||||
|
||||
|
||||
//Exposing the UE4 Subtitle system for Solus
|
||||
// <3 Rama
|
||||
USTRUCT(BlueprintType)
|
||||
struct FVictorySubtitleCue
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
/** The text to appear in the subtitle. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=SubtitleCue)
|
||||
FText SubtitleText;
|
||||
|
||||
/** The time at which the subtitle is to be displayed, in seconds relative to the beginning of the line. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=SubtitleCue)
|
||||
float Time;
|
||||
|
||||
FVictorySubtitleCue()
|
||||
: Time(0)
|
||||
{ }
|
||||
FVictorySubtitleCue(const FText& InText, float InTime)
|
||||
: SubtitleText(InText)
|
||||
, Time(InTime)
|
||||
{}
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class VICTORYBPLIBRARY_API AVictoryPC : public APlayerController
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
AVictoryPC(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
/**
|
||||
* When the sound is played OnVictorySubtitlesQueued will be called with the subtitles!
|
||||
* You can bind an event off of the audio component for OnAudioFinished to know hwen the sound is done!
|
||||
*/
|
||||
UFUNCTION(Category="Victory Subtitles", BlueprintCallable, BlueprintCosmetic, meta=( UnsafeDuringActorConstruction = "true", Keywords = "play" ))
|
||||
UAudioComponent* VictoryPlaySpeechSound(class USoundBase* Sound, float VolumeMultiplier = 1.f, float PitchMultiplier = 1.f, float StartTime = 0.f);
|
||||
|
||||
UFUNCTION(Category="Victory Subtitles", BlueprintImplementableEvent)
|
||||
void OnVictorySubtitlesQueued(const TArray<struct FVictorySubtitleCue>& VictorySubtitles, float CueDuration);
|
||||
|
||||
UFUNCTION()
|
||||
void Subtitles_CPPDelegate(const TArray<struct FSubtitleCue>& VictorySubtitles, float CueDuration);
|
||||
|
||||
public:
|
||||
/** This node relies on http://api.ipify.org, so if this node ever stops working, check out http://api.ipify.org. Returns false if the operation could not occur because HTTP module was not loaded or unable to process request. */
|
||||
UFUNCTION(BlueprintCallable, Category="Victory PC")
|
||||
bool VictoryPC_GetMyIP_SendRequest();
|
||||
|
||||
/** Implement this event to receive your IP once the request is processed! This requires that your computer has a live internet connection */
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Victory PC", meta = (DisplayName = "Victory PC ~ GetMyIP ~ Data Received!"))
|
||||
void VictoryPC_GetMyIP_DataReceived(const FString& YourIP);
|
||||
|
||||
void HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
|
||||
};
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
|
||||
By Rama
|
||||
|
||||
*/
|
||||
|
||||
#include "VictoryBPLibraryPrivatePCH.h"
|
||||
#include "VictoryTMapComp.h"
|
||||
|
||||
DEFINE_LOG_CATEGORY(VictoryTMapLog)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// UVictoryTMapComp
|
||||
|
||||
UVictoryTMapComp::UVictoryTMapComp(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//~~~ Add ~~~
|
||||
void UVictoryTMapComp::String_Actor__AddPair(FString Key, AActor* Value)
|
||||
{
|
||||
StringActor.Add(Key,Value);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::String_String__AddPair(FString Key, FString Value)
|
||||
{
|
||||
StringString.Add(Key,Value);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::String_Int__AddPair(FString Key, int32 Value)
|
||||
{
|
||||
StringInt.Add(Key,Value);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::String_Vector__AddPair(FString Key, FVector Value)
|
||||
{
|
||||
StringVector.Add(Key,Value);
|
||||
}
|
||||
void UVictoryTMapComp::String_Rotator__AddPair(FString Key, FRotator Value)
|
||||
{
|
||||
StringRotator.Add(Key,Value);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::Int_Vector__AddPair(int32 Key, FVector Value)
|
||||
{
|
||||
IntVector.Add(Key,Value);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::Int_Float__AddPair(int32 Key, float Value)
|
||||
{
|
||||
IntFloat.Add(Key,Value);
|
||||
}
|
||||
|
||||
//~~~ Get ~~~
|
||||
AActor* UVictoryTMapComp::String_Actor__Get(FString Key, bool& IsValid)
|
||||
{
|
||||
IsValid = false;
|
||||
if(!StringActor.Contains(Key))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
IsValid = true;
|
||||
return StringActor[Key];
|
||||
}
|
||||
|
||||
FString UVictoryTMapComp::String_String__Get(FString Key, bool& IsValid)
|
||||
{
|
||||
IsValid = false;
|
||||
if(!StringString.Contains(Key))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
IsValid = true;
|
||||
return StringString[Key];
|
||||
}
|
||||
|
||||
int32 UVictoryTMapComp::String_Int__Get(FString Key, bool& IsValid)
|
||||
{
|
||||
IsValid = false;
|
||||
if(!StringInt.Contains(Key))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
IsValid = true;
|
||||
return StringInt[Key];
|
||||
}
|
||||
|
||||
FVector UVictoryTMapComp::String_Vector__Get(FString Key, bool& IsValid)
|
||||
{
|
||||
IsValid = false;
|
||||
if(!StringVector.Contains(Key))
|
||||
{
|
||||
return FVector::ZeroVector;
|
||||
}
|
||||
IsValid = true;
|
||||
return StringVector[Key];
|
||||
}
|
||||
FRotator UVictoryTMapComp::String_Rotator__Get(FString Key, bool& IsValid)
|
||||
{
|
||||
IsValid = false;
|
||||
if(!StringRotator.Contains(Key))
|
||||
{
|
||||
return FRotator::ZeroRotator;
|
||||
}
|
||||
IsValid = true;
|
||||
return StringRotator[Key];
|
||||
}
|
||||
|
||||
FVector UVictoryTMapComp::Int_Vector__Get(int32 Key, bool& IsValid)
|
||||
{
|
||||
IsValid = false;
|
||||
if(!IntVector.Contains(Key))
|
||||
{
|
||||
return FVector::ZeroVector;
|
||||
}
|
||||
IsValid = true;
|
||||
return IntVector[Key];
|
||||
}
|
||||
|
||||
float UVictoryTMapComp::Int_Float__Get(int32 Key, bool& IsValid)
|
||||
{
|
||||
IsValid = false;
|
||||
if(!IntFloat.Contains(Key))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
IsValid = true;
|
||||
return IntFloat[Key];
|
||||
}
|
||||
|
||||
//~~~ Remove ~~~
|
||||
void UVictoryTMapComp::String_Actor__Remove(FString Key)
|
||||
{
|
||||
StringActor.Remove(Key);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::String_String__Remove(FString Key)
|
||||
{
|
||||
StringString.Remove(Key);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::String_Int__Remove(FString Key)
|
||||
{
|
||||
StringInt.Remove(Key);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::String_Vector__Remove(FString Key)
|
||||
{
|
||||
StringVector.Remove(Key);
|
||||
}
|
||||
void UVictoryTMapComp::String_Rotator__Remove(FString Key)
|
||||
{
|
||||
StringRotator.Remove(Key);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::Int_Vector__Remove(int32 Key)
|
||||
{
|
||||
IntVector.Remove(Key);
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::Int_Float__Remove(int32 Key, float Value)
|
||||
{
|
||||
IntFloat.Remove(Key);
|
||||
}
|
||||
|
||||
//~~~ Clear ~~~
|
||||
void UVictoryTMapComp::String_Actor__Clear()
|
||||
{
|
||||
StringActor.Empty();
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::String_String__Clear()
|
||||
{
|
||||
StringString.Empty();
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::String_Int__Clear()
|
||||
{
|
||||
StringInt.Empty();
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::String_Vector__Clear()
|
||||
{
|
||||
StringVector.Empty();
|
||||
}
|
||||
void UVictoryTMapComp::String_Rotator__Clear()
|
||||
{
|
||||
StringRotator.Empty();
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::Int_Vector__Clear()
|
||||
{
|
||||
IntVector.Empty();
|
||||
}
|
||||
|
||||
void UVictoryTMapComp::Int_Float__Clear()
|
||||
{
|
||||
IntFloat.Empty();
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
|
||||
By Rama
|
||||
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "VictoryTMapComp.generated.h"
|
||||
|
||||
DECLARE_LOG_CATEGORY_EXTERN(VictoryTMapLog, Log, All);
|
||||
|
||||
UCLASS(ClassGroup=VictoryBPLibrary, meta=(BlueprintSpawnableComponent))
|
||||
class UVictoryTMapComp : public UActorComponent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
UVictoryTMapComp(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
//Add
|
||||
public:
|
||||
/** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add")
|
||||
void String_Actor__AddPair(FString Key, AActor* Value);
|
||||
|
||||
/** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add")
|
||||
void String_String__AddPair(FString Key, FString Value);
|
||||
|
||||
/** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add")
|
||||
void String_Int__AddPair(FString Key, int32 Value);
|
||||
|
||||
/** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add")
|
||||
void String_Vector__AddPair(FString Key, FVector Value);
|
||||
|
||||
/** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add")
|
||||
void String_Rotator__AddPair(FString Key, FRotator Value);
|
||||
|
||||
/** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add")
|
||||
void Int_Vector__AddPair(int32 Key, FVector Value);
|
||||
|
||||
/** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add")
|
||||
void Int_Float__AddPair(int32 Key, float Value);
|
||||
|
||||
//Get
|
||||
public:
|
||||
/** Get the value associated with they key at fastest possible speed! <3 Rama */
|
||||
UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get")
|
||||
AActor* String_Actor__Get(FString Key, bool& IsValid);
|
||||
|
||||
/** Get the value associated with they key at fastest possible speed! <3 Rama */
|
||||
UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get")
|
||||
FString String_String__Get(FString Key, bool& IsValid);
|
||||
|
||||
/** Get the value associated with they key at fastest possible speed! <3 Rama */
|
||||
UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get")
|
||||
int32 String_Int__Get(FString Key, bool& IsValid);
|
||||
|
||||
/** Get the value associated with they key at fastest possible speed! <3 Rama */
|
||||
UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get")
|
||||
FVector String_Vector__Get(FString Key, bool& IsValid);
|
||||
|
||||
/** Get the value associated with they key at fastest possible speed! <3 Rama */
|
||||
UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get")
|
||||
FRotator String_Rotator__Get(FString Key, bool& IsValid);
|
||||
|
||||
/** Get the value associated with they key at fastest possible speed! <3 Rama */
|
||||
UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get")
|
||||
FVector Int_Vector__Get(int32 Key, bool& IsValid);
|
||||
|
||||
/** Get the value associated with they key at fastest possible speed! <3 Rama */
|
||||
UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get")
|
||||
float Int_Float__Get(int32 Key, bool& IsValid);
|
||||
|
||||
//Remove
|
||||
public:
|
||||
/** Removes the key and any associated value from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove")
|
||||
void String_Actor__Remove(FString Key);
|
||||
|
||||
/** Removes the key and any associated value from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove")
|
||||
void String_String__Remove(FString Key);
|
||||
|
||||
/** Removes the key and any associated value from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove")
|
||||
void String_Int__Remove(FString Key);
|
||||
|
||||
/** Removes the key and any associated value from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove")
|
||||
void String_Vector__Remove(FString Key);
|
||||
|
||||
/** Removes the key and any associated value from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove")
|
||||
void String_Rotator__Remove(FString Key);
|
||||
|
||||
/** Removes the key and any associated value from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove")
|
||||
void Int_Vector__Remove(int32 Key);
|
||||
|
||||
/** Removes the key and any associated value from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove")
|
||||
void Int_Float__Remove(int32 Key, float Value);
|
||||
|
||||
//Clear
|
||||
public:
|
||||
/** Removes every entry from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset"))
|
||||
void String_Actor__Clear();
|
||||
|
||||
/** Removes every entry from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset"))
|
||||
void String_String__Clear();
|
||||
|
||||
/** Removes every entry from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset"))
|
||||
void String_Int__Clear();
|
||||
|
||||
/** Removes every entry from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset"))
|
||||
void String_Vector__Clear();
|
||||
|
||||
/** Removes every entry from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset"))
|
||||
void String_Rotator__Clear();
|
||||
|
||||
/** Removes every entry from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset"))
|
||||
void Int_Vector__Clear();
|
||||
|
||||
/** Removes every entry from the TMap! <3 Rama */
|
||||
UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset"))
|
||||
void Int_Float__Clear();
|
||||
|
||||
public:
|
||||
TMap<FString,AActor*> StringActor;
|
||||
TMap<FString,FString> StringString;
|
||||
TMap<FString,int32> StringInt;
|
||||
TMap<FString,FVector> StringVector;
|
||||
TMap<FString,FRotator> StringRotator;
|
||||
TMap<int32,FVector> IntVector;
|
||||
TMap<int32,float> IntFloat;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user