Search in sources :

Example 1 with GuiGlobalLibrary

use of riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary in project Armourers-Workshop by RiskyKen.

the class GuiGlobalLibraryPanelSearchResults method initGui.

@Override
public void initGui() {
    super.initGui();
    String guiName = ((GuiGlobalLibrary) parent).getGuiName();
    buttonList.clear();
    skinPanelResults.init(x + 5, y + 24, width - 10, height - 52);
    skinPanelResults.setIconSize(iconScale);
    skinPanelResults.setPanelPadding(0);
    skinPanelResults.setShowName(true);
    iconButtonSmall = new GuiIconButton(parent, 0, x + width - 21 * 3, y + 5, 16, 16, GuiHelper.getLocalizedControlName(guiName, "searchResults.small"), BUTTON_TEXTURES);
    iconButtonSmall.setIconLocation(51, 0, 16, 16);
    iconButtonMedium = new GuiIconButton(parent, 0, x + width - 21 * 2, y + 5, 16, 16, GuiHelper.getLocalizedControlName(guiName, "searchResults.medium"), BUTTON_TEXTURES);
    iconButtonMedium.setIconLocation(51, 17, 16, 16);
    iconButtonLarge = new GuiIconButton(parent, 0, x + width - 21, y + 5, 16, 16, GuiHelper.getLocalizedControlName(guiName, "searchResults.large"), BUTTON_TEXTURES);
    iconButtonLarge.setIconLocation(51, 34, 16, 16);
    buttonList.add(iconButtonSmall);
    buttonList.add(iconButtonMedium);
    buttonList.add(iconButtonLarge);
    buttonList.add(skinPanelResults);
    buttonList.add(new GuiButtonExt(1, x + 5, y + height - 25, 80, 20, "<<"));
    buttonList.add(new GuiButtonExt(2, x + width - 85, y + height - 25, 80, 20, ">>"));
}
Also used : GuiIconButton(riskyken.armourersWorkshop.client.gui.controls.GuiIconButton) GuiButtonExt(cpw.mods.fml.client.config.GuiButtonExt) GuiGlobalLibrary(riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary)

Example 2 with GuiGlobalLibrary

use of riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary in project Armourers-Workshop by RiskyKen.

the class GuiGlobalLibraryPanelSkinEdit method deleteSkin.

public void deleteSkin() {
    PlushieSession plushieSession = PlushieAuth.PLUSHIE_SESSION;
    GuiGlobalLibrary globalLibrary = (GuiGlobalLibrary) parent;
    int userId = plushieSession.getServerId();
    String accessToken = plushieSession.getAccessToken();
    int skinId = skinJson.get("id").getAsInt();
    taskSkinEdit = GlobalSkinLibraryUtils.deleteSkin(globalLibrary.jsonDownloadExecutor, userId, accessToken, skinId);
}
Also used : PlushieSession(riskyken.armourersWorkshop.common.library.global.auth.PlushieSession) GuiGlobalLibrary(riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary)

Example 3 with GuiGlobalLibrary

use of riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary in project Armourers-Workshop by RiskyKen.

the class GuiGlobalLibraryPanelSkinInfo method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    if (button == buttonBack) {
        ((GuiGlobalLibrary) parent).switchScreen(returnScreen);
    }
    if (button == buttonDownload) {
        if (skinJson != null) {
            buttonDownload.enabled = false;
            new DownloadSkin(skinJson);
        }
    }
    if (button == buttonUserSkins) {
        if (skinJson != null && skinJson.has("user_id")) {
            int userId = skinJson.get("user_id").getAsInt();
            PlushieUser plushieUser = GlobalSkinLibraryUtils.getUserInfo(userId);
            if (plushieUser != null) {
                ((GuiGlobalLibrary) parent).panelUserSkins.clearResults();
                ((GuiGlobalLibrary) parent).switchScreen(Screen.USER_SKINS);
                ((GuiGlobalLibrary) parent).panelUserSkins.switchToUser(userId);
            }
        }
    }
    if (button == buttonEditSkin) {
        if (skinJson != null) {
            ((GuiGlobalLibrary) parent).panelSkinEdit.displaySkinInfo(skinJson, returnScreen);
        }
    }
    if (button == buttonLikeSkin) {
        setSkinLike(true);
        buttonLikeSkin.enabled = false;
    }
    if (button == buttonUnlikeSkin) {
        setSkinLike(false);
        buttonUnlikeSkin.enabled = false;
    }
}
Also used : PlushieUser(riskyken.armourersWorkshop.common.library.global.PlushieUser) GuiGlobalLibrary(riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary)

Example 4 with GuiGlobalLibrary

use of riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary in project Armourers-Workshop by RiskyKen.

the class GuiGlobalLibraryPanelHeader method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) {
    if (button == iconButtonHome) {
        ((GuiGlobalLibrary) parent).switchScreen(Screen.HOME);
        ((GuiGlobalLibrary) parent).panelHome.updateSkinPanels();
    }
    if (button == iconButtonFavourites) {
        ((GuiGlobalLibrary) parent).switchScreen(Screen.FAVOURITES);
    }
    if (button == iconButtonMyFiles) {
        GuiGlobalLibrary guiGlobalLibrary = (GuiGlobalLibrary) parent;
        int serverId = PlushieAuth.PLUSHIE_SESSION.getServerId();
        ((GuiGlobalLibrary) parent).panelUserSkins.clearResults();
        ((GuiGlobalLibrary) parent).switchScreen(Screen.USER_SKINS);
        ((GuiGlobalLibrary) parent).panelUserSkins.switchToUser(serverId);
    }
    if (button == iconButtonUploadSkin) {
        ((GuiGlobalLibrary) parent).switchScreen(Screen.UPLOAD);
    }
    if (button == iconButtonJoinBeta) {
        ((GuiGlobalLibrary) parent).switchScreen(Screen.JOIN_BETA);
    }
}
Also used : GuiGlobalLibrary(riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary)

Example 5 with GuiGlobalLibrary

use of riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary in project Armourers-Workshop by RiskyKen.

the class GuiGlobalLibraryPanelHome method initGui.

@Override
public void initGui() {
    super.initGui();
    String guiName = ((GuiGlobalLibrary) parent).getGuiName();
    buttonList.clear();
    buttonShowAll = new GuiButtonExt(-1, x + 5, y + 5, 80, 20, GuiHelper.getLocalizedControlName(guiName, "home.showAllSkins"));
    int boxW = (width - 15) / 2;
    int boxH = height - 10 - 35;
    skinPanelRecentlyUploaded.init(x + 5, y + 5 + 35, boxW, boxH);
    skinPanelMostDownloaded.init(x + boxW + 10, y + 5 + 35, boxW, boxH / 2 - 10);
    skinPanelMostLiked.init(x + boxW + 10, y + 5 + 35 + boxH / 2 + 5, boxW, boxH / 2 - 5);
    skinPanelRecentlyUploaded.setIconSize(40);
    skinPanelMostDownloaded.setIconSize(40);
    skinPanelMostLiked.setIconSize(40);
    buttonList.add(buttonShowAll);
    buttonList.add(skinPanelRecentlyUploaded);
    buttonList.add(skinPanelMostDownloaded);
    buttonList.add(skinPanelMostLiked);
}
Also used : GuiButtonExt(cpw.mods.fml.client.config.GuiButtonExt) GuiGlobalLibrary(riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary)

Aggregations

GuiGlobalLibrary (riskyken.armourersWorkshop.client.gui.globallibrary.GuiGlobalLibrary)15 JsonObject (com.google.gson.JsonObject)4 PlushieSession (riskyken.armourersWorkshop.common.library.global.auth.PlushieSession)4 GuiButtonExt (cpw.mods.fml.client.config.GuiButtonExt)3 ExecutionException (java.util.concurrent.ExecutionException)2 DownloadJsonObjectCallable (riskyken.armourersWorkshop.common.library.global.DownloadUtils.DownloadJsonObjectCallable)2 PlushieUser (riskyken.armourersWorkshop.common.library.global.PlushieUser)2 GameProfile (com.mojang.authlib.GameProfile)1 GuiScreen (net.minecraft.client.gui.GuiScreen)1 GuiControlSkinPanel (riskyken.armourersWorkshop.client.gui.controls.GuiControlSkinPanel)1 SkinIcon (riskyken.armourersWorkshop.client.gui.controls.GuiControlSkinPanel.SkinIcon)1 GuiIconButton (riskyken.armourersWorkshop.client.gui.controls.GuiIconButton)1 GuiLabeledTextField (riskyken.armourersWorkshop.client.gui.controls.GuiLabeledTextField)1 SlotHidable (riskyken.armourersWorkshop.common.inventory.slot.SlotHidable)1 LibraryFile (riskyken.armourersWorkshop.common.library.LibraryFile)1