Copy button for content patches
This commit is contained in:
@@ -78,6 +78,11 @@ public class MapPatchesDialog extends BaseDialog{
|
|||||||
b.getLabel().setAlignment(Align.left, Align.left);
|
b.getLabel().setAlignment(Align.left, Align.left);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
t.button(Icon.copy, Styles.graySquarei, Vars.iconMed, () -> {
|
||||||
|
Core.app.setClipboardText(patch.patch);
|
||||||
|
ui.showInfoFade("@copied");
|
||||||
|
}).size(h);
|
||||||
|
|
||||||
t.button(Icon.refresh, Styles.graySquarei, Vars.iconMed, () -> {
|
t.button(Icon.refresh, Styles.graySquarei, Vars.iconMed, () -> {
|
||||||
showImport(str -> addPatch(str, patches.indexOf(patch)));
|
showImport(str -> addPatch(str, patches.indexOf(patch)));
|
||||||
}).size(h);
|
}).size(h);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class ContentPatcher{
|
|||||||
private Json json;
|
private Json json;
|
||||||
private boolean applied;
|
private boolean applied;
|
||||||
private ContentLoader contentLoader;
|
private ContentLoader contentLoader;
|
||||||
private ObjectSet<PatchRecord> usedpatches = new ObjectSet<>();
|
private ObjectSet<Object> usedpatches = new ObjectSet<>();
|
||||||
private Seq<Runnable> resetters = new Seq<>();
|
private Seq<Runnable> resetters = new Seq<>();
|
||||||
private Seq<Runnable> afterCallbacks = new Seq<>();
|
private Seq<Runnable> afterCallbacks = new Seq<>();
|
||||||
private @Nullable PatchSet currentlyApplying;
|
private @Nullable PatchSet currentlyApplying;
|
||||||
@@ -122,7 +122,7 @@ public class ContentPatcher{
|
|||||||
field = path[path.length - 1];
|
field = path[path.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(object instanceof Content c){
|
if(object instanceof Content c && usedpatches.add(c)){
|
||||||
after(c::afterPatch);
|
after(c::afterPatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user