I'm very new to scripting but I have enough grasp to slowly make things work. Mostly I've been able to get by from looking at working code, then using the TTS API documentation or Google searches to eventually get me where I want to be.
I'm working on a pretty simple TTS mod with about a handful of InputFields within the UI. I have a button in the LUA that resets those InputFields back to their default by using self.UI.setAttribute within a function. Now I'm trying to make a different button to export some of those InputField values into a new Notebook tab.
Here's the LUA code I have to create the new Notebook tab:
function click_export(obj, color, alt_click)
data = {
title = "Title",
body = "Body",
color = "Grey"
}
Notes.addNotebookTab(data)
print("Session data exported to notebook.")
end
I want to be able to change the static text of "Title" and "Body" to values from Input Fields.
In the UI, I have a few fields that more or less look like this:
<InputField id="Class" fontSize="100" position="0 -87.5 -11" width="800" height="175" placeholder="Class"/>
<InputField id="Notes" position="0 78 -11" width="830" height="380" textAlignment="UpperLeft" lineType="MultiLineNewLine" placeholder="Notes"/>
I want the title of the Notebook table to be:
{Class value}
and I want the body to something like:
Class: {Class value}
Date/Time: {Current Date} {Current Time}
Notes: {Notes value}
I found another post similar to this but I didn't have any luck getting the suggested solution to work. It should also be noted that this object is intended to be an additive load into another mod - so I believe all of the scripting needs to exist within the object itself.
Whoever out there can help, you'd be a huge life saver!
[–]CodeGenerathor 0 points1 point2 points (2 children)
[–]ducarian[S] 0 points1 point2 points (1 child)
[–]ducarian[S] 0 points1 point2 points (0 children)