Merge pull request #257 from LindaJuffermans:develop
This commit is contained in:
@@ -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.
|
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
|
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]
|
## 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.
|
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.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import com.replaymod.core.events.PostRenderCallback;
|
|||||||
public class FullBrightness extends EventRegistrations implements Extra {
|
public class FullBrightness extends EventRegistrations implements Extra {
|
||||||
private ReplayModReplay module;
|
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 MinecraftClient mc;
|
||||||
private boolean active;
|
private boolean active;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class HotkeyButtons extends EventRegistrations implements Extra {
|
|||||||
|
|
||||||
public Gui(ReplayMod mod, GuiReplayOverlay overlay) {
|
public Gui(ReplayMod mod, GuiReplayOverlay overlay) {
|
||||||
toggleButton = new GuiTexturedButton(overlay).setSize(20, 20)
|
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() {
|
.onClick(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
52
src/main/java/com/replaymod/extras/QuickMode.java
Normal file
52
src/main/java/com/replaymod/extras/QuickMode.java
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,6 +23,7 @@ public class ReplayModExtras implements Module {
|
|||||||
PlayerOverview.class,
|
PlayerOverview.class,
|
||||||
YoutubeUpload.class,
|
YoutubeUpload.class,
|
||||||
FullBrightness.class,
|
FullBrightness.class,
|
||||||
|
QuickMode.class,
|
||||||
HotkeyButtons.class,
|
HotkeyButtons.class,
|
||||||
OpenEyeExtra.class
|
OpenEyeExtra.class
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -125,17 +125,6 @@ public class ReplayModReplay implements Module {
|
|||||||
}
|
}
|
||||||
}, true);
|
}, 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, () -> {
|
core.getKeyBindingRegistry().registerKeyBinding("replaymod.input.rollclockwise", Keyboard.KEY_L, () -> {
|
||||||
// Noop, actual handling logic in CameraEntity#update
|
// Noop, actual handling logic in CameraEntity#update
|
||||||
}, true);
|
}, true);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class GuiReplayOverlay extends AbstractGuiOverlay<GuiReplayOverlay> {
|
|||||||
* This is not used by the replay module itself but may be used by other modules/extras to show
|
* This is not used by the replay module itself but may be used by other modules/extras to show
|
||||||
* when they're active.
|
* 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));
|
.setLayout(new HorizontalLayout(HorizontalLayout.Alignment.RIGHT).setSpacing(5));
|
||||||
|
|
||||||
private final EventHandler eventHandler = new EventHandler();
|
private final EventHandler eventHandler = new EventHandler();
|
||||||
@@ -78,7 +78,7 @@ public class GuiReplayOverlay extends AbstractGuiOverlay<GuiReplayOverlay> {
|
|||||||
pos(topPanel, 10, 10);
|
pos(topPanel, 10, 10);
|
||||||
size(topPanel, width - 20, 20);
|
size(topPanel, width - 20, 20);
|
||||||
|
|
||||||
pos(statusIndicatorPanel, width / 2, height - 25);
|
pos(statusIndicatorPanel, width / 2, height - 21);
|
||||||
width(statusIndicatorPanel, width / 2 - 5);
|
width(statusIndicatorPanel, width / 2 - 5);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user