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


Java GuiConfigEntries.IConfigEntry方法代码示例

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


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

示例1: getConfigEntryClass

import net.minecraftforge.fml.client.config.GuiConfigEntries; //导入方法依赖的package包/类
@Override
public Class<? extends GuiConfigEntries.IConfigEntry> getConfigEntryClass()
{
    return null;
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:6,代码来源:ReflectionConfigElement.java

示例2: drawScreen

import net.minecraftforge.fml.client.config.GuiConfigEntries; //导入方法依赖的package包/类
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
    super.drawScreen(mouseX, mouseY, partialTicks);

    Position position = null;
    Anchor anchor = null;
    boolean fromServer = false;
    int xOffset = 0;
    int yOffset = 0;
    for (int i = 0; i < this.entryList.getSize(); i++) {
        GuiConfigEntries.IConfigEntry configEntry = this.entryList.getListEntry(i);
        Object value = configEntry.getCurrentValue();
        try {
            switch (configEntry.getName()) {
                case "anchorHUD":
                    if (value instanceof String) anchor = Anchor.byName((String) value);
                    break;
                case "position":
                    if (value instanceof String) position = Position.byName((String) value);
                    break;
                case "useGuiConfigFromServer":
                    if (value instanceof Boolean) fromServer = (Boolean) value;
                    break;
                case "xOffset":
                    if (value instanceof String) xOffset = Integer.valueOf((String) value);
                    break;
                case "yOffset":
                    if (value instanceof String) yOffset = Integer.valueOf((String) value);
                    break;
            }
        } catch (NumberFormatException ignored) {

        }
    }

    ScaledResolution resolution = new ScaledResolution(mc);
    Point2i point = null;

    int hudWidth = 70;
    int xOffsetAnchor = 0;

    if (fromServer && EnderPay.settings instanceof SettingsClient) {
        MessageSettings messageSettings = ((SettingsClient) EnderPay.settings).getMessage();
        if (messageSettings == null) return;
        point = messageSettings.getPosition().getPoint(resolution, mc);
        xOffset = messageSettings.getxOffset();
        yOffset = messageSettings.getyOffset();
        if (messageSettings.getAnchor() != Anchor.LEFT) {
            if (anchor == Anchor.RIGHT) xOffsetAnchor -= hudWidth;
            else xOffsetAnchor -= hudWidth / 2;
        }
    }
    if (!fromServer && position != null) {
        point = position.getPoint(resolution, mc);
        if (anchor != Anchor.LEFT) {
            if (anchor == Anchor.RIGHT) xOffsetAnchor -= hudWidth;
            else xOffsetAnchor -= hudWidth / 2;
        }
    }
    if (point == null) return;

    drawRect(point.getX() + xOffset + xOffsetAnchor, point.getY() + yOffset,
            point.getX() + xOffset + hudWidth + xOffsetAnchor, point.getY() + yOffset + 14,
            0x8800FF00);
    drawRect(point.getX() + xOffset, point.getY() + yOffset,
            point.getX() + xOffset + 14, point.getY() + yOffset + 14,
            0x88FF0000);
}
 
开发者ID:kamildanak,项目名称:EnderPay,代码行数:69,代码来源:EnderPayGuiConfig.java


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