当前位置: 首页>>代码示例>>Java>>正文


Java GuiNewChat.calculateChatboxHeight方法代码示例

本文整理汇总了Java中net.minecraft.client.gui.GuiNewChat.calculateChatboxHeight方法的典型用法代码示例。如果您正苦于以下问题:Java GuiNewChat.calculateChatboxHeight方法的具体用法?Java GuiNewChat.calculateChatboxHeight怎么用?Java GuiNewChat.calculateChatboxHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.gui.GuiNewChat的用法示例。


在下文中一共展示了GuiNewChat.calculateChatboxHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getKeyBinding

import net.minecraft.client.gui.GuiNewChat; //导入方法依赖的package包/类
/**
 * Gets a key binding.
 */
public String getKeyBinding(GameSettings.Options p_74297_1_)
{
    String s = I18n.format(p_74297_1_.getEnumString(), new Object[0]) + ": ";

    if (p_74297_1_.getEnumFloat())
    {
        float f1 = this.getOptionFloatValue(p_74297_1_);
        float f = p_74297_1_.normalizeValue(f1);
        return p_74297_1_ == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.sensitivity.max", new Object[0]) : s + (int)(f * 200.0F) + "%")) : (p_74297_1_ == GameSettings.Options.FOV ? (f1 == 70.0F ? s + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s + I18n.format("options.fov.max", new Object[0]) : s + (int)f1)) : (p_74297_1_ == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == p_74297_1_.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int)f1 + " fps") : (p_74297_1_ == GameSettings.Options.RENDER_CLOUDS ? (f1 == p_74297_1_.valueMin ? s + I18n.format("options.cloudHeight.min", new Object[0]) : s + ((int)f1 + 128)) : (p_74297_1_ == GameSettings.Options.GAMMA ? (f == 0.0F ? s + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.gamma.max", new Object[0]) : s + "+" + (int)(f * 100.0F) + "%")) : (p_74297_1_ == GameSettings.Options.SATURATION ? s + (int)(f * 400.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_OPACITY ? s + (int)(f * 90.0F + 10.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_WIDTH ? s + GuiNewChat.calculateChatboxWidth(f) + "px" : (p_74297_1_ == GameSettings.Options.RENDER_DISTANCE ? s + (int)f1 + " chunks" : (p_74297_1_ == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)f1) : (p_74297_1_ == GameSettings.Options.STREAM_FPS ? s + TwitchStream.formatStreamFps(f) + " fps" : (p_74297_1_ == GameSettings.Options.STREAM_KBPS ? s + TwitchStream.formatStreamKbps(f) + " Kbps" : (p_74297_1_ == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? s + String.format("%.3f bpp", new Object[] {Float.valueOf(TwitchStream.formatStreamBps(f))}): (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)(f * 100.0F) + "%")))))))))))))));
    }
    else if (p_74297_1_.getEnumBoolean())
    {
        boolean flag = this.getOptionOrdinalValue(p_74297_1_);
        return flag ? s + I18n.format("options.on", new Object[0]) : s + I18n.format("options.off", new Object[0]);
    }
    else if (p_74297_1_ == GameSettings.Options.GUI_SCALE)
    {
        return s + getTranslation(GUISCALES, this.guiScale);
    }
    else if (p_74297_1_ == GameSettings.Options.CHAT_VISIBILITY)
    {
        return s + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]);
    }
    else if (p_74297_1_ == GameSettings.Options.PARTICLES)
    {
        return s + getTranslation(PARTICLES, this.particleSetting);
    }
    else if (p_74297_1_ == GameSettings.Options.AMBIENT_OCCLUSION)
    {
        return s + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
    }
    else if (p_74297_1_ == GameSettings.Options.STREAM_COMPRESSION)
    {
        return s + getTranslation(STREAM_COMPRESSIONS, this.streamCompression);
    }
    else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_ENABLED)
    {
        return s + getTranslation(STREAM_CHAT_MODES, this.streamChatEnabled);
    }
    else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_USER_FILTER)
    {
        return s + getTranslation(STREAM_CHAT_FILTER_MODES, this.streamChatUserFilter);
    }
    else if (p_74297_1_ == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR)
    {
        return s + getTranslation(STREAM_MIC_MODES, this.streamMicToggleBehavior);
    }
    else if (p_74297_1_ == GameSettings.Options.RENDER_CLOUDS)
    {
        return s + getTranslation(field_181149_aW, this.clouds);
    }
    else if (p_74297_1_ == GameSettings.Options.GRAPHICS)
    {
        if (this.fancyGraphics)
        {
            return s + I18n.format("options.graphics.fancy", new Object[0]);
        }
        else
        {
            String s1 = "options.graphics.fast";
            return s + I18n.format("options.graphics.fast", new Object[0]);
        }
    }
    else
    {
        return s;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:72,代码来源:GameSettings.java

示例2: getKeyBinding

import net.minecraft.client.gui.GuiNewChat; //导入方法依赖的package包/类
/**
 * Gets a key binding.
 */
public String getKeyBinding(GameSettings.Options p_74297_1_)
{
    String s = this.getKeyBindingOF(p_74297_1_);

    if (s != null)
    {
        return s;
    }
    else
    {
        String s1 = I18n.format(p_74297_1_.getEnumString(), new Object[0]) + ": ";

        if (p_74297_1_.getEnumFloat())
        {
            float f1 = this.getOptionFloatValue(p_74297_1_);
            float f = p_74297_1_.normalizeValue(f1);
            return p_74297_1_ == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s1 + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.sensitivity.max", new Object[0]) : s1 + (int)(f * 200.0F) + "%")) : (p_74297_1_ == GameSettings.Options.FOV ? (f1 == 70.0F ? s1 + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s1 + I18n.format("options.fov.max", new Object[0]) : s1 + (int)f1)) : (p_74297_1_ == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == p_74297_1_.valueMax ? s1 + I18n.format("options.framerateLimit.max", new Object[0]) : s1 + (int)f1 + " fps") : (p_74297_1_ == GameSettings.Options.RENDER_CLOUDS ? (f1 == p_74297_1_.valueMin ? s1 + I18n.format("options.cloudHeight.min", new Object[0]) : s1 + ((int)f1 + 128)) : (p_74297_1_ == GameSettings.Options.GAMMA ? (f == 0.0F ? s1 + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.gamma.max", new Object[0]) : s1 + "+" + (int)(f * 100.0F) + "%")) : (p_74297_1_ == GameSettings.Options.SATURATION ? s1 + (int)(f * 400.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_OPACITY ? s1 + (int)(f * 90.0F + 10.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_WIDTH ? s1 + GuiNewChat.calculateChatboxWidth(f) + "px" : (p_74297_1_ == GameSettings.Options.RENDER_DISTANCE ? s1 + (int)f1 + " chunks" : (p_74297_1_ == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int)f1) : (p_74297_1_ == GameSettings.Options.STREAM_FPS ? s1 + TwitchStream.formatStreamFps(f) + " fps" : (p_74297_1_ == GameSettings.Options.STREAM_KBPS ? s1 + TwitchStream.formatStreamKbps(f) + " Kbps" : (p_74297_1_ == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? s1 + String.format("%.3f bpp", new Object[] {Float.valueOf(TwitchStream.formatStreamBps(f))}): (f == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int)(f * 100.0F) + "%")))))))))))))));
        }
        else if (p_74297_1_.getEnumBoolean())
        {
            boolean flag = this.getOptionOrdinalValue(p_74297_1_);
            return flag ? s1 + I18n.format("options.on", new Object[0]) : s1 + I18n.format("options.off", new Object[0]);
        }
        else if (p_74297_1_ == GameSettings.Options.GUI_SCALE)
        {
            return s1 + getTranslation(GUISCALES, this.guiScale);
        }
        else if (p_74297_1_ == GameSettings.Options.CHAT_VISIBILITY)
        {
            return s1 + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]);
        }
        else if (p_74297_1_ == GameSettings.Options.PARTICLES)
        {
            return s1 + getTranslation(PARTICLES, this.particleSetting);
        }
        else if (p_74297_1_ == GameSettings.Options.AMBIENT_OCCLUSION)
        {
            return s1 + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
        }
        else if (p_74297_1_ == GameSettings.Options.STREAM_COMPRESSION)
        {
            return s1 + getTranslation(STREAM_COMPRESSIONS, this.streamCompression);
        }
        else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_ENABLED)
        {
            return s1 + getTranslation(STREAM_CHAT_MODES, this.streamChatEnabled);
        }
        else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_USER_FILTER)
        {
            return s1 + getTranslation(STREAM_CHAT_FILTER_MODES, this.streamChatUserFilter);
        }
        else if (p_74297_1_ == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR)
        {
            return s1 + getTranslation(STREAM_MIC_MODES, this.streamMicToggleBehavior);
        }
        else if (p_74297_1_ == GameSettings.Options.RENDER_CLOUDS)
        {
            return s1 + getTranslation(field_181149_aW, this.clouds);
        }
        else if (p_74297_1_ == GameSettings.Options.GRAPHICS)
        {
            if (this.fancyGraphics)
            {
                return s1 + I18n.format("options.graphics.fancy", new Object[0]);
            }
            else
            {
                String s2 = "options.graphics.fast";
                return s1 + I18n.format("options.graphics.fast", new Object[0]);
            }
        }
        else
        {
            return s1;
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:81,代码来源:GameSettings.java

示例3: getKeyBinding

import net.minecraft.client.gui.GuiNewChat; //导入方法依赖的package包/类
/**
 * Gets a key binding.
 */
public String getKeyBinding(GameSettings.Options settingOption)
{
    String s = this.getKeyBindingOF(settingOption);

    if (s != null)
    {
        return s;
    }
    else
    {
        String s1 = I18n.format(settingOption.getEnumString(), new Object[0]) + ": ";

        if (settingOption.getEnumFloat())
        {
            float f1 = this.getOptionFloatValue(settingOption);
            float f = settingOption.normalizeValue(f1);
            return settingOption == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s1 + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.sensitivity.max", new Object[0]) : s1 + (int)(f * 200.0F) + "%")) : (settingOption == GameSettings.Options.FOV ? (f1 == 70.0F ? s1 + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s1 + I18n.format("options.fov.max", new Object[0]) : s1 + (int)f1)) : (settingOption == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == settingOption.valueMax ? s1 + I18n.format("options.framerateLimit.max", new Object[0]) : s1 + I18n.format("options.framerate", new Object[] {Integer.valueOf((int)f1)})): (settingOption == GameSettings.Options.RENDER_CLOUDS ? (f1 == settingOption.valueMin ? s1 + I18n.format("options.cloudHeight.min", new Object[0]) : s1 + ((int)f1 + 128)) : (settingOption == GameSettings.Options.GAMMA ? (f == 0.0F ? s1 + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.gamma.max", new Object[0]) : s1 + "+" + (int)(f * 100.0F) + "%")) : (settingOption == GameSettings.Options.SATURATION ? s1 + (int)(f * 400.0F) + "%" : (settingOption == GameSettings.Options.CHAT_OPACITY ? s1 + (int)(f * 90.0F + 10.0F) + "%" : (settingOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_WIDTH ? s1 + GuiNewChat.calculateChatboxWidth(f) + "px" : (settingOption == GameSettings.Options.RENDER_DISTANCE ? s1 + I18n.format("options.chunks", new Object[] {Integer.valueOf((int)f1)}): (settingOption == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int)f1) : (f == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int)(f * 100.0F) + "%"))))))))))));
        }
        else if (settingOption.getEnumBoolean())
        {
            boolean flag = this.getOptionOrdinalValue(settingOption);
            return flag ? s1 + I18n.format("options.on", new Object[0]) : s1 + I18n.format("options.off", new Object[0]);
        }
        else if (settingOption == GameSettings.Options.MAIN_HAND)
        {
            return s1 + this.mainHand;
        }
        else if (settingOption == GameSettings.Options.GUI_SCALE)
        {
            return this.guiScale >= GUISCALES.length ? s1 + this.guiScale + "x" : s1 + getTranslation(GUISCALES, this.guiScale);
        }
        else if (settingOption == GameSettings.Options.CHAT_VISIBILITY)
        {
            return s1 + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]);
        }
        else if (settingOption == GameSettings.Options.PARTICLES)
        {
            return s1 + getTranslation(PARTICLES, this.particleSetting);
        }
        else if (settingOption == GameSettings.Options.AMBIENT_OCCLUSION)
        {
            return s1 + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
        }
        else if (settingOption == GameSettings.Options.RENDER_CLOUDS)
        {
            return s1 + getTranslation(CLOUDS_TYPES, this.clouds);
        }
        else if (settingOption == GameSettings.Options.GRAPHICS)
        {
            if (this.fancyGraphics)
            {
                return s1 + I18n.format("options.graphics.fancy", new Object[0]);
            }
            else
            {
                String s2 = "options.graphics.fast";
                return s1 + I18n.format("options.graphics.fast", new Object[0]);
            }
        }
        else
        {
            return settingOption == GameSettings.Options.ATTACK_INDICATOR ? s1 + getTranslation(ATTACK_INDICATORS, this.attackIndicator) : s1;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:69,代码来源:GameSettings.java

示例4: getKeyBinding

import net.minecraft.client.gui.GuiNewChat; //导入方法依赖的package包/类
/**
 * Gets a key binding.
 */
public String getKeyBinding(GameSettings.Options settingOption)
{
    String s = I18n.format(settingOption.getEnumString(), new Object[0]) + ": ";

    if (settingOption.getEnumFloat())
    {
        float f1 = this.getOptionFloatValue(settingOption);
        float f = settingOption.normalizeValue(f1);
        return settingOption == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.sensitivity.max", new Object[0]) : s + (int)(f * 200.0F) + "%")) : (settingOption == GameSettings.Options.FOV ? (f1 == 70.0F ? s + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s + I18n.format("options.fov.max", new Object[0]) : s + (int)f1)) : (settingOption == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == settingOption.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int)f1 + " fps") : (settingOption == GameSettings.Options.RENDER_CLOUDS ? (f1 == settingOption.valueMin ? s + I18n.format("options.cloudHeight.min", new Object[0]) : s + ((int)f1 + 128)) : (settingOption == GameSettings.Options.GAMMA ? (f == 0.0F ? s + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.gamma.max", new Object[0]) : s + "+" + (int)(f * 100.0F) + "%")) : (settingOption == GameSettings.Options.SATURATION ? s + (int)(f * 400.0F) + "%" : (settingOption == GameSettings.Options.CHAT_OPACITY ? s + (int)(f * 90.0F + 10.0F) + "%" : (settingOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_WIDTH ? s + GuiNewChat.calculateChatboxWidth(f) + "px" : (settingOption == GameSettings.Options.RENDER_DISTANCE ? s + (int)f1 + " chunks" : (settingOption == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)f1) : (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)(f * 100.0F) + "%"))))))))))));
    }
    else if (settingOption.getEnumBoolean())
    {
        boolean flag = this.getOptionOrdinalValue(settingOption);
        return flag ? s + I18n.format("options.on", new Object[0]) : s + I18n.format("options.off", new Object[0]);
    }
    else if (settingOption == GameSettings.Options.MAIN_HAND)
    {
        return s + this.mainHand;
    }
    else if (settingOption == GameSettings.Options.GUI_SCALE)
    {
        return s + getTranslation(GUISCALES, this.guiScale);
    }
    else if (settingOption == GameSettings.Options.CHAT_VISIBILITY)
    {
        return s + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]);
    }
    else if (settingOption == GameSettings.Options.PARTICLES)
    {
        return s + getTranslation(PARTICLES, this.particleSetting);
    }
    else if (settingOption == GameSettings.Options.AMBIENT_OCCLUSION)
    {
        return s + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
    }
    else if (settingOption == GameSettings.Options.RENDER_CLOUDS)
    {
        return s + getTranslation(CLOUDS_TYPES, this.clouds);
    }
    else if (settingOption == GameSettings.Options.GRAPHICS)
    {
        if (this.fancyGraphics)
        {
            return s + I18n.format("options.graphics.fancy", new Object[0]);
        }
        else
        {
            String s1 = "options.graphics.fast";
            return s + I18n.format("options.graphics.fast", new Object[0]);
        }
    }
    else
    {
        return settingOption == GameSettings.Options.ATTACK_INDICATOR ? s + getTranslation(ATTACK_INDICATORS, this.attackIndicator) : s;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:60,代码来源:GameSettings.java


注:本文中的net.minecraft.client.gui.GuiNewChat.calculateChatboxHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。