Java 类net.minecraft.client.gui.GuiVideoSettings 实例源码

项目:BaseClient    文件:GuiShaderOptions.java   
private GuiButton getSelectedButton(int x, int y)
{
    for (int i = 0; i < this.buttonList.size(); ++i)
    {
        GuiButton guibutton = (GuiButton)this.buttonList.get(i);
        int j = GuiVideoSettings.getButtonWidth(guibutton);
        int k = GuiVideoSettings.getButtonHeight(guibutton);

        if (x >= guibutton.xPosition && y >= guibutton.yPosition && x < guibutton.xPosition + j && y < guibutton.yPosition + k)
        {
            return guibutton;
        }
    }

    return null;
}
项目:BaseClient    文件:TooltipManager.java   
private GuiButton getSelectedButton(int p_getSelectedButton_1_, int p_getSelectedButton_2_, List p_getSelectedButton_3_)
{
    for (int i = 0; i < p_getSelectedButton_3_.size(); ++i)
    {
        GuiButton guibutton = (GuiButton)p_getSelectedButton_3_.get(i);
        int j = GuiVideoSettings.getButtonWidth(guibutton);
        int k = GuiVideoSettings.getButtonHeight(guibutton);
        boolean flag = p_getSelectedButton_1_ >= guibutton.xPosition && p_getSelectedButton_2_ >= guibutton.yPosition && p_getSelectedButton_1_ < guibutton.xPosition + j && p_getSelectedButton_2_ < guibutton.yPosition + k;

        if (flag)
        {
            return guibutton;
        }
    }

    return null;
}
项目:BaseClient    文件:GuiQualitySettingsOF.java   
private GuiButton getSelectedButton(int p_getSelectedButton_1_, int p_getSelectedButton_2_)
{
    for (int i = 0; i < this.buttonList.size(); ++i)
    {
        GuiButton guibutton = (GuiButton)this.buttonList.get(i);
        int j = GuiVideoSettings.getButtonWidth(guibutton);
        int k = GuiVideoSettings.getButtonHeight(guibutton);
        boolean flag = p_getSelectedButton_1_ >= guibutton.xPosition && p_getSelectedButton_2_ >= guibutton.yPosition && p_getSelectedButton_1_ < guibutton.xPosition + j && p_getSelectedButton_2_ < guibutton.yPosition + k;

        if (flag)
        {
            return guibutton;
        }
    }

    return null;
}
项目:BaseClient    文件:GuiDetailSettingsOF.java   
private GuiButton getSelectedButton(int p_getSelectedButton_1_, int p_getSelectedButton_2_)
{
    for (int i = 0; i < this.buttonList.size(); ++i)
    {
        GuiButton guibutton = (GuiButton)this.buttonList.get(i);
        int j = GuiVideoSettings.getButtonWidth(guibutton);
        int k = GuiVideoSettings.getButtonHeight(guibutton);
        boolean flag = p_getSelectedButton_1_ >= guibutton.xPosition && p_getSelectedButton_2_ >= guibutton.yPosition && p_getSelectedButton_1_ < guibutton.xPosition + j && p_getSelectedButton_2_ < guibutton.yPosition + k;

        if (flag)
        {
            return guibutton;
        }
    }

    return null;
}
项目:BaseClient    文件:GuiOtherSettingsOF.java   
private GuiButton getSelectedButton(int p_getSelectedButton_1_, int p_getSelectedButton_2_)
{
    for (int i = 0; i < this.buttonList.size(); ++i)
    {
        GuiButton guibutton = (GuiButton)this.buttonList.get(i);
        int j = GuiVideoSettings.getButtonWidth(guibutton);
        int k = GuiVideoSettings.getButtonHeight(guibutton);
        boolean flag = p_getSelectedButton_1_ >= guibutton.xPosition && p_getSelectedButton_2_ >= guibutton.yPosition && p_getSelectedButton_1_ < guibutton.xPosition + j && p_getSelectedButton_2_ < guibutton.yPosition + k;

        if (flag)
        {
            return guibutton;
        }
    }

    return null;
}
项目:BaseClient    文件:GuiPerformanceSettingsOF.java   
private GuiButton getSelectedButton(int p_getSelectedButton_1_, int p_getSelectedButton_2_)
{
    for (int i = 0; i < this.buttonList.size(); ++i)
    {
        GuiButton guibutton = (GuiButton)this.buttonList.get(i);
        int j = GuiVideoSettings.getButtonWidth(guibutton);
        int k = GuiVideoSettings.getButtonHeight(guibutton);
        boolean flag = p_getSelectedButton_1_ >= guibutton.xPosition && p_getSelectedButton_2_ >= guibutton.yPosition && p_getSelectedButton_1_ < guibutton.xPosition + j && p_getSelectedButton_2_ < guibutton.yPosition + k;

        if (flag)
        {
            return guibutton;
        }
    }

    return null;
}
项目:Backmemed    文件:GuiScreenOF.java   
public static GuiButton getSelectedButton(List<GuiButton> p_getSelectedButton_0_, int p_getSelectedButton_1_, int p_getSelectedButton_2_)
{
    for (int i = 0; i < p_getSelectedButton_0_.size(); ++i)
    {
        GuiButton guibutton = (GuiButton)p_getSelectedButton_0_.get(i);

        if (guibutton.visible)
        {
            int j = GuiVideoSettings.getButtonWidth(guibutton);
            int k = GuiVideoSettings.getButtonHeight(guibutton);

            if (p_getSelectedButton_1_ >= guibutton.xPosition && p_getSelectedButton_2_ >= guibutton.yPosition && p_getSelectedButton_1_ < guibutton.xPosition + j && p_getSelectedButton_2_ < guibutton.yPosition + k)
            {
                return guibutton;
            }
        }
    }

    return null;
}
项目:Backmemed    文件:TooltipManager.java   
private GuiButton getSelectedButton(int p_getSelectedButton_1_, int p_getSelectedButton_2_, List p_getSelectedButton_3_)
{
    for (int i = 0; i < p_getSelectedButton_3_.size(); ++i)
    {
        GuiButton guibutton = (GuiButton)p_getSelectedButton_3_.get(i);
        int j = GuiVideoSettings.getButtonWidth(guibutton);
        int k = GuiVideoSettings.getButtonHeight(guibutton);
        boolean flag = p_getSelectedButton_1_ >= guibutton.xPosition && p_getSelectedButton_2_ >= guibutton.yPosition && p_getSelectedButton_1_ < guibutton.xPosition + j && p_getSelectedButton_2_ < guibutton.yPosition + k;

        if (flag)
        {
            return guibutton;
        }
    }

    return null;
}
项目:Resilience-Client-Source    文件:GuiQualitySettingsOF.java   
private GuiButton getSelectedButton(int i, int j)
{
    for (int k = 0; k < this.buttonList.size(); ++k)
    {
        GuiButton btn = (GuiButton)this.buttonList.get(k);
        int btnWidth = GuiVideoSettings.getButtonWidth(btn);
        int btnHeight = GuiVideoSettings.getButtonHeight(btn);
        boolean flag = i >= btn.field_146128_h && j >= btn.field_146129_i && i < btn.field_146128_h + btnWidth && j < btn.field_146129_i + btnHeight;

        if (flag)
        {
            return btn;
        }
    }

    return null;
}
项目:Resilience-Client-Source    文件:GuiDetailSettingsOF.java   
private GuiButton getSelectedButton(int i, int j)
{
    for (int k = 0; k < this.buttonList.size(); ++k)
    {
        GuiButton btn = (GuiButton)this.buttonList.get(k);
        int btnWidth = GuiVideoSettings.getButtonWidth(btn);
        int btnHeight = GuiVideoSettings.getButtonHeight(btn);
        boolean flag = i >= btn.field_146128_h && j >= btn.field_146129_i && i < btn.field_146128_h + btnWidth && j < btn.field_146129_i + btnHeight;

        if (flag)
        {
            return btn;
        }
    }

    return null;
}
项目:Resilience-Client-Source    文件:GuiOtherSettingsOF.java   
private GuiButton getSelectedButton(int i, int j)
{
    for (int k = 0; k < this.buttonList.size(); ++k)
    {
        GuiButton btn = (GuiButton)this.buttonList.get(k);
        int btnWidth = GuiVideoSettings.getButtonWidth(btn);
        int btnHeight = GuiVideoSettings.getButtonHeight(btn);
        boolean flag = i >= btn.field_146128_h && j >= btn.field_146129_i && i < btn.field_146128_h + btnWidth && j < btn.field_146129_i + btnHeight;

        if (flag)
        {
            return btn;
        }
    }

    return null;
}
项目:Resilience-Client-Source    文件:GuiPerformanceSettingsOF.java   
private GuiButton getSelectedButton(int i, int j)
{
    for (int k = 0; k < this.buttonList.size(); ++k)
    {
        GuiButton btn = (GuiButton)this.buttonList.get(k);
        int btnWidth = GuiVideoSettings.getButtonWidth(btn);
        int btnHeight = GuiVideoSettings.getButtonHeight(btn);
        boolean flag = i >= btn.field_146128_h && j >= btn.field_146129_i && i < btn.field_146128_h + btnWidth && j < btn.field_146129_i + btnHeight;

        if (flag)
        {
            return btn;
        }
    }

    return null;
}
项目:BaseClient    文件:TooltipManager.java   
public void drawTooltips(int p_drawTooltips_1_, int p_drawTooltips_2_, List p_drawTooltips_3_)
{
    if (Math.abs(p_drawTooltips_1_ - this.lastMouseX) <= 5 && Math.abs(p_drawTooltips_2_ - this.lastMouseY) <= 5)
    {
        int i = 700;

        if (System.currentTimeMillis() >= this.mouseStillTime + (long)i)
        {
            int j = this.guiScreen.width / 2 - 150;
            int k = this.guiScreen.height / 6 - 7;

            if (p_drawTooltips_2_ <= k + 98)
            {
                k += 105;
            }

            int l = j + 150 + 150;
            int i1 = k + 84 + 10;
            GuiButton guibutton = this.getSelectedButton(p_drawTooltips_1_, p_drawTooltips_2_, p_drawTooltips_3_);

            if (guibutton instanceof IOptionControl)
            {
                IOptionControl ioptioncontrol = (IOptionControl)guibutton;
                GameSettings.Options gamesettings$options = ioptioncontrol.getOption();
                String[] astring = getTooltipLines(gamesettings$options);

                if (astring == null)
                {
                    return;
                }

                GuiVideoSettings.drawGradientRect(this.guiScreen, j, k, l, i1, -536870912, -536870912);

                for (int j1 = 0; j1 < astring.length; ++j1)
                {
                    String s = astring[j1];
                    int k1 = 14540253;

                    if (s.endsWith("!"))
                    {
                        k1 = 16719904;
                    }

                    FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj;
                    fontrenderer.drawStringWithShadow(s, (float)(j + 5), (float)(k + 5 + j1 * 11), k1);
                }
            }
        }
    }
    else
    {
        this.lastMouseX = p_drawTooltips_1_;
        this.lastMouseY = p_drawTooltips_2_;
        this.mouseStillTime = System.currentTimeMillis();
    }
}
项目:Backmemed    文件:TooltipManager.java   
public void drawTooltips(int p_drawTooltips_1_, int p_drawTooltips_2_, List p_drawTooltips_3_)
{
    if (Math.abs(p_drawTooltips_1_ - this.lastMouseX) <= 5 && Math.abs(p_drawTooltips_2_ - this.lastMouseY) <= 5)
    {
        int i = 700;

        if (System.currentTimeMillis() >= this.mouseStillTime + (long)i)
        {
            int j = this.guiScreen.width / 2 - 150;
            int k = this.guiScreen.height / 6 - 7;

            if (p_drawTooltips_2_ <= k + 98)
            {
                k += 105;
            }

            int l = j + 150 + 150;
            int i1 = k + 84 + 10;
            GuiButton guibutton = this.getSelectedButton(p_drawTooltips_1_, p_drawTooltips_2_, p_drawTooltips_3_);

            if (guibutton instanceof IOptionControl)
            {
                IOptionControl ioptioncontrol = (IOptionControl)guibutton;
                GameSettings.Options gamesettings$options = ioptioncontrol.getOption();
                String[] astring = getTooltipLines(gamesettings$options);

                if (astring == null)
                {
                    return;
                }

                GuiVideoSettings.drawRect(j, k, l, i1, -536870912);

                for (int j1 = 0; j1 < astring.length; ++j1)
                {
                    String s = astring[j1];
                    int k1 = 14540253;

                    if (s.endsWith("!"))
                    {
                        k1 = 16719904;
                    }

                    FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj;
                    fontrenderer.drawStringWithShadow(s, (float)(j + 5), (float)(k + 5 + j1 * 11), k1);
                }
            }
        }
    }
    else
    {
        this.lastMouseX = p_drawTooltips_1_;
        this.lastMouseY = p_drawTooltips_2_;
        this.mouseStillTime = System.currentTimeMillis();
    }
}
项目:Fullscreen-Windowed-Minecraft    文件:DrawScreenEventHandler.java   
@SubscribeEvent
public void handleDrawScreenEvent(GuiScreenEvent.DrawScreenEvent event) {
    if(!ConfigurationHandler.instance().isFullscreenWindowedEnabled())
        return;


    boolean newState = isCorrectKeyBinding();
    if(_initialFullscreen && _cooldown >= Reference.DRAW_SCREEN_EVENT_COOLDOWN) {
        _cooldown = 0;
        _initialFullscreen = false;
        FullscreenWindowed.proxy.toggleFullScreen(_initialGoFullScreen, _initialDesiredMonitor);
    }
    else if(_cooldown >= Reference.DRAW_SCREEN_EVENT_COOLDOWN && (_lastState != newState) && newState)
    {
        _cooldown = 0;
        _lastState = newState;
        FullscreenWindowed.proxy.toggleFullScreen(!ClientProxy.fullscreen, ConfigurationHandler.instance().getFullscreenMonitor());
    }

    _lastState = newState;

    if(_cooldown < Reference.DRAW_SCREEN_EVENT_COOLDOWN)
        _cooldown++;

    if(client.getVersion().startsWith("forge-11")){
        //Do it the old way in 1.8 since event.getGui does not exist.
        if(client.currentScreen instanceof GuiVideoSettings && client.fullscreen != ClientProxy.fullscreen) {
            FullscreenWindowed.proxy.toggleFullScreen(client.fullscreen);
        }
    }else{
        try {
            if (event.getGui() instanceof GuiVideoSettings && client.fullscreen != ClientProxy.fullscreen) {
                FullscreenWindowed.proxy.toggleFullScreen(client.fullscreen);
            }
        // In certain scenarios of 1.8, client mods further change the version and the previous check fails.
        // In those scenarios, we'll get this error and we will fallback to the old method.
        } catch (NoSuchMethodError error) {
            //Do it the old way in 1.8 since event.getGui does not exist.
            if(client.currentScreen instanceof GuiVideoSettings && client.fullscreen != ClientProxy.fullscreen) {
                FullscreenWindowed.proxy.toggleFullScreen(client.fullscreen);
            }
        }
    }
}
项目:RuneCraftery    文件:GuiOptions.java   
protected void func_73875_a(GuiButton p_73875_1_) {
   if(p_73875_1_.field_73742_g) {
      if(p_73875_1_.field_73741_f < 100 && p_73875_1_ instanceof GuiSmallButton) {
         this.field_74051_d.func_74306_a(((GuiSmallButton)p_73875_1_).func_73753_a(), 1);
         p_73875_1_.field_73744_e = this.field_74051_d.func_74297_c(EnumOptions.func_74379_a(p_73875_1_.field_73741_f));
      }

      if(p_73875_1_.field_73741_f == 101) {
         this.field_73882_e.field_71474_y.func_74303_b();
         this.field_73882_e.func_71373_a(new GuiVideoSettings(this, this.field_74051_d));
      }

      if(p_73875_1_.field_73741_f == 100) {
         this.field_73882_e.field_71474_y.func_74303_b();
         this.field_73882_e.func_71373_a(new GuiControls(this, this.field_74051_d));
      }

      if(p_73875_1_.field_73741_f == 102) {
         this.field_73882_e.field_71474_y.func_74303_b();
         this.field_73882_e.func_71373_a(new GuiLanguage(this, this.field_74051_d, this.field_73882_e.func_135016_M()));
      }

      if(p_73875_1_.field_73741_f == 103) {
         this.field_73882_e.field_71474_y.func_74303_b();
         this.field_73882_e.func_71373_a(new ScreenChatOptions(this, this.field_74051_d));
      }

      if(p_73875_1_.field_73741_f == 104) {
         this.field_73882_e.field_71474_y.func_74303_b();
         this.field_73882_e.func_71373_a(new GuiSnooper(this, this.field_74051_d));
      }

      if(p_73875_1_.field_73741_f == 200) {
         this.field_73882_e.field_71474_y.func_74303_b();
         this.field_73882_e.func_71373_a(this.field_74053_c);
      }

      if(p_73875_1_.field_73741_f == 105) {
         this.field_73882_e.field_71474_y.func_74303_b();
         this.field_73882_e.func_71373_a(new GuiScreenTemporaryResourcePackSelect(this, this.field_74051_d));
      }

   }
}