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

When finding a broken reference, offer option to remove the reference #1189

Open
bjorn opened this issue Jan 28, 2016 · 10 comments
Open

When finding a broken reference, offer option to remove the reference #1189

bjorn opened this issue Jan 28, 2016 · 10 comments
Labels
feature It's a feature, not a bug. usability Generally about making something more intuitive or efficient.

Comments

@bjorn
Copy link
Member

bjorn commented Jan 28, 2016

A possible resolution when a map refers to a no longer available file would be to remove the reference to that file (including any assets or tiles on the map relying on this reference).

Tiled could provide this action as an option in the broken references view (that pops up when opening a map with broken references).

Suggested at http://forum.mapeditor.org/t/art-study-castlevania-legends/1070

@bjorn bjorn added the feature It's a feature, not a bug. label Jan 28, 2016
@bjorn bjorn added the Urgent label Jun 22, 2016
@bjorn bjorn added the usability Generally about making something more intuitive or efficient. label Oct 25, 2016
@bjorn
Copy link
Member Author

bjorn commented Oct 25, 2016

First the broken references thing needs to be fixed on the wip/tilesetdocument branch, to avoid creating unnecessary conflicts.

@ketanhwr
Copy link
Contributor

@bjorn, what exactly is being worked upon in the wip/tilesetdocument branch? I'd like to pick this issue as my next conrribution :-)

@bjorn
Copy link
Member Author

bjorn commented Mar 26, 2017

@ketanhwr That was already done and this branch has been merged into master last year. It was the major reorganization to allow editing of external tilesets.

@ketanhwr
Copy link
Contributor

Why is this issue still open then?

@bjorn
Copy link
Member Author

bjorn commented Mar 26, 2017

@ketanhwr Because only the thing that needed to be done first is done, not what this task is actually about.

@ketanhwr
Copy link
Contributor

Alright.

@ketanhwr
Copy link
Contributor

This might be a stupid doubt, but there is an Ignore option when it comes to broken links. How exactly is it different from the one you've mentioned in this issue?

@bjorn
Copy link
Member Author

bjorn commented Mar 29, 2017

This might be a stupid doubt, but there is an Ignore option when it comes to broken links. How exactly is it different from the one you've mentioned in this issue?

"Ignore" means don't do anything and hide the widget, whereas "Remove" would change the map to remove the broken reference (which generally means tiles and tile objects may need to be removed).

@ketanhwr
Copy link
Contributor

So I've started working on this now. When a particular tileset is missing (MapTilesetReference), then I'm using the RemoveTileset class to remove the reference of that tileset.

What exactly is the difference between TilesetTileImageSource and TilesetImageSource? I think I should do the same in both of these cases as well?

After removing that Tileset from the references, I'm thinking of replacing all the Tiles linked with that Tileset with a blank Cell just like the Erase function. Is this fine?

@bjorn
Copy link
Member Author

bjorn commented Apr 4, 2017

What exactly is the difference between TilesetTileImageSource and TilesetImageSource? I think I should do the same in both of these cases as well?

TilesetImageSource means that the image source for a tileset can't be found. Removing that would mean removing the tileset from the map, which should indeed be the same as handling MapTilesetReference.

TilesetTileImageSource means that an image for one particular tile could not be found. In that case, you don't want to remove the entire tileset but you'd rather want to remove that single tile from the tileset (and clear any usages of that tile on the map). See TilesetEditor::removeTiles for how to do this.

After removing that Tileset from the references, I'm thinking of replacing all the Tiles linked with that Tileset with a blank Cell just like the Erase function. Is this fine?

You will have to do this, yes. See TilesetDock::removeTileset for this and its call to removeTileReferences. It uses a macro to make sure there is only one undo step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug. usability Generally about making something more intuitive or efficient.
Projects
None yet
Development

No branches or pull requests

2 participants