Skip to content

Commit

Permalink
Merge pull request #47 from TPPI-Dev/Dev
Browse files Browse the repository at this point in the history
Merge Dev into Master
  • Loading branch information
tterrag1098 committed Feb 12, 2014
2 parents f710f3c + 8cdda8f commit a6a028d
Show file tree
Hide file tree
Showing 21 changed files with 743 additions and 493 deletions.
2 changes: 2 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
<classpathentry kind="lib" path="/EnderIO/lib/NotEnoughItems-dev 1.6.1.4.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mekanism"/>
<classpathentry kind="lib" path="E:/Development/Let&apos;s Mod/development/forge/mcp/lib/DartCraft Beta 0.2.15_deobf.jar"/>
<classpathentry kind="lib" path="E:/Development/Let&apos;s Mod/development/forge/mcp/lib/Mariculture-1.6.X-v1.1.4e_deobf.zip"/>
<classpathentry kind="lib" path="E:/Development/Let&apos;s Mod/development/forge/mcp/lib/Reliquary-1.6.4-1.1-TPPI_deobf.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
2 changes: 1 addition & 1 deletion mod.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version.minecraft=1.6.X
version.number=0.8.1
version.number=0.8.3
version.build=

mod.id=TPPITweaks
Expand Down
27 changes: 16 additions & 11 deletions src/tppitweaks/TPPITweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@

@Mod(modid = "TPPITweaks", name = "TPPI Tweaks", version = TPPITweaks.VERSION, dependencies = Reference.DEPENDENCIES)
@NetworkMod(serverSideRequired = true, clientSideRequired = true, channels = { Reference.CHANNEL }, packetHandler = PacketHandler.class)
public class TPPITweaks {

public static final String VERSION = "0.8.1";
public class TPPITweaks
{
public static final String VERSION = "0.8.3";

@Instance("TPPITweaks")
public static TPPITweaks instance;

public static TPPIEventHandler eventHandler;
public static TPPIPlayerTracker playerTracker;

public static final Logger logger = Logger.getLogger("TPPITweaks");

public static CreativeTabTPPI creativeTab = new CreativeTabTPPI(CreativeTabs.getNextID());

@EventHandler
Expand Down Expand Up @@ -77,13 +77,11 @@ public void preInit(FMLPreInitializationEvent event) {
playerTracker = new TPPIPlayerTracker();
GameRegistry.registerPlayerTracker(playerTracker);
MinecraftForge.EVENT_BUS.register(playerTracker);

if (FMLCommonHandler.instance().getEffectiveSide().isClient())
GuiHelper.initMap();
}

@EventHandler
public void init(FMLInitializationEvent event) {
public void init(FMLInitializationEvent event)
{
AM2SpawnControls.doAM2SpawnControls();

eventHandler = new TPPIEventHandler();
Expand All @@ -92,12 +90,19 @@ public void init(FMLInitializationEvent event) {
}

@EventHandler
public void postInit(FMLPostInitializationEvent event) {
public void postInit(FMLPostInitializationEvent event)
{
RecipeTweaks.doPostInitRecipeTweaks();

if (FMLCommonHandler.instance().getSide().isClient())
{
GuiHelper.initMap();
}
}

@EventHandler
public void onFMLServerStart(FMLServerStartingEvent event) {
public void onFMLServerStart(FMLServerStartingEvent event)
{
event.registerServerCommand(new CommandTPPI());
}
}
319 changes: 157 additions & 162 deletions src/tppitweaks/client/gui/UpdateGui.java
Original file line number Diff line number Diff line change
@@ -1,162 +1,157 @@
package tppitweaks.client.gui;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ChatMessageComponent;

import org.lwjgl.input.Keyboard;

import tppitweaks.TPPITweaks;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class UpdateGui extends GuiScreen
{
protected GuiScreen parentScreen;
private boolean noShow = true, firstTime;

List<InstructionsGui> modScreens = new ArrayList<InstructionsGui>();
Iterator<InstructionsGui> iterator;
ConfigGui configGui = null;

public void initModInstallationMenus()
{

if (!Loader.isModLoaded("Thaumcraft"))
modScreens.add(new InstructionsGui(new ModDownload("Thaumcraft 4", "http://adf.ly/1311628/thaumcraft-4", "Thaumcraft")));

if (!Loader.isModLoaded("TwilightForest"))
modScreens.add(new InstructionsGui(new ModDownload("Twilight Forest", "http://adf.ly/Zvi5J", "TwilightForest")));

iterator = modScreens.iterator();

configGui = new ConfigGui();

}

public UpdateGui(GuiScreen parentScreen, boolean firstTime)
{
this.parentScreen = parentScreen;

initModInstallationMenus();

if (modScreens.isEmpty())
Minecraft.getMinecraft().thePlayer.sendChatToPlayer(new ChatMessageComponent().addText("You have all optional mods installed!"));

for (InstructionsGui g : modScreens)
{
if (!Loader.isModLoaded(g.mod.modid))
noShow = false;
}

this.firstTime = firstTime;
}

@SuppressWarnings("unchecked")
@Override
public void initGui()
{
if (noShow)
{
System.out.println("not opening GUI");
this.mc.displayGuiScreen(this.parentScreen);
return;
}
else
{

}

// Unsure exactly what this does but...it seems necessary
Keyboard.enableRepeatEvents(true);

this.buttonList.clear();

this.buttonList.add(new GuiButton(-1, this.width / 2 - 150, this.height / 2 + 30, 300, 20, "Continue"));
this.buttonList.add(new GuiButton(11, this.width / 2 - 150, this.height / 2 + 65, 300, 20, "Skip the downloads completely"));
}

@Override
public void onGuiClosed()
{
Keyboard.enableRepeatEvents(false);
}

@Override
protected void actionPerformed(GuiButton button)
{
if (button.enabled)
{
if (button.id == 11)
this.mc.displayGuiScreen(this.parentScreen);
else
{
try
{
if (GuiHelper.updateGui.iterator.hasNext())
{
this.mc.displayGuiScreen(GuiHelper.updateGui.iterator.next());
}
/*
else if (configGui != null)
{
File file=new File("config/TPPI/config/hardconfig.zip");
if (file.exists()) this.mc.displayGuiScreen(configGui);
configGui = null;
}
*/
else if (GuiHelper.updateGui.modScreens.size() > 0)
{
this.mc.displayGuiScreen(new RestartGui());
}
else
{
this.mc.displayGuiScreen(this.parentScreen);
}
}
catch (Exception e)
{
TPPITweaks.logger.log(Level.SEVERE, "Error opening webpage, please contact TPPI Team.");
e.printStackTrace();
}
}
}
}

@Override
public void drawScreen(int par1, int par2, float par3)
{
drawScreen(par1, par2, par3, true);
}

public void drawScreen(int par1, int par2, float par3, boolean draw)
{
if (draw)
{
this.drawDefaultBackground();

if (firstTime)
{
this.drawCenteredString(this.fontRenderer, "Hey there! This seems like the first time you are starting TPPI. Welcome!", this.width / 2, this.height / 2 - 100, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "This menu will not show again unless enabled in the TPPI Tweaks config.", this.width / 2, this.height / 2 - 10, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "Alternatively, you may use the command \"/tppi download\" to show it in-game.", this.width / 2, this.height / 2, 0xFFFFFF);
}

this.drawCenteredString(this.fontRenderer, "As it turns out, there are some mods we really wanted to include,", this.width / 2, this.height / 2 - 80, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "but couldn't ship directly with the rest of the pack.", this.width / 2, this.height / 2 - 70, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "Though we had to leave them out, we built this little utility to", this.width / 2, this.height / 2 - 50, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "help you all add them manually, to gain what we feel is the full TPPI experience.", this.width / 2, this.height / 2 - 40, 0xFFFFFF);

}

super.drawScreen(par1, par2, par3);
}
}
package tppitweaks.client.gui;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ChatMessageComponent;

import org.lwjgl.input.Keyboard;

import tppitweaks.TPPITweaks;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class UpdateGui extends GuiScreen
{
protected GuiScreen parentScreen;
private boolean noShow = true, firstTime;

List<InstructionsGui> modScreens = new ArrayList<InstructionsGui>();
Iterator<InstructionsGui> iterator;
ConfigGui configGui = null;

public void initModInstallationMenus()
{
if (!Loader.isModLoaded("TwilightForest"))
modScreens.add(new InstructionsGui(new ModDownload("Twilight Forest", "http://adf.ly/Zvi5J", "TwilightForest")));

iterator = modScreens.iterator();

configGui = new ConfigGui();
}

public UpdateGui(GuiScreen parentScreen, boolean firstTime)
{
this.parentScreen = parentScreen;

initModInstallationMenus();

if (modScreens.isEmpty() && !firstTime)
Minecraft.getMinecraft().thePlayer.sendChatToPlayer(new ChatMessageComponent().addText("You have all optional mods installed!"));

for (InstructionsGui g : modScreens)
{
if (!Loader.isModLoaded(g.mod.modid))
noShow = false;
}

this.firstTime = firstTime;
}

@SuppressWarnings("unchecked")
@Override
public void initGui()
{
if (noShow)
{
System.out.println("not opening GUI");
this.mc.displayGuiScreen(this.parentScreen);
return;
}
else
{

}

// Unsure exactly what this does but...it seems necessary
Keyboard.enableRepeatEvents(true);

this.buttonList.clear();

this.buttonList.add(new GuiButton(-1, this.width / 2 - 150, this.height / 2 + 30, 300, 20, "Continue"));
this.buttonList.add(new GuiButton(11, this.width / 2 - 150, this.height / 2 + 65, 300, 20, "Skip the downloads completely"));
}

@Override
public void onGuiClosed()
{
Keyboard.enableRepeatEvents(false);
}

@Override
protected void actionPerformed(GuiButton button)
{
if (button.enabled)
{
if (button.id == 11)
this.mc.displayGuiScreen(this.parentScreen);
else
{
try
{
if (GuiHelper.updateGui.iterator.hasNext())
{
this.mc.displayGuiScreen(GuiHelper.updateGui.iterator.next());
}
/*
else if (configGui != null)
{
File file=new File("config/TPPI/config/hardconfig.zip");
if (file.exists()) this.mc.displayGuiScreen(configGui);
configGui = null;
}
*/
else if (GuiHelper.updateGui.modScreens.size() > 0)
{
this.mc.displayGuiScreen(new RestartGui());
}
else
{
this.mc.displayGuiScreen(this.parentScreen);
}
}
catch (Exception e)
{
TPPITweaks.logger.log(Level.SEVERE, "Error opening webpage, please contact TPPI Team.");
e.printStackTrace();
}
}
}
}

@Override
public void drawScreen(int par1, int par2, float par3)
{
drawScreen(par1, par2, par3, true);
}

public void drawScreen(int par1, int par2, float par3, boolean draw)
{
if (draw)
{
this.drawDefaultBackground();

if (firstTime)
{
this.drawCenteredString(this.fontRenderer, "Hey there! This seems like the first time you are starting TPPI. Welcome!", this.width / 2, this.height / 2 - 100, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "This menu will not show again unless enabled in the TPPI Tweaks config.", this.width / 2, this.height / 2 - 10, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "Alternatively, you may use the command \"/tppi download\" to show it in-game.", this.width / 2, this.height / 2, 0xFFFFFF);
}

this.drawCenteredString(this.fontRenderer, "As it turns out, there are some mods we really wanted to include,", this.width / 2, this.height / 2 - 80, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "but couldn't ship directly with the rest of the pack.", this.width / 2, this.height / 2 - 70, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "Though we had to leave them out, we built this little utility to", this.width / 2, this.height / 2 - 50, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "help you all add them manually, to gain what we feel is the full TPPI experience.", this.width / 2, this.height / 2 - 40, 0xFFFFFF);

}

super.drawScreen(par1, par2, par3);
}
}
Loading

0 comments on commit a6a028d

Please sign in to comment.