mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-10-25 12:02:40 +00:00
[+] Port SelectionDetail
This commit is contained in:
parent
e8307cdcd9
commit
8fa356242e
@ -279,6 +279,9 @@
|
||||
<Reference Include="UnityEngine.XRModule">
|
||||
<HintPath>Libs\UnityEngine.XRModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UrGUI">
|
||||
<HintPath>Libs\UrGUI.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Cheat\DebugFeature.cs" />
|
||||
@ -311,6 +314,7 @@
|
||||
<Compile Include="UX\QuickSkip.cs" />
|
||||
<Compile Include="UX\RandomBgm.cs" />
|
||||
<Compile Include="UX\RunCommandOnEvents.cs" />
|
||||
<Compile Include="UX\SelectionDetail.cs" />
|
||||
<Compile Include="UX\SinglePlayer.cs" />
|
||||
<Compile Include="UX\SkipEventInfo.cs" />
|
||||
<Compile Include="UX\SkipWarningScreen.cs" />
|
||||
|
||||
@ -54,6 +54,8 @@ CustomPlaceName=""
|
||||
# In the song selection screen, press the Service button or the "7" key (the round button in the middle of the arrow keys in the default ADX firmware) to toggle the display of self-made charts.
|
||||
# A directory is considered to contain self-made charts if it does not have DataConfig.xml or OfficialChartsMark.txt in the Axxx directory.
|
||||
HideSelfMadeCharts=true
|
||||
# Show detail of selected song in music selection screen
|
||||
SelectionDetail=true
|
||||
|
||||
[Performance]
|
||||
# Disable some useless delays to speed up the game boot process
|
||||
|
||||
@ -60,6 +60,8 @@ CustomPlaceName=""
|
||||
# 选歌界面按下 Service 键或者键盘上的 “7” 键(ADX 默认固件下箭头键中间的圆形按键)切换自制谱的显示和隐藏
|
||||
# 是否是自制谱的判断方式是 Axxx 目录里没有 DataConfig.xml 或 OfficialChartsMark.txt 就认为这个目录里是自制谱
|
||||
HideSelfMadeCharts=true
|
||||
# 选歌界面显示选择的歌曲的详情
|
||||
SelectionDetail=true
|
||||
|
||||
# ===================================
|
||||
# 一些性能优化
|
||||
|
||||
@ -34,6 +34,7 @@ namespace AquaMai
|
||||
public bool LoadLocalBga { get; set; }
|
||||
public bool TestProof { get; set; }
|
||||
public bool HideSelfMadeCharts { get; set; }
|
||||
public bool SelectionDetail { get; set; }
|
||||
public string CustomVersionString { get; set; }
|
||||
public string CustomPlaceName { get; set; }
|
||||
public string ExecOnIdle { get; set; }
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ILMerge>
|
||||
<IncludeAssemblies>tomlet</IncludeAssemblies>
|
||||
<IncludeAssemblies>tomlet|urgui</IncludeAssemblies>
|
||||
<NamespacePrefix>$AquaMai$_</NamespacePrefix>
|
||||
</ILMerge>
|
||||
</Weavers>
|
||||
</Weavers>
|
||||
|
||||
BIN
AquaMai/Libs/UrGUI.dll
Normal file
BIN
AquaMai/Libs/UrGUI.dll
Normal file
Binary file not shown.
83
AquaMai/UX/SelectionDetail.cs
Normal file
83
AquaMai/UX/SelectionDetail.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using System.Linq;
|
||||
using AquaMai.Helpers;
|
||||
using HarmonyLib;
|
||||
using MAI2.Util;
|
||||
using Manager;
|
||||
using Manager.MaiStudio;
|
||||
using Manager.UserDatas;
|
||||
using Monitor;
|
||||
using Process;
|
||||
using UnityEngine;
|
||||
using UrGUI.GUIWindow;
|
||||
|
||||
namespace AquaMai.UX;
|
||||
|
||||
public class SelectionDetail
|
||||
{
|
||||
private static Window window;
|
||||
public static MusicSelectProcess.MusicSelectData SelectData { get; private set; }
|
||||
public static int Difficulty { get; private set; }
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(MusicSelectMonitor), "UpdateRivalScore")]
|
||||
public static void ScrollUpdate(MusicSelectProcess ____musicSelect, MusicSelectMonitor __instance)
|
||||
{
|
||||
if (__instance != ____musicSelect.MonitorArray[0]) return;
|
||||
if (window != null)
|
||||
{
|
||||
window.Close();
|
||||
}
|
||||
|
||||
if (____musicSelect.IsRandomIndex()) return;
|
||||
|
||||
SelectData = ____musicSelect.GetMusic(0);
|
||||
if (SelectData == null) return;
|
||||
Difficulty = ____musicSelect.GetDifficulty(0);
|
||||
|
||||
window = __instance.gameObject.AddComponent<Window>();
|
||||
}
|
||||
|
||||
public class Window : MonoBehaviour
|
||||
{
|
||||
private GUIWindow window;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
window = GUIWindow.Begin($"ID: {SelectData.MusicData.name.id}", Screen.width / 2f - 100, Screen.height * 0.87f, 200, 50, 10, 22, 5, true, true, true);
|
||||
window.Label(MusicDirHelper.LookupPath(SelectData.MusicData.name.id).Split('/').Reverse().ToArray()[3]);
|
||||
window.Label(SelectData.MusicData.genreName?.str);
|
||||
window.Label(SelectData.MusicData.AddVersion?.str);
|
||||
window.Label($"{SelectData.MusicData.notesData[Difficulty]?.level}.{SelectData.MusicData.notesData[Difficulty]?.levelDecimal}");
|
||||
|
||||
var rate = CalcB50(SelectData.MusicData);
|
||||
if (rate > 0)
|
||||
{
|
||||
window.Label($"SSS+ => DXRating += {rate}");
|
||||
}
|
||||
}
|
||||
|
||||
private uint CalcB50(MusicData musicData)
|
||||
{
|
||||
var newRate = new UserRate(musicData.name.id, Difficulty, 1010000, (uint)musicData.version);
|
||||
var user = Singleton<UserDataManager>.Instance.GetUserData(0);
|
||||
var userLowRate = (newRate.OldFlag ? user.RatingList.RatingList : user.RatingList.NewRatingList).Last();
|
||||
|
||||
if (newRate.SingleRate > userLowRate.SingleRate)
|
||||
{
|
||||
return newRate.SingleRate - userLowRate.SingleRate;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
window.Draw();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Destroy(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user