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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion dirtylarry/dirtylarry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function dirtylarry.radio(self, node, action_id, action, id, value)
return value
end

function dirtylarry.input(self, node, action_id, action, type, empty_text)
function dirtylarry.input(self, node, action_id, action, type, empty_text, set_text)

local node_bg = gui.get_node(node .. "/bg")
local node_inner = gui.get_node(node .. "/inner")
Expand All @@ -126,6 +126,12 @@ function dirtylarry.input(self, node, action_id, action, type, empty_text)
end

local input_node = dirtylarry.input_nodes[key]

if set_text ~= nil then
input_node.data = set_text
gui.set_text(node_content,set_text)
end

if not dirtylarry.is_enabled(self, node_bg) then
return input_node.data
end
Expand Down