Skip to content

Releases: enigma-dev/RadialGM

RadialGM-v1.0.128

24 Nov 04:17
8d48718
Compare
Choose a tag to compare
Linux CMake for emake/Update Submodule (#52)

Update the enigma-dev submodule to the latest master and tweak the AppVeyor build to be compatible with FindProtobuf.

RadialGM-v1.0.127

17 Nov 12:39
c099a98
Compare
Choose a tag to compare
Tree Drag & Drop (#51)

* Changed `TreeModel` constructor to accept `ResourceModelMap` so the tree model is capable of adding new resources to the map when doing a drag copy operation.
* Changed `MainWindow::CreateResource` to allocate a new `TreeNode` directly instead of through the root. I did this originally anticipating that `TreeModel::addNode` would be used by the drag and drop code, but ultimately it wasn't.
* Changed TreeModel::addNode to append the allocated child and undid the change in #47 we merged a few days ago.
* Created the helper `ResourceModelMap::CreateResourceName` which gives a unique name for a new resource of the given type. This was created by extracting the logic from `MainWindow::CreateResource` so that it could also be used by a drag copy operation. Again, I will reiterate from my previous comments on #42 that this can later be made more efficient by just caching the last number (maybe max id) used to create a new resource of that type.
* Changed the `dragDropMode` of the main window's tree view to `DragDrop` instead of `InternalMove` because we want to support copying the resources to the same target. Without this change the copy operation (done by holding CTRL during the drag) becomes just a move operation when the source and target are the same view.
* Changed `TreeModel::flags` to indicate `Qt::ItemIsDropEnabled` where appropriate (e.g, folders & the root) and `Qt::ItemIsDragEnabled` where appropriate (e.g, every valid/visible node).
* Changed `TreeModel::parent` to return an invalid model index, which means the root, when the parent node found in the `parents` map is null. This is actually an error condition and should hypothetically only occur if a logic mistake is made somewhere else, but I ran into it while doing this drag and drop and hence made the change.
* Added `TreeModel::supportedDropActions` to indicate that we support `MoveAction` and not just `CopyAction` (the default implementation of `QAbstractItemModel`).
* Added the private inline helper `TreeNode::treeNodeMime` so I didn't have to repeat the literal string multiple times, which decreases the potential for mistakes and typos and turns them into a compile-time error instead.
* Added `TreeModel::mimeTypes` to return the mime types supported by the tree model, for now it's just the "RadialGM/TreeNode" custom mime that is currently pointer based.
* Added `TreeModel::mimeData` to serialize tree nodes for drag and drop operations. 
    - It cannot do any IPC transferring of the data because it is purely pointer based for now.
    - I guard against drag operations originating outside the process by writing the application process id to the data stream and checking it later during the drop processing.
    - This can later be changed to just serialize the proto into bytes, but that requires some extra work I didn't want to do yet. For example, it will need to do some file transferring as well for certain resources like the sound file of a sound resource. I am not too sure how interested people would be in this proposed feature yet.
    - I sort the indices from lowest to highest row number so that I can make certain assumptions when processing a drop operation. For example, one of the things I like to assume is that other nodes removed from the same parent have effectively decreased the index of the current row we are removing. This also allows me to create new names for the nodes during a drag copy operation in a consecutive order.
* Added `TreeModel::dropMimeData` so the tree model can accept drop operations.
    - `ExtractSubrange` is used to remove the node from its parent's `child` repeated pointer field. I used this because it seemed to work but also the documentation says it releases ownership without destroying the item, which is what was intended.
    - `MoveAction` is the trickier one because it requires adjusting the insert and remove rows based on what rows we are dragging. This is even more complicated considering the fact that I chose to allow non-contiguous selections in the tree.
    - `CopyAction` is handled by doing a copy of the proto, not removing the previous nodes, and inserting the new nodes with a unique name based on their type. Later this will need to duplicate files on disk for certain resources, like the sound data file for a sound.
    - The insertion of the moved or copied nodes is done by appending it at the end of the new parent's `child` field. I then swap it into place since `RepeatedPtrField` has no built-in way of inserting items anywhere other than the end.

RadialGM-v1.0.126

13 Nov 02:18
cd8ff62
Compare
Choose a tag to compare
Missing emake Crash Fix (#48)

Make keyword API a noop if emake not connected and look for emake in a folder named "enigma-dev" next to the executable.

RadialGM-v1.0.125

13 Nov 01:47
cab1e51
Compare
Choose a tag to compare
Resource Renaming Fix (#46)

* Removed the lambda that listens to `QAbstractItemModel::dataChanged` signal of `treeModel` to update the subwindow title for opened editors.
* Changed the `BaseEditor::dataChanged` slot to update the subwindow title.
* Changed `MainWindow::openSubWindow` to set the subwindow title directly on the editor widget that is used to create the subwindow. This stops the subwindow title from overriding the one set in the `BaseEditor::dataChanged` slot.
* Changed `TreeModel::setData` to compare the old and new name and short-circuit without firing any signals if they are the same.
* Added a `ResourceRenamed` signal to `TreeModel` that has the same signature as the signal emitted by `BaseEditor`.
* Changed `ResourceModelMap::ResourceRenamed` slot to compare the old and new name and short-circuit if they are the same or if there was no entry for a resource under the old name. Also made it remove the entry under the old name instead of setting it to a `nullptr` which should be safer and keep the map from growing unnecessarily large.
* Connected the `treeModel` to `resMap` so the latter is informed of when resources are renamed directly from the tree via an edit trigger. This fixes a crash that occurs when attempting to open the editor of a resource after just having renamed it in the tree.
* Connected the `treeModel` to `res` in `MainWindow::openSubWindow` so `res` knows when the resource is renamed from the tree. This ensures the subwindow title is updated when the resource is renamed from the tree.
* Changed `ProtoModel` constructor to forward its `dataChanged` signal that provides the old value as the `QAbstractItemModel` signal by the same name which doesn't. This ensures that components, like ImmediateMapper, that listen for the old signal will still receive the signal even if they don't care about the optional parameter.

RadialGM-v1.0.124

12 Nov 06:51
67bbf72
Compare
Choose a tag to compare
Fix Crash When Adding Tree Node (#47)

Use the correct row index when inserting a node into the tree which is one less than the child size since the child has already been added to the parent.

RadialGM-v1.0.123

11 Nov 15:47
Compare
Choose a tag to compare
Update enigma-dev submodule.

ENIGMA's history has been rewritten to remove some binaries and undesirable commits.
RadialGM's submodule must be updated.

RadialGM-v1.0.122

08 Nov 03:46
73d6e5a
Compare
Choose a tag to compare
Fix Crash When Opening Unknown Resources (#45)

Change the logic for opening a subwindow to not insert a tree node into the subwindows map unless there's a registered factory for the tree node's type case and a new subwindow is in fact created.

RadialGM-v1.0.121

05 Nov 12:53
c4cd13e
Compare
Choose a tag to compare
Fix Tree Model Crashes for Missing Previews (#44)

Use no icon for sprites without subimages, missing sprite/background images, and objects with no sprites.

RadialGM-v1.0.120

05 Nov 03:26
4708e24
Compare
Choose a tag to compare
Fix for Unknown Resource Conversion to Sprites (#43)

Don't allocate oneof fields not already set. This prevents conversion of unknown resources to sprites with a 0 id.

RadialGM-v1.0.119

02 Nov 02:49
862e3d0
Compare
Choose a tag to compare
Creating Resources/Project Switching (#42)

* Moved `MainWindow::resourceMap` member from a raw pointer to a `QScopedPointer` with explicitly no parent to prevent double delete and ensure cleanup when switching projects.
* Moved `MainWindow::treeModel` member from a raw pointer to a `QScopedPointer` with explicitly no parent to prevent double delete and ensure cleanup when switching projects.
* Moved some logic from `MainWindow::openFile` to a new method  `MainWindow::openProject` so the same logic can be used to implement the new project action and to ensure that the same logic is used to reset the tree and model and such. The new method also closes all of the open subwindows before switching the project, which is necessary and what LGM and GM have always done too.
* Added `MainWindow::openNewProject` to make the new project action actually work and so the logic would not need duplicated for the main window constructor to initially start with a new project. The method also creates the new project with default folder/groups for all of our supported resource types.
* NOTE: `openNewProject` is called from the main window constructor so that if a project to load was specified on the command line and it fails, the window will still be initialized with a new project and be in a usable state.
* Added `MainWindow::CreateResource` which creates a new resource of the passed type case using reflection. The method uses the `MainWindow::resourceMap` to find a unique name though that implementation could later be made more efficient by having the resource map store the maximum/last id by type case. The new resource is added to the root tree node for now and then the resource is opened for editing.
* Added `ResourceModelMap::AddResource` to add newly created resources without having to duplicate logic from its constructor.
* Added `TreeModel::addNode` to add new nodes to the tree.