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, ""));
}
Aggregations