Merge branch '1.8.9' into 1.9.4
ed56673Merge branch '1.8' into 1.8.991573d9Update jGui, ReplayStudio and Translationsd71358bAdd confirmation dialog before overwriting path presets (fixes #65)1a55983Move addCallback method from integration test Utils to main Utils18c5bcdBe more cooperative with other mods on the ingame menu (fixes #42)c054fe8Register keys for simplepathing only once (fixes #63)f13297cFix default interpolator handling in keyframe gui and after loading (fixes #64)391f304Show error popup if entity tracker fails to load0e0eaaaFix entity tracker being set even if it failed loading (fixes #50)a34bbbcFix NPE when spectating a player without a camera entity60879fbChange local class to be an inner class because Srg2Source breaks with itdfafbecLoad translations from github repo, only reload language not all resource packs8a6ec51Add missing tooltips to player overview and various missing chat messages5677fc5Re-add warning to replay editor748a91eFix missing tooltips on fav/like/dislike buttons in replay centeree24866Fix upload replay button not being updated when name/tags changedba085cMove translations into separate repo3f0e3e7Fix NPE when receiving Replay|Restrict messages (fixes #16 GH)40e1d85Fix crash when saving the last keyframe in the edit gui (fixes #61)03aada1Update Mixin to 0.6.8 (fixes #9 GH)0c1dc65Fix interpolator being lost when moving keyframe to the end (fixes #62)fcbbbc9Add integration test. Run with ./gradlew runIntegrationTestfe6ded0Fix movement of keyframe via GuiEditKeyframe not updating selected keyframef58fa8fFix Login GUI not respecting other GUIs opened on startup4fc3a31Fix OpenEye being installed into working dir instead of mcDataDir
This commit is contained in:
@@ -209,6 +209,9 @@ public class ReplayHandler {
|
||||
*/
|
||||
public void spectateEntity(Entity e) {
|
||||
CameraEntity cameraEntity = getCameraEntity();
|
||||
if (cameraEntity == null) {
|
||||
return; // Cannot spectate if we have no camera
|
||||
}
|
||||
if (e == null || e == cameraEntity) {
|
||||
spectating = null;
|
||||
e = cameraEntity;
|
||||
|
||||
@@ -6,7 +6,11 @@ import com.google.common.util.concurrent.Futures;
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import com.replaymod.core.utils.ModCompat;
|
||||
import com.replaymod.replay.camera.*;
|
||||
import com.replaymod.replay.camera.CameraController;
|
||||
import com.replaymod.replay.camera.CameraControllerRegistry;
|
||||
import com.replaymod.replay.camera.CameraEntity;
|
||||
import com.replaymod.replay.camera.ClassicCameraController;
|
||||
import com.replaymod.replay.camera.VanillaCameraController;
|
||||
import com.replaymod.replay.gui.overlay.GuiMarkerTimeline;
|
||||
import com.replaymod.replay.gui.screen.GuiModCompatWarning;
|
||||
import com.replaymod.replay.handler.GuiHandler;
|
||||
@@ -99,6 +103,7 @@ public class ReplayModReplay {
|
||||
@Override
|
||||
public void onSuccess(NoGuiScreenshot result) {
|
||||
try {
|
||||
core.printInfoToChat("replaymod.chat.savingthumb");
|
||||
replayHandler.getReplayFile().writeThumb(result.getImage());
|
||||
core.printInfoToChat("replaymod.chat.savedthumb");
|
||||
} catch (IOException e) {
|
||||
@@ -109,6 +114,7 @@ public class ReplayModReplay {
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
t.printStackTrace();
|
||||
core.printWarningToChat("replaymod.chat.failedthumb");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiHandler {
|
||||
private static final int BUTTON_EXIT_SERVER = 1;
|
||||
private static final int BUTTON_RETURN_TO_GAME = 4;
|
||||
private static final int BUTTON_ACHIEVEMENTS = 5;
|
||||
private static final int BUTTON_STATS = 6;
|
||||
private static final int BUTTON_OPEN_TO_LAN = 7;
|
||||
@@ -46,7 +46,9 @@ public class GuiHandler {
|
||||
// Pause replay when menu is opened
|
||||
mod.getReplayHandler().getReplaySender().setReplaySpeed(0);
|
||||
|
||||
for(GuiButton b : new ArrayList<>(event.getButtonList())) {
|
||||
GuiButton achievements = null, stats = null, openToLan = null;
|
||||
List<GuiButton> buttonList = event.getButtonList();
|
||||
for(GuiButton b : new ArrayList<>(buttonList)) {
|
||||
switch (b.id) {
|
||||
// Replace "Exit Server" button with "Exit Replay" button
|
||||
case BUTTON_EXIT_SERVER:
|
||||
@@ -55,15 +57,39 @@ public class GuiHandler {
|
||||
break;
|
||||
// Remove "Achievements", "Stats" and "Open to LAN" buttons
|
||||
case BUTTON_ACHIEVEMENTS:
|
||||
buttonList.remove(achievements = b);
|
||||
break;
|
||||
case BUTTON_STATS:
|
||||
buttonList.remove(stats = b);
|
||||
break;
|
||||
case BUTTON_OPEN_TO_LAN:
|
||||
event.getButtonList().remove(b);
|
||||
}
|
||||
// Move all buttons except the "Return to game" button upwards
|
||||
if (b.id != BUTTON_RETURN_TO_GAME) {
|
||||
b.yPosition -= 48;
|
||||
buttonList.remove(openToLan = b);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (achievements != null && stats != null) {
|
||||
moveAllButtonsDirectlyBelowUpwards(buttonList, achievements.yPosition,
|
||||
achievements.xPosition, stats.xPosition + stats.width);
|
||||
}
|
||||
if (openToLan != null) {
|
||||
moveAllButtonsDirectlyBelowUpwards(buttonList, openToLan.yPosition,
|
||||
openToLan.xPosition, openToLan.xPosition + openToLan.width);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves all buttons that are within a rectangle below a certain y coordinate upwards by 24 units.
|
||||
* @param buttons List of buttons
|
||||
* @param belowY The Y limit
|
||||
* @param xStart Left x limit of the rectangle
|
||||
* @param xEnd Right x limit of the rectangle
|
||||
*/
|
||||
private void moveAllButtonsDirectlyBelowUpwards(List<GuiButton> buttons, int belowY, int xStart, int xEnd) {
|
||||
for (GuiButton button : buttons) {
|
||||
if (button.yPosition >= belowY && button.xPosition <= xEnd && button.xPosition + button.width >= xStart) {
|
||||
button.yPosition -= 24;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user