Merge branch '1.8' into 1.9.4
d9b796dMixin'd the Shader's mods ShadersRender class to only render hands if the Forge event isn't cancelled6bbff3bUpdated Mixin to 0.6.4-SNAPSHOT and set mixin target level6f3ac71Add CustomMainMenu compatibility info to docsb0a1cdfSearch for ffmpeg executable in common locations to simplify setupd465891Fixed GuiEditPositionKeyframe's width to fit on all screen sizes Centered all rows of GuiEditPositionKeyframe's VerticalLayout1b099f9Add render queue03534c6Update docs4388d69Only try to create the downloads folder if it does not yet exist7ad19aaAdd mod version and accepted MC version directly to the @Mod annotation655bea0Replace @Mod.Instance with direct static references458dad6Merge pull request #4 from ReplayMod/1.8-editoreb5ccb2Add Replay Editor (for now, trimming only)6498d62Fix server game data snapshot being restored in singleplayer (fixes #44)2c898a8Prevent rendering without sufficient keyframes (fixes #45)5d520a5Fix deserialization of chroma key color (fixes #43)c681742Use caching maven proxy for faster and more stable drone buildsfbf165eAdded Anti-Aliasing to the Render Settings
This commit is contained in:
48
src/main/java/com/replaymod/editor/handler/GuiHandler.java
Normal file
48
src/main/java/com/replaymod/editor/handler/GuiHandler.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.replaymod.editor.handler;
|
||||
|
||||
import com.replaymod.editor.ReplayModEditor;
|
||||
import com.replaymod.editor.gui.GuiReplayEditor;
|
||||
import de.johni0702.minecraft.gui.container.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class GuiHandler {
|
||||
private static final int BUTTON_REPLAY_EDITOR = 17890237;
|
||||
|
||||
private final ReplayModEditor mod;
|
||||
|
||||
public GuiHandler(ReplayModEditor mod) {
|
||||
this.mod = mod;
|
||||
}
|
||||
|
||||
public void register() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void injectIntoMainMenu(GuiScreenEvent.InitGuiEvent event) {
|
||||
if (!(event.getGui() instanceof GuiMainMenu)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GuiButton button = new GuiButton(BUTTON_REPLAY_EDITOR, event.getGui().width / 2 + 2,
|
||||
event.getGui().height / 4 + 10 + 3 * 24, I18n.format("replaymod.gui.replayeditor"));
|
||||
button.width = button.width / 2 - 2;
|
||||
event.getButtonList().add(button);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onButton(GuiScreenEvent.ActionPerformedEvent.Pre event) {
|
||||
if(!event.getButton().enabled) return;
|
||||
|
||||
if (event.getGui() instanceof GuiMainMenu) {
|
||||
if (event.getButton().id == BUTTON_REPLAY_EDITOR) {
|
||||
new GuiReplayEditor(GuiScreen.wrap(event.getGui()), mod.getCore()).display();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user