FModel v4.0.2

This commit is contained in:
iAmAsval 2021-09-19 22:35:04 +02:00
parent 17a1b0b69b
commit f2f6fc01d2
2 changed files with 11 additions and 13 deletions

@ -1 +1 @@
Subproject commit 4736f8231f61631ffbc5afbd2b4a1281b8651be5
Subproject commit 6d911668e730b3f4c1eab0b3f7e9a99bc3dde943

View File

@ -931,11 +931,11 @@ namespace FModel.ViewModels
_fillPaint.StrokeWidth = 5;
var cubeMovementsBitmap = new SKBitmap(_widthHeight, _widthHeight, SKColorType.Rgba8888, SKAlphaType.Premul);
using var c = new SKCanvas(cubeMovementsBitmap);
if (!Utils.TryLoadObject("/CorruptionGameplay/Levels/CorruptionGameplay_ApolloTerrain_Overlay.BP_CubeMovementGradient_2", out UObject overlay) ||
!overlay.TryGetValue(out FSoftObjectPath[] cubeMovementStaticPaths, "cubeMovementStaticPaths") || cubeMovementStaticPaths.Length < 1)
return;
var oldColor = _pathPaint.Color;
_pathPaint.Color = SKColors.Purple;
foreach (var cubeMovementStaticPath in cubeMovementStaticPaths)
@ -947,7 +947,7 @@ namespace FModel.ViewModels
DrawCubeMovements(c, staticPath, true);
}
if (Utils.TryLoadObject("/CorruptionGameplay/Levels/CubeMovement/Apollo_CM_Gold_Overlay.CM_Spline_Gold", out UObject goldPath))
{
_pathPaint.Color = SKColors.Gold;
@ -962,8 +962,7 @@ namespace FModel.ViewModels
private void DrawCubeMovements(SKCanvas c, UObject staticPath, bool fixLocation)
{
if (!staticPath.TryGetValue(out FStructFallback[] pathTravelers, "PathTravelers") || pathTravelers.Length < 1 ||
!pathTravelers[0].TryGetValue(out FPackageIndex[] generatedSplinesArray, "GeneratedSplinesArray") || generatedSplinesArray.Length < 1 ||
!pathTravelers[0].TryGetValue(out FStructFallback[] stepMetaData, "StepMetaData") || stepMetaData.Length < 1)
!pathTravelers[0].TryGetValue(out FPackageIndex[] generatedSplinesArray, "GeneratedSplinesArray") || generatedSplinesArray.Length < 1)
return;
UObject uObject;
@ -980,21 +979,20 @@ namespace FModel.ViewModels
var bDone = false;
var path = new SKPath();
for (var i = 0; i < generatedSplinesArray.Length; i++)
foreach (var generatedSpline in generatedSplinesArray)
{
if (!stepMetaData[i].TryGetValue(out bool bSkipStep, "bSkipStep") || bSkipStep ||
!Utils.TryGetPackageIndexExport(generatedSplinesArray[i], out uObject) ||
if (!Utils.TryGetPackageIndexExport(generatedSpline, out uObject) ||
!uObject.TryGetValue(out FVector relativeLocation, "RelativeLocation")) continue;
if (!uObject.TryGetValue(out FStructFallback splineCurves, "SplineCurves") ||
!splineCurves.TryGetValue(out FStructFallback positions, "Position") ||
!positions.TryGetValue(out FStructFallback[] positionPoints, "Points")) continue;
for (var j = 0; j < positionPoints.Length; j++)
foreach (var positionPoint in positionPoints)
{
if (!positionPoints[j].TryGetValue(out FVector position, "OutVal")) continue;
if (!positionPoint.TryGetValue(out FVector point, "OutVal")) continue;
var vector = GetMapPosition(parentRelativeLocation + relativeLocation + position, _brRadius);
var vector = GetMapPosition(parentRelativeLocation + relativeLocation + point, _brRadius);
if (!bDone)
{
path.MoveTo(vector.X, vector.Y);
@ -1006,7 +1004,7 @@ namespace FModel.ViewModels
}
}
}
c.DrawPath(path, _pathPaint);
}
}