Fix dice roll and timer in Test#16
Conversation
Reviewer's Guide by SourceryThis pull request addresses two main issues: fixing the dice roll logic to ensure the fail path can be triggered, and correcting the timer behavior to stop counting down when skipped. Additionally, it introduces a new feature to display INFO notifications that last as long as the timer. The changes involve refactoring notification handling, adding timer management, and ensuring the RNG is properly randomized. File-Level Changes
Tips
|
There was a problem hiding this comment.
Hey @RailKill - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding additional thread safety measures for the timer modifications to prevent potential race conditions.
- The
_process_nodefunction in MonologueProcess.gd handles many different node types. Consider refactoring this into smaller, more focused functions for better maintainability and potential performance improvements.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
| notify(text, "INFO", Color.DODGER_BLUE, time) | ||
|
|
||
|
|
||
| func notify(text, tag, color, time): |
There was a problem hiding this comment.
suggestion: Consider using a more type-safe approach for color parameters
Instead of accepting any value for color, you could use a Color type hint or create an enum for predefined colors. This would prevent potential runtime errors from invalid color values.
| func notify(text, tag, color, time): | |
| func notify(text: String, tag: String, color: Color, time: float) -> void: |
Just some minor fixes that I found in Test, taking a break after this.
Bug Fixes
next()being called by timer expiry, even after the user has skipped the timer by pressingui_accept. Basically, the timer does not stop counting down even after a dialogue skip, which will make it callnext()one extra time.Features
Summary by Sourcery
Fix issues with DiceRoll and timer behavior in Test. Add an [INFO] notification for timer duration that closes when skipped, and ensure the random number generator in MonologueProcess.gd functions correctly. Prevent
next()from being called by timer expiry after a dialogue skip.New Features:
Bug Fixes:
next()being called by timer expiry even after the user has skipped the timer by pressingui_accept, preventing an extra call tonext().