organized splash code

This commit is contained in:
LAX1DUDE 2022-07-25 20:11:20 -07:00
parent 7b5e336606
commit 0d4efc3bbd
4 changed files with 14 additions and 33 deletions

View File

@ -12,7 +12,7 @@ alert("You're not supposed to 'open' this file in your browser. Please upload th
window.addEventListener("load", function(){ window.addEventListener("load", function(){
window.minecraftOpts = [ window.minecraftOpts = [
"game_frame","assets.epk", "game_frame","assets.epk",
"CgAACQAHc2VydmVycwoAAAABCAACaXAAIHdzKHMpOi8vIChhZGRyZXNzIGhlcmUpOihwb3J0KSAvCAAEbmFtZQAIdGVtcGxhdGUBAAtoaWRlQWRkcmVzcwEIAApmb3JjZWRNT1REABl0aGlzIGlzIG5vdCBhIHJlYWwgc2VydmVyAAA=" "CgAACQAHc2VydmVycwoAAAABCAAEbmFtZQARTG9jYWwgVGVzdCBTZXJ2ZXIIAAJpcAAPMTI3LjAuMC4xOjI1NTY1CAALaGlkZUFkZHJlc3MABWZhbHNlCAAKZm9yY2VkTU9URAAAAAkACHNwbGFzaGVzCAAAAAoACkRhcnZpZ2xldCEADkRhcnZpZ2xvcGhpbGUhAAtZb3UgRWFnbGVyIQALWWVlZWVlZWVlZSEAC1lvdSBZZWVsZXIhAA1FRUVFRUVFRUVFRUUhAAtZb3UgRGFydmlnIQAJWW91IFZpZ2chAAI6PgACfD4BAAxlbmFibGVTcGxhc2gBAA=="
]; ];
(function(){ (function(){
var q = window.location.search; var q = window.location.search;

View File

@ -20,6 +20,8 @@ public class ConfigConstants {
public static String mainMenuItemLine1 = null; public static String mainMenuItemLine1 = null;
public static String mainMenuItemLine2 = null; public static String mainMenuItemLine2 = null;
public static String mainMenuItemLink = null; public static String mainMenuItemLink = null;
public static boolean enableSplash = false;
public static NBTTagList splashTexts = null; public static NBTTagList splashTexts = null;
} }

View File

@ -3,8 +3,6 @@ package net.minecraft.src;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.io.IOException;
import java.util.*;
import net.lax1dude.eaglercraft.ConfigConstants; import net.lax1dude.eaglercraft.ConfigConstants;
import net.lax1dude.eaglercraft.EaglerAdapter; import net.lax1dude.eaglercraft.EaglerAdapter;
@ -14,7 +12,6 @@ import net.lax1dude.eaglercraft.LocalStorageManager;
import net.lax1dude.eaglercraft.TextureLocation; import net.lax1dude.eaglercraft.TextureLocation;
import net.lax1dude.eaglercraft.adapter.Tessellator; import net.lax1dude.eaglercraft.adapter.Tessellator;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.lax1dude.eaglercraft.Base64;
public class GuiMainMenu extends GuiScreen { public class GuiMainMenu extends GuiScreen {
@ -22,7 +19,7 @@ public class GuiMainMenu extends GuiScreen {
private static final EaglercraftRandom rand = new EaglercraftRandom(); private static final EaglercraftRandom rand = new EaglercraftRandom();
/** The splash message. */ /** The splash message. */
public String splashText = "missingno"; public String splashText = null;
private GuiButton buttonResetDemo; private GuiButton buttonResetDemo;
private static boolean showingEndian = true; private static boolean showingEndian = true;
@ -76,28 +73,14 @@ public class GuiMainMenu extends GuiScreen {
public boolean showAck = false; public boolean showAck = false;
public GuiMainMenu() { public GuiMainMenu() {
/* if (ConfigConstants.enableSplash) {
* this.field_92025_p = ""; String var14 =
* System.getProperty("os_architecture"); var3 =
* System.getProperty("java_version");
*
* if ("ppc".equalsIgnoreCase(var14)) { this.field_92025_p = "" +
* EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET +
* " PowerPC compatibility will be dropped in Minecraft 1.6";
* this.field_104024_v = "http://tinyurl.com/javappc"; } else if (var3 != null
* && var3.startsWith("1.5")) { this.field_92025_p = "" +
* EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET +
* " Java 1.5 compatibility will be dropped in Minecraft 1.6";
* this.field_104024_v = "http://tinyurl.com/javappc"; }
*
* if (this.field_92025_p.length() == 0) { (new Thread(new
* RunnableTitleScreen(this), "1.6 Update Check Thread")).start(); }
*/
if (enableSplash) {
EaglercraftRandom rand = new EaglercraftRandom();
NBTTagList splashesList = ConfigConstants.splashTexts; NBTTagList splashesList = ConfigConstants.splashTexts;
if(splashesList.tagCount() > 0) {
EaglercraftRandom rand = new EaglercraftRandom();
this.splashText = ((NBTTagString) splashesList.tagAt(rand.nextInt(splashesList.tagCount()))).data; this.splashText = ((NBTTagString) splashesList.tagAt(rand.nextInt(splashesList.tagCount()))).data;
}else {
this.splashText = "missingno";
}
} }
this.field_92025_p = EaglerAdapter._wisWebGL() ? ("eaglercraft javascript runtime") : ("eaglercraft desktop runtime"); this.field_92025_p = EaglerAdapter._wisWebGL() ? ("eaglercraft javascript runtime") : ("eaglercraft desktop runtime");
this.start = System.currentTimeMillis() + System.currentTimeMillis() % 10000l; this.start = System.currentTimeMillis() + System.currentTimeMillis() % 10000l;
@ -116,7 +99,6 @@ public class GuiMainMenu extends GuiScreen {
return false; return false;
} }
public void handleMouseInput() { public void handleMouseInput() {
super.handleMouseInput(); super.handleMouseInput();
if(showAck) { if(showAck) {
@ -215,9 +197,6 @@ public class GuiMainMenu extends GuiScreen {
} }
public static boolean enableSplash = false;
protected void mouseClicked(int par1, int par2, int par3) { protected void mouseClicked(int par1, int par2, int par3) {
if(!showAck) { if(!showAck) {
super.mouseClicked(par1, par2, par3); super.mouseClicked(par1, par2, par3);
@ -502,7 +481,7 @@ public class GuiMainMenu extends GuiScreen {
// this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, // this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12,
// 16777215); // 16777215);
} }
if (enableSplash) { if (this.splashText != null) {
var4.setColorOpaque_I(16777215); var4.setColorOpaque_I(16777215);
EaglerAdapter.glPushMatrix(); EaglerAdapter.glPushMatrix();
EaglerAdapter.glTranslatef((float) (this.width / 2 + 90), 70.0F, 0.0F); EaglerAdapter.glTranslatef((float) (this.width / 2 + 90), 70.0F, 0.0F);

View File

@ -33,8 +33,8 @@ public class ServerList {
public static void loadDefaultServers(String base64) { public static void loadDefaultServers(String base64) {
try { try {
NBTTagCompound nbt = CompressedStreamTools.readUncompressed(Base64.decodeBase64(base64)); NBTTagCompound nbt = CompressedStreamTools.readUncompressed(Base64.decodeBase64(base64));
GuiMainMenu.enableSplash = nbt.getBoolean("enableSplash"); ConfigConstants.enableSplash = nbt.getBoolean("enableSplash");
if (GuiMainMenu.enableSplash) { if (ConfigConstants.enableSplash) {
ConfigConstants.splashTexts = nbt.getTagList("splashes"); ConfigConstants.splashTexts = nbt.getTagList("splashes");
} }
ConfigConstants.profanity = nbt.getBoolean("profanity"); ConfigConstants.profanity = nbt.getBoolean("profanity");