Skip to content

Commit

Permalink
[O] Make HideMask separate component
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Oct 2, 2024
1 parent 1bcb721 commit bae5a7c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions AquaMai/AquaMai.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ DEBUG</DefineConstants>
<Compile Include="UX\CustomVersionString.cs" />
<Compile Include="UX\DemoMaster.cs" />
<Compile Include="UX\ExtendTimer.cs" />
<Compile Include="UX\HideMask.cs" />
<Compile Include="UX\HideSelfMadeCharts.cs" />
<Compile Include="UX\ImmediateSave.cs" />
<Compile Include="UX\LoadAssetsPng.cs" />
Expand Down
2 changes: 2 additions & 0 deletions AquaMai/AquaMai.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ UnlockUtage=true
[UX]
# Single player: Show 1P only, at the center of the screen
SinglePlayer=true
# Remove the circle mask in the game
HideMask=true
# Set the version string displayed at the top-right corner of the screen
CustomVersionString=""
# Deprecated: Use `LoadAssetsPng` instead
Expand Down
2 changes: 2 additions & 0 deletions AquaMai/AquaMai.zh.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ UnlockUtage=true
[UX]
# 单人模式,不显示 2P
SinglePlayer=true
# 移除遮罩
HideMask=true
# 把右上角的版本更改为自定义文本
CustomVersionString=""
# 已弃用,请使用 LoadAssetsPng
Expand Down
1 change: 1 addition & 0 deletions AquaMai/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class UXConfig
{
public string Locale { get; set; }
public bool SinglePlayer { get; set; }
public bool HideMask { get; set; }
public bool LoadAssetsPng { get; set; }
public bool LoadJacketPng { get; set; }
public bool LoadAssetBundleWithoutManifest { get; set; }
Expand Down
14 changes: 14 additions & 0 deletions AquaMai/UX/HideMask.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using HarmonyLib;
using UnityEngine;

namespace AquaMai.UX;

public class HideMask
{
[HarmonyPrefix]
[HarmonyPatch(typeof(Main.GameMain), "LateInitialize", typeof(MonoBehaviour), typeof(Transform), typeof(Transform))]
public static void LateInitialize(MonoBehaviour gameMainObject)
{
GameObject.Find("Mask").SetActive(false);
}
}
7 changes: 2 additions & 5 deletions AquaMai/UX/SinglePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ public class SinglePlayer
{
[HarmonyPrefix]
[HarmonyPatch(typeof(Main.GameMain), "LateInitialize", new Type[] { typeof(MonoBehaviour), typeof(Transform), typeof(Transform) })]
public static bool LateInitialize(MonoBehaviour gameMainObject, ref Transform left, ref Transform right)
public static void LateInitialize(MonoBehaviour gameMainObject, ref Transform left, ref Transform right)
{
left.transform.position = Vector3.zero;
right.localScale = Vector3.zero;
GameObject.Find("Mask").SetActive(false);

return true;
}

[HarmonyPrefix]
Expand Down Expand Up @@ -55,4 +52,4 @@ public static bool WaitPartnerPreOpen()
return false;
}
}
}
}

0 comments on commit bae5a7c

Please sign in to comment.