1
0
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:
2024-07-22 14:55:49 +00:00
committed by あかニャン
parent 7f5cd6d0d7
commit 8cbc7e8b86
5 changed files with 113 additions and 0 deletions

View 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();
}
}