Search in sources :

Example 1 with SkinTypeRegistry

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

the class GuiTabArmourerMain method initGui.

@Override
public void initGui(int xPos, int yPos, int width, int height) {
    super.initGui(xPos, yPos, width, height);
    String guiName = tileEntity.getInventoryName();
    buttonList.clear();
    SkinTypeRegistry str = SkinTypeRegistry.INSTANCE;
    GuiDropDownList dropDownList = new GuiDropDownList(0, 10, 20, 50, "", this);
    ArrayList<ISkinType> skinList = str.getRegisteredSkinTypes();
    int skinCount = 0;
    for (int i = 0; i < skinList.size(); i++) {
        ISkinType skinType = skinList.get(i);
        if (!skinType.isHidden()) {
            String skinLocalizedName = str.getLocalizedSkinTypeName(skinType);
            String skinRegistryName = skinType.getRegistryName();
            dropDownList.addListItem(skinLocalizedName, skinRegistryName, skinType.enabled());
            if (skinType == tileEntity.getSkinType()) {
                dropDownList.setListSelectedIndex(skinCount);
            }
            skinCount++;
        }
    }
    buttonList.add(dropDownList);
    buttonList.add(new GuiButtonExt(13, 86, 16, 50, 12, GuiHelper.getLocalizedControlName(guiName, "save")));
    buttonList.add(new GuiButtonExt(14, 86, 16 + 13, 50, 12, GuiHelper.getLocalizedControlName(guiName, "load")));
    textItemName = new GuiTextField(fontRenderer, x + 64, y + 58, 103, 16);
    textItemName.setMaxStringLength(40);
    textItemName.setText(tileEntity.getSkinProps().getPropertyString(Skin.KEY_CUSTOM_NAME, ""));
}
Also used : GuiDropDownList(riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList) ISkinType(riskyken.armourersWorkshop.api.common.skin.type.ISkinType) GuiButtonExt(cpw.mods.fml.client.config.GuiButtonExt) SkinTypeRegistry(riskyken.armourersWorkshop.common.skin.type.SkinTypeRegistry) GuiTextField(net.minecraft.client.gui.GuiTextField)

Aggregations

GuiButtonExt (cpw.mods.fml.client.config.GuiButtonExt)1 GuiTextField (net.minecraft.client.gui.GuiTextField)1 ISkinType (riskyken.armourersWorkshop.api.common.skin.type.ISkinType)1 GuiDropDownList (riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList)1 SkinTypeRegistry (riskyken.armourersWorkshop.common.skin.type.SkinTypeRegistry)1