1
0
forked from akanyan/mu3-mods

feat: various enhancements

* AttractVideoPlayer,LoadBoost: allow setting a cache directory
* AttractVideoPlayer: color leds
* BetterGiveUp: prevent multiple restarts in a row
* use GetTriggerOn in general where applicable
This commit is contained in:
2024-07-23 01:45:36 +09:00
parent 8cbc7e8b86
commit 4ad595f6c3
10 changed files with 109 additions and 76 deletions

View File

@ -13,6 +13,7 @@ class patch_PlayMusic: PlayMusic {
public static bool QuickSkip = false;
private GameEngine _gameEngine;
private SessionInfo _sessionInfo;
private bool _pressedYellow;
private bool _isRolling;
private float _totalRollingFrame;
private DateTime _rollingStartTime;
@ -30,11 +31,13 @@ class patch_PlayMusic: PlayMusic {
return min + (max - min) * Math.Pow(progress, 2.0);
}
private static bool IsHolding() {
return Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuLeft) ^ Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuRight);
private bool IsHolding() {
return Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuLeft)
^ (_pressedYellow && Singleton<UIInput>.instance.getStateOn(UIInput.Key.MenuRight));
}
private void StartRolling() {
_pressedYellow = false;
_isRolling = true;
_totalRollingFrame = ntMgr.getCurrentFrame();
_rollingStartTime = CustomDateTime.Now;
@ -60,6 +63,9 @@ class patch_PlayMusic: PlayMusic {
}
private void Execute_Play() {
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuRight)) {
_pressedYellow = true;
}
if(_isRolling) {
TimeSpan timeSpan = CustomDateTime.Now - _rollingStartTime;
if(timeSpan <= ROLL_DURATION) {