Removed possible sources of issues with the Replay Speed value
This commit is contained in:
@@ -121,6 +121,7 @@ public class GuiEventHandler {
|
||||
@SubscribeEvent
|
||||
public void onInit(InitGuiEvent event) {
|
||||
if(event.gui instanceof GuiIngameMenu && ReplayHandler.isInReplay()) {
|
||||
ReplayMod.replaySender.setReplaySpeed(0);
|
||||
for(GuiButton b : new ArrayList<GuiButton>(event.buttonList)) {
|
||||
if(b.id == 1) {
|
||||
b.displayString = I18n.format("replaymod.gui.exit");
|
||||
|
||||
@@ -37,11 +37,8 @@ public class GuiKeyframeRepository extends GuiScreen {
|
||||
|
||||
private int currentSetTimeKeyframeCount, currentSetPositionKeyframeCount, currentSetDuration;
|
||||
|
||||
private double prevSpeed;
|
||||
|
||||
public GuiKeyframeRepository(KeyframeSet[] keyframeRepository) {
|
||||
this.keyframeRepository = keyframeRepository;
|
||||
prevSpeed = ReplayMod.replaySender.getReplaySpeed();
|
||||
ReplayMod.replaySender.setReplaySpeed(0);
|
||||
}
|
||||
|
||||
@@ -226,7 +223,6 @@ public class GuiKeyframeRepository extends GuiScreen {
|
||||
ArrayList<KeyframeSet> copy = new ArrayList<KeyframeSet>(keyframeSetList.getCopyOfElements());
|
||||
this.keyframeRepository = copy.toArray(new KeyframeSet[copy.size()]);
|
||||
ReplayHandler.setKeyframeRepository(keyframeRepository, true);
|
||||
ReplayMod.replaySender.setReplaySpeed(prevSpeed);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,6 @@ public class GuiSpectateSelection extends GuiScreen {
|
||||
|
||||
private int lowerBound;
|
||||
|
||||
private double prevSpeed;
|
||||
private boolean drag = false;
|
||||
private int lastY = 0;
|
||||
private int fitting = 0;
|
||||
@@ -37,8 +36,6 @@ public class GuiSpectateSelection extends GuiScreen {
|
||||
private final String screenTitle = I18n.format("replaymod.gui.spectate.title");
|
||||
|
||||
public GuiSpectateSelection(List<EntityPlayer> players) {
|
||||
this.prevSpeed = ReplayMod.replaySender.getReplaySpeed();
|
||||
|
||||
Collections.sort(players, new PlayerComparator());
|
||||
|
||||
this.players = new ArrayList<Pair<EntityPlayer, ResourceLocation>>();
|
||||
@@ -84,7 +81,6 @@ public class GuiSpectateSelection extends GuiScreen {
|
||||
int off = mouseY - 30;
|
||||
int p = (off / 21) + upperPlayer;
|
||||
ReplayHandler.spectateEntity(players.get(p).first());
|
||||
ReplayMod.replaySender.setReplaySpeed(prevSpeed);
|
||||
mc.displayGuiScreen(null);
|
||||
}
|
||||
}
|
||||
@@ -115,11 +111,6 @@ public class GuiSpectateSelection extends GuiScreen {
|
||||
super.mouseClickMove(mouseX, mouseY, clickedMouseButton, timeSinceLastClick);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
ReplayMod.replaySender.setReplaySpeed(prevSpeed);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseReleased(int mouseX, int mouseY, int state) {
|
||||
drag = false;
|
||||
|
||||
Reference in New Issue
Block a user