-
Notifications
You must be signed in to change notification settings - Fork 9
Merging UI overhaul and QOL-Enhancements #93
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… now correctly represented
…added status bar to Main Window.
Once the game path ahs been configured, the user can go directly to the editor once the game files have been loaded on startup.
To match the App's overall look the context menu and tooltip now have a dark color scheme.
Implemented a undo-stack to experiment with undo feature. Currently, the entire MapTemplate gets serialized and pushed on the stack. Practically functional, but can get slow for complex maps. Some different solution should be looked into for the long run. But that will probably take some extensive refactoring to enable some kind of diffing.
Removed the hard copy of the entire template. This was just an ugly solution for the undo/redo feature. Now there is a proper Undo/Redo Stack that can take new entries of the IStackEntry interface. Each kind of action can have its own implementation and push it to the stack. Undo and redo is then handled by the UndoRedoStack Class.
The Stack entries are created in MapView.xaml.cs which isn't really that elegant. But that file is already quite complex and handles lots of editor interactions. So touching it not that mutch is probably a good idea for now. Ultimately, the acutal edit actions should be lifted out to have consistent methods of editing the map when the user does it by different means (like maybe toolbar or context menu) in the future. There are still some places that seem to not be NULL-safe. Have to clean that up at some point...
Actions can be undone/redone with CTRL+Z/Y. The action history shows the past actions that can be undone. Intended to be clickable in the future to undo multiple actions at once. Scrollbars now match the App's theming.
Dependencies between island size and type make it quite cumbersome to restore those properties on undo. Will have to look into some solutions that make it easier to handle island properties, probably also how they are handled in the models. Having different Models for fixed and random islands should not be necessary.
Removing the need for separate controls for fixed and random island. Unifies the handling of adding actions to the undo/redo stack. Slots and Fertilities not yet updated. They are configurable, but not yet represented in the undo/redo stack. Planning to rework those features to be less cumbersome.
For a more coherent look of the Editor. Still need to rearrange some UI elements for Session and Island Properties.
The fertilities can now be selected directly in the island properties. Changes to fertilities can be undone and redone. By default, only fertilities from the current region can be selected. Fertilities from other regions that have been set beforehand have a warning hint besides them and can be removed. Also added the possibility to resize island and session property sections of the main window. The error and warning notifications have been overhauled in their appearance.
To make the data integrity more reliable and prevent some visual issues, the island properties now get shown via a ContentControl bound to its viewmodel. SelectedIsland and MapTemplate are now nun-null parameters of the constructor of the viewmodel. Also tweaked some visuals of the not allowed fertility warning.
The island label is applied once the text box has lost its focus (also possible by hitting enter). So not every letter is un-/re-done, but only if a changed label has been applied.
Islands can now be removed via the toolbar button or the delete key. Also fixed some comment typos.
Also added some preparations for undo/redo of map size configuration. The way the configuration of the playable area works right now is a bit complicated and does not work well with undo/redo. This will require some more extensive reworks on that feature. But I wanted to make this more accessible anyway.
…roperty updates Also removed no longer needed fertility control and overlay. Reused components have been moved to a different namespace accordingly.
The toolbar now has its own control with an associated service. This allows fore more flexible integration of the toolbar buttons in the editor by just providing an event to listen to. Also button states can be set globally depending on state. Some parts are still a bit hacky, but it should be a good basis.
The map template properties are now a lot simpler and no longer hidden in an expander. Maybe map size should also only be enabled when a toggle is set, together with playable area. Added styling for sliders and some general tweaks to styling.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In preparation for the adaptation to Anno 117 - Pax Romana, I want to merge my UI and QOL enhancements to the main repository and create an up-to-date release of the Anno 1800-only variant of the Map Editor as version 0.6.0.
The editor in this version has been in use for a few months and no major bugs are known that would prevent a release. But the software is still heavily WIP of course.
Any further work will have 117 in mind and aims to make the editor fully compatible with both games.