/// <inheritdoc /> public override void SetHasFocus(string subFieldName = null) { if (subFieldName != null && subFieldName.StartsWith("center.")) { string component = subFieldName.Remove(0, "center.".Length); if (component == "X") { centerField.SetInputFocus(VectorComponent.X, true); } else if (component == "Y") { centerField.SetInputFocus(VectorComponent.Y, true); } else if (component == "Z") { centerField.SetInputFocus(VectorComponent.Z, true); } else { centerField.SetInputFocus(VectorComponent.X, true); } } if (subFieldName != null && subFieldName.StartsWith("size.")) { string component = subFieldName.Remove(0, "size.".Length); if (component == "X") { sizeField.SetInputFocus(VectorComponent.X, true); } else if (component == "Y") { sizeField.SetInputFocus(VectorComponent.Y, true); } else if (component == "Z") { sizeField.SetInputFocus(VectorComponent.Z, true); } else { sizeField.SetInputFocus(VectorComponent.X, true); } } }
/// <inheritdoc/> public override void SetHasFocus(string subFieldName = null) { if (subFieldName == "X") { guiField.SetInputFocus(VectorComponent.X, true); } else if (subFieldName == "Y") { guiField.SetInputFocus(VectorComponent.Y, true); } else if (subFieldName == "Z") { guiField.SetInputFocus(VectorComponent.Z, true); } else { guiField.SetInputFocus(VectorComponent.X, true); } }
/// <summary> /// Changes keyboard focus to a specific field on the component with the provided UUID. /// </summary> /// <param name="uuid">UUID of the component on which to select the field.</param> /// <param name="path">Path to the field on the object being inspected.</param> internal void FocusOnField(UUID uuid, string path) { if (activeSO == null) { return; } if (activeSO.UUID == uuid) { if (path == "position.X") { soPos.SetInputFocus(VectorComponent.X, true); } else if (path == "position.Y") { soPos.SetInputFocus(VectorComponent.Y, true); } else if (path == "position.Z") { soPos.SetInputFocus(VectorComponent.Z, true); } else if (path == "rotation.X") { soRot.SetInputFocus(VectorComponent.X, true); } else if (path == "rotation.Y") { soRot.SetInputFocus(VectorComponent.Y, true); } else if (path == "rotation.Z") { soRot.SetInputFocus(VectorComponent.Z, true); } else if (path == "scale.X") { soScale.SetInputFocus(VectorComponent.X, true); } else if (path == "scale.Y") { soScale.SetInputFocus(VectorComponent.Y, true); } else if (path == "scale.Z") { soScale.SetInputFocus(VectorComponent.Z, true); } else if (path == "name") { soNameInput.Focus = true; } } else { foreach (var entry in inspectorComponents) { if (entry.uuid != uuid) { continue; } entry.inspector.FocusOnField(path); } } }