#134 - New GUI layout (thanks to InsomniaKitten)
This commit is contained in:
parent
60ad79f286
commit
5f9d8cf2f6
|
@ -13,11 +13,13 @@ import net.minecraft.util.ResourceLocation;
|
|||
public class GuiAccessoryButton extends GuiButton
|
||||
{
|
||||
|
||||
protected static final ResourceLocation BUTTON_TEXTURES = new ResourceLocation("aether_legacy", "textures/gui/inventory/icon.png");
|
||||
protected static final ResourceLocation BUTTON_TEXTURE = new ResourceLocation("aether_legacy", "textures/gui/inventory//button/cloud.png");
|
||||
|
||||
protected static final ResourceLocation BUTTON_HOVERED_TEXTURE = new ResourceLocation("aether_legacy", "textures/gui/inventory/button/cloud_hover.png");
|
||||
|
||||
public GuiAccessoryButton(ScaledResolution resolution)
|
||||
{
|
||||
super(18067, (resolution.getScaledWidth() / 2) - 65, (resolution.getScaledHeight() / 2) - 20, 14, 14, "");
|
||||
super(18067, (resolution.getScaledWidth() / 2) - 64, (resolution.getScaledHeight() / 2) - 19, 14, 14, "");
|
||||
|
||||
Collection<PotionEffect> collection = Minecraft.getMinecraft().thePlayer.getActivePotionEffects();
|
||||
|
||||
|
@ -41,15 +43,10 @@ public class GuiAccessoryButton extends GuiButton
|
|||
{
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.pushMatrix();
|
||||
mc.getTextureManager().bindTexture(BUTTON_TEXTURES);
|
||||
int i = this.getHoverState(this.hovered);
|
||||
mc.getTextureManager().bindTexture(i == 2 ? BUTTON_HOVERED_TEXTURE : BUTTON_TEXTURE);
|
||||
GlStateManager.enableBlend();
|
||||
|
||||
if (i == 2)
|
||||
{
|
||||
GlStateManager.color(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
drawModalRectWithCustomSizedTexture(-5 + this.xPosition + this.width / 2, this.yPosition, 0, 0, 14, 14, 14, 14);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
|
|
|
@ -7,8 +7,8 @@ import net.minecraft.client.gui.GuiButton;
|
|||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
@ -19,15 +19,12 @@ import com.legacy.aether.common.networking.AetherNetworkingManager;
|
|||
import com.legacy.aether.common.networking.packets.PacketOpenContainer;
|
||||
import com.legacy.aether.common.player.PlayerAether;
|
||||
import com.legacy.aether.common.player.perks.AetherRankings;
|
||||
import com.legacy.aether.universal.AetherCompatibility;
|
||||
|
||||
public class GuiAccessories extends GuiContainer
|
||||
{
|
||||
|
||||
private static final ResourceLocation ACCESSORIES = new ResourceLocation("aether_legacy", "textures/gui/inventory/accessories.png");
|
||||
|
||||
private static final ResourceLocation ACCESSORIES_SHIFTED = new ResourceLocation("aether_legacy", "textures/gui/inventory/accessories_shifted.png");
|
||||
|
||||
PlayerAether playerAether;
|
||||
|
||||
public GuiAccessories(PlayerAether player)
|
||||
|
@ -48,7 +45,7 @@ public class GuiAccessories extends GuiContainer
|
|||
this.buttonList.add(new GuiButtonPerks(this.width / 2 - 108, this.height / 2 - 83));
|
||||
}
|
||||
|
||||
this.buttonList.add(new GuiAccessoryButton(new ScaledResolution(Minecraft.getMinecraft()), 43, 19));
|
||||
this.buttonList.add(new GuiAccessoryButton(new ScaledResolution(Minecraft.getMinecraft()), 47, 19));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -65,14 +62,6 @@ public class GuiAccessories extends GuiContainer
|
|||
{
|
||||
this.setButtonPosition(button, this.width / 2 + 65, this.height / 2 - 23);
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("Baubles"))
|
||||
{
|
||||
if (id == 55)
|
||||
{
|
||||
button.xPosition = (new ScaledResolution(mc).getScaledWidth() / 2) - 39;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,7 +89,7 @@ public class GuiAccessories extends GuiContainer
|
|||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
|
||||
this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 115, 8, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -108,7 +97,7 @@ public class GuiAccessories extends GuiContainer
|
|||
{
|
||||
GL11.glColor3d(1.0D, 1.0D, 1.0D);
|
||||
|
||||
this.mc.renderEngine.bindTexture(AetherCompatibility.visualModsLoaded() ? ACCESSORIES_SHIFTED : ACCESSORIES);
|
||||
this.mc.renderEngine.bindTexture(ACCESSORIES);
|
||||
|
||||
this.drawTexturedModalRect(this.width / 2 - 88, this.height / 2 - 166 / 2, 0, 0, 176, 166);
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import com.legacy.aether.common.containers.slots.SlotAccessory;
|
|||
import com.legacy.aether.common.containers.util.AccessoryType;
|
||||
import com.legacy.aether.common.items.accessories.ItemAccessory;
|
||||
import com.legacy.aether.common.player.PlayerAether;
|
||||
import com.legacy.aether.universal.AetherCompatibility;
|
||||
|
||||
public class ContainerAccessories extends ContainerPlayer
|
||||
{
|
||||
|
@ -35,36 +34,14 @@ public class ContainerAccessories extends ContainerPlayer
|
|||
|
||||
for (Slot slot : (ArrayList<Slot>) this.inventorySlots)
|
||||
{
|
||||
if (slot.slotNumber == 0)
|
||||
if (slot.slotNumber > 0 && slot.slotNumber < 5)
|
||||
{
|
||||
if (!AetherCompatibility.visualModsLoaded())
|
||||
{
|
||||
slot.yDisplayPosition += 34;
|
||||
slot.xDisplayPosition -= 11;
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.yDisplayPosition += 34;
|
||||
slot.xDisplayPosition -= 20;
|
||||
}
|
||||
}
|
||||
else if (slot.slotNumber > 0 && slot.slotNumber < 5)
|
||||
{
|
||||
if (!AetherCompatibility.visualModsLoaded())
|
||||
{
|
||||
slot.yDisplayPosition -= 10;
|
||||
slot.xDisplayPosition += 36;
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.yDisplayPosition -= 10;
|
||||
slot.xDisplayPosition += 26;
|
||||
}
|
||||
slot.xDisplayPosition += 18;
|
||||
}
|
||||
|
||||
if (slot.slotNumber > 4 && slot.slotNumber < 9)
|
||||
{
|
||||
slot.xDisplayPosition += 54;
|
||||
slot.xDisplayPosition += 51;
|
||||
}
|
||||
else if (slot.slotNumber == 45)
|
||||
{
|
||||
|
@ -80,7 +57,7 @@ public class ContainerAccessories extends ContainerPlayer
|
|||
{
|
||||
AccessoryType type = this.playerAether.accessories.slotTypes[slotID];
|
||||
|
||||
this.addSlotToContainer(new SlotAccessory(inventoryInstance, slotID, type, 62 + x * 18, 8 + y * 18));
|
||||
this.addSlotToContainer(new SlotAccessory(inventoryInstance, slotID, type, 59 + x * 18, 8 + y * 18));
|
||||
slotID++;
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 362 B |
Binary file not shown.
After Width: | Height: | Size: 407 B |
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB |
Loading…
Reference in a new issue