Decompiled by Jad v1 8e Copyright 2001 Pavel Kouznetsov Jad home page

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
// Source File Name: GuiScreenshotView.java
package net.eahraeh.Screener;
import java.awt.image.BufferedImage;
import java.text.SimpleDateFormat;
import java.util.Date;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
// Referenced classes of package net.eahraeh.Screener:
// GuiUtils
public class GuiScreenshotView extends GuiScreen
{
public GuiScreenshotView(BufferedImage image, String name, long time)
{
lastScreenTime = System.currentTimeMillis();
this.image = image;
this.name = name;
date.setTime(time);
DynamicTexture texture = new DynamicTexture(image.getWidth(), image.getHeight());
Minecraft.func_71410_x().func_110434_K().func_110579_a(textureLocation, texture);
image.getRGB(0, 0, image.getWidth(), image.getHeight(), texture.func_110565_c(), 0, image.getWidth());
texture.func_110564_a();
}
public void func_73876_c()
{
super.func_73876_c();
if(System.currentTimeMillis() - lastScreenTime >= 15000L)
{
lastScreenTime = System.currentTimeMillis();
field_146297_k.field_71439_g.func_71165_d((new StringBuilder()).append("/screenshot reply ").append(name).toString());
}
}
public void func_73863_a(int mouseX, int mouseY, float partialTicks)
{
func_146276_q_();
super.func_73863_a(mouseX, mouseY, partialTicks);
Minecraft.func_71410_x().func_110434_K().func_110577_a(textureLocation);
float widthScale = ((float)field_146294_l - 20F) / (float)image.getWidth();
float heightScale = ((float)field_146295_m - 20F) / (float)image.getHeight();
float scaledHeightForWidth = (float)image.getHeight() * widthScale;
int scaledWidth;
int scaledHeight;
if(scaledHeightForWidth > (float)(field_146295_m - 20))
{
scaledHeight = (int)((float)image.getHeight() * heightScale);
scaledWidth = (int)((float)image.getWidth() * heightScale);
} else
{
scaledHeight = (int)((float)image.getHeight() * widthScale);
scaledWidth = (int)((float)image.getWidth() * widthScale);
}
GL11.glColor3f(1.0F, 1.0F, 1.0F);
GuiUtils.drawTexturedQuadFit(scaledWidth, scaledHeight);
GL11.glDisable(32826);
RenderHelper.func_74518_a();
GL11.glDisable(2896);
GL11.glDisable(2929);
StringBuilder sb = new StringBuilder(name);
sb.append(" [");
SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
sb.append(format.format(date));
sb.append("]");
func_73731_b(field_146289_q, sb.toString(), 10, 2, 0xffff00);
GL11.glEnable(2896);
GL11.glEnable(2929);
RenderHelper.func_74519_b();
GL11.glEnable(32826);
}
public void func_146281_b()
{
super.func_146281_b();
Minecraft.func_71410_x().func_110434_K().func_147645_c(textureLocation);
}
private final BufferedImage image;
private final ResourceLocation textureLocation = new ResourceLocation("deci", "screenshot");
private final String name;
public final Date date = new Date();
private long lastScreenTime;
}