Skip to content

Commit

Permalink
[F] jacketAsMovie incorrect sprite size (#29)
Browse files Browse the repository at this point in the history
* fix jacketAsMovie incorrect sprite size

* improve jacketAsMovie

* add static value
  • Loading branch information
ck2739046 authored Feb 7, 2025
1 parent 35bf9a6 commit 0f8afd7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions AquaMai.Mods/GameSystem/Assets/MovieLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ 用封面作为背景 PV
private static readonly string movieAssetsDir = "LocalAssets";

private static readonly Dictionary<string, string> optionFileMap = [];
private static bool[] isLoadingJacket = [false, false];

[HarmonyPrefix]
[HarmonyPatch(typeof(DataManager), "LoadMusicBase")]
Expand Down Expand Up @@ -147,6 +148,27 @@ public static void LoadLocalBgaAwake(GameObject ____movieMaskObj, int ___monitor
{
sprite.sprite = Sprite.Create(jacket, new Rect(0, 0, jacket.width, jacket.height), new Vector2(0.5f, 0.5f));
sprite.material = new Material(Shader.Find("Sprites/Default"));
isLoadingJacket = [true, true];
}
}

[HarmonyPostfix]
[HarmonyPatch(typeof(MovieController), "GetMovieHeight")]
public static void GetMovieHeightPostfix(ref uint __result)
{
if (isLoadingJacket[0]) {
__result = 1080;
isLoadingJacket[0] = false;
}
}

[HarmonyPostfix]
[HarmonyPatch(typeof(MovieController), "GetMovieWidth")]
public static void GetMovieWidthPostfix(ref uint __result)
{
if (isLoadingJacket[1]) {
__result = 1080;
isLoadingJacket[1] = false;
}
}

Expand Down

0 comments on commit 0f8afd7

Please sign in to comment.