More manual stuff
This commit is contained in:
parent
6549282ea0
commit
acb5bfedf1
6 changed files with 149 additions and 3 deletions
|
@ -14,14 +14,17 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemParts;
|
||||
import techreborn.items.ItemPlates;
|
||||
import techreborn.manual.pages.AdvancedMachines;
|
||||
import techreborn.manual.pages.BasicMachinesPage;
|
||||
import techreborn.manual.pages.ContentsPage;
|
||||
import techreborn.manual.pages.CraftingInfoPage;
|
||||
import techreborn.manual.pages.DescriptionPage;
|
||||
import techreborn.manual.pages.GeneratingPowerPage;
|
||||
import techreborn.manual.pages.GettingStartedPage;
|
||||
import techreborn.manual.pages.ToolsPage;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiManual extends GuiScreen
|
||||
|
@ -71,7 +74,26 @@ public class GuiManual extends GuiScreen
|
|||
pageCollection.addPage(new CraftingInfoPage(ModBlocks.Extractor.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.Extractor), "", Reference.pageNames.BASICMACHINES_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModBlocks.Compressor.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.Compressor), "", Reference.pageNames.BASICMACHINES_PAGE));
|
||||
|
||||
|
||||
//ADVANCED MACHINES
|
||||
pageCollection.addPage(new AdvancedMachines(Reference.pageNames.ADVANCEDMACHINES_PAGE, pageCollection));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModBlocks.BlastFurnace.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.BlastFurnace), "", Reference.pageNames.ADVANCEDMACHINES_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModBlocks.industrialSawmill.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.industrialSawmill), "", Reference.pageNames.ADVANCEDMACHINES_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModBlocks.IndustrialElectrolyzer.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.IndustrialElectrolyzer), "", Reference.pageNames.ADVANCEDMACHINES_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModBlocks.IndustrialGrinder.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.IndustrialGrinder), "", Reference.pageNames.ADVANCEDMACHINES_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModBlocks.ImplosionCompressor.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.ImplosionCompressor), "", Reference.pageNames.ADVANCEDMACHINES_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModBlocks.centrifuge.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.centrifuge), "", Reference.pageNames.ADVANCEDMACHINES_PAGE));
|
||||
|
||||
//TOOLS
|
||||
pageCollection.addPage(new ToolsPage(Reference.pageNames.TOOLS_PAGE, pageCollection));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModItems.ironDrill.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.ironDrill), "", Reference.pageNames.TOOLS_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModItems.diamondDrill.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.diamondDrill), "", Reference.pageNames.TOOLS_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModItems.advancedDrill.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.advancedDrill), "", Reference.pageNames.TOOLS_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModItems.ironChainsaw.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.ironChainsaw), "", Reference.pageNames.TOOLS_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModItems.diamondChainsaw.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.diamondChainsaw), "", Reference.pageNames.TOOLS_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModItems.advancedChainsaw.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.advancedChainsaw), "", Reference.pageNames.TOOLS_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModItems.omniTool.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.omniTool), "", Reference.pageNames.TOOLS_PAGE));
|
||||
pageCollection.addPage(new CraftingInfoPage(ModItems.treeTap.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.treeTap), "", Reference.pageNames.TOOLS_PAGE));
|
||||
|
||||
return pageCollection;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@ public class Reference
|
|||
public static final String GETTINGSTARTED_KEY = "techreborn.manual.gettingstarted";
|
||||
public static final String GENERATINGPOWER_KEY = "techreborn.manual.generatingpower";
|
||||
public static final String BASICMACHINES_KEY = "techreborn.manual.basicmachines";
|
||||
|
||||
public static final String ADVANCEDMACHINES_KEY = "techreborn.manual.advancedmachines";
|
||||
public static final String TOOLS_KEY = "techreborn.manual.tools";
|
||||
|
||||
public static final String GETTINGRUBBER_KEY = "techreborn.manual.gettingrubber";
|
||||
public static final String CRAFTINGPLATES_KEY = "techreborn.manual.gettingplates";
|
||||
|
@ -22,5 +23,7 @@ public class Reference
|
|||
public static final String GETTINGRUBBER2_PAGE = "gettingrubber2";
|
||||
public static final String CRAFTINGPLATES_PAGE = "gettingplates";
|
||||
public static final String GENERATINGPOWER_PAGE = "generatingpower";
|
||||
public static final String ADVANCEDMACHINES_PAGE = "advancedmachines";
|
||||
public static final String TOOLS_PAGE = "tools";
|
||||
}
|
||||
}
|
||||
|
|
50
src/main/java/techreborn/manual/pages/AdvancedMachines.java
Normal file
50
src/main/java/techreborn/manual/pages/AdvancedMachines.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
package techreborn.manual.pages;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.manual.PageCollection;
|
||||
import techreborn.manual.Reference;
|
||||
import techreborn.manual.util.ButtonUtil;
|
||||
import techreborn.manual.util.GuiButtonItemTexture;
|
||||
|
||||
public class AdvancedMachines extends TitledPage
|
||||
{
|
||||
public AdvancedMachines(String name, PageCollection collection)
|
||||
{
|
||||
super(name, false, collection, Reference.ADVANCEDMACHINES_KEY, Color.white.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
buttonList.clear();
|
||||
ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList);
|
||||
buttonList.add(new GuiButtonItemTexture(1, getXMin() + 10, getYMin() + 20, 0, 46, 100, 20, new ItemStack(ModBlocks.BlastFurnace),
|
||||
ModBlocks.BlastFurnace.getUnlocalizedName(), ttl(ModBlocks.BlastFurnace.getLocalizedName())));
|
||||
buttonList.add(new GuiButtonItemTexture(2, getXMin() + 10, getYMin() + 40, 0, 46, 100, 20, new ItemStack(ModBlocks.industrialSawmill),
|
||||
ModBlocks.industrialSawmill.getUnlocalizedName(), ttl(ModBlocks.industrialSawmill.getLocalizedName())));
|
||||
buttonList.add(new GuiButtonItemTexture(3, getXMin() + 10, getYMin() + 60, 0, 46, 100, 20, new ItemStack(ModBlocks.IndustrialElectrolyzer),
|
||||
ModBlocks.IndustrialElectrolyzer.getUnlocalizedName(), ttl(ModBlocks.IndustrialElectrolyzer.getLocalizedName())));
|
||||
buttonList.add(new GuiButtonItemTexture(4, getXMin() + 10, getYMin() + 80, 0, 46, 100, 20, new ItemStack(ModBlocks.IndustrialGrinder),
|
||||
ModBlocks.IndustrialGrinder.getUnlocalizedName(), ttl(ModBlocks.IndustrialGrinder.getLocalizedName())));
|
||||
buttonList.add(new GuiButtonItemTexture(5, getXMin() + 10, getYMin() + 100, 0, 46, 100, 20, new ItemStack(ModBlocks.ImplosionCompressor),
|
||||
ModBlocks.ImplosionCompressor.getUnlocalizedName(), ttl(ModBlocks.ImplosionCompressor.getLocalizedName())));
|
||||
buttonList.add(new GuiButtonItemTexture(6, getXMin() + 10, getYMin() + 120, 0, 46, 100, 20, new ItemStack(ModBlocks.centrifuge),
|
||||
ModBlocks.centrifuge.getUnlocalizedName(), ttl(ModBlocks.centrifuge.getLocalizedName())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button)
|
||||
{
|
||||
if (button.id == 0) collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE);
|
||||
if (button.id == 1) collection.changeActivePage(ModBlocks.BlastFurnace.getLocalizedName());
|
||||
if (button.id == 2) collection.changeActivePage(ModBlocks.industrialSawmill.getLocalizedName());
|
||||
if (button.id == 3) collection.changeActivePage(ModBlocks.IndustrialElectrolyzer.getLocalizedName());
|
||||
if (button.id == 4) collection.changeActivePage(ModBlocks.IndustrialGrinder.getLocalizedName());
|
||||
if (button.id == 5) collection.changeActivePage(ModBlocks.ImplosionCompressor.getLocalizedName());
|
||||
if (button.id == 6) collection.changeActivePage(ModBlocks.centrifuge.getLocalizedName());
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemPlates;
|
||||
import techreborn.manual.PageCollection;
|
||||
import techreborn.manual.Reference;
|
||||
|
@ -29,6 +30,10 @@ public class ContentsPage extends TitledPage
|
|||
Reference.pageNames.GENERATINGPOWER_PAGE, ttl(Reference.GENERATINGPOWER_KEY)));
|
||||
buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, new ItemStack(ModBlocks.ElectricFurnace),
|
||||
Reference.pageNames.BASICMACHINES_PAGE, ttl(Reference.BASICMACHINES_KEY)));
|
||||
buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, new ItemStack(ModBlocks.BlastFurnace),
|
||||
Reference.pageNames.ADVANCEDMACHINES_PAGE, ttl(Reference.ADVANCEDMACHINES_KEY)));
|
||||
buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, new ItemStack(ModItems.ironDrill),
|
||||
Reference.pageNames.TOOLS_PAGE, ttl(Reference.TOOLS_KEY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,5 +48,7 @@ public class ContentsPage extends TitledPage
|
|||
if (button.id == 0) collection.changeActivePage(Reference.pageNames.GETTINGSTARTED_PAGE);
|
||||
if (button.id == 1) collection.changeActivePage(Reference.pageNames.GENERATINGPOWER_PAGE);
|
||||
if (button.id == 2) collection.changeActivePage(Reference.pageNames.BASICMACHINES_PAGE);
|
||||
if (button.id == 3) collection.changeActivePage(Reference.pageNames.ADVANCEDMACHINES_PAGE);
|
||||
if (button.id == 4) collection.changeActivePage(Reference.pageNames.TOOLS_PAGE);
|
||||
}
|
||||
}
|
||||
|
|
63
src/main/java/techreborn/manual/pages/ToolsPage.java
Normal file
63
src/main/java/techreborn/manual/pages/ToolsPage.java
Normal file
|
@ -0,0 +1,63 @@
|
|||
package techreborn.manual.pages;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.manual.PageCollection;
|
||||
import techreborn.manual.Reference;
|
||||
import techreborn.manual.util.ButtonUtil;
|
||||
import techreborn.manual.util.GuiButtonItemTexture;
|
||||
|
||||
public class ToolsPage extends TitledPage
|
||||
{
|
||||
public ToolsPage(String name, PageCollection collection)
|
||||
{
|
||||
super(name, false, collection, Reference.TOOLS_KEY, Color.white.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
buttonList.clear();
|
||||
ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList);
|
||||
ButtonUtil.addNextButton(1, width / 2 + 40, height / 2 + 64, buttonList);
|
||||
buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, new ItemStack(ModItems.ironDrill),
|
||||
ModItems.ironDrill.getUnlocalizedName(), ttl(ModItems.ironDrill.getUnlocalizedName() + ".name")));
|
||||
buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, new ItemStack(ModItems.diamondDrill),
|
||||
ModItems.diamondDrill.getUnlocalizedName(), ttl(ModItems.diamondDrill.getUnlocalizedName() + ".name")));
|
||||
buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, new ItemStack(ModItems.advancedDrill),
|
||||
ModItems.advancedDrill.getUnlocalizedName(), ttl(ModItems.advancedDrill.getUnlocalizedName() + ".name")));
|
||||
buttonList.add(new GuiButtonItemTexture(5, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, new ItemStack(ModItems.ironChainsaw),
|
||||
ModItems.ironChainsaw.getUnlocalizedName(), ttl(ModItems.ironChainsaw.getUnlocalizedName() + ".name")));
|
||||
buttonList.add(new GuiButtonItemTexture(6, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, new ItemStack(ModItems.diamondChainsaw),
|
||||
ModItems.diamondChainsaw.getUnlocalizedName(), ttl(ModItems.diamondChainsaw.getUnlocalizedName() + ".name")));
|
||||
buttonList.add(new GuiButtonItemTexture(7, getXMin() + 20, getYMin() + 120, 0, 46, 100, 20, new ItemStack(ModItems.advancedChainsaw),
|
||||
ModItems.advancedChainsaw.getUnlocalizedName(), ttl(ModItems.advancedChainsaw.getUnlocalizedName() + ".name")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton button)
|
||||
{
|
||||
if (button.id == 0) collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE);
|
||||
if (button.id == 1)
|
||||
{
|
||||
buttonList.clear();
|
||||
ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList);
|
||||
buttonList.add(new GuiButtonItemTexture(8, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, new ItemStack(ModItems.omniTool),
|
||||
ModItems.omniTool.getUnlocalizedName(), ttl(ModItems.omniTool.getUnlocalizedName() + ".name")));
|
||||
buttonList.add(new GuiButtonItemTexture(9, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, new ItemStack(ModItems.treeTap),
|
||||
ModItems.treeTap.getUnlocalizedName(), ttl(ModItems.treeTap.getUnlocalizedName() + ".name")));
|
||||
}
|
||||
if (button.id == 2) collection.changeActivePage(ModItems.ironDrill.getUnlocalizedName() + ".name");
|
||||
if (button.id == 3) collection.changeActivePage(ModItems.diamondDrill.getUnlocalizedName() + ".name");
|
||||
if (button.id == 4) collection.changeActivePage(ModItems.advancedDrill.getUnlocalizedName() + ".name");
|
||||
if (button.id == 5) collection.changeActivePage(ModItems.ironChainsaw.getUnlocalizedName() + ".name");
|
||||
if (button.id == 6) collection.changeActivePage(ModItems.diamondChainsaw.getUnlocalizedName() + ".name");
|
||||
if (button.id == 7) collection.changeActivePage(ModItems.advancedChainsaw.getUnlocalizedName() + ".name");
|
||||
if (button.id == 8) collection.changeActivePage(ModItems.omniTool.getUnlocalizedName() + ".name");
|
||||
if (button.id == 9) collection.changeActivePage(ModItems.treeTap.getUnlocalizedName() + ".name");
|
||||
}
|
||||
}
|
|
@ -929,7 +929,8 @@ techreborn.manual.contents=Contents Page
|
|||
techreborn.manual.gettingstarted=Getting Started
|
||||
techreborn.manual.generatingpower=Generating Power
|
||||
techreborn.manual.basicmachines=Basic Machines
|
||||
|
||||
techreborn.manual.advancedmachines=Advanced Machines
|
||||
techreborn.manual.tools=Tools
|
||||
|
||||
techreborn.manual.gettingrubber=Collecting Rubber
|
||||
techreborn.manual.backbutton=Back
|
||||
|
|
Loading…
Add table
Reference in a new issue