forked from akanyan/mu3-mods
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>
This commit is contained in:
35
AttractVideoPlayer/MU3/patch_AdvManager.cs
Normal file
35
AttractVideoPlayer/MU3/patch_AdvManager.cs
Normal file
@ -0,0 +1,35 @@
|
||||
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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user