Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to set text for input node #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kerabromsmu
Copy link
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
Contributor Author

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

@andsve
Copy link
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.

None yet

2 participants