Small improvements to the version checker

This commit is contained in:
modmuss50 2015-08-09 10:57:13 +01:00
parent 87743ae687
commit 2f63a24070

View file

@ -8,6 +8,7 @@ import org.lwjgl.opengl.GL11;
import techreborn.Core;
import java.awt.*;
import java.util.ArrayList;
public class VersionCheckerClient {
ResourceLocation texture;
@ -19,26 +20,28 @@ public class VersionCheckerClient {
@SubscribeEvent
public void drawGui(GuiScreenEvent.DrawScreenEvent event){
if(event.gui instanceof GuiModList){
ArrayList<String> changeLog = Core.INSTANCE.versionChecker.getChangeLogSinceCurrentVersion();
String s = "";
if(Core.INSTANCE.versionChecker.isChecking){
s = "Checking for update...";
} else if(Core.INSTANCE.versionChecker.isLatestVersion()){
s = "You have the latest version of TechReborn";
} else{
s = "There is an update for TechReborn with " + Core.INSTANCE.versionChecker.getChangeLogSinceCurrentVersion().size() + " changes.";
s = "There is an update for TechReborn with " + changeLog.size() + " changes.";
}
event.gui.drawString(event.gui.mc.fontRenderer, s, 10, 5, Color.white.getRGB());
}
if(!Core.INSTANCE.versionChecker.isLatestVersion()){
if(event.mouseY < 20){
GuiUtil.drawTooltipBox(5, 15, 330, Core.INSTANCE.versionChecker.getChangeLogSinceCurrentVersion().size() * 10 + 5);
int y = 20;
for(String change : Core.INSTANCE.versionChecker.getChangeLogSinceCurrentVersion()){
event.gui.drawString(event.gui.mc.fontRenderer, change, 10, y, Color.white.getRGB());
y+= 10;
if(!Core.INSTANCE.versionChecker.isLatestVersion()){
if(event.mouseY < 20){
GuiUtil.drawTooltipBox(5, 15, 330, changeLog.size() * 10 + 5);
int y = 20;
for(String change : changeLog){
event.gui.drawString(event.gui.mc.fontRenderer, change, 10, y, Color.white.getRGB());
y+= 10;
}
}
}
}
}
}