本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
}
示例7: updateScreen
import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
public void updateScreen() {
super.updateScreen();
for (IGuiWidget widget : widgets)
widget.update();
}
示例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;
}
示例9: addWidget
import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
protected void addWidget(IGuiWidget widget) {
widgets.add(widget);
widget.setListener(this);
}
示例10: actionPerformed
import uk.co.qmunity.lib.client.gui.widget.IGuiWidget; //导入依赖的package包/类
@Override
public void actionPerformed(IGuiWidget widget) {
}