Refactor menu rendering and state management
- Introduced _AsciiMenuTypography and _AsciiMenuRowFont enums to manage typography settings for menu rendering. - Updated AsciiRenderer to utilize new typography settings for main menu and game select screens. - Enhanced SixelRenderer and SoftwareRenderer to support new menu rendering logic, including sidebars for options labels. - Added disabled text color handling in WolfMenuPalette for better visual feedback on menu entries. - Implemented a new method _drawSelectableMenuRows to streamline the drawing of menu rows based on selection state. - Created a comprehensive test suite for level state carry-over and pause menu functionality, ensuring player state is preserved across levels and menus. - Adjusted footer rendering to account for layout changes and improved visual consistency across different renderers. Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -50,6 +50,7 @@ abstract class WolfMenuPic {
|
||||
abstract class WolfMenuPalette {
|
||||
static const int selectedTextIndex = 19;
|
||||
static const int unselectedTextIndex = 23;
|
||||
static const int disabledTextIndex = 4;
|
||||
static const int _headerTargetRgb = 0xFFF700;
|
||||
|
||||
static int? _cachedHeaderTextIndex;
|
||||
@@ -62,6 +63,8 @@ abstract class WolfMenuPalette {
|
||||
static int get unselectedTextColor =>
|
||||
ColorPalette.vga32Bit[unselectedTextIndex];
|
||||
|
||||
static int get disabledTextColor => ColorPalette.vga32Bit[disabledTextIndex];
|
||||
|
||||
static int get headerTextColor => ColorPalette.vga32Bit[headerTextIndex];
|
||||
|
||||
static int _nearestPaletteIndex(int rgb) {
|
||||
|
||||
Reference in New Issue
Block a user