Add clear all keyframes key
This commit is contained in:
@@ -37,6 +37,8 @@ import de.johni0702.minecraft.gui.layout.CustomLayout;
|
|||||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||||
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||||
|
import de.johni0702.minecraft.gui.popup.GuiYesNoPopup;
|
||||||
|
import de.johni0702.minecraft.gui.utils.Colors;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import org.apache.commons.lang3.tuple.Triple;
|
import org.apache.commons.lang3.tuple.Triple;
|
||||||
@@ -354,6 +356,28 @@ public class GuiPathing {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
core.getKeyBindingRegistry().registerKeyBinding("replaymod.input.clearkeyframes", Keyboard.KEY_C, () -> {
|
||||||
|
GuiYesNoPopup popup = GuiYesNoPopup.open(overlay,
|
||||||
|
new GuiLabel().setI18nText("replaymod.gui.clearcallback.title").setColor(Colors.BLACK)
|
||||||
|
).setYesI18nLabel("gui.yes").setNoI18nLabel("gui.no");
|
||||||
|
Futures.addCallback(popup.getFuture(), new FutureCallback<Boolean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Boolean delete) {
|
||||||
|
if (delete) {
|
||||||
|
Timeline timeline = mod.createTimeline();
|
||||||
|
timeline.createPath();
|
||||||
|
timeline.createPath();
|
||||||
|
mod.setCurrentTimeline(timeline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Start loading entity tracker
|
// Start loading entity tracker
|
||||||
entityTrackerFuture = SettableFuture.create();
|
entityTrackerFuture = SettableFuture.create();
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user