2012-08-15 22:41:41 +02:00
|
|
|
package net.uberkat.obsidian.client;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.net.URL;
|
|
|
|
|
|
|
|
import org.lwjgl.Sys;
|
|
|
|
|
|
|
|
import net.minecraft.src.*;
|
2012-08-21 18:25:58 +02:00
|
|
|
import net.uberkat.obsidian.common.ObsidianIngotsCore;
|
2012-08-15 22:41:41 +02:00
|
|
|
import net.uberkat.obsidian.common.ObsidianUtils;
|
|
|
|
|
|
|
|
public class GuiCredits extends GuiScreen {
|
|
|
|
|
|
|
|
private static String updateProgress = "";
|
|
|
|
|
|
|
|
public void initGui()
|
|
|
|
{
|
|
|
|
controlList.clear();
|
|
|
|
controlList.add(new GuiButton(2, width / 2 - 100, height / 4 + 72 + 12, "Update"));
|
|
|
|
controlList.add(new GuiButton(1, width / 2 - 100, height / 4 + 96 + 12, "Cancel"));
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onGuiClosed()
|
|
|
|
{
|
|
|
|
updateProgress = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void onFinishedDownloading()
|
|
|
|
{
|
|
|
|
updateProgress = "Successfully updated. Restart Minecraft to load.";
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void onErrorDownloading()
|
|
|
|
{
|
|
|
|
updateProgress = "Error updating.";
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void actionPerformed(GuiButton guibutton)
|
|
|
|
{
|
|
|
|
if(!guibutton.enabled)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(guibutton.id == 2)
|
|
|
|
{
|
|
|
|
if(!ObsidianUtils.isClientLatestVersion())
|
|
|
|
{
|
|
|
|
updateProgress = "Downloading latest version...";
|
|
|
|
guibutton.enabled = false;
|
2012-08-17 22:40:28 +02:00
|
|
|
new ThreadUpdate("http://dl.dropbox.com/u/90411166/ObsidianIngots.jar");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
updateProgress = "You already have the latest version.";
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if(guibutton.id == 1)
|
|
|
|
{
|
|
|
|
mc.displayGuiScreen(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void writeText(String text, int yAxis)
|
|
|
|
{
|
|
|
|
drawString(fontRenderer, text, width / 2 - 140, (height / 4 - 60) + 20 + yAxis, 0xa0a0a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void drawScreen(int i, int j, float f)
|
|
|
|
{
|
|
|
|
drawDefaultBackground();
|
|
|
|
drawCenteredString(fontRenderer, "Obsidian Ingots by aidancbrady", width / 2, (height / 4 - 60) + 20, 0xffffff);
|
2012-08-21 18:25:58 +02:00
|
|
|
drawString(fontRenderer, (new StringBuilder()).append("Your version: ").append(ObsidianUtils.isClientLatestVersion() ? ObsidianIngotsCore.versionNumber.toString() : (ObsidianIngotsCore.versionNumber.toString() + " -- OUTDATED")).toString(), width / 2 - 140, (height / 4 - 60) + 20 + 36, 0xa0a0a0);
|
|
|
|
drawString(fontRenderer, (new StringBuilder()).append("Newest version: ").append(ObsidianIngotsCore.latestVersionNumber).toString(), width / 2 - 140, (height / 4 - 60) + 20 + 45, 0xa0a0a0);
|
2012-08-15 22:41:41 +02:00
|
|
|
writeText("*Developed on Mac OS X 10.8 Mountain Lion", 63);
|
|
|
|
writeText("*Code, textures, and ideas by aidancbrady", 72);
|
2012-08-21 18:25:58 +02:00
|
|
|
writeText("Recent news: " + ObsidianIngotsCore.recentNews, 81);
|
2012-08-15 22:41:41 +02:00
|
|
|
writeText(updateProgress, 99);
|
|
|
|
super.drawScreen(i, j, f);
|
|
|
|
}
|
|
|
|
}
|