Started creating GuiEditKeyframe
Therefore, added support for floating point numbers in GuiNumberInput
This commit is contained in:
@@ -118,12 +118,13 @@ public class GuiReplayOverlay extends Gui {
|
||||
@SubscribeEvent
|
||||
public void onRenderGui(RenderGameOverlayEvent.Post event) throws IllegalArgumentException, IllegalAccessException {
|
||||
|
||||
if(!ReplayHandler.isInReplay() || FMLClientHandler.instance().isGUIOpen(GuiSpectateSelection.class)
|
||||
if(!ReplayHandler.isInReplay() || FMLClientHandler.instance().isGUIOpen(GuiPlayerOverview.class)
|
||||
|| VideoWriter.isRecording() || FMLClientHandler.instance().isGUIOpen(GuiKeyframeRepository.class)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!ReplayGuiRegistry.hidden) ReplayGuiRegistry.hide();
|
||||
if(!ReplayGuiRegistry.hidden && ReplayHandler.isCamera()) ReplayGuiRegistry.hide();
|
||||
else if(!ReplayHandler.isCamera() && ReplayGuiRegistry.hidden) ReplayGuiRegistry.show();
|
||||
|
||||
if(FMLClientHandler.instance().isGUIOpen(GuiChat.class) || FMLClientHandler.instance().isGUIOpen(GuiInventory.class)) {
|
||||
mc.displayGuiScreen(new GuiMouseInput());
|
||||
@@ -308,7 +309,7 @@ public class GuiReplayOverlay extends Gui {
|
||||
GlStateManager.resetColor();
|
||||
this.drawModalRectWithCustomSizedTexture(time_ButtonX, time_ButtonY, x, y, 20, 20, 64, 64);
|
||||
|
||||
if(mouseX >= (timelineX + 4) && mouseX <= width - 18 && mouseY >= 11 && mouseY <= 29) {
|
||||
if(mouseX >= (timelineX + 4) && mouseX <= width - 18 && mouseY >= 11 && mouseY <= 29 && mc.currentScreen == null) {
|
||||
double tot = (width - 18) - (timelineX + 4);
|
||||
double perc = (mouseX - (timelineX + 4)) / tot;
|
||||
long time = Math.round(perc * (double) ReplayMod.replaySender.replayLength());
|
||||
@@ -365,6 +366,8 @@ public class GuiReplayOverlay extends Gui {
|
||||
this.drawModalRectWithCustomSizedTexture(cursorX - 3, y + 3, 44, 0, 8, 16, 64, 64);
|
||||
}
|
||||
|
||||
private long keyframeSelectionTime = 0;
|
||||
|
||||
private void drawRealTimeline(int minX, int maxX, int y, int mouseX, int mouseY) {
|
||||
int zero = minX + tl_begin_width;
|
||||
int full = maxX - tl_end_width;
|
||||
@@ -469,7 +472,7 @@ public class GuiReplayOverlay extends Gui {
|
||||
}
|
||||
|
||||
//show Time String
|
||||
if(mouseX >= zero && mouseX <= full && mouseY >= y && mouseY <= y + 22) {
|
||||
if(mouseX >= zero && mouseX <= full && mouseY >= y && mouseY <= y + 22 && mc.currentScreen == null) {
|
||||
long tot = Math.round((double) timelineLength * zoom_scale);
|
||||
double perc = (mouseX - (realTimelineX + 4)) / (double) (full - zero);
|
||||
|
||||
@@ -554,13 +557,23 @@ public class GuiReplayOverlay extends Gui {
|
||||
//tolerance is 2 pixels multiplied with the timespan of one pixel
|
||||
int tolerance = 2 * Math.round(abs_width / (float) width);
|
||||
|
||||
Keyframe close;
|
||||
if(mouseY >= y + 9) {
|
||||
TimeKeyframe close = ReplayHandler.getClosestTimeKeyframeForRealTime(ReplayHandler.getRealTimelineCursor(), tolerance);
|
||||
close = ReplayHandler.getClosestTimeKeyframeForRealTime(ReplayHandler.getRealTimelineCursor(), tolerance);
|
||||
ReplayHandler.selectKeyframe(close); //can be null, deselects keyframe
|
||||
} else {
|
||||
PositionKeyframe close = ReplayHandler.getClosestPlaceKeyframeForRealTime(ReplayHandler.getRealTimelineCursor(), tolerance);
|
||||
close = ReplayHandler.getClosestPlaceKeyframeForRealTime(ReplayHandler.getRealTimelineCursor(), tolerance);
|
||||
ReplayHandler.selectKeyframe(close); //can be null, deselects keyframe
|
||||
}
|
||||
|
||||
if(close != null) {
|
||||
long cur = System.currentTimeMillis();
|
||||
if(cur - keyframeSelectionTime < 500) { //if double click on Keyframe
|
||||
mc.displayGuiScreen(new GuiEditKeyframe(close));
|
||||
} else {
|
||||
keyframeSelectionTime = cur;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,8 +95,6 @@ public class RecordingHandler {
|
||||
|
||||
packet.readPacketData(pb);
|
||||
|
||||
packet.field_148960_i = player.getDataWatcher();
|
||||
|
||||
return packet;
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -320,7 +318,6 @@ public class RecordingHandler {
|
||||
if(event.entity.getEntityId() != mc.thePlayer.getEntityId()) {
|
||||
return;
|
||||
}
|
||||
;
|
||||
|
||||
S19PacketEntityStatus packet = new S19PacketEntityStatus();
|
||||
|
||||
@@ -358,7 +355,6 @@ public class RecordingHandler {
|
||||
if(event.entity.getEntityId() != mc.thePlayer.getEntityId()) {
|
||||
return;
|
||||
}
|
||||
;
|
||||
|
||||
S19PacketEntityStatus packet = new S19PacketEntityStatus();
|
||||
|
||||
@@ -404,7 +400,6 @@ public class RecordingHandler {
|
||||
if(event.entityPlayer != mc.thePlayer) {
|
||||
return;
|
||||
}
|
||||
;
|
||||
|
||||
System.out.println(event.getResult());
|
||||
S0APacketUseBed pub = new S0APacketUseBed();
|
||||
@@ -433,7 +428,6 @@ public class RecordingHandler {
|
||||
if(event.player != mc.thePlayer) {
|
||||
return;
|
||||
}
|
||||
;
|
||||
|
||||
S1BPacketEntityAttach pea = new S1BPacketEntityAttach();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user