mirror of https://github.com/hykilpikonna/AquaDX
[+] FrameRate lock + display
parent
9ead7a413e
commit
c15dcf6b98
|
@ -290,6 +290,8 @@ DEBUG</DefineConstants>
|
||||||
<Compile Include="Cheat\TicketUnlock.cs" />
|
<Compile Include="Cheat\TicketUnlock.cs" />
|
||||||
<Compile Include="Cheat\UnlockUtage.cs" />
|
<Compile Include="Cheat\UnlockUtage.cs" />
|
||||||
<Compile Include="Config.cs" />
|
<Compile Include="Config.cs" />
|
||||||
|
<Compile Include="CustomKeyMap\Enable.cs" />
|
||||||
|
<Compile Include="CustomKeyMap\KeyCodeID.cs" />
|
||||||
<Compile Include="Fix\BasicFix.cs" />
|
<Compile Include="Fix\BasicFix.cs" />
|
||||||
<Compile Include="Fix\DebugFeature.cs" />
|
<Compile Include="Fix\DebugFeature.cs" />
|
||||||
<Compile Include="Fix\DisableReboot.cs" />
|
<Compile Include="Fix\DisableReboot.cs" />
|
||||||
|
@ -299,6 +301,7 @@ DEBUG</DefineConstants>
|
||||||
<Compile Include="Fix\ForceAsServer.cs" />
|
<Compile Include="Fix\ForceAsServer.cs" />
|
||||||
<Compile Include="Fix\ForceFreePlay.cs" />
|
<Compile Include="Fix\ForceFreePlay.cs" />
|
||||||
<Compile Include="Fix\ForcePaidPlay.cs" />
|
<Compile Include="Fix\ForcePaidPlay.cs" />
|
||||||
|
<Compile Include="Fix\FrameRateLock.cs" />
|
||||||
<Compile Include="Fix\I18nSingleAssemblyHook.cs" />
|
<Compile Include="Fix\I18nSingleAssemblyHook.cs" />
|
||||||
<Compile Include="Fix\RemoveEncryption.cs" />
|
<Compile Include="Fix\RemoveEncryption.cs" />
|
||||||
<Compile Include="Fix\SkipVersionCheck.cs" />
|
<Compile Include="Fix\SkipVersionCheck.cs" />
|
||||||
|
@ -321,6 +324,7 @@ DEBUG</DefineConstants>
|
||||||
<Compile Include="TimeSaving\SkipTrackStart.cs" />
|
<Compile Include="TimeSaving\SkipTrackStart.cs" />
|
||||||
<Compile Include="TimeSaving\SkipWarningScreen.cs" />
|
<Compile Include="TimeSaving\SkipWarningScreen.cs" />
|
||||||
<Compile Include="TouchSensitivity\Enable.cs" />
|
<Compile Include="TouchSensitivity\Enable.cs" />
|
||||||
|
<Compile Include="Utils\FrameRateDisplay.cs" />
|
||||||
<Compile Include="Utils\JudgeAdjust.cs" />
|
<Compile Include="Utils\JudgeAdjust.cs" />
|
||||||
<Compile Include="Utils\LogNetworkErrors.cs" />
|
<Compile Include="Utils\LogNetworkErrors.cs" />
|
||||||
<Compile Include="Utils\LogUserId.cs" />
|
<Compile Include="Utils\LogUserId.cs" />
|
||||||
|
|
|
@ -60,6 +60,8 @@ ForceFreePlay=true
|
||||||
ForcePaidPlay=false
|
ForcePaidPlay=false
|
||||||
# Add notes sprite to the pool to prevent use up
|
# Add notes sprite to the pool to prevent use up
|
||||||
ExtendNotesPool=128
|
ExtendNotesPool=128
|
||||||
|
# Force the frame rate limit to 60 FPS and disable vSync. Do not use if your game has no issues
|
||||||
|
FrameRateLock=false
|
||||||
|
|
||||||
[Utils]
|
[Utils]
|
||||||
# Log user ID on login
|
# Log user ID on login
|
||||||
|
@ -78,6 +80,8 @@ Width=0
|
||||||
Height=0
|
Height=0
|
||||||
# Show detail of selected song in music selection screen
|
# Show detail of selected song in music selection screen
|
||||||
SelectionDetail=true
|
SelectionDetail=true
|
||||||
|
# Display framerate
|
||||||
|
FrameRateDisplay=false
|
||||||
|
|
||||||
# ===================================
|
# ===================================
|
||||||
# Save some potentially unnecessary time
|
# Save some potentially unnecessary time
|
||||||
|
|
|
@ -76,6 +76,8 @@ ForceFreePlay=true
|
||||||
ForcePaidPlay=false
|
ForcePaidPlay=false
|
||||||
# 增加更多待命的音符贴图,防止奇怪的自制谱用完音符贴图池
|
# 增加更多待命的音符贴图,防止奇怪的自制谱用完音符贴图池
|
||||||
ExtendNotesPool=128
|
ExtendNotesPool=128
|
||||||
|
# 强制设置帧率上限为 60 帧并关闭垂直同步。如果你的游戏没有问题,请不要使用
|
||||||
|
FrameRateLock=false
|
||||||
|
|
||||||
[Utils]
|
[Utils]
|
||||||
# 登录时将 UserID 输出到日志
|
# 登录时将 UserID 输出到日志
|
||||||
|
@ -96,6 +98,8 @@ Height=0
|
||||||
SelectionDetail=true
|
SelectionDetail=true
|
||||||
# 出现灰网时显示原因
|
# 出现灰网时显示原因
|
||||||
ShowNetErrorDetail=true
|
ShowNetErrorDetail=true
|
||||||
|
# 显示帧率
|
||||||
|
FrameRateDisplay=false
|
||||||
|
|
||||||
# ===================================
|
# ===================================
|
||||||
# 节省一些不知道有用没用的时间
|
# 节省一些不知道有用没用的时间
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace AquaMai
|
||||||
public bool ForceFreePlay { get; set; } = true;
|
public bool ForceFreePlay { get; set; } = true;
|
||||||
public bool ForcePaidPlay { get; set; }
|
public bool ForcePaidPlay { get; set; }
|
||||||
public int ExtendNotesPool { get; set; }
|
public int ExtendNotesPool { get; set; }
|
||||||
|
public bool FrameRateLock { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UtilsConfig
|
public class UtilsConfig
|
||||||
|
@ -61,6 +62,7 @@ namespace AquaMai
|
||||||
public bool PractiseMode { get; set; }
|
public bool PractiseMode { get; set; }
|
||||||
public bool SelectionDetail { get; set; }
|
public bool SelectionDetail { get; set; }
|
||||||
public bool ShowNetErrorDetail { get; set; }
|
public bool ShowNetErrorDetail { get; set; }
|
||||||
|
public bool FrameRateDisplay { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TimeSavingConfig
|
public class TimeSavingConfig
|
||||||
|
@ -120,5 +122,11 @@ namespace AquaMai
|
||||||
public byte E7 { get; set; } = 20;
|
public byte E7 { get; set; } = 20;
|
||||||
public byte E8 { get; set; } = 20;
|
public byte E8 { get; set; } = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CustomKeyMapConfig
|
||||||
|
{
|
||||||
|
public bool Enable { get; set; }
|
||||||
|
public string[] KeyMap { get; set; } = new string[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace AquaMai.CustomKeyMap;
|
||||||
|
|
||||||
|
public class Enable
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,146 @@
|
||||||
|
namespace AquaMai.CustomKeyMap;
|
||||||
|
|
||||||
|
public enum KeyCodeID
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Backspace,
|
||||||
|
Tab,
|
||||||
|
Clear,
|
||||||
|
Return,
|
||||||
|
Pause,
|
||||||
|
Escape,
|
||||||
|
Space,
|
||||||
|
Exclaim,
|
||||||
|
DoubleQuote,
|
||||||
|
Hash,
|
||||||
|
Dollar,
|
||||||
|
Ampersand,
|
||||||
|
Quote,
|
||||||
|
LeftParen,
|
||||||
|
RightParen,
|
||||||
|
Asterisk,
|
||||||
|
Plus,
|
||||||
|
Comma,
|
||||||
|
Minus,
|
||||||
|
Period,
|
||||||
|
Slash,
|
||||||
|
Alpha0,
|
||||||
|
Alpha1,
|
||||||
|
Alpha2,
|
||||||
|
Alpha3,
|
||||||
|
Alpha4,
|
||||||
|
Alpha5,
|
||||||
|
Alpha6,
|
||||||
|
Alpha7,
|
||||||
|
Alpha8,
|
||||||
|
Alpha9,
|
||||||
|
Colon,
|
||||||
|
Semicolon,
|
||||||
|
Less,
|
||||||
|
Equals,
|
||||||
|
Greater,
|
||||||
|
Question,
|
||||||
|
At,
|
||||||
|
LeftBracket,
|
||||||
|
Backslash,
|
||||||
|
RightBracket,
|
||||||
|
Caret,
|
||||||
|
Underscore,
|
||||||
|
BackQuote,
|
||||||
|
A,
|
||||||
|
B,
|
||||||
|
C,
|
||||||
|
D,
|
||||||
|
E,
|
||||||
|
F,
|
||||||
|
G,
|
||||||
|
H,
|
||||||
|
I,
|
||||||
|
J,
|
||||||
|
K,
|
||||||
|
L,
|
||||||
|
M,
|
||||||
|
N,
|
||||||
|
O,
|
||||||
|
P,
|
||||||
|
Q,
|
||||||
|
R,
|
||||||
|
S,
|
||||||
|
T,
|
||||||
|
U,
|
||||||
|
V,
|
||||||
|
W,
|
||||||
|
X,
|
||||||
|
Y,
|
||||||
|
Z,
|
||||||
|
Delete,
|
||||||
|
Keypad0,
|
||||||
|
Keypad1,
|
||||||
|
Keypad2,
|
||||||
|
Keypad3,
|
||||||
|
Keypad4,
|
||||||
|
Keypad5,
|
||||||
|
Keypad6,
|
||||||
|
Keypad7,
|
||||||
|
Keypad8,
|
||||||
|
Keypad9,
|
||||||
|
KeypadPeriod,
|
||||||
|
KeypadDivide,
|
||||||
|
KeypadMultiply,
|
||||||
|
KeypadMinus,
|
||||||
|
KeypadPlus,
|
||||||
|
KeypadEnter,
|
||||||
|
KeypadEquals,
|
||||||
|
UpArrow,
|
||||||
|
DownArrow,
|
||||||
|
RightArrow,
|
||||||
|
LeftArrow,
|
||||||
|
Insert,
|
||||||
|
Home,
|
||||||
|
End,
|
||||||
|
PageUp,
|
||||||
|
PageDown,
|
||||||
|
F1,
|
||||||
|
F2,
|
||||||
|
F3,
|
||||||
|
F4,
|
||||||
|
F5,
|
||||||
|
F6,
|
||||||
|
F7,
|
||||||
|
F8,
|
||||||
|
F9,
|
||||||
|
F10,
|
||||||
|
F11,
|
||||||
|
F12,
|
||||||
|
F13,
|
||||||
|
F14,
|
||||||
|
F15,
|
||||||
|
Numlock,
|
||||||
|
CapsLock,
|
||||||
|
ScrollLock,
|
||||||
|
RightShift,
|
||||||
|
LeftShift,
|
||||||
|
RightControl,
|
||||||
|
LeftControl,
|
||||||
|
RightAlt,
|
||||||
|
LeftAlt,
|
||||||
|
RightCommand,
|
||||||
|
RightApple,
|
||||||
|
LeftCommand,
|
||||||
|
LeftApple,
|
||||||
|
LeftWindows,
|
||||||
|
RightWindows,
|
||||||
|
AltGr,
|
||||||
|
Help,
|
||||||
|
Print,
|
||||||
|
SysReq,
|
||||||
|
Break,
|
||||||
|
Menu,
|
||||||
|
Mouse0,
|
||||||
|
Mouse1,
|
||||||
|
Mouse2,
|
||||||
|
Mouse3,
|
||||||
|
Mouse4,
|
||||||
|
Mouse5,
|
||||||
|
Mouse6,
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AquaMai.Fix;
|
||||||
|
|
||||||
|
public class FrameRateLock
|
||||||
|
{
|
||||||
|
public static void DoCustomPatch(HarmonyLib.Harmony h)
|
||||||
|
{
|
||||||
|
Application.targetFrameRate = 60;
|
||||||
|
QualitySettings.vSyncCount = 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
using AquaMai.Helpers;
|
||||||
|
using HarmonyLib;
|
||||||
|
using Main;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AquaMai.Utils;
|
||||||
|
|
||||||
|
public class FrameRateDisplay
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(GameMainObject), "Awake")]
|
||||||
|
[HarmonyPostfix]
|
||||||
|
public static void ShowUi(GameMainObject __instance)
|
||||||
|
{
|
||||||
|
__instance.gameObject.AddComponent<Ui>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Ui : MonoBehaviour
|
||||||
|
{
|
||||||
|
private static float sampleTime = 1f;
|
||||||
|
private static int frame;
|
||||||
|
private static float time;
|
||||||
|
private static float fps;
|
||||||
|
|
||||||
|
public void OnGUI()
|
||||||
|
{
|
||||||
|
var labelStyle = GUI.skin.GetStyle("label");
|
||||||
|
labelStyle.fontSize = GuiSizes.FontSize;
|
||||||
|
labelStyle.alignment = TextAnchor.MiddleCenter;
|
||||||
|
|
||||||
|
const float x = 10f;
|
||||||
|
const float y = 10f;
|
||||||
|
var width = GuiSizes.FontSize * 7f;
|
||||||
|
var height = GuiSizes.LabelHeight * 1.5f;
|
||||||
|
|
||||||
|
frame += 1;
|
||||||
|
time += Time.deltaTime;
|
||||||
|
|
||||||
|
if (time >= sampleTime)
|
||||||
|
{
|
||||||
|
fps = frame / time;
|
||||||
|
frame = 0;
|
||||||
|
time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GUI.Box(new Rect(x, y, width, height), "");
|
||||||
|
GUI.Label(new Rect(x, y, width, height), $"{fps:0.0} FPS");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue