Let’s see if someone can give me ideas on how to do this in terms of software design.
The problem is that I am trying to make a narrative game, in that game after a situation is presented, several options (buttons) are given, and depending on which one you press, it will produce some effects. These effects are very different, they can go from advancing the story, showing the following text, to increasing your charisma by one point, or unlocking access to a place.
About how to achieve this I was thinking for a while. I came up wiith when building the button when you generate the view of the specific dialog, in addition to passing the text that the button should display, which is stored in a data table, I can also pass a string that encodes the effects that make the button. And when you press the button it simply passes that string to a handler. The handler decodes the string and is responsible for communicating with the various objects that manage the ui, my character’s attributes, or access to different places.
Is that correct or am I overcomplicating the issue? Can you think of a design pattern that I’m not seeing that provides a better solution?