diff --git a/src/minecraft/net/machinemuse/general/gui/CosmeticGui.scala b/src/minecraft/net/machinemuse/general/gui/CosmeticGui.scala index ad55dce..49ca805 100644 --- a/src/minecraft/net/machinemuse/general/gui/CosmeticGui.scala +++ b/src/minecraft/net/machinemuse/general/gui/CosmeticGui.scala @@ -4,6 +4,9 @@ import net.minecraft.entity.player.EntityPlayer import net.machinemuse.general.gui.frame.{ColourPickerFrame, ItemModelViewFrame, PartManipContainer, ItemSelectionFrame} import net.machinemuse.general.geometry.{MuseRect, Colour, MusePoint2D} import net.minecraft.item.ItemStack +import net.machinemuse.utils.render.GlowBuffer +import net.minecraft.client.gui.ScaledResolution +import net.machinemuse.powersuits.common.Config /** * Author: MachineMuse (Claire Semple) @@ -62,5 +65,14 @@ class CosmeticGui(val player: EntityPlayer) extends MuseGui { super.update() } - + override def drawScreen(x: Int, y: Int, z: Float) { + if (Config.canUseShaders) { + GlowBuffer.clear() + } + super.drawScreen(x, y, z) + if (Config.canUseShaders) { + val screen: ScaledResolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight) + GlowBuffer.drawFullScreen(screen) + } + } } diff --git a/src/minecraft/net/machinemuse/general/gui/frame/ItemModelViewFrame.scala b/src/minecraft/net/machinemuse/general/gui/frame/ItemModelViewFrame.scala index 02d4ad5..1fb4972 100644 --- a/src/minecraft/net/machinemuse/general/gui/frame/ItemModelViewFrame.scala +++ b/src/minecraft/net/machinemuse/general/gui/frame/ItemModelViewFrame.scala @@ -9,6 +9,7 @@ import org.lwjgl.opengl.GL11._ import net.machinemuse.utils.{MuseMathUtils, MuseItemUtils} import net.minecraft.nbt.NBTTagCompound import net.machinemuse.powersuits.item.ItemPowerArmor +import net.machinemuse.utils.render.MuseRenderer /** * Author: MachineMuse (Claire Semple) @@ -69,15 +70,17 @@ class ItemModelViewFrame(itemSelector: ItemSelectionFrame, topleft: MusePoint2D, anchorx = mousex anchory = mousey } + case _ => None } } def draw() { + val mc: Minecraft = Minecraft.getMinecraft border.draw() if (itemSelector.getSelectedItem == null || !getSelectedItem.getItem.getItem.isInstanceOf[ItemPowerArmor]) return glPushMatrix() ArmorModel.instance.renderSpec = MuseItemUtils.getMuseRenderTag(getSelectedItem.getItem, getArmorSlot) - ArmorModel.instance.visible = getArmorSlot + ArmorModel.instance.visibleSection = getArmorSlot glTranslated(border.centerx + offsetx, border.centery + offsety, 0) glScaled(zoom, zoom, zoom) glClear(GL_DEPTH_BUFFER_BIT) @@ -85,7 +88,7 @@ class ItemModelViewFrame(itemSelector: ItemSelectionFrame, topleft: MusePoint2D, glRotatef(rotx.toFloat, 1, 0, 0) glRotatef(roty.toFloat, 0, 1, 0) glTranslated(0, -getArmorSlot / 2.0, 0) - ArmorModel.instance.render(Minecraft.getMinecraft.thePlayer, 0, 0, 0, 0, 0, 0.0625f) + ArmorModel.instance.render(mc.thePlayer, 0, 0, 0, 0, 0, 0.0625f) glPopMatrix() } diff --git a/src/minecraft/net/machinemuse/general/gui/frame/PartManipSubFrame.scala b/src/minecraft/net/machinemuse/general/gui/frame/PartManipSubFrame.scala index 53c75d4..0c34563 100644 --- a/src/minecraft/net/machinemuse/general/gui/frame/PartManipSubFrame.scala +++ b/src/minecraft/net/machinemuse/general/gui/frame/PartManipSubFrame.scala @@ -81,7 +81,7 @@ class PartManipSubFrame(val model: ModelSpec, val colourframe: ColourPickerFrame val tagdata = getOrDontGetSpecTag(spec) tagdata.map(e => { val oldindex = spec.getColourIndex(e) - if (oldindex >= index) { + if (oldindex >= index && oldindex > 0) { spec.setColourIndex(e, oldindex - 1) if (player.worldObj.isRemote) player.sendQueue.addToSendQueue(new MusePacketCosmeticInfo(player.asInstanceOf[Player], getSelectedItem.inventorySlot, tagname, e).getPacket250) } diff --git a/src/minecraft/net/machinemuse/powersuits/client/render/item/ArmorModel.scala b/src/minecraft/net/machinemuse/powersuits/client/render/item/ArmorModel.scala index 4cd4a0d..5251591 100644 --- a/src/minecraft/net/machinemuse/powersuits/client/render/item/ArmorModel.scala +++ b/src/minecraft/net/machinemuse/powersuits/client/render/item/ArmorModel.scala @@ -16,7 +16,7 @@ object ArmorModel { trait ArmorModel extends ModelBiped { var renderSpec: NBTTagCompound = null - var visible: Int = 0 + var visibleSection: Int = 0 def clearAndAddChildWithInitialOffsets(mr: ModelRenderer, xo: Float, yo: Float, zo: Float) { mr.cubeList.clear() diff --git a/src/minecraft/net/machinemuse/powersuits/client/render/modelspec/RenderPart.scala b/src/minecraft/net/machinemuse/powersuits/client/render/modelspec/RenderPart.scala index dd69d84..16979dc 100644 --- a/src/minecraft/net/machinemuse/powersuits/client/render/modelspec/RenderPart.scala +++ b/src/minecraft/net/machinemuse/powersuits/client/render/modelspec/RenderPart.scala @@ -23,7 +23,7 @@ class RenderPart(base: ModelBase, val parent: ModelRenderer) extends ModelRender for { nbt <- NBTTagAccessor.getValues(renderSpec).asScala part <- ModelRegistry.getPart(nbt) - if part.slot == ArmorModel.instance.visible + if part.slot == ArmorModel.instance.visibleSection if part.morph.apply(ArmorModel.instance) == parent } { withMaybeGlow(part, nbt) { @@ -33,7 +33,7 @@ class RenderPart(base: ModelBase, val parent: ModelRenderer) extends ModelRender Minecraft.getMinecraft.renderEngine.bindTexture(part.getTexture(nbt)) applyTransform val ix = part.getColourIndex(nbt) - if (ix < colours.size) { + if (ix < colours.size && ix >= 0) { Colour.doGLByInt(colours(ix)) } part.modelSpec.applyOffsetAndRotation // not yet implemented diff --git a/src/minecraft/net/machinemuse/powersuits/item/ItemPowerArmor.scala b/src/minecraft/net/machinemuse/powersuits/item/ItemPowerArmor.scala index d1e983e..e43cc43 100644 --- a/src/minecraft/net/machinemuse/powersuits/item/ItemPowerArmor.scala +++ b/src/minecraft/net/machinemuse/powersuits/item/ItemPowerArmor.scala @@ -65,7 +65,7 @@ abstract class ItemPowerArmor(id: Int, renderIndex: Int, armorType: Int) override def getArmorModel(entityLiving: EntityLiving, itemstack: ItemStack, armorSlot: Int): ModelBiped = { val model: ArmorModel = ArmorModel.instance - model.visible = armorSlot + model.visibleSection = armorSlot if (itemstack != null) { if (entityLiving.isInstanceOf[EntityPlayer]) {