In the Replay Viewer, the "Upload" button is no longer disabled when not logged in, instead it forwards to a Login Prompt on button click
This commit is contained in:
@@ -122,6 +122,10 @@ public class GuiUploadFile extends GuiScreen {
|
||||
@Override
|
||||
public void initGui() {
|
||||
if(replayFile == null) return;
|
||||
if(!AuthenticationHandler.isAuthenticated()) {
|
||||
mc.displayGuiScreen(new GuiLoginPrompt(parent, this));
|
||||
return;
|
||||
}
|
||||
|
||||
if(fileTitleInput == null) {
|
||||
fileTitleInput = new GuiTextField(GuiConstants.UPLOAD_NAME_INPUT, fontRendererObj, (this.width / 2) + 20 + 10, 21, Math.min(200, this.width - 20 - 260), 20);
|
||||
|
||||
@@ -7,7 +7,6 @@ import eu.crushedpixel.replaymod.gui.GuiReplaySettings;
|
||||
import eu.crushedpixel.replaymod.gui.elements.GuiReplayListEntry;
|
||||
import eu.crushedpixel.replaymod.gui.elements.GuiReplayListExtended;
|
||||
import eu.crushedpixel.replaymod.gui.online.GuiUploadFile;
|
||||
import eu.crushedpixel.replaymod.online.authentication.AuthenticationHandler;
|
||||
import eu.crushedpixel.replaymod.recording.ReplayMetaData;
|
||||
import eu.crushedpixel.replaymod.registry.ResourceHelper;
|
||||
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
||||
@@ -152,10 +151,7 @@ public class GuiReplayViewer extends GuiScreen implements GuiYesNoCallback {
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
|
||||
if(uploadButton.isMouseOver() && !uploadButton.enabled && loadButton.enabled) {
|
||||
if(!AuthenticationHandler.isAuthenticated()) {
|
||||
Point mouse = MouseUtils.getMousePos();
|
||||
ReplayMod.tooltipRenderer.drawTooltip(mouseX, mouseY, I18n.format("replaymod.gui.viewer.noauth"), this, Color.RED.getRGB());
|
||||
} else if(currentFileUploaded) {
|
||||
if(currentFileUploaded) {
|
||||
Point mouse = MouseUtils.getMousePos();
|
||||
ReplayMod.tooltipRenderer.drawTooltip(mouseX, mouseY, I18n.format("replaymod.gui.viewer.alreadyuploaded"), this, Color.RED.getRGB());
|
||||
}
|
||||
@@ -240,13 +236,13 @@ public class GuiReplayViewer extends GuiScreen implements GuiYesNoCallback {
|
||||
|
||||
public void setButtonsEnabled(boolean b) {
|
||||
loadButton.enabled = b;
|
||||
if(!b || !AuthenticationHandler.isAuthenticated()) {
|
||||
uploadButton.enabled = false;
|
||||
} else {
|
||||
|
||||
if(b) {
|
||||
currentFileUploaded = ReplayMod.uploadedFileHandler.isUploaded(replayFileList.get(replayGuiList.selected).first().first());
|
||||
uploadButton.enabled = !currentFileUploaded;
|
||||
}
|
||||
|
||||
|
||||
renameButton.enabled = b;
|
||||
deleteButton.enabled = b;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user