1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-26 07:03:22 +00:00

Render terminal cursor in a less awkward way

The previous way seemed weird enough to seem to have had a purpose, but I can't tell. Revert this if it turns out that there was.
This commit is contained in:
Lignum 2017-05-04 23:53:43 +02:00
parent 7e71045c7b
commit 4e3def39e0
No known key found for this signature in database
GPG Key ID: E4DE8F54CA0912BA

View File

@ -407,23 +407,22 @@ public void draw( Minecraft mc, int xOrigin, int yOrigin, int mouseX, int mouseY
TextBuffer colour = terminal.getTextColourLine( line );
TextBuffer backgroundColour = terminal.getBackgroundColourLine( line );
fontRenderer.drawString( text, x, y, colour, backgroundColour, m_leftMargin, m_rightMargin, greyscale );
if( tblink && ty == line )
{
if( tx >= 0 && tx < tw )
{
TextBuffer cursor = new TextBuffer( '_', 1 );
TextBuffer cursorColour = new TextBuffer( "0123456789abcdef".charAt( terminal.getTextColour() ), 1 );
fontRenderer.drawString(
cursor,
x + FixedWidthFontRenderer.FONT_WIDTH * tx,
y,
cursorColour, null,
0, 0,
greyscale
);
}
}
y = y + FixedWidthFontRenderer.FONT_HEIGHT;
y += FixedWidthFontRenderer.FONT_HEIGHT;
}
if( tblink )
{
TextBuffer cursor = new TextBuffer( '_', 1 );
TextBuffer cursorColour = new TextBuffer( "0123456789abcdef".charAt( terminal.getTextColour() ), 1 );
fontRenderer.drawString(
cursor,
x + FixedWidthFontRenderer.FONT_WIDTH * tx,
startY + m_topMargin + FixedWidthFontRenderer.FONT_HEIGHT * ty,
cursorColour, null,
0, 0,
greyscale
);
}
}
}