Java 类net.minecraft.client.gui.stream.GuiStreamUnavailable 实例源码
项目:BaseClient
文件:Minecraft.java
public void dispatchKeypresses() {
int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey();
if (i != 0 && !Keyboard.isRepeatEvent()) {
if (!(this.currentScreen instanceof GuiControls)
|| ((GuiControls) this.currentScreen).time <= getSystemTime() - 20L) {
if (Keyboard.getEventKeyState()) {
if (i == this.gameSettings.keyBindStreamStartStop.getKeyCode()) {
if (this.getTwitchStream().isBroadcasting()) {
this.getTwitchStream().stopBroadcasting();
} else if (this.getTwitchStream().isReadyToBroadcast()) {
this.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() {
public void confirmClicked(boolean result, int id) {
if (result) {
Minecraft.this.getTwitchStream().func_152930_t();
}
Minecraft.this.displayGuiScreen((GuiScreen) null);
}
}, I18n.format("stream.confirm_start", new Object[0]), "", 0));
} else if (this.getTwitchStream().func_152928_D() && this.getTwitchStream().func_152936_l()) {
if (this.theWorld != null) {
this.ingameGUI.getChatGUI()
.printChatMessage(new ChatComponentText("Not ready to start streaming yet!"));
}
} else {
GuiStreamUnavailable.func_152321_a(this.currentScreen);
}
} else if (i == this.gameSettings.keyBindStreamPauseUnpause.getKeyCode()) {
if (this.getTwitchStream().isBroadcasting()) {
if (this.getTwitchStream().isPaused()) {
this.getTwitchStream().unpause();
} else {
this.getTwitchStream().pause();
}
}
} else if (i == this.gameSettings.keyBindStreamCommercials.getKeyCode()) {
if (this.getTwitchStream().isBroadcasting()) {
this.getTwitchStream().requestCommercial();
}
} else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) {
this.stream.muteMicrophone(true);
} else if (i == this.gameSettings.keyBindFullscreen.getKeyCode()) {
this.toggleFullscreen();
} else if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) {
this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir,
this.displayWidth, this.displayHeight, this.framebufferMc));
}
} else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) {
this.stream.muteMicrophone(false);
}
}
}
}
项目:Cauldron
文件:GuiOptions.java
protected void actionPerformed(GuiButton p_146284_1_)
{
if (p_146284_1_.enabled)
{
if (p_146284_1_.id < 100 && p_146284_1_ instanceof GuiOptionButton)
{
this.field_146443_h.setOptionValue(((GuiOptionButton)p_146284_1_).returnEnumOptions(), 1);
p_146284_1_.displayString = this.field_146443_h.getKeyBinding(GameSettings.Options.getEnumOptions(p_146284_1_.id));
}
if (p_146284_1_.id == 8675309)
{
this.mc.entityRenderer.activateNextShader();
}
if (p_146284_1_.id == 101)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiVideoSettings(this, this.field_146443_h));
}
if (p_146284_1_.id == 100)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiControls(this, this.field_146443_h));
}
if (p_146284_1_.id == 102)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiLanguage(this, this.field_146443_h, this.mc.getLanguageManager()));
}
if (p_146284_1_.id == 103)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new ScreenChatOptions(this, this.field_146443_h));
}
if (p_146284_1_.id == 104)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiSnooper(this, this.field_146443_h));
}
if (p_146284_1_.id == 200)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(this.field_146441_g);
}
if (p_146284_1_.id == 105)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiScreenResourcePacks(this));
}
if (p_146284_1_.id == 106)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiScreenOptionsSounds(this, this.field_146443_h));
}
if (p_146284_1_.id == 107)
{
this.mc.gameSettings.saveOptions();
IStream istream = this.mc.func_152346_Z();
if (istream.func_152936_l() && istream.func_152928_D())
{
this.mc.displayGuiScreen(new GuiStreamOptions(this, this.field_146443_h));
}
else
{
GuiStreamUnavailable.func_152321_a(this);
}
}
}
}
项目:Cauldron
文件:GuiOptions.java
protected void actionPerformed(GuiButton p_146284_1_)
{
if (p_146284_1_.enabled)
{
if (p_146284_1_.id < 100 && p_146284_1_ instanceof GuiOptionButton)
{
this.field_146443_h.setOptionValue(((GuiOptionButton)p_146284_1_).returnEnumOptions(), 1);
p_146284_1_.displayString = this.field_146443_h.getKeyBinding(GameSettings.Options.getEnumOptions(p_146284_1_.id));
}
if (p_146284_1_.id == 8675309)
{
this.mc.entityRenderer.activateNextShader();
}
if (p_146284_1_.id == 101)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiVideoSettings(this, this.field_146443_h));
}
if (p_146284_1_.id == 100)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiControls(this, this.field_146443_h));
}
if (p_146284_1_.id == 102)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiLanguage(this, this.field_146443_h, this.mc.getLanguageManager()));
}
if (p_146284_1_.id == 103)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new ScreenChatOptions(this, this.field_146443_h));
}
if (p_146284_1_.id == 104)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiSnooper(this, this.field_146443_h));
}
if (p_146284_1_.id == 200)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(this.field_146441_g);
}
if (p_146284_1_.id == 105)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiScreenResourcePacks(this));
}
if (p_146284_1_.id == 106)
{
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiScreenOptionsSounds(this, this.field_146443_h));
}
if (p_146284_1_.id == 107)
{
this.mc.gameSettings.saveOptions();
IStream istream = this.mc.func_152346_Z();
if (istream.func_152936_l() && istream.func_152928_D())
{
this.mc.displayGuiScreen(new GuiStreamOptions(this, this.field_146443_h));
}
else
{
GuiStreamUnavailable.func_152321_a(this);
}
}
}
}