Search in sources :

Example 1 with MessageClientGuiSetArmourerSkinProps

use of riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps in project Armourers-Workshop by RiskyKen.

the class GuiTabArmourerMain method keyTyped.

@Override
public boolean keyTyped(char c, int keycode) {
    if (!textItemName.textboxKeyTyped(c, keycode)) {
        return super.keyTyped(c, keycode);
    } else {
        SkinProperties skinProps = tileEntity.getSkinProps();
        String sendText = textItemName.getText().trim();
        if (fidgCount < 3) {
            if (sendText.equalsIgnoreCase("fidget spinner")) {
                sendText = fidgMessage[fidgCount];
                fidgCount++;
            }
        }
        String oldText = skinProps.getPropertyString(Skin.KEY_CUSTOM_NAME, "");
        if (!sendText.equals(oldText)) {
            skinProps.setProperty(Skin.KEY_CUSTOM_NAME, sendText);
            PacketHandler.networkWrapper.sendToServer(new MessageClientGuiSetArmourerSkinProps(skinProps));
            return true;
        }
    }
    return false;
}
Also used : MessageClientGuiSetArmourerSkinProps(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps) SkinProperties(riskyken.armourersWorkshop.common.skin.data.SkinProperties)

Example 2 with MessageClientGuiSetArmourerSkinProps

use of riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps in project Armourers-Workshop by RiskyKen.

the class GuiTabArmourerSkinSettings method onChangeSliderValue.

@Override
public void onChangeSliderValue(GuiSlider slider) {
    if (!resetting) {
        SkinProperties skinProps = tileEntity.getSkinProps();
        SkinProperties.PROP_WINGS_IDLE_SPEED.setValue(skinProps, (double) Math.round(sliderWingIdleSpeed.getValue()));
        SkinProperties.PROP_WINGS_FLYING_SPEED.setValue(skinProps, (double) Math.round(sliderWingFlyingSpeed.getValue()));
        SkinProperties.PROP_WINGS_MIN_ANGLE.setValue(skinProps, (double) Math.round(sliderWingMinAngle.getValue()));
        SkinProperties.PROP_WINGS_MAX_ANGLE.setValue(skinProps, (double) Math.round(sliderWingMaxAngle.getValue()));
        PacketHandler.networkWrapper.sendToServer(new MessageClientGuiSetArmourerSkinProps(skinProps));
    }
}
Also used : MessageClientGuiSetArmourerSkinProps(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps) SkinProperties(riskyken.armourersWorkshop.common.skin.data.SkinProperties)

Example 3 with MessageClientGuiSetArmourerSkinProps

use of riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps in project Armourers-Workshop by RiskyKen.

the class GuiTabArmourerSkinSettings method onDropDownListChanged.

@Override
public void onDropDownListChanged(GuiDropDownList dropDownList) {
    SkinProperties skinProps = tileEntity.getSkinProps();
    SkinProperties.PROP_WINGS_MOVMENT_TYPE.setValue(skinProps, dropDownList.getListSelectedItem().tag);
    ModLogger.log("Setting skin movment type to: " + dropDownList.getListSelectedItem().tag);
    PacketHandler.networkWrapper.sendToServer(new MessageClientGuiSetArmourerSkinProps(skinProps));
}
Also used : MessageClientGuiSetArmourerSkinProps(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps) SkinProperties(riskyken.armourersWorkshop.common.skin.data.SkinProperties)

Example 4 with MessageClientGuiSetArmourerSkinProps

use of riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps in project Armourers-Workshop by RiskyKen.

the class GuiTabArmourerSkinSettings method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    SkinProperties skinProps = tileEntity.getSkinProps();
    if (!checkBlockMultiblock.isChecked()) {
        checkBlockBed.enabled = false;
        checkBlockBed.setIsChecked(false);
    } else {
        checkBlockBed.enabled = true;
    }
    checkBlockEnderInventory.enabled = !checkBlockInventory.isChecked();
    checkBlockInventory.enabled = !checkBlockEnderInventory.isChecked();
    if (checkBlockInventory.isChecked()) {
        checkBlockEnderInventory.setIsChecked(false);
    }
    if (checkBlockEnderInventory.isChecked()) {
        checkBlockInventory.setIsChecked(false);
    }
    // TODO remove to re-enable beds
    checkBlockBed.enabled = false;
    if (button == checkBlockGlowing | button == checkBlockLadder | button == checkBlockNoCollision | button == checkBlockSeat | button == checkBlockMultiblock | button == checkBlockBed | button == checkBlockInventory | button == inventorySize | button == checkBlockEnderInventory) {
        SkinProperties.PROP_BLOCK_GLOWING.setValue(skinProps, checkBlockGlowing.isChecked());
        SkinProperties.PROP_BLOCK_LADDER.setValue(skinProps, checkBlockLadder.isChecked());
        SkinProperties.PROP_BLOCK_NO_COLLISION.setValue(skinProps, checkBlockNoCollision.isChecked());
        SkinProperties.PROP_BLOCK_SEAT.setValue(skinProps, checkBlockSeat.isChecked());
        SkinProperties.PROP_BLOCK_MULTIBLOCK.setValue(skinProps, checkBlockMultiblock.isChecked());
        SkinProperties.PROP_BLOCK_BED.setValue(skinProps, checkBlockBed.isChecked());
        SkinProperties.PROP_BLOCK_INVENTORY.setValue(skinProps, checkBlockInventory.isChecked());
        SkinProperties.PROP_BLOCK_ENDER_INVENTORY.setValue(skinProps, checkBlockEnderInventory.isChecked());
        SkinProperties.PROP_BLOCK_INVENTORY_WIDTH.setValue(skinProps, inventorySize.getSelectionWidth());
        SkinProperties.PROP_BLOCK_INVENTORY_HEIGHT.setValue(skinProps, inventorySize.getSelectionHeight());
        PacketHandler.networkWrapper.sendToServer(new MessageClientGuiSetArmourerSkinProps(skinProps));
    }
    if (button == checkArmourOverrideBodyPart | button == checkArmourHideOverlay) {
        SkinProperties.PROP_ARMOUR_OVERRIDE.setValue(skinProps, checkArmourOverrideBodyPart.isChecked());
        SkinProperties.PROP_ARMOUR_HIDE_OVERLAY.setValue(skinProps, checkArmourHideOverlay.isChecked());
        PacketHandler.networkWrapper.sendToServer(new MessageClientGuiSetArmourerSkinProps(skinProps));
    }
    inventorySize.visible = checkBlockInventory.isChecked();
}
Also used : MessageClientGuiSetArmourerSkinProps(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps) SkinProperties(riskyken.armourersWorkshop.common.skin.data.SkinProperties)

Aggregations

MessageClientGuiSetArmourerSkinProps (riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetArmourerSkinProps)4 SkinProperties (riskyken.armourersWorkshop.common.skin.data.SkinProperties)4