Skip to content

Commit

Permalink
修改 统一GUI文本样式
Browse files Browse the repository at this point in the history
  • Loading branch information
WYH2004-MC committed Oct 13, 2024
1 parent 5bf972e commit f46b347
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 30 deletions.
4 changes: 2 additions & 2 deletions BuildInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SinmaiAssist {
public static partial class BuildInfo {
public const string CommitHash = "f1733f1";
public const string BuildDate = "2024-10-13T14:48:04.5384536+08:00";
public const string CommitHash = "5bf972e";
public const string BuildDate = "2024-10-13T16:13:38.0560559+08:00";
}
}
2 changes: 1 addition & 1 deletion GUI/AutoPlayPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class AutoPlayPanel
{
public static void OnGUI()
{
GUILayout.Label($"Mode: {AutoPlay.autoPlayMode}");
GUILayout.Label($"Mode: {AutoPlay.autoPlayMode}", MainGUI.Style.Text);
AutoPlay.DisableUpdate = GUILayout.Toggle(AutoPlay.DisableUpdate, "Disable Mode Update");
if (GUILayout.Button("Critical (AP+)")) AutoPlay.autoPlayMode = AutoPlay.AutoPlayMode.Critical;
if (GUILayout.Button("Perfect")) AutoPlay.autoPlayMode = AutoPlay.AutoPlayMode.Perfect;
Expand Down
6 changes: 3 additions & 3 deletions GUI/ChartTimerPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public static void OnGUI()
GUIStyle buttonStyle = new GUIStyle(UnityEngine.GUI.skin.button) { fontSize = 24 };
ChartTimer.ButtonStatus = ChartTimer.Button.None;
Manager.NotesManager notesManager = new Manager.NotesManager();
GUILayout.Label($"Timer Status: {(notesManager.IsPlaying() ? (ChartTimer.IsPlaying ? "Playing" : "Paused") : "Not Play")}");
GUILayout.Label($"Timer:", new GUIStyle(UnityEngine.GUI.skin.label) { fontSize = 20 });
GUILayout.Label($"Timer Status: {(notesManager.IsPlaying() ? (ChartTimer.IsPlaying ? "Playing" : "Paused") : "Not Play")}", MainGUI.Style.Text);
GUILayout.Label($"Timer:", new GUIStyle(MainGUI.Style.Text) { fontSize = 20 });
GUILayout.Label($"{ChartTimer.Timer.ToString("0000000.0000")}", new GUIStyle(MainGUI.Style.Title) { fontSize = 20 });
if (GUILayout.Button($"{(ChartTimer.IsPlaying ? "Pause" : "Play")}", buttonStyle, GUILayout.Height(45f))) ChartTimer.ButtonStatus = ChartTimer.Button.Pause;
GUILayout.BeginHorizontal();
Expand All @@ -25,7 +25,7 @@ public static void OnGUI()
if (GUILayout.Button("Reset", buttonStyle, GUILayout.Height(45f))) ChartTimer.ButtonStatus = ChartTimer.Button.Reset;
GUILayout.Label(
"While paused, you can use the LeftArrow and RightArrow keys to perform small range fast forward or rewind.",
new GUIStyle(UnityEngine.GUI.skin.label)
new GUIStyle(MainGUI.Style.Text)
{
fontSize = 12,
wordWrap = true
Expand Down
13 changes: 3 additions & 10 deletions GUI/DebugPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,16 @@ namespace SinmaiAssist.GUI;

public class DebugPanel
{
private static readonly GUIStyle MiddleStyle = new GUIStyle()
{
fontSize = 12,
normal = new GUIStyleState() { textColor = Color.white },
alignment = TextAnchor.MiddleCenter
};

public static void OnGUI()
{
GUILayout.Label($"Throw Exception Test", MiddleStyle);
GUILayout.Label($"Throw Exception Test", MainGUI.Style.Title);
if (GUILayout.Button("NullReferenceException"))
{
GameObject obj = null;
obj.SetActive(true);
}
if (GUILayout.Button("InvalidCastException")) throw new InvalidCastException("Debug");
GUILayout.Label($"Test Tools", MiddleStyle);
GUILayout.Label($"Test Tools", MainGUI.Style.Title);
if (GUILayout.Button("TouchArea Display")) Common.InputManager.TouchAreaDisplayButton = true;
if (GUILayout.Button("Send Test Message"))
{
Expand All @@ -34,7 +27,7 @@ public static void OnGUI()
if (GUILayout.Button("Save P1 Option To DefaultOption")) Common.ChangeDefaultOption.SaveOptionFile(0L);
if (GUILayout.Button("Save P2 Option To DefaultOption")) Common.ChangeDefaultOption.SaveOptionFile(1L);
if (GUILayout.Button("↑ ↓ ↑ ↓")) SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, 1);
GUILayout.Label($"GUI Toggle", MiddleStyle);
GUILayout.Label($"GUI Toggle", MainGUI.Style.Title);
if (GUILayout.Button("Toggle Show Info")) SinmaiAssist.config.ModSetting.ShowInfo = !SinmaiAssist.config.ModSetting.ShowInfo;
if (GUILayout.Button("Toggle Show FPS")) SinmaiAssist.config.Common.ShowFPS = !SinmaiAssist.config.Common.ShowFPS;
}
Expand Down
6 changes: 3 additions & 3 deletions GUI/DummyLoginPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ public class DummyLoginPanel

public static void OnGUI()
{
GUILayout.Label(SinmaiAssist.IsSDGB?"QrCode:":"AccessCode:");
GUILayout.Label(SinmaiAssist.IsSDGB?"QrCode:":"AccessCode:", MainGUI.Style.Text);
DummyLoginCode = GUILayout.TextArea(DummyLoginCode, GUILayout.Height(100f));
if (GUILayout.Button(SinmaiAssist.IsSDGB?"QrCode Login":"AccessCode Login"))
{
CodeLoginFlag = true;
if (!SinmaiAssist.IsSDGB) DummyAimeLogin.ReadCard();
}
GUILayout.Label("UserID:");
GUILayout.Label("UserID:", MainGUI.Style.Text);
DummyUserId = GUILayout.TextField(DummyUserId, GUILayout.Height(20f));
if (GUILayout.Button("UserId Login"))
{
UserIdLoginFlag = true;
if (!SinmaiAssist.IsSDGB) DummyAimeLogin.ReadCard("12312312312312312312", DummyLoginCode);
}
GUILayout.Label($"AMDaemon BootTime: {AMDaemon.Allnet.Auth.AuthTime}");
GUILayout.Label($"AMDaemon BootTime: {AMDaemon.Allnet.Auth.AuthTime}", MainGUI.Style.Text);
if (GUILayout.Button("UserId Logout"))
{
PacketHelper.StartPacket(new UserLogout(ulong.Parse(DummyUserId), AMDaemon.Allnet.Auth.AuthTime, "", LogoutComplete,LogoutFailed));
Expand Down
6 changes: 3 additions & 3 deletions GUI/FastSkipPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ public class FastSkipPanel
public static void OnGUI()
{
FastSkip.SkipButton = false;
GUILayout.Label($"Skip Mode: {(FastSkip.CustomSkip ? "Custom" : "Default")}");
GUILayout.Label($"Skip Mode: {(FastSkip.CustomSkip ? "Custom" : "Default")}", MainGUI.Style.Text);
if (GUILayout.Button("Skip", new GUIStyle(UnityEngine.GUI.skin.button){ fontSize=20 }, GUILayout.Height(45f))) FastSkip.SkipButton = true;
GUILayout.Label($"Mode Setting", MainGUI.Style.Title);
if (GUILayout.Button("Default")) FastSkip.CustomSkip = false;
if (GUILayout.Button("Custom")) FastSkip.CustomSkip = true;
if (FastSkip.CustomSkip)
{
GUILayout.Label($"Custom Setting", MainGUI.Style.Title);
GUILayout.Label($"Custom Score(0 - 101): ");
GUILayout.Label($"Custom Score(0 - 101): ", MainGUI.Style.Text);
_scoreInput = GUILayout.TextField(_scoreInput);
if (int.TryParse(_scoreInput, out int scoreValue))
{
if (scoreValue >= 0f && scoreValue <= 101f)
{
FastSkip.CustomAchivement = scoreValue;
GUILayout.Label($"Custom Score: {scoreValue} %");
GUILayout.Label($"Custom Score: {scoreValue} %", MainGUI.Style.Text);
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions GUI/GraphicPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public static void OnGUI()
GUILayout.Label($"Custom Graphic Settings", MainGUI.Style.Title);
GUILayout.BeginHorizontal();
GUILayout.BeginVertical();
GUILayout.Label($"Width:");
GUILayout.Label($"Width:", MainGUI.Style.Text);
screenWidth = GUILayout.TextField(screenWidth);
GUILayout.EndVertical();
GUILayout.BeginVertical();
GUILayout.Label($"Height:");
GUILayout.Label($"Height:", MainGUI.Style.Text);
screenHeight = GUILayout.TextField(screenHeight);
GUILayout.EndVertical();
GUILayout.BeginVertical();
GUILayout.Label($"Max FPS (Unlimited is -1):");
GUILayout.Label($"Max FPS (Unlimited is -1):", MainGUI.Style.Text);
frameRate = GUILayout.TextField(frameRate);
GUILayout.EndVertical();
GUILayout.EndHorizontal();
Expand Down
12 changes: 12 additions & 0 deletions GUI/Style.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,16 @@ public class Style
{
normal = new GUIStyleState() { textColor = Color.red }
};

public GUIStyle Text
{
get
{
return new GUIStyle(UnityEngine.GUI.skin.label)
{
fontSize = 12,
alignment = TextAnchor.MiddleLeft
};
}
}
}
10 changes: 5 additions & 5 deletions GUI/UserDataPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private enum CollectionType

public static void OnGUI()
{
GUILayout.Label($"User Info:");
GUILayout.Label($"User Info", MainGUI.Style.Title);
try
{
_player1 = Singleton<UserDataManager>.Instance.GetUserData(0);
Expand All @@ -37,15 +37,15 @@ public static void OnGUI()
{
// ignore
}
GUILayout.Label($"1P: {_player1.Detail.UserName} ({_player1.Detail.UserID})");
GUILayout.Label($"2P: {_player2.Detail.UserName} ({_player2.Detail.UserID})");
GUILayout.Label($"1P: {_player1.Detail.UserName} ({_player1.Detail.UserID})", MainGUI.Style.Text);
GUILayout.Label($"2P: {_player2.Detail.UserName} ({_player2.Detail.UserID})", MainGUI.Style.Text);

GUILayout.Label("Add Collections", MainGUI.Style.Title);
foreach (CollectionType type in Enum.GetValues(typeof(CollectionType)))
{
GUILayout.BeginHorizontal();
int typeId = (int)type;
GUILayout.Label(type.ToString(), new GUIStyle(UnityEngine.GUI.skin.label){fixedWidth = 50});
GUILayout.Label(type.ToString(), new GUIStyle(MainGUI.Style.Text){fixedWidth = 50});
_userInputId[typeId] = GUILayout.TextField(_userInputId[typeId]);
if (GUILayout.Button("Add", new GUIStyle(UnityEngine.GUI.skin.button){ fixedWidth = 50}))
{
Expand All @@ -57,7 +57,7 @@ public static void OnGUI()

GUILayout.Label("Unlock Music", MainGUI.Style.Title);
GUILayout.BeginHorizontal();
GUILayout.Label("Music", new GUIStyle(UnityEngine.GUI.skin.label){fixedWidth = 50});
GUILayout.Label("Music", new GUIStyle(MainGUI.Style.Text){fixedWidth = 50});
_userInputId[0] = GUILayout.TextField(_userInputId[0]);
if (GUILayout.Button("Add", new GUIStyle(UnityEngine.GUI.skin.button){ fixedWidth = 50}))
{
Expand Down

0 comments on commit f46b347

Please sign in to comment.