Code cleanup.

This commit is contained in:
2023-02-18 15:46:32 +08:00
parent 900bd7b77a
commit 33ee7a9a87
8 changed files with 41 additions and 47 deletions

View File

@@ -1,4 +1,5 @@
using Cryville.Common.Unity;
using Cryville.Common;
using Cryville.Common.Unity;
using Cryville.Common.Unity.Input;
using System.Collections.Generic;
using UnityEngine;
@@ -26,10 +27,10 @@ namespace Cryville.Crtr.Config {
SimpleInputConsumer _consumer;
public InputProxy proxy;
readonly Dictionary<string, InputConfigPanelEntry> _entries = new Dictionary<string, InputConfigPanelEntry>();
readonly Dictionary<Identifier, InputConfigPanelEntry> _entries = new Dictionary<Identifier, InputConfigPanelEntry>();
string _sel;
public void OpenDialog(string entry) {
Identifier _sel;
public void OpenDialog(Identifier entry) {
_sel = entry;
m_inputDialog.SetActive(true);
CallHelper.Purge(m_deviceList);

View File

@@ -1,4 +1,5 @@
using UnityEngine;
using Cryville.Common;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
@@ -13,8 +14,8 @@ namespace Cryville.Crtr.Config {
[SerializeField]
Button m_button;
public void SetKey(InputConfigPanel master, string name) {
m_key.text = name;
public void SetKey(InputConfigPanel master, Identifier name) {
m_key.text = (string)name.Name;
m_value.text = "None";
m_button.onClick.AddListener(() => {
master.OpenDialog(name);
@@ -40,13 +41,5 @@ namespace Cryville.Crtr.Config {
}
}
}
public void SetValue(string name) {
m_value.text = name;
}
public void SetEnabled(bool flag) {
m_button.interactable = flag;
}
}
}