mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 23:13:21 +00:00
New textures needed!
This commit is contained in:
1 parent
431b428403
commit
954c707959
8 files changed
+67
-21
No files matched your search
@@ -9,7 +9,6 @@ public class ItemConduitSubtype {
|
||||
public final String iconKey;
|
||||
|
||||
public ItemConduitSubtype(String unlocalisedName, String uiName, String iconKey) {
|
||||
super();
|
||||
this.unlocalisedName = unlocalisedName;
|
||||
this.uiName = uiName;
|
||||
this.iconKey = iconKey;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
private ToggleButtonEIO useOreDictB;
|
||||
private ToggleButtonEIO stickyB;
|
||||
|
||||
boolean inOutShowIn = true;
|
||||
boolean inOutShowIn = false;
|
||||
|
||||
private ItemFilter activeFilter;
|
||||
|
||||
@@ -71,15 +71,12 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
if(nextFilterB != null) {
|
||||
gui.removeButton(nextFilterB);
|
||||
}
|
||||
int headingWidth = gui.getFontRenderer().getStringWidth(getHeading());
|
||||
|
||||
int y = customTop;
|
||||
int x;
|
||||
|
||||
int x = 40;//((width - headingWidth) / 2) + 3;
|
||||
// prevFilterB = new IconButtonEIO(gui, NEXT_FILTER_ID, x, y, IconEIO.LEFT_ARROW);
|
||||
// prevFilterB.setSize(8, 16);
|
||||
|
||||
x = ((width - headingWidth) / 2) + headingWidth + 13;
|
||||
int headingWidth = gui.getFontRenderer().getStringWidth(getHeading());
|
||||
x = ((width - headingWidth) / 2) + headingWidth + 16;
|
||||
nextFilterB = new IconButtonEIO(gui, NEXT_FILTER_ID, x, y, IconEIO.RIGHT_ARROW);
|
||||
nextFilterB.setSize(8, 16);
|
||||
|
||||
@@ -98,7 +95,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
stickyB.setToolTip("Sticky Mode", "Reserve Matched Items");
|
||||
|
||||
y += 20;
|
||||
x = 122;
|
||||
x = 112;
|
||||
|
||||
useNbtB = new ToggleButtonEIO(gui, ID_NBT, x, y, IconEIO.FILTER_NBT, IconEIO.FILTER_NBT);
|
||||
useNbtB.setToolTip("Match NBT Data");
|
||||
@@ -118,6 +115,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
|
||||
private void updateGuiVisibility() {
|
||||
gui.removeButton(nextFilterB);
|
||||
gui.removeButton(stickyB);
|
||||
//gui.removeButton(prevFilterB);
|
||||
|
||||
boolean showInput = false;
|
||||
@@ -170,7 +168,12 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
return;
|
||||
}
|
||||
|
||||
stickyB.onGuiInit();
|
||||
ConnectionMode mode = con.getConectionMode(gui.dir);
|
||||
boolean outputActive = (mode == ConnectionMode.IN_OUT && !inOutShowIn) || (mode == ConnectionMode.OUTPUT);
|
||||
if(outputActive) {
|
||||
stickyB.onGuiInit();
|
||||
}
|
||||
|
||||
useNbtB.onGuiInit();
|
||||
useOreDictB.onGuiInit();
|
||||
useMetaB.onGuiInit();
|
||||
|
||||
@@ -33,7 +33,9 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
public static final String ICON_KEY = "enderio:itemConduit";
|
||||
|
||||
public static final String ICON_CORE_KEY = "enderio:itemConduitCore";
|
||||
public static final String ICON_KEY_CORE = "enderio:itemConduitCore";
|
||||
|
||||
public static final String ICON_KEY_CORE_ADV = "enderio:itemConduitCoreAdvanced";
|
||||
|
||||
public static final String ICON_KEY_INPUT = "enderio:itemConduitInput";
|
||||
|
||||
@@ -41,6 +43,12 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
public static final String ICON_KEY_IN_OUT = "enderio:itemConduitInOut";
|
||||
|
||||
private static final String ICON_KEY_INPUT_ADV = "enderio:itemConduitInputAdvanced";
|
||||
|
||||
private static final String ICON_KEY_OUTPUT_ADV = "enderio:itemConduitOutputAdvanced";
|
||||
|
||||
private static final String ICON_KEY_IN_OUT_ADV = "enderio:itemConduitInOutAdvanced";
|
||||
|
||||
public static final String ICON_KEY_ENDER = "enderio:ender_still";
|
||||
|
||||
static final Map<String, Icon> ICONS = new HashMap<String, Icon>();
|
||||
@@ -51,10 +59,16 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
@Override
|
||||
public void registerIcons(IconRegister register) {
|
||||
ICONS.put(ICON_KEY, register.registerIcon(ICON_KEY));
|
||||
ICONS.put(ICON_CORE_KEY, register.registerIcon(ICON_CORE_KEY));
|
||||
ICONS.put(ICON_KEY_CORE, register.registerIcon(ICON_KEY_CORE));
|
||||
ICONS.put(ICON_KEY_CORE_ADV, register.registerIcon(ICON_KEY_CORE_ADV));
|
||||
ICONS.put(ICON_KEY_INPUT, register.registerIcon(ICON_KEY_INPUT));
|
||||
ICONS.put(ICON_KEY_OUTPUT, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
ICONS.put(ICON_KEY_IN_OUT, register.registerIcon(ICON_KEY_IN_OUT));
|
||||
|
||||
ICONS.put(ICON_KEY_INPUT_ADV, register.registerIcon(ICON_KEY_INPUT_ADV));
|
||||
ICONS.put(ICON_KEY_OUTPUT_ADV, register.registerIcon(ICON_KEY_OUTPUT_ADV));
|
||||
ICONS.put(ICON_KEY_IN_OUT_ADV, register.registerIcon(ICON_KEY_IN_OUT_ADV));
|
||||
|
||||
ICONS.put(ICON_KEY_ENDER, register.registerIcon(ICON_KEY_ENDER));
|
||||
}
|
||||
|
||||
@@ -76,7 +90,26 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
protected final EnumMap<ForgeDirection, ItemFilter> outputFilters = new EnumMap<ForgeDirection, ItemFilter>(ForgeDirection.class);
|
||||
|
||||
private int metaData;
|
||||
|
||||
public ItemConduit() {
|
||||
this(0);
|
||||
}
|
||||
|
||||
public ItemConduit(int itemDamage) {
|
||||
this.metaData = itemDamage;
|
||||
updateFromMetadata();
|
||||
}
|
||||
|
||||
private void updateFromMetadata() {
|
||||
if(metaData == 1) {
|
||||
maxExtractedOnTick = 64;
|
||||
extractRatePerTick = (4 * 64) / 20f; //4 stacks a second
|
||||
} else {
|
||||
maxExtractedOnTick = 1;
|
||||
extractRatePerTick = 0.25f; //four items a second
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -205,7 +238,7 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@Override
|
||||
protected ConnectionMode getDefaultConnectionMode() {
|
||||
return ConnectionMode.INPUT;
|
||||
return ConnectionMode.OUTPUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -232,17 +265,17 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@Override
|
||||
public Icon getTextureForInputMode() {
|
||||
return ICONS.get(ICON_KEY_INPUT);
|
||||
return metaData == 1 ? ICONS.get(ICON_KEY_INPUT_ADV) : ICONS.get(ICON_KEY_INPUT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getTextureForOutputMode() {
|
||||
return ICONS.get(ICON_KEY_OUTPUT);
|
||||
return metaData == 1 ? ICONS.get(ICON_KEY_OUTPUT_ADV) : ICONS.get(ICON_KEY_OUTPUT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getTextureForInOutMode() {
|
||||
return ICONS.get(ICON_KEY_IN_OUT);
|
||||
return metaData == 1 ? ICONS.get(ICON_KEY_IN_OUT_ADV) : ICONS.get(ICON_KEY_IN_OUT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -250,13 +283,17 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
return ICONS.get(ICON_KEY_ENDER);
|
||||
}
|
||||
|
||||
public Icon getCoreIcon() {
|
||||
return metaData == 1 ? ICONS.get(ICON_KEY_CORE_ADV) : ICONS.get(ICON_KEY_CORE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getTextureForState(CollidableComponent component) {
|
||||
if(component.dir == ForgeDirection.UNKNOWN) {
|
||||
return ICONS.get(ICON_CORE_KEY);
|
||||
return getCoreIcon();
|
||||
}
|
||||
if(EXTERNAL_INTERFACE_GEOM.equals(component.data)) {
|
||||
return ICONS.get(ICON_CORE_KEY);
|
||||
return getCoreIcon();
|
||||
}
|
||||
return ICONS.get(ICON_KEY);
|
||||
}
|
||||
@@ -270,6 +307,8 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
|
||||
nbtRoot.setShort("metaData", (short) metaData);
|
||||
|
||||
for (Entry<ForgeDirection, ItemFilter> entry : inputFilters.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
ItemFilter f = entry.getValue();
|
||||
@@ -298,6 +337,8 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
public void readFromNBT(NBTTagCompound nbtRoot) {
|
||||
super.readFromNBT(nbtRoot);
|
||||
|
||||
metaData = nbtRoot.getShort("metaData");
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
String key = "inFilts." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
@@ -314,6 +355,8 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
outputFilters.put(dir, filter);
|
||||
}
|
||||
}
|
||||
|
||||
updateFromMetadata();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,7 +9,8 @@ import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
public class ItemItemConduit extends AbstractItemConduit {
|
||||
|
||||
private static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemItemConduit.unlocalisedName, ModObject.itemItemConduit.name, "enderio:itemItemConduit")
|
||||
new ItemConduitSubtype(ModObject.itemItemConduit.unlocalisedName, ModObject.itemItemConduit.name, "enderio:itemItemConduit"),
|
||||
new ItemConduitSubtype(ModObject.itemItemConduit.unlocalisedName, ModObject.itemItemConduit.name + "Advanced", "enderio:itemItemConduitAdvanced")
|
||||
};
|
||||
|
||||
public static ItemItemConduit create() {
|
||||
@@ -28,8 +29,8 @@ public class ItemItemConduit extends AbstractItemConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConduit createConduit(ItemStack item) {
|
||||
return new ItemConduit();
|
||||
public IConduit createConduit(ItemStack item) {
|
||||
return new ItemConduit(item.getItemDamage());
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 909 B |
Binary file not shown.
|
After Width: | Height: | Size: 834 B |
Binary file not shown.
|
After Width: | Height: | Size: 904 B |
Binary file not shown.
Reference in new issue
Block a user