Cleaner gui
This commit is contained in:
parent
7a50db2d61
commit
7f889958a2
8 changed files with 98 additions and 144 deletions
|
@ -14,7 +14,6 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.StatCollector;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.pda.pages.BlocksPage;
|
||||
import techreborn.pda.pages.ContentsPage;
|
||||
import techreborn.pda.pages.CraftingInfoPage;
|
||||
import techreborn.pda.pages.IndexPage;
|
||||
|
@ -43,60 +42,68 @@ public class GuiManual extends GuiScreen{
|
|||
final PageCollection pageCollection = new PageCollection();
|
||||
pageCollection.addPage(new IndexPage("INDEX", pageCollection));
|
||||
pageCollection.addPage(new ContentsPage("CONTENTS", pageCollection));
|
||||
pageCollection.addPage(new ItemsPage("ITEMS", pageCollection));
|
||||
pageCollection.addPage(new BlocksPage("BLOCKS", pageCollection));
|
||||
pageCollection.addPage(new ItemsPage("ITEMS", pageCollection, "ITEM_PAGE"));
|
||||
pageCollection.addPage(new ItemsPage("TOOLS", pageCollection, "TOOLS_PAGE"));
|
||||
pageCollection.addPage(new ItemsPage("UPGRADES", pageCollection, "UPGRADES_PAGE"));
|
||||
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Aesu), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.AlloyFurnace), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.AlloySmelter), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.AssemblyMachine), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.BlastFurnace), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.centrifuge), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.chargeBench), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ChemicalReactor), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ChunkLoader), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ComputerCube), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.DieselGenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.digitalChest), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Distillationtower), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Dragoneggenergysiphoner), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ElectricCraftingTable), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.farm), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.FusionCoil), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.FusionControlComputer), ""));
|
||||
pageCollection.addPage(new ItemsPage("MACHINES", pageCollection, "MACHINES_PAGE"));
|
||||
pageCollection.addPage(new ItemsPage("POWER_GENERATION", pageCollection, "POWER_GENERATION_PAGE"));
|
||||
pageCollection.addPage(new ItemsPage("POWER_STORAGE", pageCollection, "POWER_STORAGE_PAGE"));
|
||||
pageCollection.addPage(new ItemsPage("MULTIBLOCK", pageCollection, "MULTIBLOCK_PAGE"));
|
||||
|
||||
|
||||
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_STORAGE_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Aesu), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.AlloyFurnace), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.AlloySmelter), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.AssemblyMachine), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.BlastFurnace), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.centrifuge), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.chargeBench), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ChemicalReactor), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ChunkLoader), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ComputerCube), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.DieselGenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.digitalChest), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Distillationtower), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Dragoneggenergysiphoner), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ElectricCraftingTable), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.farm), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.FusionCoil), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.FusionControlComputer), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Gasturbine), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Grinder), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.heatGenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.HighAdvancedMachineBlock), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Idsu), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ImplosionCompressor), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.IndustrialElectrolyzer), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.lathe), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Lesu), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.LesuStorage), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.LightningRod), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.machineframe), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.MagicalAbsorber), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Magicenergeyconverter), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.MatterFabricator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Metalshelf), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.PlasmaGenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.platecuttingmachine), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.quantumChest), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.quantumTank), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.RollingMachine), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Semifluidgenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.thermalGenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.VacuumFreezer), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Woodenshelf), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Grinder), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.heatGenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.HighAdvancedMachineBlock), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_STORAGE_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Idsu), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ImplosionCompressor), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.IndustrialElectrolyzer), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.lathe), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_STORAGE_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Lesu), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_STORAGE_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.LesuStorage), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.LightningRod), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.machineframe), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.MagicalAbsorber), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Magicenergeyconverter), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.MatterFabricator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Metalshelf), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.PlasmaGenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.platecuttingmachine), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.quantumChest), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.quantumTank), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.RollingMachine), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Semifluidgenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.thermalGenerator), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.VacuumFreezer), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Woodenshelf), ""));
|
||||
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.advancedDrill), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.cloakingDevice), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.lapotronicOrb), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.lapotronpack), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.lithiumBatpack), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.omniTool), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.rockCutter), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.advancedDrill), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.cloakingDevice), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.lapotronicOrb), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.lapotronpack), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.lithiumBatpack), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.omniTool), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.rockCutter), ""));
|
||||
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE."+getNextPageIndex(), pageCollection, new ItemStack(ModItems.uuMatter), ""));
|
||||
|
||||
return pageCollection;
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
package techreborn.pda.pages;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import techreborn.pda.PageCollection;
|
||||
import techreborn.pda.util.GuiButtonAHeight;
|
||||
import techreborn.pda.util.GuiButtonTextOnly;
|
||||
|
||||
public class BlocksPage extends TitledPage{
|
||||
|
||||
public BlocksPage(String name, PageCollection collection) {
|
||||
super(name, false, collection, "techreborn.pda.blockspage", 518915);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
buttonList.clear();
|
||||
int row = 0;
|
||||
int collum = 0;
|
||||
for (BasePage page : collection.pages){
|
||||
if (page.hasIndexButton){
|
||||
String indexName = page.INDEX_NAME;
|
||||
if (page.getReferenceName() != null && page.getReferenceName().contains("BLOCK_PAGE")){
|
||||
if (indexName==null && page instanceof CraftingInfoPage) indexName = ttl(((CraftingInfoPage)page).result.getUnlocalizedName()+".name");
|
||||
else if (indexName==null) indexName = page.getReferenceName();
|
||||
int colour = 0000000;
|
||||
|
||||
buttonList.add(new GuiButtonTextOnly(999, getXMin()+5+collum*81, getYMin()+20+(row*7), 82, 7, indexName, page.getReferenceName(), colour));
|
||||
row++;
|
||||
if (row > 21){
|
||||
row = 0;
|
||||
collum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button) {
|
||||
if (button instanceof GuiButtonTextOnly)
|
||||
collection.changeActivePage(((GuiButtonTextOnly)button).LINKED_PAGE);
|
||||
if (button.id == 0) collection.changeActivePage("CONTENTS");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
super.drawScreen(minecraft, offsetX, offsetY, mouseX, mouseY);
|
||||
for (int k = 0; k < this.buttonList.size(); ++k){
|
||||
if (buttonList.get(k) instanceof GuiButtonTextOnly && ((GuiButtonTextOnly) buttonList.get(k)).getIsHovering()) {
|
||||
((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")));
|
||||
}
|
||||
}
|
|
@ -20,33 +20,31 @@ public class ContentsPage extends TitledPage{
|
|||
@Override
|
||||
public void initGui() {
|
||||
buttonList.clear();
|
||||
buttonList.add(new GuiButton(0, getXMin() + 25, getYMin() + 20, "ITEMS"));
|
||||
buttonList.add(new GuiButton(1, getXMin() + 25, getYMin() + 40, "BLOCKS"));
|
||||
buttonList.add(new GuiButton(2, getXMin() + 25, getYMin() + 160, "INDEX"));
|
||||
buttonList.add(new GuiButtonCustomTexture(3, getXMin() + 25, getYMin() + 60, 0, 46, 60, 20, new ItemStack(ModBlocks.Aesu), "INDEX"));
|
||||
buttonList.add(new GuiButtonCustomTexture(0, getXMin() + 25, getYMin() + 20, 0, 46, 60, 20, new ItemStack(ModBlocks.AlloySmelter), "INDEX", "MACHINES"));
|
||||
buttonList.add(new GuiButtonCustomTexture(1, getXMin() + 160, getYMin() + 20, 0, 46, 60, 20, new ItemStack(ModItems.uuMatter), "INDEX", "ITEMS"));
|
||||
buttonList.add(new GuiButtonCustomTexture(2, getXMin() + 25, getYMin() + 40, 0, 46, 60, 20, new ItemStack(ModBlocks.DieselGenerator), "INDEX", "POWER GENERATION"));
|
||||
buttonList.add(new GuiButtonCustomTexture(3, getXMin() + 160, getYMin() + 40, 0, 46, 60, 20, new ItemStack(ModItems.advancedDrill), "INDEX", "TOOLS"));
|
||||
buttonList.add(new GuiButtonCustomTexture(4, getXMin() + 25, getYMin() + 60, 0, 46, 60, 20, new ItemStack(ModBlocks.Aesu), "INDEX", "POWER STORAGE"));
|
||||
buttonList.add(new GuiButtonCustomTexture(5, getXMin() + 25, getYMin() + 80, 0, 46, 60, 20, new ItemStack(ModBlocks.Aesu), "INDEX", "MULTIBLOCKS"));
|
||||
buttonList.add(new GuiButtonCustomTexture(6, getXMin() + 160, getYMin() + 60, 0, 46, 60, 20, new ItemStack(ModItems.upgrades), "INDEX", "UPGRADES"));
|
||||
|
||||
buttonList.add(new GuiButtonCustomTexture(7, getXMin() + 160, getYMin() + 160, 0, 46, 60, 20, new ItemStack(ModItems.upgrades), "INDEX", "TECHREBORN"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button) {
|
||||
if (button.id == 0)collection.changeActivePage("ITEMS");
|
||||
if (button.id == 1)collection.changeActivePage("BLOCKS");
|
||||
if (button.id == 2)collection.changeActivePage("INDEX");
|
||||
if (button.id == 0)collection.changeActivePage("MACHINES");
|
||||
if (button.id == 1)collection.changeActivePage("ITEMS");
|
||||
if (button.id == 2)collection.changeActivePage("POWER_GENERATION");
|
||||
if (button.id == 3)collection.changeActivePage("TOOLS");
|
||||
if (button.id == 4)collection.changeActivePage("POWER_STORAGE");
|
||||
if (button.id == 5)collection.changeActivePage("MULTIBLOCKS");
|
||||
if (button.id == 6)collection.changeActivePage("UPGRADES");
|
||||
if (button.id == 7)collection.changeActivePage("VERSION");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
super.drawScreen(minecraft, offsetX, offsetY, mouseX, mouseY);
|
||||
for (int k = 0; k < this.buttonList.size(); ++k){
|
||||
if (buttonList.get(k) instanceof GuiButtonTextOnly && ((GuiButtonTextOnly) buttonList.get(k)).getIsHovering()) {
|
||||
((GuiButtonTextOnly) this.buttonList.get(k)).drawButton(this.mc, mouseX + offsetX, mouseY + offsetY);
|
||||
}
|
||||
}
|
||||
drawCenteredString(minecraft.fontRenderer, ttl(ModInfo.MOD_NAME + " " + ModInfo.MOD_VERSION), offsetX + 128, offsetY + 185, 848465);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,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", 0000000);
|
||||
super(name, true, collection, itemStack.getUnlocalizedName()+".name", 7777777);
|
||||
this.result = itemStack;
|
||||
this.recipe = getFirstRecipeForItem(itemStack);
|
||||
for (ItemStack stack : recipe) if (stack != null) hasRecipe = true;
|
||||
|
@ -62,7 +62,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, 0000000);
|
||||
drawString(fontRendererObj, "No Crafting Recipe", offsetX + 145, offsetY + 17, 6666666);
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
@ -123,7 +123,7 @@ public class CraftingInfoPage extends TitledPage{
|
|||
s = s.substring(2);
|
||||
offset += fontRendererObj.FONT_HEIGHT/2;
|
||||
}
|
||||
fontRendererObj.drawString(s, 0, offset, 0x000000);
|
||||
fontRendererObj.drawString(s, 0, offset, 6666666);
|
||||
offset += fontRendererObj.FONT_HEIGHT;
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
|
|
@ -25,7 +25,7 @@ public class IndexPage extends TitledPage{
|
|||
else if (indexName==null) indexName = page.getReferenceName();
|
||||
int colour = 0000000;
|
||||
|
||||
buttonList.add(new GuiButtonTextOnly(999, getXMin()+5+collum*81, getYMin()+20+(row*7), 82, 7, indexName, page.getReferenceName(), colour));
|
||||
buttonList.add(new GuiButtonTextOnly(999, getXMin()+5+collum*81, getYMin()+20+(row*7), 82, 7, indexName, page.getReferenceName(), 6666666));
|
||||
row++;
|
||||
if (row > 21){
|
||||
row = 0;
|
||||
|
|
|
@ -10,9 +10,11 @@ import techreborn.pda.util.GuiButtonCustomTexture;
|
|||
import techreborn.pda.util.GuiButtonTextOnly;
|
||||
|
||||
public class ItemsPage extends TitledPage{
|
||||
public String PAGE;
|
||||
|
||||
public ItemsPage(String name, PageCollection collection) {
|
||||
super(name, false, collection, "techreborn.pda.itemspage", 518915);
|
||||
public ItemsPage(String name, PageCollection collection, String page) {
|
||||
super(name, false, collection, page, 7777777);
|
||||
PAGE = page;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -24,12 +26,12 @@ public class ItemsPage extends TitledPage{
|
|||
for (BasePage page : collection.pages){
|
||||
if (page.hasIndexButton){
|
||||
String indexName = page.INDEX_NAME;
|
||||
if (page.getReferenceName() != null && page.getReferenceName().contains("ITEM_PAGE")){
|
||||
if (page.getReferenceName() != null && page.getReferenceName().contains(PAGE)){
|
||||
if (indexName==null && page instanceof CraftingInfoPage) indexName = ttl(((CraftingInfoPage)page).result.getUnlocalizedName()+".name");
|
||||
else if (indexName==null) indexName = page.getReferenceName();
|
||||
int colour = 0000000;
|
||||
int colour = 77777777;
|
||||
|
||||
buttonList.add(new GuiButtonTextOnly(999, getXMin()+5+collum*81, getYMin()+20+(row*7), 82, 7, indexName, page.getReferenceName(), colour));
|
||||
buttonList.add(new GuiButtonTextOnly(999, getXMin()+5+collum*81, getYMin()+20+(row*7), 82, 7, indexName, page.getReferenceName(), 6666666));
|
||||
row++;
|
||||
if (row > 21){
|
||||
row = 0;
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
import cpw.mods.fml.client.config.GuiButtonExt;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
@ -15,12 +16,14 @@ public class GuiButtonCustomTexture extends GuiButtonExt {
|
|||
public int textureV;
|
||||
public ItemStack itemstack;
|
||||
public String LINKED_PAGE;
|
||||
public String NAME;
|
||||
|
||||
public GuiButtonCustomTexture(int id, int xPos, int yPos, int u, int v, int width, int height, ItemStack stack, String linkedPage) {
|
||||
public GuiButtonCustomTexture(int id, int xPos, int yPos, int u, int v, int width, int height, ItemStack stack, String linkedPage, String name) {
|
||||
super(id, xPos, yPos, width, height, "_");
|
||||
textureU = u;
|
||||
textureV = v;
|
||||
itemstack = stack;
|
||||
NAME = name;
|
||||
this.LINKED_PAGE = linkedPage;
|
||||
}
|
||||
|
||||
|
@ -40,8 +43,14 @@ public class GuiButtonCustomTexture extends GuiButtonExt {
|
|||
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(32826);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, itemstack, this.xPosition, this.yPosition);
|
||||
this.drawString(mc.fontRenderer, itemstack.getDisplayName(), this.xPosition + 20, this.yPosition + 3, 515611);
|
||||
this.drawString(mc.fontRenderer, this.NAME, this.xPosition + 20, this.yPosition + 3, 777777);
|
||||
}
|
||||
}
|
||||
public boolean getIsHovering(){return field_146123_n;}
|
||||
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Loading…
Reference in a new issue