From 40aaf7fbef36fc618849519ba8afb5e749be9a80 Mon Sep 17 00:00:00 2001 From: CrushedPixel Date: Fri, 7 Aug 2015 12:23:58 +0200 Subject: [PATCH] When initially asked to Log in, rename "Cancel" to "Skip" button to indicate that the user doesn't have to log in in order to use the mod --- .../replaymod/events/handlers/GuiEventHandler.java | 4 ++-- .../crushedpixel/replaymod/gui/online/GuiLoginPrompt.java | 8 +++++++- .../replaymod/gui/online/GuiReplayCenter.java | 2 +- .../crushedpixel/replaymod/gui/online/GuiUploadFile.java | 2 +- src/main/resources/assets/replaymod/lang/en_US.lang | 2 ++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/crushedpixel/replaymod/events/handlers/GuiEventHandler.java b/src/main/java/eu/crushedpixel/replaymod/events/handlers/GuiEventHandler.java index 81cfc03c..d471c682 100755 --- a/src/main/java/eu/crushedpixel/replaymod/events/handlers/GuiEventHandler.java +++ b/src/main/java/eu/crushedpixel/replaymod/events/handlers/GuiEventHandler.java @@ -46,7 +46,7 @@ public class GuiEventHandler { if(ReplayMod.firstMainMenu) { ReplayMod.firstMainMenu = false; if(!AuthenticationHandler.isAuthenticated()) { - event.gui = new GuiLoginPrompt(event.gui, event.gui).toMinecraft(); + event.gui = new GuiLoginPrompt(event.gui, event.gui, false).toMinecraft(); return; } } else { @@ -179,7 +179,7 @@ public class GuiEventHandler { if(AuthenticationHandler.isAuthenticated()) { mc.displayGuiScreen(new GuiReplayCenter()); } else { - mc.displayGuiScreen(new GuiLoginPrompt(event.gui, new GuiReplayCenter()).toMinecraft()); + mc.displayGuiScreen(new GuiLoginPrompt(event.gui, new GuiReplayCenter(), true).toMinecraft()); } } else if(event.button.id == GuiConstants.REPLAY_EDITOR_BUTTON_ID) { mc.displayGuiScreen(new GuiReplayEditor()); diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiLoginPrompt.java b/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiLoginPrompt.java index 856227f2..447050eb 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiLoginPrompt.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiLoginPrompt.java @@ -78,10 +78,16 @@ public class GuiLoginPrompt extends AbstractGuiScreen { password.onTextChanged(contentValidation); } - public GuiLoginPrompt(net.minecraft.client.gui.GuiScreen parent, net.minecraft.client.gui.GuiScreen successScreen) { + public GuiLoginPrompt(net.minecraft.client.gui.GuiScreen parent, + net.minecraft.client.gui.GuiScreen successScreen, boolean manuallyTriggered) { this.parent = parent; this.successScreen = successScreen; + //if the login prompt was opened automatically (on mod startup), show a "skip" instead of "cancel" button + if(!manuallyTriggered) { + cancelButton.setI18nLabel("replaymod.gui.login.skip"); + } + setLayout(new CustomLayout() { @Override protected void layout(GuiLoginPrompt container, int width, int height) { diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiReplayCenter.java b/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiReplayCenter.java index 5e9177d4..5fd8b901 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiReplayCenter.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiReplayCenter.java @@ -57,7 +57,7 @@ public class GuiReplayCenter extends GuiScreen implements GuiYesNoCallback { if(!initialized) { if(!AuthenticationHandler.isAuthenticated()) { - mc.displayGuiScreen(new GuiLoginPrompt(new GuiMainMenu(), this).toMinecraft()); + mc.displayGuiScreen(new GuiLoginPrompt(new GuiMainMenu(), this, true).toMinecraft()); } //Top Button Bar diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiUploadFile.java b/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiUploadFile.java index 276ec408..912afa8c 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiUploadFile.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiUploadFile.java @@ -135,7 +135,7 @@ public class GuiUploadFile extends GuiScreen implements ProgressUpdateListener { } if(!AuthenticationHandler.isAuthenticated()) { - mc.displayGuiScreen(new GuiLoginPrompt(parent, this).toMinecraft()); + mc.displayGuiScreen(new GuiLoginPrompt(parent, this, true).toMinecraft()); return; } diff --git a/src/main/resources/assets/replaymod/lang/en_US.lang b/src/main/resources/assets/replaymod/lang/en_US.lang index fff0b519..5d1782ce 100644 --- a/src/main/resources/assets/replaymod/lang/en_US.lang +++ b/src/main/resources/assets/replaymod/lang/en_US.lang @@ -124,6 +124,8 @@ replaymod.gui.login.logging=Logging in... replaymod.gui.login.incorrect=Incorrect username or password replaymod.gui.login.connectionerror=Could not connect to ReplayMod.com +replaymod.gui.login.skip=Skip + replaymod.gui.register.title=Register on ReplayMod.com replaymod.gui.register.confirmpw=Confirm Password