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 historical changes support for the Editor #7779

Merged
merged 16 commits into from
Sep 22, 2023
Merged

Conversation

ihhub
Copy link
Owner

@ihhub ihhub commented Sep 20, 2023

relates to #6845

  • implement historical changes support through undo and redo methods (U and R keys)
  • rename Editor class into EditorInterface to avoid the clash of names with a namespace
  • fix application quitting event when pressing Save Map button in the Editor
  • rename multiple Tiles class' members to be more human readable
  • add a check in the main loop to detect invalid logic and to avoid infinite loop execution
fheroes2.engine.version_.1.0.8.2023-09-19.23-23-55.mp4

This PR also fixes rare flickering on a first load of a new map in the Editor:

fheroes2.engine.version_.1.0.8.2023-09-20.14-20-33.mp4

@ihhub ihhub added bug Something doesn't work improvement New feature, request or improvement editor Map editor related stuff labels Sep 20, 2023
@ihhub ihhub added this to the 1.0.9 milestone Sep 20, 2023
@ihhub ihhub self-assigned this Sep 20, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ clang-tidy found issue(s) with the introduced code (1/1)

@ihhub ihhub marked this pull request as draft September 20, 2023 04:33
@ihhub ihhub marked this pull request as ready for review September 20, 2023 06:35
Copy link
Collaborator

@Districh-ru Districh-ru left a comment

Choose a reason for hiding this comment

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

Hi, @ihhub, I tested the undo/redo feature and I like how it works. It could be easily used for all new editor actions.
I only found one issue with the radar update on undo/redo and left a couple of comments about it. Could you please check them when you have time.

Also currently we can make the unlimited number of undo history records. Maybe we should limit the history manager maximum size to, in example, 100 records. What do you think?

Copy link
Collaborator

@oleg-derevenetz oleg-derevenetz left a comment

Choose a reason for hiding this comment

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

Hi @ihhub I just left a few questions, could you please take a look when you have time?

@ihhub
Copy link
Owner Author

ihhub commented Sep 21, 2023

Hi @oleg-derevenetz and @Districh-ru , I've added a limit for actions as 500: average value from both of you :)

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@ihhub ihhub merged commit 243d2ba into master Sep 22, 2023
@ihhub ihhub deleted the editor-history-manager branch September 22, 2023 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work editor Map editor related stuff improvement New feature, request or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants