-
Notifications
You must be signed in to change notification settings - Fork 5
Define custom shapes #158
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
Define custom shapes #158
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Mika Lehtinen <Smibu@users.noreply.github.com>
I haven't removed the support for deserialization of JSON shapes to help with converting between the old JSON and the new LEV format.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
… to adjust if necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates, it's getting closer to finish line :) I added a few more comments here.
Found a bug (imo): if I place a shape, reopen form and cancel, it forgets the last selected shape. I think this used to work so maybe broke in refactoring.
|
||
if (!IsHandleCreated) | ||
{ | ||
SharedContext = sharedContext; // Set shared context before initialization |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Yeah I know, it happened after refactoring to storing the state in the _shapeSelection object. I left it for now but I can see if I can fix it. 8000 |
ExtraRendering shouldn't be needed because we have transient elements already and we don't have to render anything extra Co-authored-by: Mika Lehtinen <Smibu@users.noreply.github.com>
Co-authored-by: Mika Lehtinen <Smibu@users.noreply.github.com>
The handle should never be able to be created at this point anyways
This reverts commit a5146ac.
…election after closing Shape Selection From with the Cancel button
The bug has been fixed here: 3fe32b0 |
…rong LGR when opening Shape Selection Form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This seems almost ready for merging. Can you update PR description to reflect current state? I will squash merge this, so PR title and description will be used as the commit message.
Co-authored-by: Mika Lehtinen <Smibu@users.noreply.github.com>
I've updated the pull request description (the first message in this pull request). Let me know if I should change anything :) |
Big thanks and congrats for getting this over the finish line. :) I will create a build later today and announce in discord. |
Thank you for all your help! Very much appreciated the time you put in to helping me get this finished :) |
This pull request adds a new Custom Shape Tool, called "Shape", to the Level Editor that allows you to quickly place predefined custom shapes into the current level.
Furthermore, this pull request also adds a new right click context menu option called "Save as shape..." which creates a new custom shape based on the current selection.
Custom shapes are saved as regular Elma levels (*.lev) on disk, and are grouped by sub-folders in the root folder for custom shapes. The root folder for custom shapes is called
sle_shapes
and will be created in the same directory as Elmanager.exe the first time a custom shape is saved.The custom shape collection is just a folder structure with files, and therefore easily shareable / importable / exportable.
The following components can be added to custom shapes:
The new Custom Shape Tool supports the following actions:
Images
New Shape button, and Shape Selection dialog
Shapes are grouped by folders.
Example shapes for quick testing
Here is an example collection of shapes you can use for trying it out.
Place the following
sle_shapes
folder in the same folder as the Elmanager.exesle_shapes.zip