Search in sources :

Example 1 with MessageClientGuiButton

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

the class GuiGlobalLibraryPanelUpload method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    if (button == buttonUpload) {
        GameProfile gameProfile = mc.thePlayer.getGameProfile();
        PlushieSession plushieSession = PlushieAuth.PLUSHIE_SESSION;
        if (!plushieSession.isAuthenticated()) {
            JsonObject jsonObject = PlushieAuth.updateAccessToken(gameProfile.getName(), gameProfile.getId().toString());
            plushieSession.authenticate(jsonObject);
        }
        if (!plushieSession.isAuthenticated()) {
            ModLogger.log(Level.ERROR, "Authentication failed.");
            return;
        }
        MessageClientGuiButton message = new MessageClientGuiButton((byte) 0);
        PacketHandler.networkWrapper.sendToServer(message);
    }
}
Also used : GameProfile(com.mojang.authlib.GameProfile) PlushieSession(riskyken.armourersWorkshop.common.library.global.auth.PlushieSession) JsonObject(com.google.gson.JsonObject) MessageClientGuiButton(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiButton)

Example 2 with MessageClientGuiButton

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

the class GuiTabArmourerDisplaySettings method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    if (button.id == 8) {
        String username = textUserSkin.getText().trim();
        PacketHandler.networkWrapper.sendToServer(new MessageClientGuiSetSkin(new PlayerTexture(username, TextureType.values()[textureTypeList.getListSelectedIndex()])));
    } else {
        PacketHandler.networkWrapper.sendToServer(new MessageClientGuiButton((byte) button.id));
    }
}
Also used : PlayerTexture(riskyken.armourersWorkshop.client.texture.PlayerTexture) MessageClientGuiSetSkin(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetSkin) MessageClientGuiButton(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiButton)

Example 3 with MessageClientGuiButton

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

the class GuiColourMixer method onDropDownListChanged.

@Override
public void onDropDownListChanged(GuiDropDownList dropDownList) {
    if (dropDownList == colourFamilyList) {
        ColourFamily cf = ColourFamily.values()[dropDownList.getListSelectedIndex()];
        colourSelector.setColourFamily(cf);
        MessageClientGuiButton message = new MessageClientGuiButton((byte) cf.ordinal());
        PacketHandler.networkWrapper.sendToServer(message);
    }
    if (dropDownList == paintTypeDropDown) {
        updateColour();
    }
}
Also used : MessageClientGuiButton(riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiButton) ColourFamily(riskyken.armourersWorkshop.utils.UtilColour.ColourFamily)

Aggregations

MessageClientGuiButton (riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiButton)3 JsonObject (com.google.gson.JsonObject)1 GameProfile (com.mojang.authlib.GameProfile)1 PlayerTexture (riskyken.armourersWorkshop.client.texture.PlayerTexture)1 PlushieSession (riskyken.armourersWorkshop.common.library.global.auth.PlushieSession)1 MessageClientGuiSetSkin (riskyken.armourersWorkshop.common.network.messages.client.MessageClientGuiSetSkin)1 ColourFamily (riskyken.armourersWorkshop.utils.UtilColour.ColourFamily)1