Skip to content

Add functionality to set text for input node#8

Open
kerabromsmu wants to merge 4 commits intoandsve:masterfrom
kerabromsmu:master
Open

Add functionality to set text for input node#8
kerabromsmu wants to merge 4 commits intoandsve:masterfrom
kerabromsmu:master

Conversation

@kerabromsmu
Copy link
Copy Markdown
Contributor

Added the set_text parameter to dirtylarry:input() method. If this parameter is set (i.e. not nil), then the text on the input field is set to this parameter's value. Passing an empty string will set the input field to empty. Type of value is not checked.

kerabromsmu and others added 4 commits May 7, 2017 21:28
Added instruction to add input bindings to game.input_binding
Fix paragraphs
Added the **set_text** parameter to dirtylarry:input() method. If this parameter is set (i.e. not nil), then the text on the input field is set to this parameter's value. Passing an empty string will set the input field to empty. Type of value is not checked.
@kerabromsmu
Copy link
Copy Markdown
Contributor Author

Hello! It's been a while since I made this PR. Would you accept or decline it?

@andsve
Copy link
Copy Markdown
Owner

andsve commented Jul 31, 2017

Hey! Sorry for the late reply, been on vacation!

I'm thinking if it actually should be a separate function, like;

dirtylarry:set_input_text("input_node", "replacement text")

Mostly since it might be confusing to set/reset text of an input using the "handle input" function. Then it would be possible to set the text of a input node without the need to run all the input handling code as well. Like;

dirtylarry:button("clear_button", action_id, action, function()
    dirtylarry:set_input_text("input_node", "")
end)

On the other hand, this might be a bit against the imgui-ish style of dirtylarry...
But I'm not sure, it might make sense to actually have both options, what do you think?

I love that you want to contribute! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants