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, ">>"));
}
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);
}
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;
}
}
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);
}
}
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);
}
Aggregations