Fix crash on load when no slot key assigned (#26354)
Co-authored-by: wrexbe <wrexbe@protonmail.com>
This commit is contained in:
@@ -42,11 +42,12 @@ public class ActionButtonContainer : GridContainer
|
|||||||
{
|
{
|
||||||
var button = new ActionButton(_entity);
|
var button = new ActionButton(_entity);
|
||||||
|
|
||||||
if (keys.TryGetValue(index, out var boundKey))
|
if (!keys.TryGetValue(index, out var boundKey))
|
||||||
{
|
return button;
|
||||||
button.KeyBind = boundKey;
|
|
||||||
|
|
||||||
var binding = _input.GetKeyBinding(boundKey);
|
button.KeyBind = boundKey;
|
||||||
|
if (_input.TryGetKeyBinding(boundKey, out var binding))
|
||||||
|
{
|
||||||
button.Label.Text = binding.GetKeyString();
|
button.Label.Text = binding.GetKeyString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user