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 story point progression #148

Merged
merged 1 commit into from
Oct 11, 2023
Merged

Conversation

jckrebs
Copy link
Collaborator

@jckrebs jckrebs commented Oct 10, 2023

Closes #146

This PR adds the ability to click through lines of dialogue during a story event by progressing through each story point when clicked until ultimately resetting and hiding the canvas.

Testing

Load up the test scene Assets/Scenes/Test/StoryMonoSystem_Test/StoryMonoSystemScene_Test.unity and click the red box. Then, click through the two separate lines of dialogue that should have different character names. Finally, make sure the scene returns to normal, displaying the red box again.

Considerations

I tried to follow this outline:

image

I used a C# event/action to communicate between the dialogue panel and the controller and used the message bus and a direct reference at times to communicate between the controller and the monosystem, following the architecture we had laid out during previous work.

I ended up refactoring the StoryMonoSystem.GetCurrentStoryPoint() and StoryMonoSystem.HasStoryEventEnded() methods a bit by introducing a third method called StoryMonoSystem.AdvanceStoryPoint() in order to separate functionality a little more clearly. Before the refactor, the StoryPointIndex could exceed the number of story points in the story event and the code I wrote to fix that within the original method made everything feel kinda messy.

@jckrebs jckrebs self-assigned this Oct 10, 2023
Copy link
Owner

@GenoImel GenoImel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good. Definitely good application of Unity/C# events with how our individual features work in game. I'm glad the diagram came in handy. I'll try to make more to cover other details of our architecture.

The only thing that might be good is potentially changing StoryEventAvailableMessage to StoryPointAvailableMessage, but that could be covered in the next PR. Only thing that makes me thing that's a good idea is that this message is being used on a point-by-point basis. Not sure there's a better workaround than what you've done though. 🤔

@jckrebs jckrebs merged commit d2655bc into main Oct 11, 2023
@jckrebs jckrebs deleted the feature/146-dialogue-progression branch October 11, 2023 14:59
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.

Add the ability to progress through StoryEvents
3 participants