Skip to content

RadialGM-v1.0.116

Compare
Choose a tag to compare
@EnigmaBot EnigmaBot released this 29 Oct 12:40
Recursive Models and Room Editor Rendering (#36)

* Added a 500mb pixmap cache to the `ArtManager` class for caching large images used by the background, sprite, and room renderering widgets. That way they don't each load their own copy. Later it can be expanded with a file change monitor to automatically reload the pixmaps when they are changed on disk.
* Changed ArtManager::GetIcon to load more icons that have not yet been loaded.
* Used `QMenuView` widget by Ulrich Van Den Hekke to implement resource picker.
* Changed `BackgroundEditor` and `ScriptEditor` to use the renamed default mapper of `BaseEditor` which distinguishes it from the mapper used for mapping the resource's name in the tree model.
* Changed `BackgroundEditor::dataChanged` to forward itself to the `BaseEditor` base event.
* Made the `BackgroundEditor` save button mutate the dirty state of the default resource mapper and not the dirty state of its model.
* Changed the `BaseEditor` close event to check the dirty state of the default resource mapper and not the dirty state of its model. When not saving changes it also now clears the mappings to its tree node mapper. Finally, it will otherwise mark its mapper as not dirty now instead of its model.
* Added a map of resource type cases to to tree node field numbers to `BaseEditor.h` to facilitate looking up the submodel of a tree node.
* Added a `ResourceRenamed` signal to `BaseEditor` that is emitted when the tree node of the resource is renamed.
* Used the tree node mapper of `BaseEditor` in the room editor to map the name field on the settings tab.
* Used the resource mapper of `BaseEditor` in the room editor to map the rest of the settings that are fields of the root room resource proto.
* Added a new mapper in the room editor to map the view settings on the views tab.
* Made the current view combo box change the currently mapped view resource on the views tab.
* Tied the selection of assets in the assets list to the model shown in the asset properties view. Later this same selection model needs to be shared with the RoomRenderer as well.
* Added a status bar just under the room renderer that tracks the mouse position.
* Used an event filter to paint the transparency checkerboard pattern on the background of the room preview scroll area viewport.
* Added zooming to the room editor and room renderer.
* Put the room preview and the room property tabs into a horizontal splitter so more screen space can be used when designing levels.
* Because we decided to deprecate the transparent field from GM6 in libEGM when I fixed GMK, I removed the transparent checkbox from the sprite and background editors as well as the logic from both renderers.
* Changed the close event of the main window to close all the subwindows which triggers their save changes dialog. More work needs to be done to this to make it perfect. Even if you decline the individual dialog for each editor, there should still be a final overruling dialog that's shown if the tree model itself is dirty. That is how GM5 behaved though it could be improved upon with "Yes to All" or "No to All".
* Changed the `BaseEditor` constructor to accept the tree node instead of its subresource so editors can map the name field.
* Created the composite `ModelMapper` class that combines `ImmediateDataWidgetMapper` together with `ProtoModel` using traditional class composition. Fundies argued that since everywhere we use a model, we also want a mapper, it ultimately will save redundant code.
* Changed the `ProtoModel` to deal with recursive submodels from nested protobuf messages.
* Added the `RepeatedProtoModel` class for use with repeated submodels, such as instances that are a repeated field in the Room proto.
* Added the `TreeSortFilterProxyModel` class for filtering the main tree by resource type. It is used in conjunction with QMenuView to implement the resource picker which needs to filter by type.
* Added the `RoomRenderer` widget that uses the submodels of the Room proto to render the room layers, views, assets, grid, etc.
* Added the `ResourceModelMap` class that facilitates in finding resources by name as well as getting an object/sprite preview for the tree.
* Fixed a typo in the background renderer's grid painting algorithm. The mistake was that fundies put width where he meant height for the number of horizontal lines.