protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) { super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); Object object = this.rectDownload_t; synchronized (this.rectDownload_t) { int varinfow = this.width / 2 - 119; if (this.newVersionDetected != null && this.newVersionDetected.length() > 0 && p_73864_1_ >= this.width /2 + 2 && p_73864_1_ <= this.width / 2 + 100 && p_73864_2_ >= this.rectDownload_u && p_73864_2_ <= this.rectDownload_w) { GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.downloadUrl, 13, true); guiconfirmopenlink.func_146358_g(); this.mc.displayGuiScreen(guiconfirmopenlink); } if (this.newVersionDetected != null && this.newVersionDetected.length() > 0 && p_73864_1_ >= varinfow && p_73864_1_ <= varinfow + 117 && p_73864_2_ >= this.rectDownload_u && p_73864_2_ <= this.rectDownload_w) { if(!Menu.instance.changeLog.equals(null)) { GuiChangeLog guichangelog = new GuiChangeLog(this, Menu.instance.changeLog); this.mc.displayGuiScreen(guichangelog); } } } }
/** * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton */ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { super.mouseClicked(mouseX, mouseY, mouseButton); synchronized (this.threadLock) { if (!this.openGLWarning1.isEmpty() && mouseX >= this.field_92022_t && mouseX <= this.field_92020_v && mouseY >= this.field_92021_u && mouseY <= this.field_92019_w) { GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.openGLWarningLink, 13, true); guiconfirmopenlink.disableSecurityWarning(); this.mc.displayGuiScreen(guiconfirmopenlink); } } if (this.func_183501_a()) { this.mouseClicked(mouseX, mouseY, mouseButton); } }
@Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { super.mouseClicked(mouseX, mouseY, mouseButton); int imageWidth = 64; int imageHeight = 64; int leftBound = (width / 2) - guiWidth + (this.guiWidth - imageWidth) / 2; int topBound = ((height - this.guiHeight) / 2) + 75; boolean xClick = mouseX <= leftBound + imageWidth && mouseX >= leftBound; boolean yClick = mouseY >= topBound && mouseY <= topBound + imageHeight; if (currentPage == 0 && xClick && yClick) { this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, uri.toString(), 13, true)); } }
/** * Called when the mouse is clicked. */ protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) { super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); Object object = this.field_104025_t; synchronized (this.field_104025_t) { if (this.field_92025_p.length() > 0 && p_73864_1_ >= this.field_92022_t && p_73864_1_ <= this.field_92020_v && p_73864_2_ >= this.field_92021_u && p_73864_2_ <= this.field_92019_w) { GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true); guiconfirmopenlink.func_146358_g(); this.mc.displayGuiScreen(guiconfirmopenlink); } } }
@Override public boolean onClick() { try { uri = new URI(uriString); final String scheme = uri.getScheme().toLowerCase(Locale.ROOT); if (!safeProtocolSchemes.contains(scheme)) { uri = null; throw new URISyntaxException(uriString, "Unsupported protocol: " + scheme); } final Minecraft mc = Minecraft.getMinecraft(); origGui = mc.currentScreen; if (mc.gameSettings.chatLinksPrompt) { mc.displayGuiScreen(new GuiConfirmOpenLink(this, uriString, 0, false)); } else { visitLink(uri); } } catch (URISyntaxException urisyntaxexception) { Core.logWarning("Can't open url for " + uriString, urisyntaxexception); } return true; }
protected void actionPerformed(GuiButton p_146284_1_) { switch (p_146284_1_.id) { case 0: this.mc.displayGuiScreen((GuiScreen)null); this.mc.setIngameFocus(); break; case 1: URI uri = URI.create("http://artur1998g.ru/store/loot.html"); if (uri != null) { // Rude not to ask if (Minecraft.getMinecraft().gameSettings.chatLinksPrompt) { this.displayedURI = uri; this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, this.displayedURI.toString(), PROMPT_REPLY_ACTION, false)); } else { openURI(uri); } } break; } }
/** * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton */ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { super.mouseClicked(mouseX, mouseY, mouseButton); Object object = this.threadLock; synchronized (this.threadLock) { if (this.openGLWarning1.length() > 0 && mouseX >= this.field_92022_t && mouseX <= this.field_92020_v && mouseY >= this.field_92021_u && mouseY <= this.field_92019_w) { GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true); guiconfirmopenlink.disableSecurityWarning(); this.mc.displayGuiScreen(guiconfirmopenlink); } } }
@SuppressWarnings("ucd") public void passClick(URI webLocation) { // Rude not to ask if user has chat link prompts disabled. if (Minecraft.getMinecraft().gameSettings.chatLinksPrompt) { this.displayedURI = webLocation; this.mc.displayGuiScreen( new GuiConfirmOpenLink( this, this.displayedURI.toString(), PROMPT_REPLY_ACTION, false ) ); } else { // Open the URL normally without asking anything. openURI( webLocation ); } }
@Override public void initGui() { if (ImgurAuthHandler.getInstance().isLoggedIn()) { displayGuiScreen(new ImgurAuthConfirmScreen(this, this.parent)); return; } if (!linkGiven) { if (this.mc.gameSettings.chatLinksPrompt) { displayGuiScreen(new GuiConfirmOpenLink(this, LOGIN_URL, 0, false)); } else { openLink(); } } int buttonWidth = 100; int buttonHeight = 20; btnAccept = addControl(new GuiButton(ACCEPT, this.width / 2 - buttonWidth - 8, this.height / 6 + 96, buttonWidth, buttonHeight, TranslationManager.getTranslation("image.auth.accept"))); btnCancel = addControl(new GuiButton(CANCEL, this.width / 2 + 8, this.height / 6 + 96, buttonWidth, buttonHeight, TranslationManager.getTranslation("image.auth.cancel"))); pinCode = new GuiTextField(this.fontRendererObj, this.width / 2 - buttonWidth - 8, this.height / 6 + 64, buttonWidth * 2 + 16, buttonHeight); init = true; }
protected void actionPerformed(GuiButton p_146284_1_) { switch (p_146284_1_.id) { case 0: this.mc.displayGuiScreen((GuiScreen)null); this.mc.setIngameFocus(); break; case 1: URI uri = URI.create("https://minecraft.net/store"); if (uri != null) { // Rude not to ask if (Minecraft.getMinecraft().gameSettings.chatLinksPrompt) { this.displayedURI = uri; this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, this.displayedURI.toString(), PROMPT_REPLY_ACTION, false)); } else { openURI(uri); } } break; } }
protected void func_73864_a(int p_73864_1_, int p_73864_2_, int p_73864_3_) { if(p_73864_3_ == 0 && this.field_73882_e.field_71474_y.field_74359_p) { ChatClickData var4 = this.field_73882_e.field_71456_v.func_73827_b().func_73766_a(Mouse.getX(), Mouse.getY()); if(var4 != null) { URI var5 = var4.func_78308_g(); if(var5 != null) { if(this.field_73882_e.field_71474_y.field_74358_q) { this.field_73902_p = var5; this.field_73882_e.func_71373_a(new GuiConfirmOpenLink(this, var4.func_78309_f(), 0, false)); } else { this.func_73896_a(var5); } return; } } } this.field_73901_a.func_73793_a(p_73864_1_, p_73864_2_, p_73864_3_); super.func_73864_a(p_73864_1_, p_73864_2_, p_73864_3_); }
protected void actionPerformed(GuiButton p_146284_1_) { switch (p_146284_1_.id) { case 0: this.mc.displayGuiScreen((GuiScreen)null); this.mc.setIngameFocus(); break; case 1: URI uri = URI.create("http://artur1998g.ru/store/loot.html#"); if (uri != null) { // Rude not to ask if (Minecraft.getMinecraft().gameSettings.chatLinksPrompt) { this.displayedURI = uri; this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, this.displayedURI.toString(), PROMPT_REPLY_ACTION, false)); } else { openURI(uri); } } break; } }
public GuiDonationStation(ContainerDonationStation container) { super(container, 176, 172, "openblocks.gui.donationstation"); root.addComponent((lblModName = new GuiComponentLabel(55, 31, 100, 10, ""))); root.addComponent((lblAuthors = new GuiComponentLabel(55, 42, 200, 18, "").setScale(0.5f))); root.addComponent((buttonDonate = new GuiComponentTextButton(31, 60, 115, 13, 0xFFFFFF)).setText("Donate to the author")); buttonDonate.setListener((IMouseDownListener)(component, x, y, button) -> { if (!buttonDonate.isButtonEnabled()) return; String donationUrl = getContainer().getOwner().getDonationUrl(); if (Strings.isNullOrEmpty(donationUrl)) return; URI uri = URI.create(donationUrl); if (Minecraft.getMinecraft().gameSettings.chatLinksPrompt) { displayedURI = uri; mc.displayGuiScreen(new GuiConfirmOpenLink(GuiDonationStation.this, displayedURI.toString(), PROMPT_REPLY_ACTION, false)); } else { openURI(uri); } }); }
protected BaseComponent createActionButton(int x, int y, final String link, Icon icon, String text, final IConfirmListener listener) { EmptyComposite result = new EmptyComposite(x, y, 50, 8); GuiComponentLabel label = new GuiComponentLabel(15, 2, TranslationUtils.translateToLocal(text)); label.setScale(BookScaleConfig.getPageContentScale()); result.addComponent(label); GuiComponentSprite image = new GuiComponentSprite(0, 0, icon); result.addComponent(image); result.setListener((IMouseDownListener)(component, clickX, clickY, button) -> { final Minecraft mc = Minecraft.getMinecraft(); if (mc.gameSettings.chatLinksPrompt) { final GuiScreen prevGui = mc.currentScreen; mc.displayGuiScreen(new GuiConfirmOpenLink((response, id) -> { if (response) listener.onConfirm(); mc.displayGuiScreen(prevGui); }, link, 0, false)); } else { listener.onConfirm(); } }); return result; }
@Override public void actionPerformed(String ident, Object... params) { if (ident.equals("patreon")) { GuiConfirmOpenLink gui = new GuiConfirmOpenLink(this, "patreon.com/cb", 0, true); gui.disableSecurityWarning(); mc.displayGuiScreen(gui); } else super.actionPerformed(ident, params); }
public void clickWeb(IBookGraphics nav) { GuiScreen parent = (GuiScreen) nav.owner(); Minecraft mc = Minecraft.getMinecraft(); if (!mc.gameSettings.chatLinks) { return; } try { URI uri = new URI(webTarget); String s = uri.getScheme(); if (s == null) { throw new URISyntaxException(webTarget, "Missing protocol"); } if (!PROTOCOLS.contains(s.toLowerCase(Locale.ROOT))) { throw new URISyntaxException(webTarget, "Unsupported protocol: " + s.toLowerCase(Locale.ROOT)); } if (mc.gameSettings.chatLinksPrompt) { ReflectionHelper.setPrivateValue(GuiScreen.class, parent, uri, "field_175286_t", "clickedLinkURI"); mc.displayGuiScreen(new GuiConfirmOpenLink(parent, webTarget, 31102009, false)); } else { openWebLink(uri); } } catch (URISyntaxException urisyntaxexception) { GuidebookMod.logger.error("Can't open url {}", webTarget, urisyntaxexception); } }
@Override public void actionPerformed(String ident, Object... params) { if (ident.equals("patreon")) { GuiConfirmOpenLink gui = new GuiConfirmOpenLink(this, "patreon.com/cb", 0, true); gui.disableSecurityWarning(); mc.displayGuiScreen(gui); } else { super.actionPerformed(ident, params); } }
@Override public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { if(enabled && visible && mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height) { if (mc.gameSettings.chatLinksPrompt) mc.displayGuiScreen(new GuiConfirmOpenLink(this, url, 0, false)); return true; } return false; }
@Override public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { if(enabled && visible && mouseX >= x && mouseY >= y && mouseX < x + width && mouseY < y + height) { if (mc.gameSettings.chatLinksPrompt) mc.displayGuiScreen(new GuiConfirmOpenLink(this, url, 0, false)); return true; } return false; }
@Override public boolean onClicked() { EntityPlayerSP player = Minecraft.getMinecraft().player; String parsedCommand = command.replace("@p", player.getName()); if (ClientCommandHandler.instance.executeCommand(player, parsedCommand) == 0) { if (clipboard) { GuiConfirmOpenLink.setClipboardString(parsedCommand); player.sendStatusMessage(new TextComponentString("Command copied to clipboard"), true); } else { player.sendChatMessage(parsedCommand); } } return false; }
@Override protected void actionPerformed(GuiButton guibutton) { if(guibutton.id == 206) { try { URI currentURI = new URI("https://sites.google.com/site/awertyb/minecraft-mods/controlpack"); if (this.mc.gameSettings.chatLinksPrompt) { this.clickedURI = currentURI; this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, "https://sites.google.com/site/awertyb/minecraft-mods/controlpack", 0, false)); } else { this.OpenURI(currentURI); } } catch (URISyntaxException e) { e.printStackTrace(); } } if(guibutton.id == 205) { mc.displayGuiScreen(new GuiControlPackItemOptions(this)); } if(guibutton.id == 204) { mc.displayGuiScreen(new GuiWaypoints(this)); } if(guibutton.id == 203) { mc.displayGuiScreen(new GuiControlPackOptions(this)); } else if(guibutton.id == 202) { mc.displayGuiScreen(new GuiControlPackBindings(this)); } else if(guibutton.id == 201) { mc.displayGuiScreen(new GuiControlPackVolume(this)); } else if(guibutton.id == 200) { mc.displayGuiScreen(null); } }
protected void func_73864_a(int p_73864_1_, int p_73864_2_, int p_73864_3_) { super.func_73864_a(p_73864_1_, p_73864_2_, p_73864_3_); Object var4 = this.field_104025_t; synchronized(this.field_104025_t) { if(this.field_92025_p.length() > 0 && p_73864_1_ >= this.field_92022_t && p_73864_1_ <= this.field_92020_v && p_73864_2_ >= this.field_92021_u && p_73864_2_ <= this.field_92019_w) { GuiConfirmOpenLink var5 = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true); var5.func_92026_h(); this.field_73882_e.func_71373_a(var5); } } }
@Override public boolean onMouseClick(GuiWiki gui, int x, int y){ if(linkAddress != null) { if(getMouseSpace().contains(x, y)) { if(linkAddress.contains("www")) { parentGui = Minecraft.getMinecraft().currentScreen; Minecraft.getMinecraft().displayGuiScreen(new GuiConfirmOpenLink(this, linkAddress, 0, false)); } else { gui.setCurrentFile(linkAddress); } return true; } } return false; }
/** * A static alternative to * {@link GuiScreen#handleComponentClick(IChatComponent)}, with the * additional functionality that click events from elsewhere can be handled * * @param event * @return */ public static boolean handleClickEvent(ClickEvent event) { if (event != null) { if (event.getAction() == ClickEvent.Action.OPEN_URL) { if (!Minecraft.getMinecraft().gameSettings.chatLinks) { return false; } try { final URI webUri = new URI(event.getValue()); String protocol = webUri.getScheme(); if (protocol == null) { throw new URISyntaxException(event.getValue(), "Missing protocol"); } if (!PROTOCOLS.contains(protocol.toLowerCase())) { throw new URISyntaxException(event.getValue(), "Unsupported protocol: " + protocol.toLowerCase()); } if (Minecraft.getMinecraft().gameSettings.chatLinksPrompt) { final GuiScreen prevScreen = Minecraft.getMinecraft().currentScreen; GuiYesNoCallback callback = new GuiYesNoCallback() { @Override public void confirmClicked(boolean result, int id) { if (id == 31102009) { if (result) { openWebLink(webUri); } Minecraft.getMinecraft().displayGuiScreen(prevScreen); } } }; Minecraft.getMinecraft() .displayGuiScreen(new GuiConfirmOpenLink(callback, event.getValue(), 31102009, false)); } else { openWebLink(webUri); } } catch (URISyntaxException e) { MC_LOGGER.error("Can't open url for " + event, e); } } else if (event.getAction() == ClickEvent.Action.OPEN_FILE) { URI fileUri = new File(event.getValue()).toURI(); openWebLink(fileUri); } else if (event.getAction() == ClickEvent.Action.SUGGEST_COMMAND) { // Can't do insertion } else if (event.getAction() == ClickEvent.Action.RUN_COMMAND) { if (Minecraft.getMinecraft().player != null) Minecraft.getMinecraft().player.sendChatMessage(event.getValue()); } else { MC_LOGGER.error("Don't know how to handle " + event); } return true; } return false; }
/** * Called when the mouse is clicked. */ protected void mouseClicked(int par1, int par2, int par3) { if (par3 == 0 && this.mc.gameSettings.chatLinks) { IChatComponent ichatcomponent = this.mc.ingameGUI.getChatGUI().func_146236_a(Mouse.getX(), Mouse.getY()); if (ichatcomponent != null) { ClickEvent clickevent = ichatcomponent.getChatStyle().getChatClickEvent(); if (clickevent != null) { if (isShiftKeyDown()) { inputField.writeText(ichatcomponent.getUnformattedTextForChat()); } else { URI uri; if (clickevent.getAction() == ClickEvent.Action.OPEN_URL) { try { uri = new URI(clickevent.getValue()); if (this.mc.gameSettings.chatLinksPrompt) { this.clickedURI = uri; this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, clickevent.getValue(), 0, false)); } else { this.func_146407_a(uri); } } catch (URISyntaxException urisyntaxexception) { logger.error("Can\'t open url for " + clickevent, urisyntaxexception); } } else if (clickevent.getAction() == ClickEvent.Action.OPEN_FILE) { uri = (new File(clickevent.getValue())).toURI(); this.func_146407_a(uri); } else if (clickevent.getAction() == ClickEvent.Action.SUGGEST_COMMAND) { inputField.setText(clickevent.getValue()); } else if (clickevent.getAction() == ClickEvent.Action.RUN_COMMAND) { this.func_146403_a(clickevent.getValue()); } else { logger.error("Don\'t know how to handle " + clickevent); } } return; } } } inputField.mouseClicked(par1, par2, par3); super.mouseClicked(par1, par2, par3); }
@Override protected void actionPerformed(GuiButton currentButton) { if (currentButton.enabled) { if (currentButton.id == 0) { this.mc.displayGuiScreen(this.parentScreen); } if (currentButton.id == 1) { this.mc.displayGuiScreen(new XrayModChooserGui()); } if (currentButton.id == 2) { UyjuliansXrayModMain.getModInstance().loadBlockList(this.profileNameTextBox.getText()); this.mc.renderGlobal.loadRenderers(); this.mc.displayGuiScreen(this.parentScreen); } if (currentButton.id == 3) { try { URI currentURI = new URI("http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1287646-q"); if (this.mc.gameSettings.chatLinksPrompt) { this.clickedURI = currentURI; this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1287646-q", 0, false)); } else { this.OpenURI(currentURI); } } catch (URISyntaxException e) { e.printStackTrace(); } } if (currentButton.id == 4) { XrayModMainGui newGuiObj = new XrayModMainGui(this, mc.gameSettings); newGuiObj.chooseScreen = 1; this.mc.displayGuiScreen(newGuiObj); } if (currentButton.id == 5) { if ((this.configKeyTextBox.getText().length() > 0) && (this.configValueTextBox.getText().length() > 0)) { XrayModConfiguration.setProperty(this.configKeyTextBox.getText(), this.configValueTextBox.getText()); } this.mc.displayGuiScreen(this.parentScreen); } } }