1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-07-05 11:33:21 +00:00

Fix selected slot now showing in the turtle GUI

This commit is contained in:
SquidDev 2020-07-27 18:37:07 +01:00
parent e5cf0d1c61
commit 3093f882d8
2 changed files with 14 additions and 18 deletions

View File

@ -113,7 +113,6 @@ public void render( @Nonnull MatrixStack stack, int mouseX, int mouseY, float pa
setBlitOffset( getBlitOffset() + 1 );
super.render( stack, mouseX, mouseY, partialTicks );
func_230459_a_( stack, mouseX, mouseY );
}
@Override

View File

@ -95,33 +95,30 @@ public boolean keyPressed( int key, int scancode, int modifiers )
return super.keyPressed( key, scancode, modifiers );
}
private void drawSelectionSlot( boolean advanced )
{
// Draw selection slot
int slot = m_container.getSelectedSlot();
if( slot >= 0 )
{
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
int slotX = slot % 4;
int slotY = slot / 4;
minecraft.getTextureManager().bindTexture( advanced ? BACKGROUND_ADVANCED : BACKGROUND_NORMAL );
// TODO: blit( guiLeft + ContainerTurtle.TURTLE_START_X - 2 + slotX * 18, guiTop + ContainerTurtle.PLAYER_START_Y - 2 + slotY * 18, 0, 217, 24, 24 );
}
}
@Override
protected void drawGuiContainerBackgroundLayer( @Nonnull MatrixStack transform, float partialTicks, int mouseX, int mouseY )
{
// Draw term
boolean advanced = m_family == ComputerFamily.ADVANCED;
ResourceLocation texture = m_family == ComputerFamily.ADVANCED ? BACKGROUND_ADVANCED : BACKGROUND_NORMAL;
terminal.draw( terminalWrapper.getX(), terminalWrapper.getY() );
// Draw border/inventory
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
minecraft.getTextureManager().bindTexture( advanced ? BACKGROUND_ADVANCED : BACKGROUND_NORMAL );
minecraft.getTextureManager().bindTexture( texture );
blit( transform, guiLeft, guiTop, 0, 0, xSize, ySize );
drawSelectionSlot( advanced );
// Draw selection slot
int slot = m_container.getSelectedSlot();
if( slot >= 0 )
{
int slotX = slot % 4;
int slotY = slot / 4;
blit( transform,
guiLeft + ContainerTurtle.TURTLE_START_X - 2 + slotX * 18,
guiTop + ContainerTurtle.PLAYER_START_Y - 2 + slotY * 18,
0, 217, 24, 24
);
}
}
@Override