Merge branch '1.9.4' into 1.10.2
54790d3Merge branch '1.8' into 1.9.40ba5b0aMerge branch '1.8-shaders' into 1.81658617Merge branch '1.8' into 1.9.40db1b9eFix opening a replay multiple times by quickly double clicking (fixes #25)5014edaRemove javascript comments from mcmod.infoe5eb982Add Optifine compatibility to rendering by disabling their separate chunk loading queue Add compatibility to shaders that utilize the Shadow Map by manually setting displayListEntitiesDirty to false Call Shaders.beginRender in an Event Handler to avoid calling all of EntityRenderer#renderWorld3a28c5bDraw the GuiVideoRenderer on a separate framebuffer that has the actual size of the window instead of MC's framebuffer which may have a different size636ce7bAdd compatibility for GLSL Shaders92eb11aChange video preview to be compatible with Optifine9ff767bFix spectated player having the arm model of the camera playerd82cef3Make sure video folder exists before rendering (fixes #24)cc65b26Replace custom update system with forge update checkerc8b71dcAdd tooltips to ingame buttonsb240f8aFix camera path always playing from the beginning regardless of ctrl key4805e5eFix crash when setting two keyframes to the same time via the edit keyframe gui18f8303Fix crash when moving the last keyframefcd4c07Add error popup when trying to play path with reversed time keyframes Update jGui9c605baUpdate jGui Fix handling of ESC key in popups (fixes #17)721fdc4Allow moving the keyframe timeline cursor by dragging (fixes #18)1851e97Allow deletion of selected keyframes by pressing the DELETE key (fixes #19)d547098Fix markers not being removedb2c7faaFix marker not being deselected when clicking anywhere else4e6b387Update jGui Fix popups being drawn outside of the actually visible element (fixes #21)21bbeb2Fix bitrate field always being active regardless of selected preset (fixes #20)b5a6d8bFix camera player head being visible while in third persondd0537bCenter star between resolution fields in render settings guie35bfcaIncrease spacing between rows in the render settings gui6d0cdfbUpdate jGui (fixes #15)
This commit is contained in:
@@ -29,10 +29,7 @@ import net.minecraftforge.fml.common.network.handshake.NetworkDispatcher;
|
||||
import org.lwjgl.opengl.Display;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import static net.minecraft.client.renderer.GlStateManager.*;
|
||||
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
|
||||
@@ -62,7 +59,7 @@ public class ReplayHandler {
|
||||
*/
|
||||
private boolean suppressCameraMovements;
|
||||
|
||||
private final Set<Marker> markers;
|
||||
private final List<Marker> markers;
|
||||
|
||||
private final GuiReplayOverlay overlay;
|
||||
|
||||
@@ -81,7 +78,7 @@ public class ReplayHandler {
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new ReplayOpenEvent.Pre(this));
|
||||
|
||||
markers = new HashSet<>(replayFile.getMarkers().or(Collections.<Marker>emptySet()));
|
||||
markers = new ArrayList<>(replayFile.getMarkers().or(Collections.emptySet()));
|
||||
|
||||
replaySender = new ReplaySender(this, replayFile, asyncMode);
|
||||
|
||||
@@ -188,9 +185,9 @@ public class ReplayHandler {
|
||||
/**
|
||||
* Returns all markers.
|
||||
* When changed, {@link #saveMarkers()} should be called to save the changes.
|
||||
* @return Set of markers
|
||||
* @return Collection of markers in no particular order
|
||||
*/
|
||||
public Set<Marker> getMarkers() {
|
||||
public Collection<Marker> getMarkers() {
|
||||
return markers;
|
||||
}
|
||||
|
||||
@@ -199,7 +196,7 @@ public class ReplayHandler {
|
||||
*/
|
||||
public void saveMarkers() {
|
||||
try {
|
||||
replayFile.writeMarkers(markers);
|
||||
replayFile.writeMarkers(new HashSet<>(markers));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
@@ -237,6 +238,14 @@ public class CameraEntity extends EntityPlayerSP {
|
||||
return ReplayModReplay.instance.getReplayHandler().isCameraView(); // Make sure we're treated as spectator
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderInPass(int pass) {
|
||||
// Never render the camera
|
||||
// This is necessary to hide the player head in third person mode and to not
|
||||
// cause any unwanted shadows when rendering with shaders.
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getLocationSkin() {
|
||||
Entity view = mc.getRenderViewEntity();
|
||||
@@ -246,6 +255,15 @@ public class CameraEntity extends EntityPlayerSP {
|
||||
return super.getLocationSkin();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSkinType() {
|
||||
Entity view = mc.getRenderViewEntity();
|
||||
if (view != this && view instanceof AbstractClientPlayer) {
|
||||
return ((AbstractClientPlayer) view).getSkinType();
|
||||
}
|
||||
return super.getSkinType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSwingProgress(float renderPartialTicks) {
|
||||
Entity view = mc.getRenderViewEntity();
|
||||
|
||||
@@ -5,14 +5,17 @@ import com.replaymod.replay.ReplayHandler;
|
||||
import de.johni0702.minecraft.gui.container.GuiContainer;
|
||||
import de.johni0702.minecraft.gui.container.GuiPanel;
|
||||
import de.johni0702.minecraft.gui.element.*;
|
||||
import de.johni0702.minecraft.gui.function.Typeable;
|
||||
import de.johni0702.minecraft.gui.layout.GridLayout;
|
||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||
import de.johni0702.minecraft.gui.layout.VerticalLayout;
|
||||
import de.johni0702.minecraft.gui.popup.AbstractGuiPopup;
|
||||
import de.johni0702.minecraft.gui.utils.Colors;
|
||||
import com.replaymod.replaystudio.data.Marker;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.util.ReadablePoint;
|
||||
|
||||
public class GuiEditMarkerPopup extends AbstractGuiPopup<GuiEditMarkerPopup> {
|
||||
public class GuiEditMarkerPopup extends AbstractGuiPopup<GuiEditMarkerPopup> implements Typeable {
|
||||
private final ReplayHandler replayHandler;
|
||||
private final Marker marker;
|
||||
|
||||
@@ -107,4 +110,13 @@ public class GuiEditMarkerPopup extends AbstractGuiPopup<GuiEditMarkerPopup> {
|
||||
protected GuiEditMarkerPopup getThis() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean typeKey(ReadablePoint mousePosition, int keyCode, char keyChar, boolean ctrlDown, boolean shiftDown) {
|
||||
if (keyCode == Keyboard.KEY_ESCAPE) {
|
||||
cancelButton.onClick();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,6 +133,8 @@ public class GuiMarkerTimeline extends AbstractGuiTimeline<GuiMarkerTimeline> im
|
||||
replayHandler.doJump(marker.getTime(), false);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
selectedMarker = null;
|
||||
}
|
||||
return super.mouseClick(position, button);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@ import de.johni0702.minecraft.gui.GuiRenderer;
|
||||
import de.johni0702.minecraft.gui.RenderInfo;
|
||||
import de.johni0702.minecraft.gui.container.AbstractGuiOverlay;
|
||||
import de.johni0702.minecraft.gui.container.GuiPanel;
|
||||
import de.johni0702.minecraft.gui.element.GuiElement;
|
||||
import de.johni0702.minecraft.gui.element.GuiSlider;
|
||||
import de.johni0702.minecraft.gui.element.GuiTexturedButton;
|
||||
import de.johni0702.minecraft.gui.element.GuiTooltip;
|
||||
import de.johni0702.minecraft.gui.element.advanced.IGuiTimeline;
|
||||
import de.johni0702.minecraft.gui.layout.CustomLayout;
|
||||
import de.johni0702.minecraft.gui.layout.HorizontalLayout;
|
||||
@@ -27,8 +29,20 @@ public class GuiReplayOverlay extends AbstractGuiOverlay<GuiReplayOverlay> {
|
||||
|
||||
public final GuiPanel topPanel = new GuiPanel(this)
|
||||
.setLayout(new HorizontalLayout(HorizontalLayout.Alignment.LEFT).setSpacing(5));
|
||||
public final GuiTexturedButton playPauseButton = new GuiTexturedButton().setSize(20, 20)
|
||||
.setTexture(ReplayMod.TEXTURE, TEXTURE_SIZE);
|
||||
public final GuiTexturedButton playPauseButton = new GuiTexturedButton() {
|
||||
@Override
|
||||
public GuiElement getTooltip(RenderInfo renderInfo) {
|
||||
GuiTooltip tooltip = (GuiTooltip) super.getTooltip(renderInfo);
|
||||
if (tooltip != null) {
|
||||
if (getTextureNormal().getY() == 0) { // Play button
|
||||
tooltip.setI18nText("replaymod.gui.ingame.menu.unpause");
|
||||
} else { // Pause button
|
||||
tooltip.setI18nText("replaymod.gui.ingame.menu.pause");
|
||||
}
|
||||
}
|
||||
return tooltip;
|
||||
}
|
||||
}.setSize(20, 20).setTexture(ReplayMod.TEXTURE, TEXTURE_SIZE).setTooltip(new GuiTooltip());
|
||||
public final GuiSlider speedSlider = new GuiSlider().setSize(100, 20).setSteps(37); // 0.0 is not included
|
||||
public final GuiMarkerTimeline timeline;
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ public class GuiReplayViewer extends GuiScreen {
|
||||
}).onSelectionDoubleClicked(() -> {
|
||||
if (this.loadButton.isEnabled()) {
|
||||
this.loadButton.onClick();
|
||||
// Disable load button to prevent the player from opening the replay twice at the same time
|
||||
this.loadButton.setDisabled();
|
||||
}
|
||||
}).setDrawShadow(true).setDrawSlider(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user