debug tweak; extra null check on EventSystem.current

This commit is contained in:
Tyfon
2024-06-22 03:31:31 -07:00
parent 376999a472
commit ab23705cdb
2 changed files with 3 additions and 5 deletions

View File

@@ -36,8 +36,7 @@ namespace UIFixes
foreach (ItemContextClass itemContext in MultiSelect.ItemContexts)
{
builder.AppendFormat("x{0} {1}", itemContext.Item.StackObjectsCount, itemContext.Item.ToString());
builder.AppendLine();
builder.AppendFormat("x{0} {1}\n", itemContext.Item.StackObjectsCount, itemContext.Item.ToString());
}
if (MultiSelect.SecondaryContexts.Any())
@@ -45,8 +44,7 @@ namespace UIFixes
builder.AppendFormat("Secondary Items: <color=yellow>{0}</color>\n", MultiSelect.SecondaryCount);
foreach (ItemContextClass itemContext in MultiSelect.SecondaryContexts)
{
builder.Append(itemContext.Item.ToString());
builder.AppendLine();
builder.AppendFormat("x{0} {1}\n", itemContext.Item.StackObjectsCount, itemContext.Item.ToString());
}
}

View File

@@ -29,7 +29,7 @@ namespace UIFixes
{
// Need an item context to operate on, and ignore these keypresses if there's a focused textbox somewhere
ItemContextAbstractClass itemContext = __instance.R().ItemContext;
if (itemContext == null || EventSystem.current.currentSelectedGameObject?.GetComponent<TMP_InputField>() != null)
if (itemContext == null || EventSystem.current?.currentSelectedGameObject?.GetComponent<TMP_InputField>() != null)
{
return;
}