1
0
forked from akanyan/mu3-mods
Files
mu3-mods/AttractVideoPlayer/MU3/patch_AdvManager.cs
jujuforce 8cbc7e8b86 feat: implement AttractVideoPlayer (#2)
Service Button : Pause the attract video
L2/L3 Buttons : Previous/next to cycle through all the attract videos
Saving the selected video for future game launches

Co-authored-by: akanyan <alicechecker01@proton.me>
Reviewed-on: akanyan/mu3-mods#2
Co-authored-by: jujuforce <jujuforce@noreply.gitea.tendokyu.moe>
Co-committed-by: jujuforce <jujuforce@noreply.gitea.tendokyu.moe>
2024-07-22 14:55:49 +00:00

35 lines
1.1 KiB
C#

using MU3.Operation;
using MU3.Util;
using UnityEngine;
namespace MU3;
class patch_AdvManager: AdvManager {
private GameObject objMovie;
private CriManaMovieMaterial movieController;
private extern bool orig_exec();
public new bool exec() {
if(movieController?.player?.status == CriMana.Player.Status.Playing) {
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.Service)) {
movieController.player.Pause(!movieController.player.IsPaused());
} else if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.L2)) {
addMovieOffset(-1);
} else if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.L3)) {
addMovieOffset(1);
}
}
return orig_exec();
}
public void addMovieOffset(int offset) {
var om = (patch_OperationManager)Singleton<OperationManager>.instance;
om.MovieIndex += offset;
movieController.Stop();
Utility.destroyGameObject(ref movieController);
Utility.destroyGameObject(ref objMovie);
initMovie();
}
}