Moved Key Events to KeyInputHandler

Added Spectator Menu and Mode to Replay
This commit is contained in:
Marius Metzger
2015-02-01 15:44:55 +01:00
parent 521bf52e79
commit 101a0359d3
13 changed files with 450 additions and 115 deletions

View File

@@ -49,10 +49,14 @@ public class GuiEventHandler {
@SubscribeEvent
public void onGui(GuiOpenEvent event) {
if(ReplayMod.firstMainMenu && event.gui instanceof GuiMainMenu) {
ReplayMod.firstMainMenu = false;
event.gui = new GuiLoginPrompt(event.gui, event.gui);
return;
if(event.gui instanceof GuiMainMenu) {
if(ReplayMod.firstMainMenu) {
ReplayMod.firstMainMenu = false;
event.gui = new GuiLoginPrompt(event.gui, event.gui);
return;
} else {
ReplayHandler.setSpeed(1f);
}
}
if(!AuthenticationHandler.isAuthenticated()) return;
@@ -76,7 +80,7 @@ public class GuiEventHandler {
private static final Color DARK_RED = Color.decode("#DF0101");
private static final Color DARK_GREEN = Color.decode("#01DF01");
@SubscribeEvent
public void onDraw(DrawScreenEvent e) {
if(e.gui instanceof GuiMainMenu) {
@@ -147,7 +151,6 @@ public class GuiEventHandler {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
ReplayHandler.setSpeed(1f);
ReplayHandler.endReplay();
mc.gameSettings.setOptionFloatValue(Options.GAMMA, ReplayHandler.getInitialGamma());