InputField doesn’t show cursor

Hey guys

I've added InputFields to a plugin i'm writing.
It works perfectly fine, but for some reason it doesn't show the cursor like other plugins does, what did I do wrong?

            static public void CreateInputField(ref CuiElementContainer element, string panel, string color, string text, int size, string aMin, string aMax, string command, int charsLimit, bool isPassword = false, TextAnchor align = TextAnchor.MiddleLeft)
            {
                element.Add(new CuiElement
                {
                    Parent = panel,
                    Components =
                    {
                        new CuiInputFieldComponent { Text = text, FontSize = size, Align = align, CharsLimit = charsLimit, Color = color, Command = command, IsPassword = isPassword },
                        new CuiRectTransformComponent { AnchorMin = aMin, AnchorMax = aMax },
                    }
                });
            }
                    UI.CreatePanel(ref sellElement, PanelMarket, UIColors["light"], "0.35 0.91", "0.50 0.99"); // UIColors is just a gray background.
                    UI.CreateInputField(ref sellElement, PanelMarket, UIColors["white"], string.Empty, 18, "0.36 0.91", "0.50 0.99", "", 6); // UIColors is 1,1,1,1
You need CuiNeedsCursorComponent or something.
5b6ed4c9ac8e4.jpg misticos
You need CuiNeedsCursorComponent or something.

Hmm, can't seem to get that to work.
Isn't that for panels, to tell it if there should be a mouse cursor?

When I say cursor I mean the blinking |

Did you try clicking input field?
5b6ed4c9ac8e4.jpg misticos
Did you try clicking input field?

ofc. :)
It seems that the curser is very dark, don't know why.
I choose a brigther background, then i was barely able to see it. apparenlty it gets the color of the parent panel instead of the inputfield. So weird.

another question. I can't figure out how to return what is inside the InputField

I tried this

                    UI.CreateInputField(ref sellElement, PanelMarket, UIColors["white"], string.Empty, 18, "0.36 0.93", "0.44 0.97", "TestTextCommand", 6);
        [ConsoleCommand("TestTextCommand")]
        private void TestTextCommand(ConsoleSystem.Arg arg, string args)
        {
            var player = arg.Connection.player as BasePlayer;
            GetSendMSG(player, args);
        }

Sorry about all the stupid questions. I'm fairly new to the Rust API.

Isnt it a wrong command signature? It shouldn't have `string args`, only `ConsoleSystem.Arg arg`, hm? You can get an array of args from `arg.Args`.
5b6ed4c9ac8e4.jpg misticos
Isnt it a wrong command signature? It shouldn't have `string args`, only `ConsoleSystem.Arg arg`, hm? You can get an array of args from `arg.Args`.

Yeah, that was something I tested before, didn't work either.
I can't seem to figure out this whole InputField thing. It's so confusing



Merged post

lol... What was i thinking??
Jesus... It works.. I'm so stupid...

 private void TestTextCommand(ConsoleSystem.Arg arg) { var player = arg.Connection.player as BasePlayer; GetSendMSG(player, arg.Args[0]); }

Thanks a ton misticos!
I've watched myself blind... been working on this for hours with no sleep

Also, I.. must notice that input field still runs keybinds and etc, so don't be surprised when you accidentally ban someone :D
5b6ed4c9ac8e4.jpg misticos
Also, I.. must notice that input field still runs keybinds and etc, so don't be surprised when you accidentally ban someone :D

Haha, I noticed it's quite buggy!
However, it's not for adminstration. :)

I am making an auction house, it's for adding price for items. :)