Skip to content

Commit 9be8463

Browse files
Make sure that the InputHandler reference is not null (#85)
Closes #84.
1 parent e9cfd3d commit 9be8463

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Assembly-CSharp/Patches/UIButtonSkins.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public class UIButtonSkins : global::UIButtonSkins
1515
[MonoModIgnore]
1616
private extern ButtonSkin GetButtonSkinFor(string buttonName);
1717
[MonoModIgnore]
18-
private extern ButtonSkin GetButtonSkinFor(InputControlType inputControlType);
19-
[MonoModIgnore]
18+
private extern ButtonSkin orig_GetButtonSkinFor(InputControlType inputControlType);
19+
2020
private InputHandler ih;
2121

2222
public extern void orig_RefreshKeyMappings();
@@ -94,6 +94,14 @@ public IEnumerator ShowCurrentButtonMappings()
9494
while (enumerator.MoveNext()) yield return enumerator.Current;
9595
yield break;
9696
}
97+
98+
private ButtonSkin GetButtonSkinFor(InputControlType inputControlType)
99+
{
100+
if(this.ih == null){
101+
this.ih = (Modding.Patches.InputHandler)InputHandler.Instance;
102+
}
103+
return orig_GetButtonSkinFor(inputControlType);
104+
}
97105

98106
private void SetupRefs()
99107
{

0 commit comments

Comments
 (0)