GuiEditKeyframe now allows the user to set the Keyframe's exact position on the timeline

This commit is contained in:
CrushedPixel
2015-05-23 00:21:49 +02:00
parent cbbc50a37a
commit f9c3448cd5
4 changed files with 59 additions and 16 deletions

View File

@@ -309,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 && mc.currentScreen == null) {
if(mouseX >= (timelineX + 4) && mouseX <= width - 18 && mouseY >= 11 && mouseY <= 29 && mc.currentScreen.getClass() == GuiMouseInput.class) {
double tot = (width - 18) - (timelineX + 4);
double perc = (mouseX - (timelineX + 4)) / tot;
long time = Math.round(perc * (double) ReplayMod.replaySender.replayLength());
@@ -476,7 +476,7 @@ public class GuiReplayOverlay extends Gui {
}
//show Time String
if(mouseX >= zero && mouseX <= full && mouseY >= y && mouseY <= y + 22 && mc.currentScreen == null) {
if(mouseX >= zero && mouseX <= full && mouseY >= y && mouseY <= y + 22 && mc.currentScreen.getClass() == GuiMouseInput.class) {
long tot = Math.round((double) timelineLength * zoom_scale);
double perc = (mouseX - (realTimelineX + 4)) / (double) (full - zero);
@@ -543,7 +543,7 @@ public class GuiReplayOverlay extends Gui {
//handle Mouse clicks on realTimeLine
if(Mouse.isButtonDown(0) && FMLClientHandler.instance().isGUIOpen(GuiMouseInput.class) && !wasSliding && mouseX >= minX + tl_begin_width && mouseX <= maxX - tl_end_width &&
mouseY >= y && mouseY <= y + 22) {
mouseY >= y && mouseY <= y + 22 && !ReplayHandler.isInPath()) {
//calculate real time and set cursor accordingly
int width = (maxX - tl_end_width) - (minX + tl_begin_width);