Greetings,
Its already pretty neat to just have something like an Input field to work with,
but can i somehow, as i created, and spawned the Ui,
automatically activate it so the user can write in it/ use it ?
i encountered already now many times where the players only complaining about a "black bar" on their screen, not knowing that its a Input bar..... as nobody is used to that ( yet ).
I know, i can set the mouse use to True, but that doesnt really help as the input executes as soon as you click somewhere else.
Code:static public void CreateInput(ref CuiElementContainer container, string panel, string color, string text, int size, string command, string aMin, string aMax) { container.Add(new CuiElement { Name = CuiHelper.GetGuid(), Parent = panel, Components = { new CuiInputFieldComponent { Align = TextAnchor.MiddleLeft, CharsLimit = 50, Color = color, Command = command + text, FontSize = size, IsPassword = false, Text = text }, new CuiRectTransformComponent {AnchorMin = aMin, AnchorMax = aMax } } } ); }
Focusing CUI input automatically?
Discussion in 'Rust Development' started by Crushed, Apr 1, 2018.
-
Calytic Community Admin Community Mod
The InputField component is effectively broken and unusable. It works (sort of) if it's the only GUI plugin you have. Not even considering the issue where the InputField executes onblur, combine it with any other GUI plugin like LustyMap or InfoPanel and the InputField becomes totally useless.
Unfortunately there isn't anything plugin developers or Oxide can do about this. This is a FP, specifically CommunityEntity problem.
If some intrepid developer wants to fix it, CommunityEntity is open-source. Admittedly pushing anything to CommunityEntity is a shot in the dark since no one except FP has the means to test changes.