Search in sources :

Example 1 with Alt

use of net.wurstclient.altmanager.Alt in project Wurst-MC-1.12 by Wurst-Imperium.

the class AddAltScreen method pressDoneButton.

@Override
protected void pressDoneButton() {
    if (getPassword().isEmpty()) {
        // add cracked alt
        message = "";
        GuiAltList.alts.add(new Alt(getEmail(), null, null));
    } else {
        // add premium alt
        message = LoginManager.login(getEmail(), getPassword());
        if (message.isEmpty())
            GuiAltList.alts.add(new Alt(getEmail(), getPassword(), mc.session.getUsername()));
    }
    if (message.isEmpty()) {
        GuiAltList.sortAlts();
        ConfigFiles.ALTS.save();
        mc.displayGuiScreen(prevScreen);
    } else
        doErrorEffect();
}
Also used : Alt(net.wurstclient.altmanager.Alt)

Example 2 with Alt

use of net.wurstclient.altmanager.Alt in project Wurst-MC-1.12 by Wurst-Imperium.

the class AltManagerScreen method drawScreen.

@Override
public void drawScreen(int par1, int par2, float par3) {
    drawDefaultBackground();
    altList.drawScreen(par1, par2, par3);
    // skin preview
    if (altList.getSelectedSlot() != -1 && altList.getSelectedSlot() < GuiAltList.alts.size()) {
        Alt alt = altList.getSelectedAlt();
        AltRenderer.drawAltBack(alt.getNameOrEmail(), (width / 2 - 125) / 2 - 32, height / 2 - 64 - 9, 64, 128);
        AltRenderer.drawAltBody(alt.getNameOrEmail(), width - (width / 2 - 140) / 2 - 32, height / 2 - 64 - 9, 64, 128);
    }
    // title text
    drawCenteredString(fontRendererObj, "Alt Manager", width / 2, 4, 16777215);
    drawCenteredString(fontRendererObj, "Alts: " + GuiAltList.alts.size(), width / 2, 14, 10526880);
    drawCenteredString(fontRendererObj, "premium: " + GuiAltList.premiumAlts + ", cracked: " + GuiAltList.crackedAlts, width / 2, 24, 10526880);
    // red flash for errors
    if (errorTimer > 0) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_CULL_FACE);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glColor4f(1, 0, 0, errorTimer / 16F);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(0, 0);
            GL11.glVertex2d(width, 0);
            GL11.glVertex2d(width, height);
            GL11.glVertex2d(0, height);
        }
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_BLEND);
        errorTimer--;
    }
    super.drawScreen(par1, par2, par3);
}
Also used : Alt(net.wurstclient.altmanager.Alt)

Example 3 with Alt

use of net.wurstclient.altmanager.Alt in project Wurst-MC-1.12 by Wurst-Imperium.

the class EditAltScreen method pressDoneButton.

@Override
protected void pressDoneButton() {
    if (getPassword().isEmpty()) {
        // cracked
        message = "";
        GuiAltList.alts.set(GuiAltList.alts.indexOf(editedAlt), new Alt(getEmail(), null, null, editedAlt.isStarred()));
    } else {
        // premium
        message = LoginManager.login(getEmail(), getPassword());
        if (message.isEmpty())
            GuiAltList.alts.set(GuiAltList.alts.indexOf(editedAlt), new Alt(getEmail(), getPassword(), mc.session.getUsername(), editedAlt.isStarred()));
    }
    if (message.isEmpty()) {
        GuiAltList.sortAlts();
        ConfigFiles.ALTS.save();
        mc.displayGuiScreen(prevScreen);
    } else
        doErrorEffect();
}
Also used : Alt(net.wurstclient.altmanager.Alt)

Example 4 with Alt

use of net.wurstclient.altmanager.Alt in project Wurst-MC-1.12 by Wurst-Imperium.

the class GuiAltList method drawSlot.

@Override
protected void drawSlot(int id, int x, int y, int var4, int var5, int var6, float partialTicks) {
    Alt alt = alts.get(id);
    // green glow when logged in
    if (mc.getSession().getUsername().equals(alt.getName())) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glDisable(GL11.GL_CULL_FACE);
        GL11.glEnable(GL11.GL_BLEND);
        float opacity = 0.3F - Math.abs(WMath.sin(Minecraft.getSystemTime() % 10000L / 10000F * (float) Math.PI * 2.0F) * 0.15F);
        GL11.glColor4f(0, 1, 0, opacity);
        GL11.glBegin(GL11.GL_QUADS);
        {
            GL11.glVertex2d(x - 2, y - 2);
            GL11.glVertex2d(x - 2 + 220, y - 2);
            GL11.glVertex2d(x - 2 + 220, y - 2 + 30);
            GL11.glVertex2d(x - 2, y - 2 + 30);
        }
        GL11.glEnd();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glDisable(GL11.GL_BLEND);
    }
    // face
    AltRenderer.drawAltFace(alt.getNameOrEmail(), x + 1, y + 1, 24, 24, isSelected(id));
    // name / email
    mc.fontRendererObj.drawString("Name: " + alt.getNameOrEmail(), x + 31, y + 3, 10526880);
    // tags
    String tags = alt.isCracked() ? "�8cracked" : "�2premium";
    if (alt.isStarred())
        tags += "�r, �estarred";
    if (alt.isUnchecked())
        tags += "�r, �cunchecked";
    mc.fontRendererObj.drawString(tags, x + 31, y + 15, 10526880);
}
Also used : Alt(net.wurstclient.altmanager.Alt)

Example 5 with Alt

use of net.wurstclient.altmanager.Alt in project Wurst-MC-1.12 by Wurst-Imperium.

the class AddAltCmd method call.

@Override
public void call(String[] args) throws CmdException {
    if (args.length != 1)
        throw new CmdSyntaxError();
    if (args[0].equals("all")) {
        int alts = 0;
        for (NetworkPlayerInfo info : WMinecraft.getConnection().getPlayerInfoMap()) {
            String name = StringUtils.stripControlCodes(info.getPlayerNameForReal());
            if (name.equals(WMinecraft.getPlayer().getName()) || name.equals("Alexander01998") || GuiAltList.alts.contains(new Alt(name, null, null)))
                continue;
            GuiAltList.alts.add(new Alt(name, null, null));
            alts++;
        }
        if (alts == 1)
            ChatUtils.message("Added 1 alt.");
        else
            ChatUtils.message("Added " + alts + " alts.");
        GuiAltList.sortAlts();
        ConfigFiles.ALTS.save();
    } else if (!args[0].equals("Alexander01998")) {
        GuiAltList.alts.add(new Alt(args[0], null, null));
        GuiAltList.sortAlts();
        ConfigFiles.ALTS.save();
        ChatUtils.message("Added 1 alt.");
    }
}
Also used : NetworkPlayerInfo(net.minecraft.client.network.NetworkPlayerInfo) Alt(net.wurstclient.altmanager.Alt)

Aggregations

Alt (net.wurstclient.altmanager.Alt)8 JsonObject (com.google.gson.JsonObject)2 JsonElement (com.google.gson.JsonElement)1 Component (java.awt.Component)1 HeadlessException (java.awt.HeadlessException)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileReader (java.io.FileReader)1 IOException (java.io.IOException)1 JDialog (javax.swing.JDialog)1 JFileChooser (javax.swing.JFileChooser)1 FileNameExtensionFilter (javax.swing.filechooser.FileNameExtensionFilter)1 GuiYesNo (net.minecraft.client.gui.GuiYesNo)1 NetworkPlayerInfo (net.minecraft.client.network.NetworkPlayerInfo)1