diff --git a/docs/content.md b/docs/content.md index 8d89465d..b5b8a203 100755 --- a/docs/content.md +++ b/docs/content.md @@ -46,7 +46,7 @@ To access the **Replay Mod Settings** from the Main Menu click the **"Replay Vie While playing, you can click the 'Mods' button in the Pause screen to reach **Replay Mod Settings** if you use Minecraft 1.12.2 and below, or have the mod [Mod Menu](https://www.curseforge.com/minecraft/mc-mods/modmenu) installed. When in a Replay, you can either bind a hotkey to the **Replay Mod Settings** in Minecraft's Control settings -or use the hotkey GUI by clicking on the arrow button in the lower left corner. +or use the hotkey GUI by clicking on the hamburger button in the lower left corner. ## Accounts [accounts] In previous versions of ReplayMod we used accounts to deliver videos to the **Replay Center**. This has since been discontinued and with that, so have the accounts. diff --git a/src/main/java/com/replaymod/extras/FullBrightness.java b/src/main/java/com/replaymod/extras/FullBrightness.java index 2459af5b..4f1fa7c5 100644 --- a/src/main/java/com/replaymod/extras/FullBrightness.java +++ b/src/main/java/com/replaymod/extras/FullBrightness.java @@ -23,7 +23,7 @@ import com.replaymod.core.events.PostRenderCallback; public class FullBrightness extends EventRegistrations implements Extra { private ReplayModReplay module; - private final IGuiImage indicator = new GuiImage().setTexture(ReplayMod.TEXTURE, 90, 20, 19, 13).setSize(19, 13); + private final IGuiImage indicator = new GuiImage().setTexture(ReplayMod.TEXTURE, 90, 20, 19, 16).setSize(19, 16); private MinecraftClient mc; private boolean active; diff --git a/src/main/java/com/replaymod/extras/HotkeyButtons.java b/src/main/java/com/replaymod/extras/HotkeyButtons.java index cbd204cd..69b0b709 100644 --- a/src/main/java/com/replaymod/extras/HotkeyButtons.java +++ b/src/main/java/com/replaymod/extras/HotkeyButtons.java @@ -52,7 +52,7 @@ public class HotkeyButtons extends EventRegistrations implements Extra { public Gui(ReplayMod mod, GuiReplayOverlay overlay) { toggleButton = new GuiTexturedButton(overlay).setSize(20, 20) - .setTexture(ReplayMod.TEXTURE, ReplayMod.TEXTURE_SIZE).setTexturePosH(0, 0) + .setTexture(ReplayMod.TEXTURE, ReplayMod.TEXTURE_SIZE).setTexturePosH(0, 120) .onClick(new Runnable() { @Override public void run() { diff --git a/src/main/java/com/replaymod/extras/QuickMode.java b/src/main/java/com/replaymod/extras/QuickMode.java new file mode 100644 index 00000000..454d20be --- /dev/null +++ b/src/main/java/com/replaymod/extras/QuickMode.java @@ -0,0 +1,52 @@ +package com.replaymod.extras; + +import com.replaymod.core.ReplayMod; +import com.replaymod.core.versions.MCVer.Keyboard; +import com.replaymod.replay.ReplayHandler; +import com.replaymod.replay.ReplayModReplay; +import com.replaymod.replay.events.ReplayOpenedCallback; +import com.replaymod.replay.gui.overlay.GuiReplayOverlay; +import de.johni0702.minecraft.gui.element.GuiImage; +import de.johni0702.minecraft.gui.layout.HorizontalLayout; +import de.johni0702.minecraft.gui.utils.EventRegistrations; + +public class QuickMode extends EventRegistrations implements Extra { + private ReplayModReplay module; + + private final GuiImage indicator = new GuiImage().setTexture(ReplayMod.TEXTURE, 40, 100, 16, 16).setSize(16, 16); + + @Override + public void register(final ReplayMod mod) { + this.module = ReplayModReplay.instance; + + mod.getKeyBindingRegistry().registerKeyBinding("replaymod.input.quickmode", Keyboard.KEY_Q, () -> { + ReplayHandler replayHandler = module.getReplayHandler(); + if (replayHandler == null) { + return; + } + replayHandler.getReplaySender().setSyncModeAndWait(); + mod.runLater(() -> { + replayHandler.ensureQuickModeInitialized(() -> { + boolean enabled = !replayHandler.isQuickMode(); + updateIndicator(replayHandler.getOverlay(), enabled); + replayHandler.setQuickMode(enabled); + replayHandler.getReplaySender().setAsyncMode(true); + }); + }); + }, true); + + register(); + } + + { + on(ReplayOpenedCallback.EVENT, replayHandler -> updateIndicator(replayHandler.getOverlay(), replayHandler.isQuickMode())); + } + + private void updateIndicator(GuiReplayOverlay overlay, boolean enabled) { + if (enabled) { + overlay.statusIndicatorPanel.addElements(new HorizontalLayout.Data(1), indicator); + } else { + overlay.statusIndicatorPanel.removeElement(indicator); + } + } +} diff --git a/src/main/java/com/replaymod/extras/ReplayModExtras.java b/src/main/java/com/replaymod/extras/ReplayModExtras.java index 5a53c707..d22ed045 100644 --- a/src/main/java/com/replaymod/extras/ReplayModExtras.java +++ b/src/main/java/com/replaymod/extras/ReplayModExtras.java @@ -23,6 +23,7 @@ public class ReplayModExtras implements Module { PlayerOverview.class, YoutubeUpload.class, FullBrightness.class, + QuickMode.class, HotkeyButtons.class, OpenEyeExtra.class ); diff --git a/src/main/java/com/replaymod/replay/ReplayModReplay.java b/src/main/java/com/replaymod/replay/ReplayModReplay.java index cd484740..6bc20a29 100644 --- a/src/main/java/com/replaymod/replay/ReplayModReplay.java +++ b/src/main/java/com/replaymod/replay/ReplayModReplay.java @@ -125,17 +125,6 @@ public class ReplayModReplay implements Module { } }, true); - registry.registerKeyBinding("replaymod.input.quickmode", Keyboard.KEY_Q, () -> { - if (replayHandler != null) { - replayHandler.getReplaySender().setSyncModeAndWait(); - core.runLater(() -> - replayHandler.ensureQuickModeInitialized(() -> { - replayHandler.setQuickMode(!replayHandler.isQuickMode()); - replayHandler.getReplaySender().setAsyncMode(true); - })); - } - }, true); - core.getKeyBindingRegistry().registerKeyBinding("replaymod.input.rollclockwise", Keyboard.KEY_L, () -> { // Noop, actual handling logic in CameraEntity#update }, true); diff --git a/src/main/java/com/replaymod/replay/gui/overlay/GuiReplayOverlay.java b/src/main/java/com/replaymod/replay/gui/overlay/GuiReplayOverlay.java index c9b924f5..0ef7cec4 100644 --- a/src/main/java/com/replaymod/replay/gui/overlay/GuiReplayOverlay.java +++ b/src/main/java/com/replaymod/replay/gui/overlay/GuiReplayOverlay.java @@ -57,7 +57,7 @@ public class GuiReplayOverlay extends AbstractGuiOverlay { * This is not used by the replay module itself but may be used by other modules/extras to show * when they're active. */ - public final GuiPanel statusIndicatorPanel = new GuiPanel(this).setSize(100, 20) + public final GuiPanel statusIndicatorPanel = new GuiPanel(this).setSize(100, 16) .setLayout(new HorizontalLayout(HorizontalLayout.Alignment.RIGHT).setSpacing(5)); private final EventHandler eventHandler = new EventHandler(); @@ -78,7 +78,7 @@ public class GuiReplayOverlay extends AbstractGuiOverlay { pos(topPanel, 10, 10); size(topPanel, width - 20, 20); - pos(statusIndicatorPanel, width / 2, height - 25); + pos(statusIndicatorPanel, width / 2, height - 21); width(statusIndicatorPanel, width / 2 - 5); } }); diff --git a/src/main/resources/assets/replaymod/replay_gui.png b/src/main/resources/assets/replaymod/replay_gui.png index 8a10a721..0e47861d 100644 Binary files a/src/main/resources/assets/replaymod/replay_gui.png and b/src/main/resources/assets/replaymod/replay_gui.png differ