Skip to content

Commit

Permalink
Deprecated keymapping code removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Quboid committed Sep 15, 2022
1 parent 328d55d commit 1fe023f
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions MoveIt/OptionsKeymapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,20 @@ protected void AddKeymapping(string label, SavedInputKey savedInputKey)
uIButton.eventVisibilityChanged += ButtonVisibilityChanged;
}

protected void OnEnable()
{
LocaleManager.eventLocaleChanged += new LocaleManager.LocaleChangedHandler(this.OnLocaleChanged);
}
//protected void OnEnable()
//{
// LocaleManager.eventLocaleChanged += new LocaleManager.LocaleChangedHandler(this.OnLocaleChanged);
//}

protected void OnDisable()
{
LocaleManager.eventLocaleChanged -= new LocaleManager.LocaleChangedHandler(this.OnLocaleChanged);
}
//protected void OnDisable()
//{
// LocaleManager.eventLocaleChanged -= new LocaleManager.LocaleChangedHandler(this.OnLocaleChanged);
//}

protected void OnLocaleChanged()
{
this.RefreshBindableInputs();
}
//protected void OnLocaleChanged()
//{
// this.RefreshBindableInputs();
//}

protected bool IsModifierKey(KeyCode code)
{
Expand Down Expand Up @@ -287,26 +287,26 @@ protected void OnBindingMouseDown(UIComponent comp, UIMouseEventParameter p)
}
}

protected void RefreshBindableInputs()
{
foreach (UIComponent current in component.GetComponentsInChildren<UIComponent>())
{
UITextComponent uITextComponent = current.Find<UITextComponent>("Binding");
if (uITextComponent != null)
{
SavedInputKey savedInputKey = uITextComponent.objectUserData as SavedInputKey;
if (savedInputKey != null)
{
uITextComponent.text = savedInputKey.ToLocalizedString("KEYNAME");
}
}
UILabel uILabel = current.Find<UILabel>("Name");
if (uILabel != null)
{
uILabel.text = Locale.Get("KEYMAPPING", uILabel.stringUserData);
}
}
}
//protected void RefreshBindableInputs()
//{
// foreach (UIComponent current in component.GetComponentsInChildren<UIComponent>())
// {
// UITextComponent uITextComponent = current.Find<UITextComponent>("Binding");
// if (uITextComponent != null)
// {
// SavedInputKey savedInputKey = uITextComponent.objectUserData as SavedInputKey;
// if (savedInputKey != null)
// {
// uITextComponent.text = savedInputKey.ToLocalizedString("KEYNAME");
// }
// }
// UILabel uILabel = current.Find<UILabel>("Name");
// if (uILabel != null)
// {
// uILabel.text = Locale.Get("KEYMAPPING", uILabel.stringUserData);
// }
// }
//}

protected InputKey GetDefaultEntry(string entryName)
{
Expand Down

0 comments on commit 1fe023f

Please sign in to comment.