mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-10-26 04:22:38 +00:00
[+] CustomLogo
This commit is contained in:
parent
7e5467935b
commit
d84b2f3870
@ -338,6 +338,7 @@ DEBUG</DefineConstants>
|
||||
<Compile Include="Utils\SelectionDetail.cs" />
|
||||
<Compile Include="Utils\ShowNetErrorDetail.cs" />
|
||||
<Compile Include="UX\CustomFont.cs" />
|
||||
<Compile Include="UX\CustomLogo.cs" />
|
||||
<Compile Include="UX\CustomNoteSkin.cs" />
|
||||
<Compile Include="UX\CustomPlaceName.cs" />
|
||||
<Compile Include="UX\CustomVersionString.cs" />
|
||||
|
||||
@ -164,6 +164,7 @@ namespace AquaMai
|
||||
Patch(typeof(CustomVersionString));
|
||||
Patch(typeof(CustomPlaceName));
|
||||
Patch(typeof(RunCommandOnEvents));
|
||||
Patch(typeof(CustomLogo));
|
||||
// Utils
|
||||
Patch(typeof(JudgeAdjust));
|
||||
# if DEBUG
|
||||
|
||||
57
AquaMai/UX/CustomLogo.cs
Normal file
57
AquaMai/UX/CustomLogo.cs
Normal file
@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using HarmonyLib;
|
||||
using Monitor;
|
||||
using Process;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace AquaMai.UX;
|
||||
|
||||
public class CustomLogo
|
||||
{
|
||||
private static List<Sprite> segaLogo = new();
|
||||
private static List<Sprite> allNetLogo = new();
|
||||
|
||||
public static void DoCustomPatch(HarmonyLib.Harmony h)
|
||||
{
|
||||
EnumSprite(segaLogo, Path.Combine(Environment.CurrentDirectory, "LocalAssets", "SegaLogo"));
|
||||
EnumSprite(allNetLogo, Path.Combine(Environment.CurrentDirectory, "LocalAssets", "AllNetLogo"));
|
||||
}
|
||||
|
||||
private static void EnumSprite(List<Sprite> collection, string path)
|
||||
{
|
||||
if (!Directory.Exists(path)) return;
|
||||
foreach (var file in Directory.EnumerateFiles(path, "*.png"))
|
||||
{
|
||||
var data = File.ReadAllBytes(file);
|
||||
var texture2D = new Texture2D(1, 1, TextureFormat.RGBA32, false);
|
||||
if (texture2D.LoadImage(data))
|
||||
{
|
||||
collection.Add(Sprite.Create(texture2D, new Rect(0f, 0f, texture2D.width, texture2D.height), new Vector2(0.5f, 0.5f)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(AdvertiseProcess), "OnStart")]
|
||||
[HarmonyPostfix]
|
||||
private static void AdvProcessPostFix(AdvertiseMonitor[] ____monitors)
|
||||
{
|
||||
if (segaLogo.Count > 0)
|
||||
{
|
||||
foreach (var monitor in ____monitors)
|
||||
{
|
||||
monitor.transform.Find("Canvas/Main/SegaAllNet_LOGO/NUL_ADT_SegaAllNet_LOGO/SegaLogo").GetComponent<Image>().sprite = segaLogo[UnityEngine.Random.Range(0, segaLogo.Count)];
|
||||
}
|
||||
}
|
||||
|
||||
if (allNetLogo.Count > 0)
|
||||
{
|
||||
foreach (var monitor in ____monitors)
|
||||
{
|
||||
monitor.transform.Find("Canvas/Main/SegaAllNet_LOGO/NUL_ADT_SegaAllNet_LOGO/AllNetLogo").GetComponent<Image>().sprite = (allNetLogo[UnityEngine.Random.Range(0, allNetLogo.Count)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,6 @@ namespace AquaMai.UX
|
||||
public class RandomBgm
|
||||
{
|
||||
private static List<string> _acbs = new List<string>();
|
||||
private static Random _rng = new Random();
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(SoundManager), "Initialize")]
|
||||
@ -43,7 +42,7 @@ namespace AquaMai.UX
|
||||
case Cue.BGM_COLLECTION:
|
||||
case Cue.BGM_RESULT_CLEAR:
|
||||
case Cue.BGM_RESULT:
|
||||
var acb = _acbs[_rng.Next(_acbs.Count)];
|
||||
var acb = _acbs[UnityEngine.Random.Range(0, _acbs.Count)];
|
||||
acbID = SoundManager.AcbID.Max;
|
||||
var result = Singleton<SoundCtrl>.Instance.LoadCueSheet((int)acbID, acb);
|
||||
MelonLogger.Msg($"Picked {acb} for {cueIndex}, result: {result}");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user