forked from akanyan/mu3-mods
feat!: rename and reorganize
This commit is contained in:
53
Enhancements/AttractVideoPlayer/MU3/patch_AdvManager.cs
Normal file
53
Enhancements/AttractVideoPlayer/MU3/patch_AdvManager.cs
Normal file
@ -0,0 +1,53 @@
|
||||
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();
|
||||
}
|
||||
|
||||
public extern bool orig_initMovie();
|
||||
public new bool initMovie() {
|
||||
UIInput instance = Singleton<UIInput>.instance;
|
||||
instance.setLedColor(UIInput.Key.L2, new Color(0f, 0.7f, 0f));
|
||||
instance.setLedColor(UIInput.Key.L3, new Color(0f, 0.7f, 0f));
|
||||
|
||||
return orig_initMovie();
|
||||
}
|
||||
|
||||
public extern void orig_exitMovie();
|
||||
public new void exitMovie() {
|
||||
orig_exitMovie();
|
||||
|
||||
UIInput instance = Singleton<UIInput>.instance;
|
||||
instance.setLedColor(UIInput.Key.L2, Color.black);
|
||||
instance.setLedColor(UIInput.Key.L3, Color.black);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user