mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-11-18 11:29:13 +00:00
01/01/2015
This commit is contained in:
1 parent
99328f69f5
commit
7727e41ed3
7 files changed
+85
-40
No files matched your search
+24
-1
@@ -1,10 +1,13 @@
|
||||
package com.brandon3055.draconicevolution.client.interfaces.componentguis;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.interfaces.guicomponents.*;
|
||||
import com.brandon3055.draconicevolution.client.interfaces.manual.GuiButtonAHeight;
|
||||
import com.brandon3055.draconicevolution.common.container.DummyContainer;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemConfigValue;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -23,6 +26,25 @@ public class GUIToolConfig extends GUIBase {
|
||||
addDependentComponents();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
buttonList.clear();
|
||||
buttonList.add(new GuiButtonAHeight(0, guiLeft + 3, guiTop + 25, 20, 12, "<="));
|
||||
((GuiButton)buttonList.get(0)).visible = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
super.actionPerformed(button);
|
||||
((GuiButton)buttonList.get(0)).visible = false;
|
||||
collection.removeGroup("LIST_SCREEN");
|
||||
collection.setOnlyGroupEnabled("INV_SCREEN");
|
||||
collection.setGroupEnabled("BACKGROUND", true);
|
||||
LogHelper.info("button");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ComponentCollection assembleComponents() {
|
||||
ComponentCollection c = new ComponentCollection(0, 0, xSize, ySize);
|
||||
@@ -67,9 +89,10 @@ public class GUIToolConfig extends GUIBase {
|
||||
fieldOffsetY += 12;
|
||||
}
|
||||
|
||||
collection.addComponent(new ComponentItemRenderer(4, 3, stack)).setGroup("LIST_SCREEN");
|
||||
collection.addComponent(new ComponentItemRenderer(3, 5, stack)).setGroup("LIST_SCREEN");
|
||||
collection.setOnlyGroupEnabled("LIST_SCREEN");
|
||||
collection.setGroupEnabled("BACKGROUND", true);
|
||||
((GuiButton)buttonList.get(0)).visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-4
@@ -5,11 +5,9 @@ package com.brandon3055.draconicevolution.client.interfaces.guicomponents;
|
||||
* This gui system is based on open blocks gui system
|
||||
*/
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@@ -92,7 +90,7 @@ public abstract class ComponentBase extends Gui {
|
||||
if (!list.isEmpty())
|
||||
{
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
// RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
int k = 0;
|
||||
@@ -160,7 +158,7 @@ public abstract class ComponentBase extends Gui {
|
||||
itemRender.zLevel = 0.0F;
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
// RenderHelper.enableStandardItemLighting();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.brandon3055.draconicevolution.client.interfaces.guicomponents;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 1/01/2015.
|
||||
*/
|
||||
public class ComponentButton extends ComponentBase {
|
||||
|
||||
public int buttonId;
|
||||
public GUIBase gui;
|
||||
|
||||
public ComponentButton(int x, int y) {
|
||||
super(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBackground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -102,9 +102,11 @@ public class ComponentCollection extends ComponentBase {
|
||||
}
|
||||
|
||||
public void removeGroup(String group){
|
||||
List<ComponentBase> list = new ArrayList<ComponentBase>();
|
||||
for (ComponentBase component : components){
|
||||
if (component.getGroup().equals(group)) components.remove(component);
|
||||
if (component.getGroup().equals(group)) list.add(component);
|
||||
}
|
||||
components.removeAll(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+13
@@ -7,6 +7,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 31/12/2014.
|
||||
*/
|
||||
@@ -63,4 +66,14 @@ public class ComponentFieldButton extends ComponentBase {
|
||||
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
drawString(fontRendererObj, field.name, x + offsetX + 2, y + offsetY + (getHeight() / 2) - (fontRendererObj.FONT_HEIGHT / 2), 0xffffff);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
if (isMouseOver(mouseX, mouseY)) {
|
||||
List list = new ArrayList();
|
||||
list.add(String.valueOf(field.value));
|
||||
drawHoveringText(list, mouseX + offsetX, mouseY + offsetY + 10, fontRendererObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -61,21 +61,23 @@ public abstract class GUIBase extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
||||
prepareRenderState();
|
||||
preRender(mouseX, mouseY);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(this.guiLeft, this.guiTop, 0);
|
||||
collection.renderBackground(this.mc, 0, 0, mouseX - this.guiLeft, mouseY - this.guiTop);
|
||||
GL11.glPopMatrix();
|
||||
postRender(mouseX, mouseY);
|
||||
restoreRenderState();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
prepareRenderState();
|
||||
//prepareRenderState();
|
||||
GL11.glPushMatrix();
|
||||
collection.renderForground(this.mc, 0, 0, mouseX - this.guiLeft, mouseY - this.guiTop);
|
||||
GL11.glPopMatrix();
|
||||
restoreRenderState();
|
||||
//restoreRenderState();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-32
@@ -46,10 +46,6 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IEnergyCo
|
||||
private int maxTransfer = References.DRACONICTRANSFER;
|
||||
private int maxEnergy = References.DRACONICCAPACITY;
|
||||
private int energyPerDamage = 80;
|
||||
// private Map<String, Byte> fieldsHelm;
|
||||
// private Map<String, Byte> fieldsChest;
|
||||
// private Map<String, Byte> fieldsLeggs;
|
||||
// private Map<String, Byte> fieldsBoots;
|
||||
|
||||
public DraconicArmor(ArmorMaterial material, int armorType, String name) {
|
||||
super(material, 0, armorType);
|
||||
@@ -269,31 +265,6 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IEnergyCo
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public String[] getNames(ItemStack stack) {
|
||||
// String[] s = new String[1];
|
||||
//
|
||||
// if (armorType == 0)
|
||||
// return fieldsHelm.keySet().toArray(s);
|
||||
// else if (armorType == 1)
|
||||
// return fieldsChest.keySet().toArray(s);
|
||||
// else if (armorType == 2)
|
||||
// return fieldsLeggs.keySet().toArray(s);
|
||||
// else if (armorType == 3)
|
||||
// return fieldsBoots.keySet().toArray(s);
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getDataType(String name) {
|
||||
// if (fieldsHelm.containsKey(name)) return fieldsHelm.get(name);
|
||||
// else if (fieldsChest.containsKey(name)) return fieldsChest.get(name);
|
||||
// else if (fieldsLeggs.containsKey(name)) return fieldsLeggs.get(name);
|
||||
// else if (fieldsBoots.containsKey(name)) return fieldsBoots.get(name);
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<ItemConfigValue> getFields(ItemStack stack, int slot) {
|
||||
List<ItemConfigValue> list = new ArrayList<ItemConfigValue>();
|
||||
@@ -302,9 +273,9 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IEnergyCo
|
||||
else if (armorType == 1)
|
||||
{
|
||||
list.add(new ItemConfigValue(References.BOOLEAN_ID, slot, "ArmorFlightLock").readFromItem(stack));
|
||||
list.add(new ItemConfigValue(References.BOOLEAN_ID, slot, "ArmorFlightLock2").readFromItem(stack));
|
||||
list.add(new ItemConfigValue(References.BOOLEAN_ID, slot, "ArmorFlightLock3").readFromItem(stack));
|
||||
list.add(new ItemConfigValue(References.BOOLEAN_ID, slot, "ArmorFlightLock4").readFromItem(stack));
|
||||
list.add(new ItemConfigValue(References.FLOAT_ID, slot, "ArmorFlightLock2").readFromItem(stack));
|
||||
list.add(new ItemConfigValue(References.INT_ID, slot, "ArmorFlightLock3").readFromItem(stack));
|
||||
list.add(new ItemConfigValue(References.STRING_ID, slot, "ArmorFlightLock4").readFromItem(stack));
|
||||
}
|
||||
else if (armorType == 2)
|
||||
list.add(new ItemConfigValue(References.FLOAT_ID, slot, "ArmorSpeedMult").readFromItem(stack));
|
||||
|
||||
Reference in new issue
Block a user