For Qt GUI, added PPU pattern view key shortcuts for context menu options.

This commit is contained in:
mjbudd77 2020-10-19 23:34:28 -04:00
parent 2f716e0e77
commit fd5e68efd0
2 changed files with 17 additions and 0 deletions

View File

@ -390,12 +390,14 @@ void ppuPatternView_t::contextMenuEvent(QContextMenuEvent *event)
sprintf( stmp, "Exit Tile View: %X%X", selTile.y(), selTile.x() );
act = new QAction(tr(stmp), &menu);
act->setShortcut( QKeySequence(tr("Z")));
connect( act, SIGNAL(triggered(void)), this, SLOT(exitTileMode(void)) );
menu.addAction( act );
act = new QAction(tr("Draw Tile Grid Lines"), &menu);
act->setCheckable(true);
act->setChecked(drawTileGrid);
act->setShortcut( QKeySequence(tr("G")));
connect( act, SIGNAL(triggered(void)), this, SLOT(toggleTileGridLines(void)) );
menu.addAction( act );
}
@ -404,10 +406,15 @@ void ppuPatternView_t::contextMenuEvent(QContextMenuEvent *event)
sprintf( stmp, "View Tile: %X%X", selTile.y(), selTile.x() );
act = new QAction(tr(stmp), &menu);
act->setShortcut( QKeySequence(tr("Z")));
connect( act, SIGNAL(triggered(void)), this, SLOT(showTileMode(void)) );
menu.addAction( act );
}
act = new QAction(tr("Next Palette"), &menu);
act->setShortcut( QKeySequence(tr("P")));
connect( act, SIGNAL(triggered(void)), this, SLOT(cycleNextPalette(void)) );
menu.addAction( act );
subMenu = menu.addMenu(tr("Palette Select"));
group = new QActionGroup(this);
@ -457,6 +464,15 @@ void ppuPatternView_t::exitTileMode(void)
mode = 0;
}
//----------------------------------------------------
void ppuPatternView_t::cycleNextPalette(void)
{
pindex[ patternIndex ] = (pindex[ patternIndex ] + 1) % 9;
PPUViewSkip = 100;
FCEUD_UpdatePPUView( -1, 0 );
}
//----------------------------------------------------
void ppuPatternView_t::selPalette0(void)
{
pindex[ patternIndex ] = 0;

View File

@ -77,6 +77,7 @@ class ppuPatternView_t : public QWidget
void selPalette6(void);
void selPalette7(void);
void selPalette8(void);
void cycleNextPalette(void);
void toggleTileGridLines(void);
};