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

Editor: Adding layers from layers widget #2884

Merged
merged 6 commits into from
May 30, 2024

Conversation

Vankata453
Copy link
Member

@Vankata453 Vankata453 commented Apr 2, 2024

Adding layers to a sector now makes more sense, since it's done through a "+" button, found after the last layer on the layers widget. Pressing the button shows an object selection, just like in the toolbox widget, only containing the objects, formerly found in the "Sector" category for non-worldmap levels, and "Tilemap" and "Background" for worldmap levels. Pressing an object directly adds it to the sector.

image

To achieve this, most of the EditorToolboxWidget code, which managed tile/object selection, was moved to a different class. The resulting EditorTilebox class can also be used for features like tile backpacks in the future.

Additionally, this PR allows objects to be moved around right after the editor is started (without an objectgroup having to be active).

Closes #638.

Adding layers to a sector now makes more sense, since it's done through a "+" button, found after the last layer on the layers widget. Pressing the button shows an object selection, just like in the toolbox widget, only containing the objects, formerly found in the "Sector" category for non-worldmap levels, and "Tilemap" and "Background" for worldmap levels. Pressing an object directly adds it to the sector.

To achieve this, most of the `EditorToolboxWidget` code, which managed tile/object selection, was moved to a different class. The resulting `Tilebox` class can also be used for features like tile backpacks in the future.

Closes SuperTux#638.
@tobbi
Copy link
Member

tobbi commented Apr 2, 2024

Difficult to review. From my preliminary look, it seems like the code looks good. But let's avoid disasters and test this thoroughly. I like how this reduces complexity in the editor classes.

@tobbi
Copy link
Member

tobbi commented Apr 2, 2024

Maybe add a border around that thing so it isn't too "out of place"?

@MatusGuy MatusGuy self-assigned this Apr 5, 2024
Copy link
Member

@MatusGuy MatusGuy left a comment

Choose a reason for hiding this comment

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

Well done. I like this pr. I may now test in game

data/images/engine/editor/add.png Show resolved Hide resolved
@MatusGuy MatusGuy removed their assignment Apr 21, 2024
@tobbi
Copy link
Member

tobbi commented Apr 30, 2024

Can you rebase this, please?

@Vankata453 Vankata453 merged commit bbf318b into SuperTux:master May 30, 2024
33 checks passed
@Vankata453 Vankata453 deleted the editor-layers-add branch May 30, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework adding layers to sector
4 participants