本文整理汇总了Java中net.minecraft.client.gui.GuiConfirmOpenLink类的典型用法代码示例。如果您正苦于以下问题:Java GuiConfirmOpenLink类的具体用法?Java GuiConfirmOpenLink怎么用?Java GuiConfirmOpenLink使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuiConfirmOpenLink类属于net.minecraft.client.gui包,在下文中一共展示了GuiConfirmOpenLink类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mouseClicked
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
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);
}
}
}
}
示例2: mouseClicked
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
/**
* 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);
}
}
示例3: mouseClicked
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
@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));
}
}
示例4: mouseClicked
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
/**
* 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);
}
}
}
示例5: onClick
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
@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;
}
示例6: actionPerformed
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
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;
}
}
示例7: mouseClicked
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
/**
* 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);
}
}
}
示例8: passClick
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
@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 );
}
}
示例9: initGui
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
@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;
}
示例10: actionPerformed
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
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;
}
}
示例11: func_73864_a
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
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_);
}
示例12: actionPerformed
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
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;
}
}
示例13: GuiDonationStation
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
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);
}
});
}
示例14: createActionButton
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
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;
}
示例15: actionPerformed
import net.minecraft.client.gui.GuiConfirmOpenLink; //导入依赖的package包/类
@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);
}