Facepunch / Rust.Community

Community Entity to fill Server Side modder requests
MIT License
46 stars 21 forks source link

[BUG] needsKeyboard Input Field closes Loot Panel #38

Closed dassjosh closed 2 years ago

dassjosh commented 2 years ago

Issue: When you are looting an entity and have an InputField with the "needsKeyboard" once you click on the input field it closes the loot panel.

Expected Result: Loot Panel stays open for Input Fields with "needsKeyboard" and the user clicks on it.

Example JSON:

The JSON below demonstrates the issue. The red background input field will close the loot panel when clicked on. The green one will not close it.

[
  {
    "name": "UiElementsTest_LootBug",
    "parent": "Overlay",
    "components": [
      {
        "type": "UnityEngine.UI.Image",
        "color": "0 0 0 0"
      },
      {
        "type": "RectTransform",
        "anchormin": "0.5 0.5",
        "anchormax": "0.5 0.5",
        "offsetmin": "-50 -50",
        "offsetmax": "50 50"
      }
    ]
  },
  {
    "name": "UiElementsTest_LootBug_1",
    "parent": "UiElementsTest_LootBug",
    "components": [
      {
        "type": "UnityEngine.UI.Image",
        "color": "0.8039 0.2745 0.1961"
      },
      {
        "type": "RectTransform",
        "anchormin": "0 0.55",
        "offsetmax": "0 0"
      }
    ]
  },
  {
    "name": "UiElementsTest_LootBug_2",
    "parent": "UiElementsTest_LootBug_1",
    "components": [
      {
        "type": "UnityEngine.UI.InputField",
        "command": "",
        "needsKeyboard": "",
        "text": "",
        "font": "robotocondensed-regular.ttf",
        "align": "MiddleCenter",
        "color": "1 1 1 0.502"
      },
      {
        "type": "RectTransform",
        "anchormin": "0.0099 0",
        "anchormax": "0.99 1",
        "offsetmax": "0 0"
      }
    ]
  },
  {
    "name": "UiElementsTest_LootBug_3",
    "parent": "UiElementsTest_LootBug",
    "components": [
      {
        "type": "UnityEngine.UI.Image",
        "color": "0.549 0.7843 0.2353"
      },
      {
        "type": "RectTransform",
        "anchormax": "1 0.4499",
        "offsetmax": "0 0"
      }
    ]
  },
  {
    "name": "UiElementsTest_LootBug_4",
    "parent": "UiElementsTest_LootBug_3",
    "components": [
      {
        "type": "UnityEngine.UI.InputField",
        "command": "",
        "text": "",
        "font": "robotocondensed-regular.ttf",
        "align": "MiddleCenter",
        "color": "1 1 1 0.502"
      },
      {
        "type": "RectTransform",
        "anchormin": "0.0099 0",
        "anchormax": "0.99 1",
        "offsetmax": "0 0"
      }
    ]
  }
]
ElChupos commented 2 years ago

This should be fixed in https://github.com/Facepunch/Rust.Community/commit/38f218231a6541c20da0bbddec52dd510f221c30

You will need to use a hudMenuInput instead of needsKeyboard.