2017-02-23 13:29:43 +01:00
|
|
|
/*
|
|
|
|
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
|
|
|
*
|
|
|
|
* Copyright (c) 2017 TechReborn
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2016-02-25 19:25:52 +01:00
|
|
|
package techreborn.manual.pages;
|
|
|
|
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
import net.minecraft.client.gui.GuiButton;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import techreborn.init.ModBlocks;
|
2016-02-26 15:35:13 +01:00
|
|
|
import techreborn.init.ModItems;
|
2016-02-25 19:25:52 +01:00
|
|
|
import techreborn.items.ItemPlates;
|
|
|
|
import techreborn.manual.PageCollection;
|
|
|
|
import techreborn.manual.Reference;
|
2016-02-26 13:56:15 +01:00
|
|
|
import techreborn.manual.util.GuiButtonItemTexture;
|
2016-02-25 19:25:52 +01:00
|
|
|
|
2016-03-27 18:41:56 +02:00
|
|
|
import java.awt.*;
|
|
|
|
|
2016-10-08 21:46:16 +02:00
|
|
|
public class ContentsPage extends TitledPage {
|
|
|
|
public ContentsPage(String name, PageCollection collection) {
|
2016-03-25 10:47:34 +01:00
|
|
|
super(name, false, collection, Reference.CONTENTS_KEY, Color.white.getRGB());
|
|
|
|
}
|
2016-02-25 19:25:52 +01:00
|
|
|
|
2016-03-25 10:47:34 +01:00
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
@Override
|
2016-10-08 21:46:16 +02:00
|
|
|
public void initGui() {
|
2016-03-25 10:47:34 +01:00
|
|
|
buttonList.clear();
|
|
|
|
buttonList.add(new GuiButtonItemTexture(0, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20,
|
2016-10-08 21:46:16 +02:00
|
|
|
ItemPlates.getPlateByName("iron"), Reference.pageNames.GETTINGSTARTED_PAGE,
|
|
|
|
ttl(Reference.GETTINGSTARTED_KEY)));
|
2016-03-25 10:47:34 +01:00
|
|
|
buttonList.add(new GuiButtonItemTexture(1, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20,
|
2017-01-01 08:29:32 +01:00
|
|
|
new ItemStack(ModBlocks.SOLID_FUEL_GENEREATOR), Reference.pageNames.GENERATINGPOWER_PAGE,
|
2016-10-08 21:46:16 +02:00
|
|
|
ttl(Reference.GENERATINGPOWER_KEY)));
|
2016-03-25 10:47:34 +01:00
|
|
|
buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20,
|
2017-01-01 08:29:32 +01:00
|
|
|
new ItemStack(ModBlocks.ELECTRIC_FURNACE), Reference.pageNames.BASICMACHINES_PAGE,
|
2016-10-08 21:46:16 +02:00
|
|
|
ttl(Reference.BASICMACHINES_KEY)));
|
2016-03-25 10:47:34 +01:00
|
|
|
buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20,
|
2017-01-01 08:29:32 +01:00
|
|
|
new ItemStack(ModBlocks.INDUSTRIAL_BLAST_FURNACE), Reference.pageNames.ADVANCEDMACHINES_PAGE,
|
2016-10-08 21:46:16 +02:00
|
|
|
ttl(Reference.ADVANCEDMACHINES_KEY)));
|
2016-03-25 10:47:34 +01:00
|
|
|
buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20,
|
2017-01-01 08:29:32 +01:00
|
|
|
new ItemStack(ModItems.STEEL_DRILL), Reference.pageNames.TOOLS_PAGE, ttl(Reference.TOOLS_KEY)));
|
2016-03-25 10:47:34 +01:00
|
|
|
}
|
2016-02-25 19:25:52 +01:00
|
|
|
|
2016-03-25 10:47:34 +01:00
|
|
|
@Override
|
2016-10-08 21:46:16 +02:00
|
|
|
public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
2016-03-25 10:47:34 +01:00
|
|
|
super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY);
|
|
|
|
}
|
2016-02-25 19:25:52 +01:00
|
|
|
|
2016-03-25 10:47:34 +01:00
|
|
|
@Override
|
2016-10-08 21:46:16 +02:00
|
|
|
public void actionPerformed(GuiButton button) {
|
2016-03-25 10:47:34 +01:00
|
|
|
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);
|
|
|
|
}
|
2016-02-25 19:25:52 +01:00
|
|
|
}
|