Automatically use sixel if it's available
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -1327,7 +1327,7 @@ class AsciiRenderer extends CliRendererBackend<dynamic> {
|
||||
}
|
||||
|
||||
// 1. Pull Retro Colors
|
||||
final int vgaStatusBarBlue = ColorPalette.vga32Bit[153];
|
||||
final int hudBackground = ColorPalette.vga32Bit[0];
|
||||
final int vgaPanelDark = ColorPalette.vga32Bit[0];
|
||||
final int white = ColorPalette.vga32Bit[15];
|
||||
final int yellow = ColorPalette.vga32Bit[11];
|
||||
@@ -1364,7 +1364,7 @@ class AsciiRenderer extends CliRendererBackend<dynamic> {
|
||||
viewHeight * 2,
|
||||
projectionWidth,
|
||||
hudRows * 2,
|
||||
vgaStatusBarBlue,
|
||||
hudBackground,
|
||||
);
|
||||
_fillTerminalRect(
|
||||
projectionOffsetX,
|
||||
@@ -1380,7 +1380,7 @@ class AsciiRenderer extends CliRendererBackend<dynamic> {
|
||||
width,
|
||||
height - viewHeight,
|
||||
' ',
|
||||
vgaStatusBarBlue,
|
||||
hudBackground,
|
||||
);
|
||||
_writeString(0, viewHeight, "═" * width, white);
|
||||
}
|
||||
@@ -1481,7 +1481,7 @@ class AsciiRenderer extends CliRendererBackend<dynamic> {
|
||||
}
|
||||
|
||||
void _drawMinimalHud(WolfEngine engine) {
|
||||
final int vgaStatusBarBlue = ColorPalette.vga32Bit[153];
|
||||
final int hudBackground = ColorPalette.vga32Bit[0];
|
||||
final int white = ColorPalette.vga32Bit[15];
|
||||
final int red = ColorPalette.vga32Bit[4];
|
||||
|
||||
@@ -1492,7 +1492,7 @@ class AsciiRenderer extends CliRendererBackend<dynamic> {
|
||||
viewHeight * 2,
|
||||
projectionWidth,
|
||||
hudRows * 2,
|
||||
vgaStatusBarBlue,
|
||||
hudBackground,
|
||||
);
|
||||
_fillTerminalRect(
|
||||
projectionOffsetX,
|
||||
@@ -1502,7 +1502,7 @@ class AsciiRenderer extends CliRendererBackend<dynamic> {
|
||||
white,
|
||||
);
|
||||
} else {
|
||||
_fillRect(0, viewHeight, width, hudRows, ' ', vgaStatusBarBlue);
|
||||
_fillRect(0, viewHeight, width, hudRows, ' ', hudBackground);
|
||||
_writeString(0, viewHeight, "═" * width, white);
|
||||
}
|
||||
|
||||
@@ -1527,7 +1527,7 @@ class AsciiRenderer extends CliRendererBackend<dynamic> {
|
||||
}
|
||||
|
||||
final int startX = drawStartX + ((drawWidth - clipped.length) ~/ 2);
|
||||
_writeString(startX, lineY, clipped, healthColor, vgaStatusBarBlue);
|
||||
_writeString(startX, lineY, clipped, healthColor, hudBackground);
|
||||
}
|
||||
|
||||
void _drawFullVgaHud(WolfEngine engine) {
|
||||
|
||||
@@ -34,7 +34,6 @@ class SixelRenderer extends CliRendererBackend<String> {
|
||||
static const int _maxRenderHeight = 240;
|
||||
static const int _menuFooterBottomMargin = 1;
|
||||
static const int _headerHeadingY = 24;
|
||||
static const String _terminalTealBackground = '\x1b[48;2;0;150;136m';
|
||||
|
||||
late Uint8List _screen;
|
||||
List<int>? _mainMenuBandFirstColumn;
|
||||
@@ -877,9 +876,7 @@ class SixelRenderer extends CliRendererBackend<String> {
|
||||
return _renderNotSupportedMessage();
|
||||
}
|
||||
|
||||
final String clearPrefix = _needsBackgroundClear
|
||||
? '$_terminalTealBackground\x1b[2J\x1b[0m'
|
||||
: '';
|
||||
final String clearPrefix = _needsBackgroundClear ? '\x1b[0m\x1b[2J' : '';
|
||||
_needsBackgroundClear = false;
|
||||
return '$clearPrefix\x1b[${_offsetRows + 1};${_offsetColumns + 1}H${toSixelString()}';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user