Skip to content

Commit

Permalink
Add support for PyroEnvironment and fix a few bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevga committed Mar 31, 2022
1 parent 2dfac53 commit b24e129
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
8 changes: 0 additions & 8 deletions BeatSaberCinema/Environment/EnvironmentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,6 @@ private static void DefaultSceneModifications(VideoConfig? videoConfig)
{
Log.Warn("BTS movement effect not found");
}

if (videoConfig!.screenPosition == null)
{
var placement = Placement.GetDefaultPlacementForScene(PlaybackController.Scene.SoloGameplay);
placement.Position.z = 80;
PlaybackController.Instance.VideoPlayer.SetPlacement(placement);
}

break;
}
case "OriginsEnvironment":
Expand Down
3 changes: 2 additions & 1 deletion BeatSaberCinema/HarmonyPatches/EnvironmentOverridePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public static void Prefix(IDifficultyBeatmap difficultyBeatmap, ref OverrideEnvi
"MonstercatEnvironment",
"CrabRaveEnvironment",
"SkrillexEnvironment",
"WeaveEnvironment"
"WeaveEnvironment",
"PyroEnvironment"
};

var mapEnvironmentInfoSo = difficultyBeatmap.GetEnvironmentInfo();
Expand Down
7 changes: 4 additions & 3 deletions BeatSaberCinema/Screen/Placement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public static Placement CreatePlacementForConfig(VideoConfig? config, PlaybackCo
);

placement.Width = placement.Height * aspectRatio;
placement.Curvature = config?.screenCurvature;
placement.Subsurfaces = config?.screenSubsurfaces;
placement.CurveYAxis = config?.curveYAxis;
placement.Curvature = config.screenCurvature ?? defaultPlacement.Curvature;
placement.Subsurfaces = config.screenSubsurfaces;
placement.CurveYAxis = config.curveYAxis;

return placement;
}
Expand Down Expand Up @@ -90,6 +90,7 @@ public static Placement GetDefaultPlacementForScene(PlaybackController.Scene sce
"MonstercatEnvironment" => new Placement(new Vector3(0f, 5.46f, 40f), new Vector3(-5f, 0f, 0f), 13f),
"SkrillexEnvironment" => new Placement(new Vector3(0f, 1.5f, 30f), Vector3.zero, 12f),
"WeaveEnvironment" => new Placement(new Vector3(0f, 1.5f, 21f), Vector3.zero, 4.3f, null, 0f),
"PyroEnvironment" => new Placement(new Vector3(0f, 12f, 60f), Vector3.zero, 24f, null, 0f),
_ => null
};
}
Expand Down
2 changes: 1 addition & 1 deletion BeatSaberCinema/Video/VideoConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ [JsonIgnore] public string? VideoPath
[JsonIgnore] public bool IsPlayable => (DownloadState == DownloadState.Downloaded || IsStreamable) && !PlaybackDisabledByMissingSuggestion;
[JsonIgnore] public bool IsWIPLevel => LevelDir != null && LevelDir.Contains(VideoLoader.WIP_DIRECTORY_NAME);
[JsonIgnore] public bool EnvironmentModified => (environment != null && environment.Length > 0) || screenPosition != null || screenHeight != null;
public float PlaybackSpeed => playbackSpeed ?? 1;
[JsonIgnore] public float PlaybackSpeed => playbackSpeed ?? 1;


private static Regex _regexParseID = new Regex(@"\/watch\?v=([a-z0-9_-]*)",
Expand Down

0 comments on commit b24e129

Please sign in to comment.