use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList in project Armourers-Workshop by RiskyKen.
the class GuiHologramProjectorTabExtra method initGui.
@Override
public void initGui(int xPos, int yPos, int width, int height) {
super.initGui(xPos, yPos, width, height);
checkGlowing = new GuiCheckBox(-1, (int) ((width / 2F) - (200 / 2F)) + 10, 30, GuiHelper.getLocalizedControlName(inventoryName, "glowing"), tileEntity.isGlowing());
dropDownPowerMode = new GuiDropDownList(0, (int) ((width / 2F) - (200 / 2F)) + 10, 55, 80, "", this);
for (int i = 0; i < PowerMode.values().length; i++) {
PowerMode powerMode = PowerMode.values()[i];
dropDownPowerMode.addListItem(GuiHelper.getLocalizedControlName(inventoryName, "powerMode." + powerMode.toString().toLowerCase()), powerMode.toString(), true);
if (powerMode == tileEntity.getPowerMode()) {
dropDownPowerMode.setListSelectedIndex(i);
}
}
buttonList.add(checkGlowing);
buttonList.add(dropDownPowerMode);
}
use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList in project Armourers-Workshop by RiskyKen.
the class GuiDialogCopy 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"));
buttonCopy = new GuiButtonExt(-1, x + width - 160 - 20, y + height - 30, 80, 20, GuiHelper.getLocalizedControlName(name, "copy"));
checkMirror = new GuiCheckBox(-1, x + 10, y + height - 50, GuiHelper.getLocalizedControlName(name, "mirror"), false);
dropDownSrcPart = new GuiDropDownList(0, x + 10, y + 35, 80, "", null);
dropDownDesPart = new GuiDropDownList(0, x + 100, y + 35, 80, "", null);
if (skinType != null) {
if (skinType != SkinTypeRegistry.skinBlock) {
for (int i = 0; i < skinType.getSkinParts().size(); i++) {
addPartToDropDown(dropDownSrcPart, skinType.getSkinParts().get(i));
addPartToDropDown(dropDownDesPart, skinType.getSkinParts().get(i));
}
} 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(dropDownSrcPart, partType);
addPartToDropDown(dropDownDesPart, partType);
}
}
dropDownSrcPart.setListSelectedIndex(0);
dropDownDesPart.setListSelectedIndex(0);
buttonList.add(buttonClose);
buttonList.add(buttonCopy);
buttonList.add(checkMirror);
buttonList.add(dropDownSrcPart);
buttonList.add(dropDownDesPart);
}
use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList in project Armourers-Workshop by RiskyKen.
the class GuiTabArmourerDisplaySettings 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();
checkShowGuides = new GuiCheckBox(7, 10, 95, GuiHelper.getLocalizedControlName(guiName, "showGuide"), tileEntity.isShowGuides());
checkShowOverlay = new GuiCheckBox(9, 10, 110, GuiHelper.getLocalizedControlName(guiName, "showOverlay"), tileEntity.isShowOverlay());
checkShowHelper = new GuiCheckBox(6, 10, 110, GuiHelper.getLocalizedControlName(guiName, "showHelper"), tileEntity.isShowHelper());
buttonList.add(new GuiButtonExt(8, width - 36 - 5, 70, 30, 16, GuiHelper.getLocalizedControlName(guiName, "set")));
textUserSkin = new GuiTextField(fontRenderer, x + 10, y + 70, 120, 16);
textUserSkin.setMaxStringLength(300);
textUserSkin.setText(tileEntity.getTexture().getTextureString());
textureTypeList = new GuiDropDownList(0, 10, 30, 50, "", this);
textureTypeList.addListItem(GuiHelper.getLocalizedControlName(tileEntity.getInventoryName(), "dropdown.user"), TextureType.USER.toString(), true);
textureTypeList.addListItem(GuiHelper.getLocalizedControlName(tileEntity.getInventoryName(), "dropdown.url"), TextureType.URL.toString(), true);
textureTypeList.setListSelectedIndex(tileEntity.getTexture().getTextureType().ordinal());
buttonList.add(checkShowGuides);
buttonList.add(checkShowOverlay);
buttonList.add(checkShowHelper);
buttonList.add(textureTypeList);
}
use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList 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, ""));
}
use of riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList in project Armourers-Workshop by RiskyKen.
the class GuiTabArmourerSkinSettings 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();
SkinProperties skinProps = tileEntity.getSkinProps();
checkBlockGlowing = new GuiCheckBox(15, 10, 20, GuiHelper.getLocalizedControlName(guiName, "glowing"), SkinProperties.PROP_BLOCK_GLOWING.getValue(skinProps));
checkBlockLadder = new GuiCheckBox(15, 10, 35, GuiHelper.getLocalizedControlName(guiName, "ladder"), SkinProperties.PROP_BLOCK_LADDER.getValue(skinProps));
checkBlockNoCollision = new GuiCheckBox(15, 10, 50, GuiHelper.getLocalizedControlName(guiName, "noCollision"), SkinProperties.PROP_BLOCK_NO_COLLISION.getValue(skinProps));
checkBlockSeat = new GuiCheckBox(15, 10, 65, GuiHelper.getLocalizedControlName(guiName, "seat"), SkinProperties.PROP_BLOCK_SEAT.getValue(skinProps));
checkBlockMultiblock = new GuiCheckBox(15, 10, 80, GuiHelper.getLocalizedControlName(guiName, "multiblock"), SkinProperties.PROP_BLOCK_MULTIBLOCK.getValue(skinProps));
checkBlockBed = new GuiCheckBox(15, 22, 95, GuiHelper.getLocalizedControlName(guiName, "bed"), SkinProperties.PROP_BLOCK_BED.getValue(skinProps));
checkBlockEnderInventory = new GuiCheckBox(15, 10, 110, GuiHelper.getLocalizedControlName(guiName, "enderInventory"), SkinProperties.PROP_BLOCK_ENDER_INVENTORY.getValue(skinProps));
checkBlockInventory = new GuiCheckBox(15, 10, 125, GuiHelper.getLocalizedControlName(guiName, "inventory"), SkinProperties.PROP_BLOCK_INVENTORY.getValue(skinProps));
if (!checkBlockMultiblock.isChecked()) {
checkBlockBed.enabled = false;
checkBlockBed.setIsChecked(false);
} else {
checkBlockBed.enabled = true;
}
// TODO remove to re-enable beds
checkBlockBed.enabled = false;
checkBlockEnderInventory.enabled = !checkBlockInventory.isChecked();
checkBlockInventory.enabled = !checkBlockEnderInventory.isChecked();
if (checkBlockInventory.isChecked()) {
checkBlockEnderInventory.setIsChecked(false);
}
if (checkBlockEnderInventory.isChecked()) {
checkBlockInventory.setIsChecked(false);
}
inventorySize = new GuiInventorySize(10, 158, 9, 6);
inventorySize.setSrc(TEXTURE, 176, 0);
inventorySize.setSelection(SkinProperties.PROP_BLOCK_INVENTORY_WIDTH.getValue(skinProps), SkinProperties.PROP_BLOCK_INVENTORY_HEIGHT.getValue(skinProps));
sliderWingIdleSpeed = new GuiCustomSlider(15, 10, 45, 154, 10, "", "ms", 200D, 10000D, SkinProperties.PROP_WINGS_IDLE_SPEED.getValue(skinProps), false, true, this);
sliderWingFlyingSpeed = new GuiCustomSlider(15, 10, 65, 154, 10, "", "ms", 200D, 10000D, SkinProperties.PROP_WINGS_FLYING_SPEED.getValue(skinProps), false, true, this);
sliderWingMinAngle = new GuiCustomSlider(15, 10, 85, 154, 10, "", DEGREE, -180D, 180D, SkinProperties.PROP_WINGS_MIN_ANGLE.getValue(skinProps), false, true, this);
sliderWingMaxAngle = new GuiCustomSlider(15, 10, 105, 154, 10, "", DEGREE, -180D, 180D, SkinProperties.PROP_WINGS_MAX_ANGLE.getValue(skinProps), false, true, this);
sliderWingIdleSpeed.setFineTuneButtons(true);
sliderWingFlyingSpeed.setFineTuneButtons(true);
sliderWingMinAngle.setFineTuneButtons(true);
sliderWingMaxAngle.setFineTuneButtons(true);
checkArmourOverrideBodyPart = new GuiCheckBox(15, 10, 20, GuiHelper.getLocalizedControlName(guiName, "overrideBodyPart"), SkinProperties.PROP_ARMOUR_OVERRIDE.getValue(skinProps));
checkArmourHideOverlay = new GuiCheckBox(15, 10, 35, GuiHelper.getLocalizedControlName(guiName, "hideOverlay"), SkinProperties.PROP_ARMOUR_HIDE_OVERLAY.getValue(skinProps));
MovementType skinMovmentType = MovementType.valueOf(SkinProperties.PROP_WINGS_MOVMENT_TYPE.getValue(skinProps));
dropDownList = new GuiDropDownList(0, 10, 125, 50, "", this);
for (int i = 0; i < MovementType.values().length; i++) {
MovementType movementType = MovementType.values()[i];
String unlocalizedName = "movmentType." + LibModInfo.ID.toLowerCase() + ":" + movementType.name().toLowerCase();
String localizedName = StatCollector.translateToLocal(unlocalizedName);
dropDownList.addListItem(localizedName, movementType.name(), true);
if (movementType == skinMovmentType) {
dropDownList.setListSelectedIndex(i);
}
}
buttonList.add(checkBlockGlowing);
buttonList.add(checkBlockLadder);
buttonList.add(checkBlockNoCollision);
buttonList.add(checkBlockSeat);
buttonList.add(checkBlockMultiblock);
buttonList.add(checkBlockBed);
buttonList.add(checkBlockInventory);
buttonList.add(checkBlockEnderInventory);
buttonList.add(inventorySize);
buttonList.add(sliderWingIdleSpeed);
buttonList.add(sliderWingFlyingSpeed);
buttonList.add(sliderWingMinAngle);
buttonList.add(sliderWingMaxAngle);
buttonList.add(checkArmourOverrideBodyPart);
buttonList.add(checkArmourHideOverlay);
buttonList.add(dropDownList);
}
Aggregations