微调
This commit is contained in:
@@ -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