This commit is contained in:
modmuss50 2015-11-01 15:58:44 +00:00
commit b2be570adb
7 changed files with 81 additions and 12 deletions

View file

@ -1,13 +1,19 @@
package techreborn.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import techreborn.client.GuiUtil;
import techreborn.client.container.ContainerBlastFurnace;
import techreborn.client.multiblock.Multiblock;
import techreborn.client.multiblock.MultiblockSet;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
import techreborn.proxies.ClientProxy;
import techreborn.tiles.TileBlastFurnace;
@ -31,6 +37,8 @@ public class GuiBlastFurnace extends GuiContainer {
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, "");
buttonList.add(button);
super.initGui();
}
@ -69,4 +77,60 @@ public class GuiBlastFurnace extends GuiContainer {
}
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
@Override
public void actionPerformed(GuiButton button) {
super.actionPerformed(button);
if(button.id == 212){
if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){
{//This code here makes a basic multiblock and then sets to the selected one.
Multiblock multiblock = new Multiblock();
multiblock.addComponent(0, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 3, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, 1, ModBlocks.MachineCasing, 0);
MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.anchor = new ChunkCoordinates(blastfurnace.xCoord + 2, blastfurnace.yCoord - 1, blastfurnace.zCoord);
}
button.displayString = "A";
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
button.displayString = "B";
}
}
}
}

View file

@ -2,6 +2,8 @@ package techreborn.pda.pages;
import java.awt.Button;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@ -80,7 +82,6 @@ public class BasePage extends GuiScreen {
}
public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY){
}
public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {

View file

@ -50,10 +50,8 @@ public class ContentsPage extends TitledPage {
if (button.id == 5)collection.changeActivePage("MULTIBLOCKS");
if (button.id == 6)collection.changeActivePage("UPGRADES");
if (button.id == 7)collection.changeActivePage("VERSION");
if (button.id == 8){
buttonList.clear();
mc.displayGuiScreen(new TechRebornConfigGui(this));
}
if (button.id == 8)mc.displayGuiScreen(new TechRebornConfigGui(this));
if (button.id == 9)collection.changeActivePage("CONFIG");
}

View file

@ -1,5 +1,6 @@
package techreborn.pda.pages;
import java.awt.Color;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Iterator;
@ -42,7 +43,7 @@ public class CraftingInfoPage extends TitledPage{
private float descriptionScale = 0.66f;
public CraftingInfoPage(String name, PageCollection collection, ItemStack itemStack, String unlocalizedDescription) {
super(name, true, collection, itemStack.getUnlocalizedName()+".name", 7777777);
super(name, true, collection, itemStack.getUnlocalizedName()+".name", Color.white.getRGB());
this.result = itemStack;
this.recipe = getFirstRecipeForItem(itemStack);
for (ItemStack stack : recipe) if (stack != null) hasRecipe = true;
@ -62,7 +63,7 @@ public class CraftingInfoPage extends TitledPage{
}
else {
drawTexturedModalRect(offsetX + 119, offsetY + 17, 0, 202, 18, 18);
drawString(fontRendererObj, "No Crafting Recipe", offsetX + 145, offsetY + 17, 6666666);
drawString(fontRendererObj, "No Crafting Recipe", offsetX + 145, offsetY + 17, Color.white.getRGB());
}
}
GL11.glPopMatrix();
@ -123,7 +124,7 @@ public class CraftingInfoPage extends TitledPage{
s = s.substring(2);
offset += fontRendererObj.FONT_HEIGHT/2;
}
fontRendererObj.drawString(s, 0, offset, 6666666);
fontRendererObj.drawString(s, 0, offset, Color.white.getRGB());
offset += fontRendererObj.FONT_HEIGHT;
}
GL11.glPopMatrix();

View file

@ -1,5 +1,9 @@
package techreborn.pda.pages;
import java.awt.Color;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.entity.RenderItem;
@ -15,7 +19,7 @@ public class ItemsPage extends TitledPage{
public String PAGE;
public ItemsPage(String name, PageCollection collection, String page) {
super(name, false, collection, page, 7777777);
super(name, false, collection, page, Color.white.getRGB());
PAGE = page;
}
@ -41,13 +45,14 @@ public class ItemsPage extends TitledPage{
}
}
}
buttonList.add(new GuiButton(1, getXMin() + 20, getYMin() + 180, ttl("techreborn.pda.backbutton")));
}
@Override
public void actionPerformed(GuiButton button) {
if (button instanceof GuiButtonTextOnly)
collection.changeActivePage(((GuiButtonTextOnly)button).LINKED_PAGE);
if (button.id == 0) collection.changeActivePage("CONTENTS");
if (button.id == 1) collection.changeActivePage("CONTENTS");
}
@Override
@ -63,6 +68,5 @@ public class ItemsPage extends TitledPage{
((GuiButtonTextOnly) this.buttonList.get(k)).drawButton(this.mc, mouseX + offsetX, mouseY + offsetY);
}
}
buttonList.add(new GuiButton(0, offsetX + 20, offsetY + 180, ttl("techreborn.pda.backbutton")));
}
}

View file

@ -43,6 +43,7 @@ public class MultiBlockPage extends TitledPage{
@Override
public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.renderOverlayComponents(minecraft, offsetX, offsetY, mouseX, mouseY);
drawCenteredString(fontRendererObj, ttl("techreborn.pda.multiblock.decripion"), offsetX + 128, offsetY + 20, Color.white.getRGB());
}
@Override

View file

@ -23,7 +23,7 @@ import techreborn.pda.PageCollection;
public class VersionPage extends TitledPage{
public VersionPage(String name, PageCollection collection, String unlocalizedTitle, int colour) {
super(name, false, collection, unlocalizedTitle, 77777);
super(name, false, collection, unlocalizedTitle, Color.white.getRGB());
}
@Override