Java 类net.minecraft.client.gui.Gui 实例源码
项目:rezolve
文件:BundleBuilderGuiContainer.java
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
//String s = this.entity.getDisplayName().getUnformattedText();
//this.fontRendererObj.drawString(s, 88 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //#404040
//this.fontRendererObj.drawString(this.playerInv.getDisplayName().getUnformattedText(), 8, 72, 4210752); //#404040
int rfBarX = 191;
int rfBarY = 17;
int rfBarHeight = 88;
int rfBarWidth = 14;
int usedHeight = (int)(this.entity.getEnergyStored(EnumFacing.DOWN) / (double)this.entity.getMaxEnergyStored(EnumFacing.DOWN) * rfBarHeight);
Gui.drawRect(rfBarX, rfBarY, rfBarX + rfBarWidth, rfBarY + rfBarHeight, 0xFF000000);
Gui.drawRect(rfBarX, rfBarY + rfBarHeight - usedHeight, rfBarX + rfBarWidth, rfBarY + rfBarHeight, 0xFFFF0000);
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
}
项目:rezolve
文件:GuiContainerBase.java
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
boolean textFocused = false;
for (Gui control : this.controls) {
if (control instanceof GuiTextField) {
GuiTextField textField = (GuiTextField) control;
if (textField.isFocused()) {
textFocused = true;
textField.textboxKeyTyped(typedChar, keyCode);
break;
}
}
}
if (!textFocused || keyCode != Keyboard.KEY_E)
super.keyTyped(typedChar, keyCode);
}
项目:rezolve
文件:GuiContainerBase.java
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
GlStateManager.pushMatrix();
GlStateManager.translate(-guiLeft, -guiTop, 0);
for (Gui control : this.controls) {
if (control instanceof GuiTextField) {
((GuiTextField)control).drawTextBox();
} else if (control instanceof GuiButton) {
((GuiButton)control).drawButton(this.mc, mouseX, mouseY);
}
}
GlStateManager.popMatrix();
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
}
项目:pnc-repressurized
文件:GuiButtonSpecial.java
@Override
public void drawButton(Minecraft mc, int x, int y, float partialTicks) {
if (thisVisible) super.drawButton(mc, x, y, partialTicks);
if (visible) {
if (renderedStacks != null) {
int middleX = this.x + width / 2;
int startX = middleX - renderedStacks.length * 9 + 1;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
for (int i = 0; i < renderedStacks.length; i++) {
itemRenderer.renderItemAndEffectIntoGUI(renderedStacks[i], startX + i * 18, this.y + 2);
}
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
if (resLoc != null) {
mc.getTextureManager().bindTexture(resLoc);
drawModalRectWithCustomSizedTexture(this.x + width / 2 - 8, this.y + 2, 0, 0, 16, 16, 16, 16);
}
if (enabled && !thisVisible && x >= this.x && y >= this.y && x < this.x + width && y < this.y + height) {
Gui.drawRect(this.x, this.y, this.x + width, this.y + height, invisibleHoverColor);
}
}
}
项目:pnc-repressurized
文件:WidgetVerticalScrollbar.java
@Override
public void render(int mouseX, int mouseY, float partialTick) {
GL11.glColor4d(1, 1, 1, 1);
if (!Mouse.isButtonDown(0)) dragging = false;
if (!wasClicking && Mouse.isButtonDown(0) && getBounds().contains(mouseX, mouseY)) {
dragging = true;
}
if (!enabled) dragging = false;
wasClicking = Mouse.isButtonDown(0);
if (dragging) currentScroll = (float) (mouseY - 7 - getBounds().y) / (getBounds().height - 17);
currentScroll = MathHelper.clamp(currentScroll, 0, 1);
Minecraft.getMinecraft().getTextureManager().bindTexture(scrollTexture);
Gui.drawModalRectWithCustomSizedTexture(x, y, 12, 0, getBounds().width, 1, 26, 15);
for (int i = 0; i < getBounds().height - 2; i++)
Gui.drawModalRectWithCustomSizedTexture(x, y + 1 + i, 12, 1, getBounds().width, 1, 26, 15);
Gui.drawModalRectWithCustomSizedTexture(x, y + getBounds().height - 1, 12, 14, getBounds().width, 1, 26, 15);
if (!enabled) GL11.glColor4d(0.6, 0.6, 0.6, 1);
Gui.drawModalRectWithCustomSizedTexture(x + 1, y + 1 + (int) ((getBounds().height - 17) * currentScroll), 0, 0, 12, 15, 26, 15);
GL11.glColor4d(1, 1, 1, 1);
}
项目:pnc-repressurized
文件:WidgetAmadronOffer.java
@Override
public void render(int mouseX, int mouseY, float partialTick) {
if (renderBackground) {
Minecraft.getMinecraft().getTextureManager().bindTexture(Textures.WIDGET_AMADRON_OFFER);
GlStateManager.color(1f, canBuy ? 1f : 0.4f, canBuy ? 1f : 0.4f, 1f);
Gui.drawModalRectWithCustomSizedTexture(x, y, 0, 0, getBounds().width, getBounds().height, 256, 256);
}
for (IGuiWidget widget : widgets) {
widget.render(mouseX, mouseY, partialTick);
}
Minecraft.getMinecraft().fontRenderer.drawString(offer.getVendor(), x + 2, y + 2, 0xFF000000);
boolean customOffer = offer instanceof AmadronOfferCustom;
if (shoppingAmount > 0) {
Minecraft.getMinecraft().fontRenderer.drawString(TextFormatting.BLACK.toString() + shoppingAmount, x + 36 - Minecraft.getMinecraft().fontRenderer.getStringWidth("" + shoppingAmount) / 2, y + (customOffer ? 15 : 20), 0xFF000000);
}
if (customOffer) {
AmadronOfferCustom custom = (AmadronOfferCustom) offer;
Minecraft.getMinecraft().fontRenderer.drawString(TextFormatting.DARK_BLUE.toString() + custom.getStock(), x + 36 - Minecraft.getMinecraft().fontRenderer.getStringWidth("" + custom.getStock()) / 2, y + 25, 0xFF000000);
}
}
项目:pnc-repressurized
文件:ProgWidget.java
@Override
public void renderExtraInfo() {
if (getExtraStringInfo() != null) {
GL11.glPushMatrix();
GL11.glScaled(0.5, 0.5, 0.5);
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
String[] splittedInfo = WordUtils.wrap(getExtraStringInfo(), 40).split(System.getProperty("line.separator"));
for (int i = 0; i < splittedInfo.length; i++) {
int stringLength = fr.getStringWidth(splittedInfo[i]);
int startX = getWidth() / 2 - stringLength / 4;
int startY = getHeight() / 2 - (fr.FONT_HEIGHT + 1) * (splittedInfo.length - 1) / 4 + (fr.FONT_HEIGHT + 1) * i / 2 - fr.FONT_HEIGHT / 4;
Gui.drawRect(startX * 2 - 1, startY * 2 - 1, startX * 2 + stringLength + 1, startY * 2 + fr.FONT_HEIGHT + 1, 0xFFFFFFFF);
fr.drawString(splittedInfo[i], startX * 2, startY * 2, 0xFF000000);
}
GL11.glPopMatrix();
GL11.glColor4d(1, 1, 1, 1);
}
}
项目:CreeperHostGui
文件:ServerListEntryPublic.java
public void ourDrawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isHovering)
{
Util.getWrapper().draw(wrapped, slotIndex, x, y, listWidth, slotHeight, mouseX > (listWidth / 2) ? mouseX : Integer.MAX_VALUE, mouseY, false);
Server server = getServerData().server;
EnumFlag flag = server.flag;
if (flag == null)
return;
Minecraft.getMinecraft().getTextureManager().bindTexture(flags);
int flagWidth = 16;
int flagHeight = flag.height / (flag.width / flagWidth);
Gui.drawScaledCustomSizeModalRect(x + listWidth - 5 - flagWidth, y + slotHeight - flagHeight, flag.x, flag.y, flag.width, flag.height, flagWidth, flagHeight, 512, 512);
if (mouseX >= x + listWidth - 5 - flagWidth
&& mouseX <= x + listWidth - 5
&& mouseY >= y + slotHeight - flagHeight
&& mouseY <= y + slotHeight - flagHeight + flagHeight)
{
String countryName = Callbacks.getCountries().get(flag.name());
if (countryName == null)
{
countryName = flag.name();
}
owner.setHoveringText(countryName + (server.subdivision.equals("Unknown") ? "" : "\n" + server.subdivision));
}
}
项目:Backmemed
文件:TeleportToTeam.java
public void renderIcon(float p_178663_1_, int alpha)
{
int i = -1;
String s = FontRenderer.getFormatFromString(this.team.getColorPrefix());
if (s.length() >= 2)
{
i = Minecraft.getMinecraft().fontRendererObj.getColorCode(s.charAt(1));
}
if (i >= 0)
{
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
Gui.drawRect(1, 1, 15, 15, MathHelper.rgb(f * p_178663_1_, f1 * p_178663_1_, f2 * p_178663_1_) | alpha << 24);
}
Minecraft.getMinecraft().getTextureManager().bindTexture(this.location);
GlStateManager.color(p_178663_1_, p_178663_1_, p_178663_1_, (float)alpha / 255.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
项目:Wurst-MC-1.12
文件:TacoCmd.java
@Override
public void onRenderGUI()
{
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if(WurstClient.INSTANCE.mods.rainbowUiMod.isActive())
{
float[] acColor = WurstClient.INSTANCE.getGui().getAcColor();
GL11.glColor4f(acColor[0], acColor[1], acColor[2], 1);
}else
GL11.glColor4f(1, 1, 1, 1);
mc.getTextureManager().bindTexture(tacos[ticks / 8]);
ScaledResolution sr = new ScaledResolution(mc);
int x = sr.getScaledWidth() / 2 - 32 + 76;
int y = sr.getScaledHeight() - 32 - 19;
int w = 64;
int h = 32;
Gui.drawModalRectWithCustomSizedTexture(x, y, 0, 0, w, h, w, h);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
}
项目:Wurst-MC-1.12
文件:WurstLogo.java
public void render()
{
String version = getVersionString();
// draw version background
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if(WurstClient.INSTANCE.mods.rainbowUiMod.isActive())
{
float[] acColor = WurstClient.INSTANCE.getGui().getAcColor();
GL11.glColor4f(acColor[0], acColor[1], acColor[2], 0.5F);
}else
GL11.glColor4f(1, 1, 1, 0.5F);
drawQuads(0, 6, Fonts.segoe22.getStringWidth(version) + 76, 18);
// draw version string
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_DEPTH_TEST);
Fonts.segoe22.drawString(version, 74, 4, 0xFF000000);
// draw Wurst logo
GL11.glColor4f(1, 1, 1, 1);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
Gui.drawModalRectWithCustomSizedTexture(0, 3, 0, 0, 72, 18, 72, 18);
}
项目:BaseClient
文件:TeleportToTeam.java
public void func_178663_a(float p_178663_1_, int alpha)
{
int i = -1;
String s = FontRenderer.getFormatFromString(this.field_178676_b.getColorPrefix());
if (s.length() >= 2)
{
i = Minecraft.getMinecraft().fontRendererObj.getColorCode(s.charAt(1));
}
if (i >= 0)
{
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
Gui.drawRect(1, 1, 15, 15, MathHelper.func_180183_b(f * p_178663_1_, f1 * p_178663_1_, f2 * p_178663_1_) | alpha << 24);
}
Minecraft.getMinecraft().getTextureManager().bindTexture(this.field_178677_c);
GlStateManager.color(p_178663_1_, p_178663_1_, p_178663_1_, (float)alpha / 255.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
项目:BaseClient
文件:TeleportToTeam.java
public void func_178663_a(float p_178663_1_, int alpha)
{
int i = -1;
String s = FontRenderer.getFormatFromString(this.field_178676_b.getColorPrefix());
if (s.length() >= 2)
{
i = Minecraft.getMinecraft().fontRendererObj.getColorCode(s.charAt(1));
}
if (i >= 0)
{
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
Gui.drawRect(1, 1, 15, 15, MathHelper.func_180183_b(f * p_178663_1_, f1 * p_178663_1_, f2 * p_178663_1_) | alpha << 24);
}
Minecraft.getMinecraft().getTextureManager().bindTexture(this.field_178677_c);
GlStateManager.color(p_178663_1_, p_178663_1_, p_178663_1_, (float)alpha / 255.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
项目:CustomWorldGen
文件:TeleportToTeam.java
public void renderIcon(float p_178663_1_, int alpha)
{
int i = -1;
String s = FontRenderer.getFormatFromString(this.team.getColorPrefix());
if (s.length() >= 2)
{
i = Minecraft.getMinecraft().fontRendererObj.getColorCode(s.charAt(1));
}
if (i >= 0)
{
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
Gui.drawRect(1, 1, 15, 15, MathHelper.rgb(f * p_178663_1_, f1 * p_178663_1_, f2 * p_178663_1_) | alpha << 24);
}
Minecraft.getMinecraft().getTextureManager().bindTexture(this.location);
GlStateManager.color(p_178663_1_, p_178663_1_, p_178663_1_, (float)alpha / 255.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
项目:FirstAid
文件:GuiUtils.java
private static void renderLine(int regen, boolean low, int yTexture, int maxHealth, int maxExtraHearts, int current, int absorption, Gui gui, boolean highlight) {
GlStateManager.pushMatrix();
Int2IntMap map = new Int2IntArrayMap();
if (low) {
for (int i = 0; i < (maxHealth + maxExtraHearts); i++)
map.put(i, EventHandler.rand.nextInt(2));
}
renderMax(regen, map, maxHealth, yTexture, gui, highlight);
if (maxExtraHearts > 0) { //for absorption
if (maxHealth != 0) {
GlStateManager.translate(2 + 9 * maxHealth, 0, 0);
}
renderMax(regen - maxHealth, map, maxExtraHearts, yTexture, gui, false); //Do not highlight absorption
}
GlStateManager.popMatrix();
GlStateManager.translate(0, 0, 1);
renderCurrentHealth(regen, map, current, yTexture, gui);
if (absorption > 0) {
int offset = maxHealth * 9 + (maxHealth == 0 ? 0 : 2);
GlStateManager.translate(offset, 0, 0);
renderAbsorption(regen - maxHealth, map, absorption, yTexture, gui);
}
}
项目:Lithium-Forge
文件:ImageRenderer.java
@SideOnly(Side.CLIENT)
@Override
public void renderLithiumControl(LImage control, GuiScreen gui) {
Point loc = NewLithiumGUI.centerControl(control);
//Ask ImageManager to give us a dynamic texture
DynamicTexture imageTexture = ImageManager.getDynamicTexture(control);
if (imageTexture != null) {
//Get Minecraft's texture manager
TextureManager textureManager = ModCoderPackUtils.getTextureManager();
//Bind the texture. (In other words, tell Minecraft to use this texture)
textureManager.bindTexture(textureManager.getDynamicTextureLocation(control.getUUID().toString(), imageTexture));
//Correct colors
GlStateManager.color(1, 1, 1, 1);
//Draw the image to the screen
Gui.drawModalRectWithCustomSizedTexture(loc.getX(), loc.getY(), 0.0F, 0.0F, control.getSize().getWidth(), control.getSize().getHeight(), control.getSize().getWidth(), control.getSize().getHeight());
}
}
项目:Lithium-Forge
文件:ProgressBarRenderer.java
@SideOnly(Side.CLIENT)
@Override
public void renderLithiumControl(LProgressBar control, GuiScreen gui) {
Point loc = NewLithiumGUI.centerControl(control);
int left = loc.getX();
int top = loc.getY();
int right = left + control.getSize().getWidth();
int bottom = top + control.getSize().getHeight();
//Render outside of the progressbar
Gui.drawRect(left, top, right, bottom, (int) control.getBorderColor().getHexColor());
//Draw the inside of the progressbar
Gui.drawRect(left + 1, top + 1, right - 1, bottom - 1, (int) control.getInsideColor().getHexColor());
int startX = left + 2;
int endX = right - 2;
//Calculate the size of the progress and fill it
Gui.drawRect(startX, top + 2, MiscUtils.ConvertRange(control.getMinValue(), control.getMaxValue(), startX, endX, control.getProgress()), bottom - 2, (int) control.getProgressColor().getHexColor());
}
项目:TextDisplayer
文件:Message.java
public void render(boolean drawBox) {
ScaledResolution res = new ScaledResolution(Minecraft.getMinecraft());
int width = getStringWidth() + 4;
int height = 14;
if (getX() < 0) {
setX(0);
} else if (getX() * getScale() > res.getScaledWidth() - width) {
setX((int) ((res.getScaledWidth() - (width * getScale())) / getScale()));
}
if (getY() < 0) {
setY(0);
} else if (getY() * getScale() > res.getScaledHeight() - height) {
setY((int) ((res.getScaledHeight() - (height * getScale())) / getScale()));
}
GlStateManager.pushMatrix();
GlStateManager.scale(getScale(), getScale(), 1.0);
if (drawBox && !a) {
Gui.drawRect(getX(), getY(), getX() + width, getY() + height, -1442840576);
}
Minecraft.getMinecraft().fontRendererObj.drawString(getMessage(), getX() + 2, getY() + 3, isChroma() ? getColor() : Color.WHITE.getRGB(), useShadow());
GlStateManager.popMatrix();
}
项目:rezolve
文件:BundlerGuiContainer.java
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
//String s = this.entity.getDisplayName().getUnformattedText();
//this.fontRendererObj.drawString(s, 88 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //#404040
//this.fontRendererObj.drawString(this.playerInv.getDisplayName().getUnformattedText(), 8, 72, 4210752); //#404040
int rfBarX = 231;
int rfBarY = 20;
int rfBarHeight = 88;
int rfBarWidth = 14;
int usedHeight = (int)(this.entity.getEnergyStored(EnumFacing.DOWN) / (double)this.entity.getMaxEnergyStored(EnumFacing.DOWN) * rfBarHeight);
Gui.drawRect(rfBarX, rfBarY, rfBarX + rfBarWidth, rfBarY + rfBarHeight - usedHeight, 0xFF000000);
Operation<BundlerEntity> op = this.entity.getCurrentOperation();
String statusStr;
if (op != null) {
int width = (int)(32 * op.getPercentage() / (double)100);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(new ResourceLocation("rezolve:textures/gui/container/arrow.png"));
GlStateManager.enableBlend();
this.drawModalRectWithCustomSizedTexture(133, 54, 0, 0, width, 32, 32, 32);
statusStr = "Operation: "+op.getPercentage()+"%";
} else {
statusStr = "Idle.";
}
this.fontRendererObj.drawString(statusStr, 7, 102, 0xFF000000);
}
项目:rezolve
文件:RemoteShellGuiContainer.java
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
int rfBarX = 231;
int rfBarY = 20;
int rfBarHeight = 88;
int rfBarWidth = 14;
int usedHeight = rfBarHeight - (int)(this.entity.getEnergyStored(EnumFacing.DOWN) / (double)this.entity.getMaxEnergyStored(EnumFacing.DOWN) * rfBarHeight);
Gui.drawRect(rfBarX, rfBarY, rfBarX + rfBarWidth, rfBarY + usedHeight, 0xFF000000);
DatabaseServerEntity db = this.entity.getDatabase();
this.nameField.setVisible(this.selectedMachine != null && db != null);
if (this.selectedMachine != null) {
BlockPos pos = this.selectedMachine;
ItemStack stack = getItemFromBlock(this.entity, pos);
if (stack != null) {
String name = stack.getDisplayName();
String stackName = stack.getDisplayName();
String position = pos.getX()+", "+pos.getY()+", "+pos.getZ();
if (!this.nameField.getVisible()) {
this.fontRendererObj.drawString(stackName, 10, 126, 0xFF000000);
this.fontRendererObj.drawString(position, 10, 141, 0xFF666666);
} else {
this.fontRendererObj.drawString(stackName, 10, 141, 0xFF666666);
this.fontRendererObj.drawString(position, 10, 153, 0xFF666666);
}
}
} else {
this.fontRendererObj.drawString("Right click a machine for info.", 10, 126, 0xFF666666);
}
}
项目:rezolve
文件:UnbundlerGuiContainer.java
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
//String s = this.entity.getDisplayName().getUnformattedText();
//this.fontRendererObj.drawString(s, 88 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); //#404040
//this.fontRendererObj.drawString(this.playerInv.getDisplayName().getUnformattedText(), 8, 72, 4210752); //#404040
int rfBarX = 226;
int rfBarY = 20;
int rfBarHeight = 88;
int rfBarWidth = 14;
int usedHeight = rfBarHeight - (int)(this.entity.getEnergyStored(EnumFacing.DOWN) / (double)this.entity.getMaxEnergyStored(EnumFacing.DOWN) * rfBarHeight);
Gui.drawRect(rfBarX, rfBarY, rfBarX + rfBarWidth, rfBarY + usedHeight, 0xFF000000);
// Draw operation details
Operation<BundlerEntity> op = this.entity.getCurrentOperation();
String statusStr;
if (op != null) {
int width = (int)(32 * op.getPercentage() / (double)100);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(new ResourceLocation("rezolve:textures/gui/container/arrow.png"));
GlStateManager.enableBlend();
this.drawModalRectWithCustomSizedTexture(103, 81, 0, 0, width, 32, 32, 32);
statusStr = "Operation: "+op.getPercentage()+"%";
} else {
statusStr = "Idle.";
}
this.fontRendererObj.drawString(statusStr, 7, 112, 0xFF000000);
}
项目:rezolve
文件:GuiContainerBase.java
@Override
public void updateScreen() {
super.updateScreen();
for (Gui control : this.controls) {
if (control instanceof GuiTextField) {
GuiTextField textField = (GuiTextField)control;
textField.updateCursorCounter();
}
}
}
项目:WurstSDK
文件:GuiPluginList.java
private void drawIcon(int x, int y, boolean selected) {
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("sdk/plugin.png"));
GL11.glEnable(3042);
if (selected) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
} else {
GL11.glColor4f(0.9F, 0.9F, 0.9F, 1.0F);
}
Gui.drawModalRectWithCustomSizedTexture(x, y, 24, 24, 24, 24, 24, 24);
Gui.drawModalRectWithCustomSizedTexture(x, y, 120, 24, 24, 24, 24, 24);
GL11.glDisable(3042);
}
项目:CustomWorldGen
文件:GuiSlotModList.java
@Override
protected void drawSlot(int idx, int right, int top, int height, Tessellator tess)
{
ModContainer mc = mods.get(idx);
String name = StringUtils.stripControlCodes(mc.getName());
String version = StringUtils.stripControlCodes(mc.getDisplayVersion());
FontRenderer font = this.parent.getFontRenderer();
CheckResult vercheck = ForgeVersion.getResult(mc);
if (Loader.instance().getModState(mc) == ModState.DISABLED)
{
font.drawString(font.trimStringToWidth(name, listWidth - 10), this.left + 3 , top + 2, 0xFF2222);
font.drawString(font.trimStringToWidth(version, listWidth - (5 + height)), this.left + 3 , top + 12, 0xFF2222);
font.drawString(font.trimStringToWidth("DISABLED", listWidth - 10), this.left + 3 , top + 22, 0xFF2222);
}
else
{
font.drawString(font.trimStringToWidth(name, listWidth - 10), this.left + 3 , top + 2, 0xFFFFFF);
font.drawString(font.trimStringToWidth(version, listWidth - (5 + height)), this.left + 3 , top + 12, 0xCCCCCC);
font.drawString(font.trimStringToWidth(mc.getMetadata() != null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 10), this.left + 3 , top + 22, 0xCCCCCC);
if (vercheck.status.shouldDraw())
{
//TODO: Consider adding more icons for visualization
Minecraft.getMinecraft().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
GlStateManager.color(1, 1, 1, 1);
GlStateManager.pushMatrix();
Gui.drawModalRectWithCustomSizedTexture(right - (height / 2 + 4), top + (height / 2 - 4), vercheck.status.getSheetOffset() * 8, (vercheck.status.isAnimated() && ((System.currentTimeMillis() / 800 & 1)) == 1) ? 8 : 0, 8, 8, 64, 16);
GlStateManager.popMatrix();
}
}
}
项目:Firma
文件:GuiKnappingButton.java
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
zLevel = 1;
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(screen.getTexture()));
if (show) {
//Gui.drawModalRectWithCustomSizedTexture(this.xPosition, this.yPosition, 0, 0, 16, 16, 16, 16);
//Gui.draw
Gui.drawModalRectWithCustomSizedTexture(this.xPosition, this.yPosition, 16*locx, 16*locy, 16, 16, 80, 80);
}
}
项目:Infernum
文件:EventHandlerClient.java
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderOverlayPostEvent(RenderGameOverlayEvent.Post event) {
if (event.getType() == ElementType.ALL) {
Minecraft minecraft = Minecraft.getMinecraft();
EntityPlayer player = minecraft.player;
if (player.getHeldItem(EnumHand.OFF_HAND).getItem() instanceof IInfernalPowerItem) {
int maxPower = player.getHeldItem(EnumHand.OFF_HAND).getMaxDamage();
int power = maxPower - player.getHeldItem(EnumHand.OFF_HAND).getItemDamage();
int width = event.getResolution().getScaledWidth();
int height = event.getResolution().getScaledHeight();
GuiIngame gui = Minecraft.getMinecraft().ingameGUI;
Minecraft.getMinecraft().getTextureManager().bindTexture(HUD_TEXTURE);
GlStateManager.enableBlend();
int y = (height / 2) - (42 / 2);
int x = 3;
int barHeight = (int) (((float) power / (float) maxPower) * 32);
gui.drawTexturedModalRect(x, y, 0, 0, 10, 42);
gui.drawTexturedModalRect(x + 1, y + 5 + (32 - barHeight), 10, 5, 8, barHeight);
Minecraft.getMinecraft().getTextureManager().bindTexture(Gui.ICONS);
GlStateManager.disableBlend();
}
}
}
项目:CreeperHostGui
文件:GuiGeneralServerInfo.java
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawDefaultBackground();
super.drawScreen(mouseX, mouseY, partialTicks);
this.drawCenteredString(this.fontRendererObj, Util.localize("info.server_name"), this.width / 2, this.height / 2 - 65, -1);
int colour;
if (nameChecked && isAcceptable)
{
colour = 0x00FF00;
}
else
{
colour = 0xFF0000;
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(lockIcon);
Gui.func_146110_a(this.width / 2 - 8, (this.height / 2) + 40, 0.0F, 0.0F, 16, 16, 16.0F, 16.0F);
int strStart = 61;
this.drawCenteredString(fontRendererObj, Util.localize("secure.line1"), this.width / 2, (this.height / 2) + strStart, 0xFFFFFF);
this.drawCenteredString(fontRendererObj, Util.localize("secure.line2"), this.width / 2, (this.height / 2) + strStart + 10, 0xFFFFFF);
this.drawCenteredString(fontRendererObj, Util.localize("secure.line3"), this.width / 2, (this.height / 2) + strStart + 20, 0xFFFFFF);
this.nameField.drawTextBox();
this.drawCenteredString(fontRendererObj, message, (this.width / 2), (this.height / 2) - 26, colour);
}
项目:CreeperHostGui
文件:ServerListEntryPublic.java
@Override
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isHovering)
{
wrapped.drawEntry(slotIndex, x, y, listWidth, slotHeight, tessellator, mouseX > (listWidth / 2) ? mouseX : Integer.MAX_VALUE, mouseY, false);
Server server = func_148296_a().server;
EnumFlag flag = server.flag;
if (flag == null)
return;
Minecraft.getMinecraft().getTextureManager().bindTexture(flags);
int flagWidth = 16;
int flagHeight = flag.height / (flag.width / flagWidth);
Gui.func_152125_a(x + listWidth - 5 - flagWidth, y + slotHeight - flagHeight, flag.x, flag.y, flag.width, flag.height, flagWidth, flagHeight, 512, 512);
if (mouseX >= x + listWidth - 5 - flagWidth
&& mouseX <= x + listWidth - 5
&& mouseY >= y + slotHeight - flagHeight
&& mouseY <= y + slotHeight - flagHeight + flagHeight)
{
String countryName = Callbacks.getCountries().get(flag.name());
if (countryName == null)
{
countryName = flag.name();
}
owner.func_146793_a(countryName + (server.subdivision.equals("Unknown") ? "" : "\n" + server.subdivision));
}
}
项目:CreeperHostGui
文件:GuiGeneralServerInfo.java
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawDefaultBackground();
super.drawScreen(mouseX, mouseY, partialTicks);
this.drawCenteredString(this.fontRendererObj, Util.localize("info.server_name"), this.width / 2, this.height / 2 - 65, -1);
int colour;
if (nameChecked && isAcceptable)
{
colour = 0x00FF00;
}
else
{
colour = 0xFF0000;
}
this.mc.getTextureManager().bindTexture(lockIcon);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
Gui.drawModalRectWithCustomSizedTexture((this.width / 2) - 8, (this.height / 2) + 40, 0.0F, 0.0F, 16, 16, 16.0F, 16.0F);
int strStart = 61;
this.drawCenteredString(fontRendererObj, Util.localize("secure.line1"), this.width / 2, (this.height / 2) + strStart, 0xFFFFFF);
this.drawCenteredString(fontRendererObj, Util.localize("secure.line2"), this.width / 2, (this.height / 2) + strStart + 10, 0xFFFFFF);
this.drawCenteredString(fontRendererObj, Util.localize("secure.line3"), this.width / 2, (this.height / 2) + strStart + 20, 0xFFFFFF);
this.nameField.drawTextBox();
this.drawCenteredString(fontRendererObj, message, (this.width / 2), (this.height / 2) - 26, colour);
}
项目:MineDonate
文件:GuiScrollingList.java
private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_)
{
Tessellator var5 = Tessellator.instance;
this.client.renderEngine.bindTexture(Gui.optionsBackground);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
float var6 = 32.0F;
var5.startDrawingQuads();
var5.setColorRGBA_I(4210752, p_22239_4_);
var5.addVertexWithUV(0.0D, (double)p_22239_2_, 0.0D, 0.0D, (double)((float)p_22239_2_ / var6));
var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_2_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_2_ / var6));
var5.setColorRGBA_I(4210752, p_22239_3_);
var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_1_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_1_ / var6));
var5.addVertexWithUV(0.0D, (double)p_22239_1_, 0.0D, 0.0D, (double)((float)p_22239_1_ / var6));
var5.draw();
}
项目:HardcoreRevival
文件:ClientProxy.java
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Post event) {
if (event.getType() == RenderGameOverlayEvent.ElementType.PORTAL) {
Minecraft mc = Minecraft.getMinecraft();
if (isKnockedOut) {
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, -300);
GuiHelper.drawGradientRectW(0, 0, mc.displayWidth, mc.displayHeight, 0x60500000, 0x90FF0000);
GlStateManager.popMatrix();
if (mc.currentScreen == null) {
mc.fontRenderer.drawStringWithShadow(I18n.format("gui.hardcorerevival.open_death_screen", mc.gameSettings.keyBindChat.getDisplayName()), 5, 5, 0xFFFFFFFF);
mc.fontRenderer.drawString(I18n.format("gui.hardcorerevival.rescue_time_left", Math.max(0, (ModConfig.maxDeathTicks - deathTime) / 20)), 5, 7 + mc.fontRenderer.FONT_HEIGHT, 16777215);
mc.getTextureManager().bindTexture(Gui.ICONS);
}
} else {
if(targetEntity != -1) {
Entity entity = mc.world.getEntityByID(targetEntity);
if (entity instanceof EntityPlayer) {
String s = I18n.format("gui.hardcorerevival.rescuing", ((EntityPlayer) entity).getDisplayNameString());
if(targetProgress >= 0.75f) {
s += " ...";
} else if(targetProgress >= 0.5f) {
s += " ..";
} else if(targetProgress >= 0.25f) {
s += " .";
}
mc.fontRenderer.drawString(s, event.getResolution().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(s) / 2, event.getResolution().getScaledHeight() / 2 + 30, 0xFFFFFFFF);
mc.getTextureManager().bindTexture(Gui.ICONS);
}
}
}
} else if(event.getType() == RenderGameOverlayEvent.ElementType.CHAT) {
if(prevChatHeight != -1f) {
Minecraft.getMinecraft().gameSettings.chatHeightFocused = prevChatHeight;
}
}
}
项目:interactionwheel
文件:RenderHelper.java
/**
* Draw a beveled box. x2 and y2 are not included.
*/
public static void drawBeveledBox(int x1, int y1, int x2, int y2, int topleftcolor, int botrightcolor, int fillcolor) {
if (fillcolor != -1) {
Gui.drawRect(x1 + 1, y1 + 1, x2 - 1, y2 - 1, fillcolor);
}
drawHorizontalLine(x1, y1, x2 - 1, topleftcolor);
drawVerticalLine(x1, y1, y2 - 1, topleftcolor);
drawVerticalLine(x2 - 1, y1, y2 - 1, botrightcolor);
drawHorizontalLine(x1, y2 - 1, x2, botrightcolor);
}
项目:interactionwheel
文件:RenderHelper.java
/**
* Draw a thick beveled box. x2 and y2 are not included.
*/
public static void drawThickBeveledBox(int x1, int y1, int x2, int y2, int thickness, int topleftcolor, int botrightcolor, int fillcolor) {
if (fillcolor != -1) {
Gui.drawRect(x1 + 1, y1 + 1, x2 - 1, y2 - 1, fillcolor);
}
Gui.drawRect(x1, y1, x2 - 1, y1 + thickness, topleftcolor);
Gui.drawRect(x1, y1, x1 + thickness, y2 - 1, topleftcolor);
Gui.drawRect(x2 - thickness, y1, x2, y2 - 1, botrightcolor);
Gui.drawRect(x1, y2 - thickness, x2, y2, botrightcolor);
}
项目:DecompiledMinecraft
文件:PlayerMenuObject.java
public void func_178663_a(float p_178663_1_, int alpha)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
项目:DecompiledMinecraft
文件:SpectatorMenu.java
public void func_178663_a(float p_178663_1_, int alpha)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(GuiSpectator.field_175269_a);
if (this.field_178666_a < 0)
{
Gui.drawModalRectWithCustomSizedTexture(0, 0, 144.0F, 0.0F, 16, 16, 256.0F, 256.0F);
}
else
{
Gui.drawModalRectWithCustomSizedTexture(0, 0, 160.0F, 0.0F, 16, 16, 256.0F, 256.0F);
}
}
项目:Wurst-MC-1.12
文件:AltRenderer.java
public static void drawAltFace(String name, int x, int y, int w, int h,
boolean selected)
{
try
{
AbstractClientPlayer
.getDownloadImageSkin(
AbstractClientPlayer.getLocationSkin(name), name)
.loadTexture(Minecraft.getMinecraft().getResourceManager());
Minecraft.getMinecraft().getTextureManager()
.bindTexture(AbstractClientPlayer.getLocationSkin(name));
GL11.glEnable(GL11.GL_BLEND);
if(selected)
GL11.glColor4f(1, 1, 1, 1);
else
GL11.glColor4f(0.9F, 0.9F, 0.9F, 1);
// Face
float fw = 192;
float fh = 192;
float u = 24;
float v = 24;
Gui.drawModalRectWithCustomSizedTexture(x, y, u, v, w, h, fw, fh);
// Hat
fw = 192;
fh = 192;
u = 120;
v = 24;
Gui.drawModalRectWithCustomSizedTexture(x, y, u, v, w, h, fw, fh);
GL11.glDisable(GL11.GL_BLEND);
}catch(Exception e)
{
e.printStackTrace();
}
}
项目:FoodCraft-Reloaded
文件:GuiHandler.java
@Nullable
@Override
public Gui getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
switch (ID) {
case GuiID.DRINK_MACHINE:
return new GuiContainerDrinkMachine(player.inventory, world.getTileEntity(new BlockPos(x, y, z)));
case GuiID.PRESSURE_COOKER:
return new GuiContainerPressureCooker(player.inventory, world.getTileEntity(new BlockPos(x, y, z)));
case GuiID.SMELTING_PRESSURE_COOKER:
return new GuiContainerSmeltingDrinkMachine(player.inventory, world.getTileEntity(new BlockPos(x, y, z)));
}
return null;
}
项目:BaseClient
文件:PlayerMenuObject.java
public void func_178663_a(float p_178663_1_, int alpha)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
项目:Backmemed
文件:PlayerMenuObject.java
public void renderIcon(float p_178663_1_, int alpha)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F);
}
项目:BaseClient
文件:SpectatorMenu.java
public void func_178663_a(float p_178663_1_, int alpha)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(GuiSpectator.field_175269_a);
if (this.field_178666_a < 0)
{
Gui.drawModalRectWithCustomSizedTexture(0, 0, 144.0F, 0.0F, 16, 16, 256.0F, 256.0F);
}
else
{
Gui.drawModalRectWithCustomSizedTexture(0, 0, 160.0F, 0.0F, 16, 16, 256.0F, 256.0F);
}
}