1
0
forked from akanyan/mu3-mods

fix: various fixes

This commit is contained in:
2024-07-12 08:14:06 +09:00
parent 26fffefbae
commit c349854cb0
9 changed files with 87 additions and 22 deletions

View File

@ -4,18 +4,31 @@ namespace MU3.Sys;
class patch_Config: Config {
public extern void orig_initialize();
public int framerate { get; private set; }
public bool isVsync { get; private set; }
public new void initialize() {
orig_initialize();
using IniFile iniFile = new("mu3.ini");
if(iniFile.getIntValue("Video", "VSync", 0) != 0) {
framerate = iniFile.getIntValue("Video", "Framerate", -1);
isVsync = iniFile.getValue("Video", "VSync", false);
if(isVsync) {
QualitySettings.vSyncCount = 1;
framerate = -1;
Debug.Log("[UnlockFrameRate] VSync on");
} else {
Application.targetFrameRate = iniFile.getIntValue("Video", "Framerate", 60);
Debug.Log("[UnlockFrameRate] Framerate lock: " + Application.targetFrameRate);
Application.targetFrameRate = framerate;
QualitySettings.vSyncCount = 0;
if(framerate == 60) {
Debug.Log("[UnlockFrameRate] Framerate locked to 60 (vanilla)");
} else if(framerate == -1) {
Debug.Log("[UnlockFrameRate] Framerate unlocked)");
} else {
Debug.Log("[UnlockFrameRate] Framerate locked to " + framerate);
}
}
}
}