diff --git a/core/src/mindustry/client/ui/SchematicBrowserDialog.java b/core/src/mindustry/client/ui/SchematicBrowserDialog.java index 3bb45d07ef..38d39ac90e 100644 --- a/core/src/mindustry/client/ui/SchematicBrowserDialog.java +++ b/core/src/mindustry/client/ui/SchematicBrowserDialog.java @@ -354,6 +354,15 @@ void tagsChanged(){ Core.settings.putJson("schematic-tags", String.class, tags); } + public void pruneTags() { + tags.removeAll(t -> { // Remove tags not attached to any schematics + for (var ss: loadedRepositories.values()) { + if (ss.find(s -> s.labels.contains(t)) != null) return false; + } + return true; + }); + } + void showAllTags(){ var dialog = new BaseDialog("@schematic.edittags"); dialog.addCloseButton(); @@ -365,6 +374,7 @@ void showAllTags(){ p.table(t -> { t.left().defaults().fillX().height(tagh).pad(2); t.button("@client.schematic.cleartags", Icon.refresh, selectedTags::clear).wrapLabel(false).get().getLabelCell().padLeft(5); + t.button("@client.schematic.prunetags", Icon.trash, this::pruneTags).wrapLabel(false).get().getLabelCell().padLeft(5); }); p.row();