<commit_before>/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014 <NAME> (Kihira)
 *
 * See LICENSE for full License
 */

package kihira.tails.client.gui;

import com.google.common.base.Strings;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonParser;
import kihira.foxlib.client.gui.GuiBaseScreen;
import kihira.tails.client.texture.TextureHelper;
import kihira.tails.common.TailInfo;
import kihira.tails.common.Tails;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.resources.I18n;
import org.apache.commons.io.IOUtils;
import org.lwjgl.opengl.Display;

import javax.imageio.ImageIO;
import javax.swing.*;
import javax.xml.bind.DatatypeConverter;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL;
import java.net.URLEncoder;

public class GuiExport extends GuiBaseScreen {

    private final GuiEditTail parent;
    private final TailInfo tailInfo;

    private ScaledResolution scaledRes;
    private String exportMessage = "";
    private GuiButtonTooltip openFolderButton;
    private URI exportLoc;

    public GuiExport(GuiEditTail parent, TailInfo tailInfo) {
        this.parent = parent;
        this.tailInfo = tailInfo;
    }

    @Override
    @SuppressWarnings("unchecked")
    public void initGui() {
        this.scaledRes = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);

        //Left
        this.buttonList.add(new GuiButtonTooltip(0, 20, this.height - 90, 130, 20, I18n.format("gui.button.export.userdir"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("gui.button.export.tooltip", System.getProperty("user.home"))));
        this.buttonList.add(new GuiButtonTooltip(1, 20, this.height - 65, 130, 20, I18n.format("gui.button.export.minecraftdir"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("gui.button.export.tooltip", System.getProperty("user.dir"))));
        this.buttonList.add(new GuiButtonTooltip(2, 20, this.height - 40, 130, 20, I18n.format("gui.button.export.custom"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("gui.button.export.custom.tooltip")));

        //Right
        this.buttonList.add(this.openFolderButton = new GuiButtonTooltip(3, this.width - 150, this.height - 65, 130, 20, I18n.format("gui.button.openfolder"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("gui.button.openfolder.tooltip")));
        this.openFolderButton.visible = !Strings.isNullOrEmpty(this.exportMessage);

        this.buttonList.add(new GuiButtonTooltip(10, this.width - 150, this.height - 40, 130, 20, I18n.format("gui.button.upload"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("tails.upload.tooltip")));
    }

    @Override
    public void drawScreen(int mouseX, int mouseY, float p_73863_3_) {
        this.drawDefaultBackground();<commit_msg>Fix export<commit_after>/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014 <NAME> (Kihira)
 *
 * See LICENSE for full License
 */

package kihira.tails.client.gui;

import com.google.common.base.Strings;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonParser;
import kihira.foxlib.client.gui.GuiBaseScreen;
import kihira.tails.client.texture.TextureHelper;
import kihira.tails.common.PartInfo;
import kihira.tails.common.Tails;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.resources.I18n;
import org.apache.commons.io.IOUtils;
import org.lwjgl.opengl.Display;

import javax.imageio.ImageIO;
import javax.swing.*;
import javax.xml.bind.DatatypeConverter;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL;
import java.net.URLEncoder;

public class GuiExport extends GuiBaseScreen {

    private final GuiEditTail parent;
    private final PartInfo tailInfo;

    private ScaledResolution scaledRes;
    private String exportMessage = "";
    private GuiButtonTooltip openFolderButton;
    private URI exportLoc;

    public GuiExport(GuiEditTail parent, PartInfo tailInfo) {
        this.parent = parent;
        this.tailInfo = tailInfo;
    }

    @Override
    @SuppressWarnings("unchecked")
    public void initGui() {
        this.scaledRes = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);

        //Left
        this.buttonList.add(new GuiButtonTooltip(0, 20, this.height - 90, 130, 20, I18n.format("gui.button.export.userdir"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("gui.button.export.tooltip", System.getProperty("user.home"))));
        this.buttonList.add(new GuiButtonTooltip(1, 20, this.height - 65, 130, 20, I18n.format("gui.button.export.minecraftdir"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("gui.button.export.tooltip", System.getProperty("user.dir"))));
        this.buttonList.add(new GuiButtonTooltip(2, 20, this.height - 40, 130, 20, I18n.format("gui.button.export.custom"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("gui.button.export.custom.tooltip")));

        //Right
        this.buttonList.add(this.openFolderButton = new GuiButtonTooltip(3, this.width - 150, this.height - 65, 130, 20, I18n.format("gui.button.openfolder"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("gui.button.openfolder.tooltip")));
        this.openFolderButton.visible = !Strings.isNullOrEmpty(this.exportMessage);

        this.buttonList.add(new GuiButtonTooltip(10, this.width - 150, this.height - 40, 130, 20, I18n.format("gui.button.upload"),
                this.scaledRes.getScaledWidth() / 2, I18n.format("tails.upload.tooltip")));
    }

    @Override
    public void drawScreen(int mouseX, int mouseY, float p_73863_3_) {
        this.drawDefaultBackground();
{'fraction_non_alphanumeric': 0.12688137239035444, 'fraction_numerical': 0.02913092733452015, 'mean_word_length': 3.828125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7054407', 'n_tokens_mistral': 2123, 'n_tokens_neox': 1984, 'n_words': 366}