mu3-mods/UnlockFrameRate/MU3.Notes/patch_NotesManager.cs
2024-07-12 08:14:06 +09:00

27 lines
732 B
C#

using MU3.Game;
using MU3.Sys;
using MU3.Util;
namespace MU3.Notes;
class patch_NotesManager: NotesManager {
private float _frame;
private float _frameReal;
private bool _altMode;
public extern void orig_initialize(SessionInfo sessionInfo);
public new void initialize(SessionInfo sessionInfo) {
orig_initialize(sessionInfo);
var cfg = (patch_Config)Singleton<Sys.System>.instance.config;
_altMode = cfg.isVsync || (cfg.framerate != 60);
}
private extern void orig_progressFrameAndFrameReal();
private void progressFrameAndFrameReal() {
if(_altMode) {
_frame = _frameReal;
} else {
orig_progressFrameAndFrameReal();
}
}
}