Search in sources :

Example 16 with ISkinPartType

use of riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType in project Armourers-Workshop by RiskyKen.

the class SkinRenderHelper method renderBuildingGrid.

public static void renderBuildingGrid(ISkinType skinType, float scale, boolean showGuides, boolean hidden, boolean multiblock) {
    for (int i = 0; i < skinType.getSkinParts().size(); i++) {
        ISkinPartType skinPartType = skinType.getSkinParts().get(i);
        IPoint3D partOffset = skinPartType.getOffset();
        GL11.glTranslated(partOffset.getX() * scale, partOffset.getY() * scale, partOffset.getZ() * scale);
        if (skinType == SkinTypeRegistry.skinBlock) {
            if (skinPartType.getPartName().equals("multiblock") & multiblock) {
                GL11.glColor4f(1F, 1F, 0.0F, 0.2F);
                renderBuildingGrid(((SkinBlock) SkinTypeRegistry.skinBlock).partBase, scale, showGuides, hidden);
                GL11.glPolygonOffset(6F, 6F);
                GL11.glColor4f(0.5F, 0.5F, 0.5F, 0.25F);
                renderBuildingGrid(skinPartType, scale, showGuides, hidden);
            } else if (skinPartType.getPartName().equals("base") & !multiblock) {
                GL11.glColor4f(0.5F, 0.5F, 0.5F, 0.25F);
                renderBuildingGrid(skinPartType, scale, showGuides, hidden);
            }
        } else {
            GL11.glColor4f(0.5F, 0.5F, 0.5F, 0.25F);
            renderBuildingGrid(skinPartType, scale, showGuides, hidden);
        }
        GL11.glTranslated(-partOffset.getX() * scale, -partOffset.getY() * scale, -partOffset.getZ() * scale);
    }
}
Also used : ISkinPartType(riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType) IPoint3D(riskyken.armourersWorkshop.api.common.IPoint3D)

Example 17 with ISkinPartType

use of riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType in project Armourers-Workshop by RiskyKen.

the class SkinRenderHelper method renderBuildingGuide.

public static void renderBuildingGuide(ISkinType skinType, float scale, boolean showSkinOverlay, boolean showHelper) {
    for (int i = 0; i < skinType.getSkinParts().size(); i++) {
        ISkinPartType skinPart = skinType.getSkinParts().get(i);
        IPoint3D partOffset = skinPart.getOffset();
        GL11.glTranslated(partOffset.getX() * scale, partOffset.getY() * scale, partOffset.getZ() * scale);
        skinPart.renderBuildingGuide(scale, showSkinOverlay, showHelper);
        GL11.glTranslated(-partOffset.getX() * scale, -partOffset.getY() * scale, -partOffset.getZ() * scale);
    }
}
Also used : ISkinPartType(riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType) IPoint3D(riskyken.armourersWorkshop.api.common.IPoint3D)

Example 18 with ISkinPartType

use of riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType in project Armourers-Workshop by RiskyKen.

the class GuiDialogClear method initGui.

@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    buttonClose = new GuiButtonExt(-1, x + width - 80 - 10, y + height - 30, 80, 20, GuiHelper.getLocalizedControlName(name, "close"));
    buttonClear = new GuiButtonExt(-1, x + width - 160 - 20, y + height - 30, 80, 20, GuiHelper.getLocalizedControlName(name, "clear"));
    dropDownParts = new GuiDropDownList(0, x + 10, y + 20, 60, "", null);
    dropDownParts.addListItem("*", "*", true);
    if (skinType != null) {
        if (skinType != SkinTypeRegistry.skinBlock) {
            for (int i = 0; i < skinType.getSkinParts().size(); i++) {
                ISkinPartType partType = skinType.getSkinParts().get(i);
                addPartToDropDown(dropDownParts, partType);
            }
        } else {
            boolean multiblock = SkinProperties.PROP_BLOCK_MULTIBLOCK.getValue(skinProperties);
            ISkinPartType partType;
            if (multiblock) {
                partType = ((SkinBlock) SkinTypeRegistry.skinBlock).partMultiblock;
            } else {
                partType = ((SkinBlock) SkinTypeRegistry.skinBlock).partBase;
            }
            addPartToDropDown(dropDownParts, partType);
        }
    }
    dropDownParts.setListSelectedIndex(0);
    checkClearBlocks = new GuiCheckBox(0, x + 10, y + height - 60, GuiHelper.getLocalizedControlName(name, "clearBlocks"), true);
    checkClearPaint = new GuiCheckBox(0, x + 10, y + height - 50, GuiHelper.getLocalizedControlName(name, "clearPaint"), true);
    checkClearMarkers = new GuiCheckBox(0, x + 10, y + height - 70, GuiHelper.getLocalizedControlName(name, "clearMarkers"), true);
    buttonList.add(buttonClose);
    buttonList.add(buttonClear);
    buttonList.add(dropDownParts);
    buttonList.add(checkClearBlocks);
    buttonList.add(checkClearPaint);
    buttonList.add(checkClearMarkers);
}
Also used : GuiDropDownList(riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList) ISkinPartType(riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType) GuiButtonExt(cpw.mods.fml.client.config.GuiButtonExt) GuiCheckBox(riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)

Aggregations

ISkinPartType (riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType)18 IPoint3D (riskyken.armourersWorkshop.api.common.IPoint3D)5 IRectangle3D (riskyken.armourersWorkshop.api.common.IRectangle3D)4 ArrayList (java.util.ArrayList)3 SkinPart (riskyken.armourersWorkshop.common.skin.data.SkinPart)3 GuiButtonExt (cpw.mods.fml.client.config.GuiButtonExt)2 Rectangle3D (riskyken.armourersWorkshop.api.common.skin.Rectangle3D)2 ISkinType (riskyken.armourersWorkshop.api.common.skin.type.ISkinType)2 GuiCheckBox (riskyken.armourersWorkshop.client.gui.controls.GuiCheckBox)2 GuiDropDownList (riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList)2 CubeMarkerData (riskyken.armourersWorkshop.common.skin.cubes.CubeMarkerData)2 SkinCubeData (riskyken.armourersWorkshop.common.skin.data.SkinCubeData)2 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 IOException (java.io.IOException)1 TileEntity (net.minecraft.tileentity.TileEntity)1 ISkinPart (riskyken.armourersWorkshop.api.common.skin.data.ISkinPart)1 ISkinPartTypeTextured (riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured)1 GuiDialogClear (riskyken.armourersWorkshop.client.gui.armourer.dialog.GuiDialogClear)1 GuiDialogCopy (riskyken.armourersWorkshop.client.gui.armourer.dialog.GuiDialogCopy)1 DropDownListItem (riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList.DropDownListItem)1