Trying to get a variable from one widget to another

I still think you don’t understand what I’m trying to do. The W_DialogueTopic widgets are the text on the left side of the dialogue box, they get created and named based on the row names in the NPC’s dialogue table.

image

The only thing inside of a W_DialogueTopic widget is a button and the text (in this case, “Hello” or “Sphere.”)

The text that should appear in the right side of the dialogue box is inside of that table we referred to earlier. This is a Text widget inside of W_DialogueTable, i.e,. the data table and the Text block that I want to change now, based on what I click on the left, are both already inside of W_DialogueTable, not W_DialogueTopic.

I only needed to get the text from W_DialogueTopic back out to use as a lookup for the table. I’d rather do that than pass the table into W_DialogueTopic, do the lookup, then pass it back into W_DialogueTable.

Apparently, you can turn text into strings and strings into names.

Edit: Unless you were suggesting that I go back and set it up so that, upon creating the W_DialogueTopic widget, I also simultaneously look up the corresponding dialogue text and pack them both into the W_DialogueTopic widget, then just get that when I call the event dispatcher?

I don’t much about programming best practices yet, but it seems like it would be more costly to replicate data that already lives in the object where I need it than to just look it up in the table each time a topic gets clicked.