mirror of https://github.com/hykilpikonna/AquaDX
[+] Network error reason
parent
e39f013808
commit
e65d67f12e
|
@ -327,6 +327,7 @@ DEBUG</DefineConstants>
|
||||||
<Compile Include="Utils\PractiseMode.cs" />
|
<Compile Include="Utils\PractiseMode.cs" />
|
||||||
<Compile Include="Utils\PractiseModeUI.cs" />
|
<Compile Include="Utils\PractiseModeUI.cs" />
|
||||||
<Compile Include="Utils\SelectionDetail.cs" />
|
<Compile Include="Utils\SelectionDetail.cs" />
|
||||||
|
<Compile Include="Utils\ShowNetErrorDetail.cs" />
|
||||||
<Compile Include="Utils\WindowState.cs" />
|
<Compile Include="Utils\WindowState.cs" />
|
||||||
<Compile Include="UX\CustomPlaceName.cs" />
|
<Compile Include="UX\CustomPlaceName.cs" />
|
||||||
<Compile Include="UX\CustomVersionString.cs" />
|
<Compile Include="UX\CustomVersionString.cs" />
|
||||||
|
|
|
@ -96,6 +96,8 @@ IWontTapOrSlideVigorously=true
|
||||||
SkipGameOverScreen=true
|
SkipGameOverScreen=true
|
||||||
# Skip TrackStart screen
|
# Skip TrackStart screen
|
||||||
SkipTrackStart=true
|
SkipTrackStart=true
|
||||||
|
# Show reason when net icon is gray
|
||||||
|
ShowNetErrorDetail=true
|
||||||
|
|
||||||
[TouchSensitivity]
|
[TouchSensitivity]
|
||||||
# Enable custom sensitivity
|
# Enable custom sensitivity
|
||||||
|
|
|
@ -94,6 +94,8 @@ Width=0
|
||||||
Height=0
|
Height=0
|
||||||
# 选歌界面显示选择的歌曲的详情
|
# 选歌界面显示选择的歌曲的详情
|
||||||
SelectionDetail=true
|
SelectionDetail=true
|
||||||
|
# 出现灰网时显示原因
|
||||||
|
ShowNetErrorDetail=true
|
||||||
|
|
||||||
# ===================================
|
# ===================================
|
||||||
# 节省一些不知道有用没用的时间
|
# 节省一些不知道有用没用的时间
|
||||||
|
|
|
@ -62,6 +62,7 @@ namespace AquaMai
|
||||||
public int Height { get; set; }
|
public int Height { get; set; }
|
||||||
public bool PractiseMode { get; set; }
|
public bool PractiseMode { get; set; }
|
||||||
public bool SelectionDetail { get; set; }
|
public bool SelectionDetail { get; set; }
|
||||||
|
public bool ShowNetErrorDetail { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TimeSavingConfig
|
public class TimeSavingConfig
|
||||||
|
|
|
@ -174,8 +174,7 @@ namespace AquaMai
|
||||||
|
|
||||||
if (_hasErrors)
|
if (_hasErrors)
|
||||||
{
|
{
|
||||||
MelonLogger.Warning("========================================================================!!!");
|
MelonLogger.Warning("========================================================================!!!\n" + Locale.LoadError);
|
||||||
MelonLogger.Warning(Locale.LoadError);
|
|
||||||
MelonLogger.Warning("===========================================================================");
|
MelonLogger.Warning("===========================================================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,42 @@ namespace AquaMai.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Aime reader error.
|
||||||
|
/// </summary>
|
||||||
|
internal static string NetErrIsAliveAimeReader {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("NetErrIsAliveAimeReader", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Aime server error.
|
||||||
|
/// </summary>
|
||||||
|
internal static string NetErrIsAliveAimeServer {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("NetErrIsAliveAimeServer", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Server communication error.
|
||||||
|
/// </summary>
|
||||||
|
internal static string NetErrIsAliveServer {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("NetErrIsAliveServer", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Data download not success.
|
||||||
|
/// </summary>
|
||||||
|
internal static string NetErrWasDownloadSuccessOnce {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("NetErrWasDownloadSuccessOnce", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Pause.
|
/// Looks up a localized string similar to Pause.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -69,4 +69,16 @@
|
||||||
<data name="Loaded" xml:space="preserve">
|
<data name="Loaded" xml:space="preserve">
|
||||||
<value>Loaded!</value>
|
<value>Loaded!</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="NetErrIsAliveServer" xml:space="preserve">
|
||||||
|
<value>Server communication error</value>
|
||||||
|
</data>
|
||||||
|
<data name="NetErrIsAliveAimeReader" xml:space="preserve">
|
||||||
|
<value>Aime reader error</value>
|
||||||
|
</data>
|
||||||
|
<data name="NetErrIsAliveAimeServer" xml:space="preserve">
|
||||||
|
<value>Aime server error</value>
|
||||||
|
</data>
|
||||||
|
<data name="NetErrWasDownloadSuccessOnce" xml:space="preserve">
|
||||||
|
<value>Data download not success</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
|
@ -62,4 +62,16 @@
|
||||||
<data name="Loaded" xml:space="preserve">
|
<data name="Loaded" xml:space="preserve">
|
||||||
<value>加载完成!</value>
|
<value>加载完成!</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="NetErrIsAliveServer" xml:space="preserve">
|
||||||
|
<value>主服务器通信错误</value>
|
||||||
|
</data>
|
||||||
|
<data name="NetErrIsAliveAimeReader" xml:space="preserve">
|
||||||
|
<value>Aime 读卡器错误</value>
|
||||||
|
</data>
|
||||||
|
<data name="NetErrIsAliveAimeServer" xml:space="preserve">
|
||||||
|
<value>AimeDB 通信错误</value>
|
||||||
|
</data>
|
||||||
|
<data name="NetErrWasDownloadSuccessOnce" xml:space="preserve">
|
||||||
|
<value>数据下载不成功</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
|
@ -42,13 +42,10 @@ public class ImmediateSave
|
||||||
void CheckSaveDone()
|
void CheckSaveDone()
|
||||||
{
|
{
|
||||||
doneCount++;
|
doneCount++;
|
||||||
if (doneCount == 4)
|
if (doneCount != 4) return;
|
||||||
{
|
if (ui == null) return;
|
||||||
if (ui != null)
|
UnityEngine.Object.Destroy(ui);
|
||||||
{
|
ui = null;
|
||||||
UnityEngine.Object.Destroy(ui);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using AquaMai.Helpers;
|
||||||
|
using AquaMai.Resources;
|
||||||
|
using HarmonyLib;
|
||||||
|
using MAI2.Util;
|
||||||
|
using Manager;
|
||||||
|
using MelonLoader;
|
||||||
|
using Monitor;
|
||||||
|
using Process;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AquaMai.Utils;
|
||||||
|
|
||||||
|
public class ShowNetErrorDetail
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(CommonProcess), "OnStart")]
|
||||||
|
[HarmonyPostfix]
|
||||||
|
public static void SetIconStatus(CommonMonitor[] ____monitors)
|
||||||
|
{
|
||||||
|
____monitors[0].gameObject.AddComponent<DetailUi>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class DetailUi : MonoBehaviour
|
||||||
|
{
|
||||||
|
public void OnGUI()
|
||||||
|
{
|
||||||
|
var errors = new List<string>();
|
||||||
|
if (!Singleton<OperationManager>.Instance.IsAliveServer)
|
||||||
|
{
|
||||||
|
errors.Add(Locale.NetErrIsAliveServer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Singleton<OperationManager>.Instance.IsAliveAimeReader)
|
||||||
|
{
|
||||||
|
errors.Add(Locale.NetErrIsAliveAimeReader);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Singleton<OperationManager>.Instance.IsAliveAimeServer)
|
||||||
|
{
|
||||||
|
errors.Add(Locale.NetErrIsAliveAimeServer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Singleton<OperationManager>.Instance.WasDownloadSuccessOnce)
|
||||||
|
{
|
||||||
|
errors.Add(Locale.NetErrWasDownloadSuccessOnce);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (errors.Count == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var labelStyle = GUI.skin.GetStyle("label");
|
||||||
|
labelStyle.fontSize = GuiSizes.FontSize;
|
||||||
|
labelStyle.alignment = TextAnchor.MiddleCenter;
|
||||||
|
|
||||||
|
var x = GuiSizes.PlayerCenter + GuiSizes.PlayerWidth * .2f;
|
||||||
|
var y = Screen.height * .01f;
|
||||||
|
var width = GuiSizes.FontSize * 15f;
|
||||||
|
var height = GuiSizes.LabelHeight * errors.Count + GuiSizes.Margin * 2;
|
||||||
|
|
||||||
|
GUI.Box(new Rect(x, y, width, height), "");
|
||||||
|
for (var i = 0; i < errors.Count; i++)
|
||||||
|
{
|
||||||
|
GUI.Label(new Rect(x, y + GuiSizes.Margin + GuiSizes.LabelHeight * i, width, GuiSizes.LabelHeight), errors[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue