-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
233 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace AquaMai.CustomKeyMap; | ||
|
||
public class Enable | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
} | ||
} | ||
} |