Prevent duplicate toasts, fix drawing logic crash #556
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve the functionality and performance of the
RotationSolver
project. The changes focus on optimizing the toast message updates, refining the drawing logic, and enhancing the overall performance of the UI components.Improvements to toast message updates:
RotationSolver/Commands/RSCommands_StateSpecialCommand.cs
: Added a check to avoid redundant toast messages by storing the last toast message and comparing it with the current message before displaying.Enhancements to drawing logic:
RotationSolver/UI/HighlightTeachingMode/DrawingHighlightHotbar.cs
: Simplified theGetAddons
method by replacing LINQ with a more efficient loop-based approach.RotationSolver/UI/HighlightTeachingMode/DrawingHighlightHotbar.cs
: Removed unnecessary unions in theTo2D
method to streamline the drawing process.RotationSolver/UI/HighlightTeachingMode/DrawingHighlightHotbar.cs
: Improved theDraw
method inImageDrawing
to ensure the draw list and texture are valid before drawing.Performance improvements in UI components:
RotationSolver/UI/OverlayWindow.cs
: Changed theDraw
method to synchronous execution by awaiting the drawing elements update directly, ensuring the draw list is valid before proceeding. [1] [2] [3]RotationSolver/UI/OverlayWindow.cs
: Removed unusedusing
directives to clean up the code.