use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.
the class GuiInscriptionTable method drawBookIcon.
private void drawBookIcon() {
int bookX = this.inventorySlots.getSlot(0).xDisplayPosition;
int bookY = this.inventorySlots.getSlot(0).yDisplayPosition;
IIcon icon = Items.writable_book.getIconFromDamage(0);
if (AMGuiHelper.instance.getFastTicker() < 20)
GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.4f);
else
GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.7f);
AMGuiHelper.DrawIconAtXY(icon, bookX, bookY, this.zLevel, 16, 16, true);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}
use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.
the class GuiInscriptionTable method drawIcon.
private boolean drawIcon(ISkillTreeEntry part, boolean allowDarken) {
boolean hovering = false;
IIcon shapeIcon = SpellIconManager.instance.getIcon(SkillManager.instance.getSkillName(part));
if (shapeIcon == null)
return false;
if (!currentSpellDefIsReadOnly()) {
if (!spellPartIsValidAddition(part) && allowDarken) {
GL11.glColor3f(0.3f, 0.3f, 0.3f);
} else {
GL11.glColor3f(1.0f, 1.0f, 1.0f);
}
} else {
GL11.glColor3f(1.0f, 0.7f, 0.7f);
}
AMGuiHelper.DrawIconAtXY(shapeIcon, iconX, iconY, this.zLevel, 16, 16, false);
if (!dragging) {
if (lastMouseX > iconX && lastMouseX < iconX + 16) {
if (lastMouseY > iconY && lastMouseY < iconY + 16) {
hoveredItem = part;
hoveredIcon = shapeIcon;
hovering = true;
}
}
}
iconX += IIconStep;
if (iconX >= 175) {
iconX = IIconXStart_upper;
iconY += 17;
}
return hovering;
}
use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.
the class GuiKeystone method drawGuiContainerForegroundLayer.
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
int l = (width - xSize) / 2;
int i1 = (height - ySize) / 2;
mc.renderEngine.bindTexture(new ResourceLocation("textures/atlas/items.png"));
int numCombos = Math.min(ItemsCommonProxy.keystone.numCombinations(((ContainerKeystone) this.inventorySlots).getKeystoneStack()), comboScrollOffset + 9);
int cx = xSize;
int cy = 13;
Tessellator t = Tessellator.instance;
KeystoneCombination matchedCombo = ((ContainerKeystone) this.inventorySlots).getCurrentMatchedCombination();
for (int i = comboScrollOffset; i < numCombos; ++i) {
KeystoneCombination combo = ItemsCommonProxy.keystone.getCombinationAt(((ContainerKeystone) this.inventorySlots).getKeystoneStack(), i);
if (matchedCombo != null && combo.equals(matchedCombo)) {
currentCombination = i;
for (int n = 0; n < combo.metas.length; ++n) {
if (combo.metas[n] > -1) {
IIcon icon = AMGuiIcons.selectedRunes;
AMGuiHelper.DrawIconAtXY(icon, cx, cy, this.zLevel, 16, 16, true);
}
cx += 18;
}
mc.renderEngine.bindTexture(new ResourceLocation("textures/atlas/items.png"));
cx = xSize;
}
for (int n = 0; n < combo.metas.length; ++n) {
if (combo.metas[n] > -1) {
IIcon icon = ItemsCommonProxy.rune.getIconFromDamage(combo.metas[n]);
AMGuiHelper.DrawIconAtXY(icon, cx, cy, this.zLevel, 16, 16, true);
}
cx += 18;
}
cy += 18;
cx = xSize;
}
mc.renderEngine.bindTexture(extras);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
// special slot(s)
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
int index = ((ContainerKeystone) this.inventorySlots).specialSlotIndex - 32;
int x = 8 + 18 * index;
int y = (((ContainerKeystone) this.inventorySlots).runebagSlot > -1) ? 216 : 179;
drawTexturedModalRect(x, y, 0, 20, 16, 16);
if (((ContainerKeystone) this.inventorySlots).runebagSlot > -1) {
index = ((ContainerKeystone) this.inventorySlots).runebagSlot;
x = 8 + 18 * (index % 9);
y = index < 9 ? 216 : 140 + 18 * (int) Math.floor(index / 9f);
drawTexturedModalRect(x, y, 0, 20, 16, 16);
}
GL11.glDisable(GL11.GL_BLEND);
combinationName.drawTextBox();
if (AMGuiHelper.instance.getSlowTicker() < displayTime) {
fontRendererObj.drawSplitString(displayMessage, -90, 0, 90, displayColor);
} else {
displayTime = 0;
}
if (matchedCombo != null) {
combinationName.setText(matchedCombo.name);
}
if (hoveredCombo > -1) {
KeystoneCombination combo = ItemsCommonProxy.keystone.getCombinationAt(((ContainerKeystone) this.inventorySlots).getKeystoneStack(), hoveredCombo);
ArrayList<String> lines = new ArrayList<String>();
lines.add(combo.name);
lines.add("\2477\247o" + StatCollector.translateToLocal("am2.gui.keystoneComboClick"));
lines.add("\2477\247o" + StatCollector.translateToLocal("am2.gui.keystoneComboClick2") + "\247r");
AMGuiHelper.drawHoveringText(lines, par1 - 25, par2 + 18, Minecraft.getMinecraft().fontRenderer, this.xSize, this.ySize);
}
}
use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.
the class ItemFlickerFocus method registerIcons.
@Override
public void registerIcons(IIconRegister par1IconRegister) {
flickerIcons = new HashMap<Integer, IIcon>();
for (int i : FlickerOperatorRegistry.instance.getMasks()) {
IFlickerFunctionality operator = FlickerOperatorRegistry.instance.getOperatorForMask(i);
flickerIcons.put(i, ResourceManager.RegisterTexture(operator.getClass().getSimpleName(), par1IconRegister));
}
this.itemIcon = ResourceManager.RegisterTexture("flicker_focus_frame", par1IconRegister);
}
use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.
the class SimpleBlockRenderHandler method renderWizardChalk.
private void renderWizardChalk(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
GL11.glColor4f(1, 1, 1, 1);
int meta = world.getBlockMetadata(x, y, z);
// Tessellator.instance.setColorOpaque_I(0xFFFFFF);
Tessellator tessellator = Tessellator.instance;
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.setColorOpaque_I(0xFFFFFF);
tessellator.setBrightness(15728864);
// renderer.renderFaceYPos(block, x, y, z, BlocksCommonProxy.wizardChalk.getIcon(1, meta));
IIcon par8Icon = BlocksCommonProxy.wizardChalk.getIcon(1, meta);
double d3 = par8Icon.getInterpolatedU(renderer.renderMinX * 16.0D);
double d4 = par8Icon.getInterpolatedU(renderer.renderMaxX * 16.0D);
double d5 = par8Icon.getInterpolatedV(renderer.renderMinZ * 16.0D);
double d6 = par8Icon.getInterpolatedV(renderer.renderMaxZ * 16.0D);
double d7 = d4;
double d8 = d3;
double d9 = d5;
double d10 = d6;
double d11 = x + renderer.renderMinX;
double d12 = x + renderer.renderMaxX;
double d13 = y + renderer.renderMaxY;
double d14 = z + renderer.renderMinZ;
double d15 = z + renderer.renderMaxZ;
tessellator.addVertexWithUV(d12, d13, d15, d4, d6);
tessellator.addVertexWithUV(d12, d13, d14, d7, d9);
tessellator.addVertexWithUV(d11, d13, d14, d3, d5);
tessellator.addVertexWithUV(d11, d13, d15, d8, d10);
}
Aggregations