微调
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Diagnostics;
|
||||
using Ichni.Menu;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -24,8 +25,11 @@ namespace Ichni.UI
|
||||
languageDropdown.SetUp(gameSettings.languageIndex, MenuManager.instance.displayLanguageList, "Menu UI/Settings_Language");
|
||||
languageDropdown.updateValueAction = () =>
|
||||
{
|
||||
BuildHangTracer.Log("UI_DROPDOWN", $"[Dropdown] 玩家选择语言索引: {languageDropdown.selectedIndex}");
|
||||
gameSettings.languageIndex = languageDropdown.selectedIndex;
|
||||
BuildHangTracer.Log("UI_DROPDOWN", "[Dropdown] 即将调用 SettingsManager.ApplyLanguageSettings()");
|
||||
SettingsManager.instance.ApplyLanguageSettings();
|
||||
BuildHangTracer.Log("UI_DROPDOWN", "[Dropdown] SettingsManager.ApplyLanguageSettings() 调用完成返回");
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -45,12 +45,14 @@ namespace Ichni.Menu
|
||||
|
||||
public partial class RebindingWindow
|
||||
{
|
||||
private const string RebindsSaveKey = "Rebinds";
|
||||
|
||||
public void LoadBindings()
|
||||
{
|
||||
// 检查EasySave中是否存在存档
|
||||
if (ES3.FileExists(rebindsFilePath))
|
||||
if (ES3.FileExists(rebindsFilePath) && ES3.KeyExists(RebindsSaveKey, rebindsFilePath))
|
||||
{
|
||||
string rebindsJson = ES3.Load<string>("Rebinds", rebindsFilePath);
|
||||
string rebindsJson = ES3.Load<string>(RebindsSaveKey, rebindsFilePath);
|
||||
inputActions.LoadBindingOverridesFromJson(rebindsJson);
|
||||
Debug.Log("键位已从EasySave加载。");
|
||||
}
|
||||
@@ -66,7 +68,7 @@ namespace Ichni.Menu
|
||||
public void SaveBindings()
|
||||
{
|
||||
string rebindsJson = inputActions.SaveBindingOverridesAsJson();
|
||||
ES3.Save("Rebinds", rebindsJson, rebindsFilePath);
|
||||
ES3.Save(RebindsSaveKey, rebindsJson, rebindsFilePath);
|
||||
Debug.Log("键位已保存到EasySave。");
|
||||
}
|
||||
}
|
||||
@@ -79,10 +81,15 @@ namespace Ichni.Menu
|
||||
// 移除所有覆盖(即恢复到Asset文件中的原始设置)
|
||||
inputActions.RemoveAllBindingOverrides();
|
||||
|
||||
// 从EasySave中删除存档
|
||||
if (ES3.KeyExists("Rebind", rebindsFilePath))
|
||||
// 从EasySave中删除存档Key与文件
|
||||
if (ES3.KeyExists(RebindsSaveKey, rebindsFilePath))
|
||||
{
|
||||
ES3.DeleteKey("Rebind", rebindsFilePath);
|
||||
ES3.DeleteKey(RebindsSaveKey, rebindsFilePath);
|
||||
}
|
||||
|
||||
if (ES3.FileExists(rebindsFilePath))
|
||||
{
|
||||
ES3.DeleteFile(rebindsFilePath);
|
||||
}
|
||||
|
||||
Debug.Log("所有键位已重置为默认值。");
|
||||
|
||||
Reference in New Issue
Block a user