small changes to PDA and a start on PdaConfig

This commit is contained in:
gigabit101 2015-09-23 18:29:34 +01:00
parent 1f2e703c4f
commit 97d990e316
6 changed files with 61 additions and 1 deletions

View file

@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.pda.pages.ConfigPage;
import techreborn.pda.pages.ContentsPage;
import techreborn.pda.pages.CraftingInfoPage;
import techreborn.pda.pages.IndexPage;
@ -53,6 +54,7 @@ public class GuiManual extends GuiScreen{
pageCollection.addPage(new ItemsPage("POWER_STORAGE", pageCollection, "POWER_STORAGE_PAGE"));
pageCollection.addPage(new VersionPage("VERSION", pageCollection, "VERSION PAGE", 777777));
pageCollection.addPage(new MultiBlockPage("MULTIBLOCKS", pageCollection, "MULTIBLOCK_PAGE"));
pageCollection.addPage(new ConfigPage("CONFIG", pageCollection, "PDA_CONFIG"));
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), ""));

View file

@ -21,7 +21,7 @@ public class BasePage extends GuiScreen {
//Name Displayed in the index page
public String INDEX_NAME;
public boolean hasIndexButton = false;
public static final ResourceLocation PAGE_TEXTURE = new ResourceLocation("techreborn:textures/gui/pda.png");
public static final ResourceLocation PAGE_TEXTURE = new ResourceLocation("techreborn:textures/pda/gui/pda.png");
private final int xSize = 256;
private final int ySize = 202;
protected PageCollection collection;

View file

@ -0,0 +1,55 @@
package techreborn.pda.pages;
import org.lwjgl.input.Keyboard;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.item.ItemStack;
import techreborn.config.TechRebornConfigGui;
import techreborn.init.ModItems;
import techreborn.pda.PageCollection;
import techreborn.pda.util.GuiButtonCustomTexture;
public class ConfigPage extends TitledPage {
public int GUI_ID = 0;
public float scale = 0F;
private GuiButton plusOneButton;
private GuiButton minusOneButton;
private GuiButton plusOneButtonScale;
private GuiButton minusOneButtonScale;
public ConfigPage(String name, PageCollection collection, String unlocalizedTitle) {
super(name, true, collection, "techreborn.pda.pdaconfig", 518915);
}
@SuppressWarnings("unchecked")
@Override
public void initGui() {
buttonList.clear();
plusOneButton = new GuiButton(0, getXMin() + 85, getYMin() + 19, 10, 10, "+");
minusOneButton = new GuiButton(1, getXMin() + 110, getYMin() + 19, 10, 10, "-");
plusOneButtonScale = new GuiButton(2, getXMin() + 85, getYMin() + 39, 10, 10, "+");
minusOneButtonScale = new GuiButton(3, getXMin() + 110, getYMin() + 39, 10, 10, "-");
buttonList.add(plusOneButton);
buttonList.add(minusOneButton);
buttonList.add(plusOneButtonScale);
buttonList.add(minusOneButtonScale);
}
@Override
public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
this.fontRendererObj.drawString("GUI_ID", getXMin() + 20, getYMin() + 20, 518915);
this.fontRendererObj.drawString(GUI_ID + "", getXMin() + 100, getYMin() + 20, 518915);
this.fontRendererObj.drawString("GUI_SCALE", getXMin() + 20, getYMin() + 40, 518915);
this.fontRendererObj.drawString(scale + "", getXMin() + 100, getYMin() + 40, 518915);
}
@Override
public void actionPerformed(GuiButton button) {
if (button.id == 0) GUI_ID++;
if (button.id == 1 && GUI_ID != 0) GUI_ID--;
if (button.id == 2) scale++;
if (button.id == 3 && scale != 0) scale--;
}
}

View file

@ -31,6 +31,7 @@ public class ContentsPage extends TitledPage{
buttonList.add(new GuiButtonCustomTexture(7, getXMin() + 160, getYMin() + 180, 0, 46, 80, 20, new ItemStack(ModItems.lapotronicOrb), "INDEX", "Changelog"));
buttonList.add(new GuiButtonCustomTexture(8, getXMin() + 25, getYMin() + 180, 0, 46, 80, 20, new ItemStack(ModItems.lapotronicOrb), "INDEX", "Configs"));
buttonList.add(new GuiButtonCustomTexture(9, getXMin() + 95, getYMin() + 180, 0, 46, 80, 20, new ItemStack(ModItems.lapotronicOrb), "INDEX", "CONFIG"));
}
@ -53,5 +54,7 @@ public class ContentsPage extends TitledPage{
buttonList.clear();
mc.displayGuiScreen(new TechRebornConfigGui(this));
}
if (button.id == 9)collection.changeActivePage("CONFIG");
}
}

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB