Search in sources :

Example 1 with GuiDialogClear

use of riskyken.armourersWorkshop.client.gui.armourer.dialog.GuiDialogClear in project Armourers-Workshop by RiskyKen.

the class GuiTabArmourerBlockUtils method dialogResult.

@Override
public void dialogResult(AbstractGuiDialog dialog, DialogResult result) {
    if (result == DialogResult.OK & dialog != null) {
        if (dialog instanceof GuiDialogClear) {
            String tag = ((GuiDialogClear) dialog).getClearTag();
            if (!StringUtils.isNullOrEmpty(tag)) {
                ISkinPartType partType = SkinTypeRegistry.INSTANCE.getSkinPartFromRegistryName(tag);
                boolean clearBlocks = ((GuiDialogClear) dialog).isClearBlocks();
                boolean clearPaint = ((GuiDialogClear) dialog).isClearPaint();
                boolean clearMarkers = ((GuiDialogClear) dialog).isClearMarkers();
                MessageClientGuiArmourerBlockUtil message;
                message = new MessageClientGuiArmourerBlockUtil("clear", partType, null, clearBlocks, clearPaint, clearMarkers);
                PacketHandler.networkWrapper.sendToServer(message);
            }
        }
        if (dialog instanceof GuiDialogCopy) {
            ISkinPartType srcPart = ((GuiDialogCopy) dialog).getSrcPart();
            ISkinPartType desPart = ((GuiDialogCopy) dialog).getDesPart();
            boolean mirror = ((GuiDialogCopy) dialog).isMirror();
            MessageClientGuiArmourerBlockUtil message;
            message = new MessageClientGuiArmourerBlockUtil("copy", srcPart, desPart, mirror, false, false);
            PacketHandler.networkWrapper.sendToServer(message);
        }
    }
}
Also used : ISkinPartType(riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType) MessageClientGuiArmourerBlockUtil(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiArmourerBlockUtil) GuiDialogCopy(riskyken.armourersWorkshop.client.gui.armourer.dialog.GuiDialogCopy) GuiDialogClear(riskyken.armourersWorkshop.client.gui.armourer.dialog.GuiDialogClear)

Aggregations

ISkinPartType (riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType)1 GuiDialogClear (riskyken.armourersWorkshop.client.gui.armourer.dialog.GuiDialogClear)1 GuiDialogCopy (riskyken.armourersWorkshop.client.gui.armourer.dialog.GuiDialogCopy)1 MessageClientGuiArmourerBlockUtil (riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiArmourerBlockUtil)1