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


Java IGuiWidget类代码示例

本文整理汇总了Java中uk.co.qmunity.lib.client.gui.widget.IGuiWidget的典型用法代码示例。如果您正苦于以下问题:Java IGuiWidget类的具体用法?Java IGuiWidget怎么用?Java IGuiWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IGuiWidget类属于uk.co.qmunity.lib.client.gui.widget包,在下文中一共展示了IGuiWidget类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawScreen

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
public void drawScreen(int x, int y, float partialTick) {

    super.drawScreen(x, y, partialTick);
    List<String> tooltip = new ArrayList<String>();
    boolean shift = QmunityLib.proxy.isSneakingInGui();
    for (IGuiWidget widget : widgets) {
        if (widget.getBounds().contains(x, y))
            widget.addTooltip(x, y, tooltip, shift);
    }
    if (!tooltip.isEmpty()) {
        List<String> localizedTooltip = new ArrayList<String>();
        for (String line : tooltip) {
            String localizedLine = I18n.format(line);
            String[] lines = WordUtils.wrap(localizedLine, 50).split(System.getProperty("line.separator"));
            for (String locLine : lines) {
                localizedTooltip.add(locLine);
            }
        }
        drawHoveringText(localizedTooltip, x, y, fontRendererObj);
    }

}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:24,代码来源:GuiContainerBase.java

示例2: actionPerformed

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
public void actionPerformed(IGuiWidget widget) {

    super.actionPerformed(widget);

    if (widget.getID() == 0)
        motor.configure(MotorSetting.REDSTONE_PULSE);
    if (widget.getID() == 1)
        motor.configure(MotorSetting.REDSTONE_INVERTED);
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:11,代码来源:GuiMotorSettings.java

示例3: actionPerformed

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
public void actionPerformed(IGuiWidget widget) {

    super.actionPerformed(widget);

    if (widget.getID() == 0)
        Config.click_through_frames = ((WidgetMode) widget).value != 0;
    if (widget.getID() == 1)
        Config.simple_frames = ((WidgetMode) widget).value != 0;

    if (widget.getID() == 0 || widget.getID() == 1) {
        Minecraft mc = Minecraft.getMinecraft();
        if (mc == null || mc.thePlayer == null || mc.theWorld == null)
            return;

        EntityPlayer player = mc.thePlayer;

        if (player == null)
            return;

        int x = (int) player.posX;
        int y = (int) player.posY;
        int z = (int) player.posZ;

        int range = 16 * 16;

        mc.theWorld.markBlockRangeForRenderUpdate(x - range, y - range, z - range, x + range, y + range, z + range);
    }
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:30,代码来源:GuiSettings.java

示例4: drawGuiContainerBackgroundLayer

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(resLoc);

    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;

    drawTexturedModalRect(x, y, 0, 0, xSize, ySize);

    for (IGuiWidget widget : widgets) {
        widget.render(i, j, f);
    }
}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:16,代码来源:GuiContainerBase.java

示例5: mouseClicked

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
protected void mouseClicked(int x, int y, int button) {

    super.mouseClicked(x, y, button);
    for (IGuiWidget widget : widgets) {
        if (widget.getBounds().contains(x, y) && (!(widget instanceof BaseWidget) || ((BaseWidget) widget).enabled))
            widget.onMouseClicked(x, y, button);
    }
}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:10,代码来源:GuiContainerBase.java

示例6: actionPerformed

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
public void actionPerformed(IGuiWidget widget) {

    if (widget instanceof GuiAnimatedStat && ((GuiAnimatedStat) widget).isClicked()) {
        for (IGuiWidget w : widgets) {
            if (w != widget && w instanceof GuiAnimatedStat
                    && ((GuiAnimatedStat) w).isLeftSided() == ((GuiAnimatedStat) widget).isLeftSided())
                ((GuiAnimatedStat) w).closeWindow();
        }
    }
}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:12,代码来源:GuiContainerBase.java

示例7: updateScreen

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
public void updateScreen() {

    super.updateScreen();
    for (IGuiWidget widget : widgets)
        widget.update();
}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:8,代码来源:GuiContainerBase.java

示例8: getWidget

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
public IGuiWidget getWidget(int id) {

        for (IGuiWidget widget : widgets)
            if (widget.getID() == id)
                return widget;

        return null;
    }
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:9,代码来源:GuiBase.java

示例9: addWidget

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
protected void addWidget(IGuiWidget widget) {

        widgets.add(widget);
        widget.setListener(this);
    }
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:6,代码来源:GuiContainerBase.java

示例10: actionPerformed

import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
public void actionPerformed(IGuiWidget widget) {

}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:5,代码来源:GuiBase.java


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