Added config parameters to save PPU viewer tile focus policy preferences for Qt GUI.
This commit is contained in:
parent
02e3c4e075
commit
68555d98ab
|
@ -901,6 +901,8 @@ ppuNameTableView_t::ppuNameTableView_t(QWidget *parent)
|
||||||
tileSelColor.setRgb(255,255,255);
|
tileSelColor.setRgb(255,255,255);
|
||||||
tileGridColor.setRgb(255, 0, 0);
|
tileGridColor.setRgb(255, 0, 0);
|
||||||
attrGridColor.setRgb( 0, 0,255);
|
attrGridColor.setRgb( 0, 0,255);
|
||||||
|
|
||||||
|
g_config->getOption("SDL.NT_TileFocusPolicy", &hover2Focus );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
ppuNameTableView_t::~ppuNameTableView_t(void)
|
ppuNameTableView_t::~ppuNameTableView_t(void)
|
||||||
|
@ -916,6 +918,8 @@ void ppuNameTableView_t::setScrollPointer( QScrollArea *sa )
|
||||||
void ppuNameTableView_t::setHoverFocus( bool hoverFocus )
|
void ppuNameTableView_t::setHoverFocus( bool hoverFocus )
|
||||||
{
|
{
|
||||||
hover2Focus = hoverFocus;
|
hover2Focus = hoverFocus;
|
||||||
|
|
||||||
|
g_config->setOption("SDL.NT_TileFocusPolicy", hover2Focus );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ppuNameTableView_t::setViewScale( int reqScale )
|
void ppuNameTableView_t::setViewScale( int reqScale )
|
||||||
|
|
|
@ -624,6 +624,11 @@ InitConfig()
|
||||||
// enable new PPU core
|
// enable new PPU core
|
||||||
config->addOption("newppu", "SDL.NewPPU", 0);
|
config->addOption("newppu", "SDL.NewPPU", 0);
|
||||||
|
|
||||||
|
// PPU Viewer Preferences
|
||||||
|
config->addOption("SDL.NT_TileFocusPolicy", 0);
|
||||||
|
config->addOption("SDL.PPU_TileFocusPolicy", 0);
|
||||||
|
config->addOption("SDL.OAM_TileFocusPolicy", 0);
|
||||||
|
|
||||||
// quit when a+b+select+start is pressed
|
// quit when a+b+select+start is pressed
|
||||||
config->addOption("4buttonexit", "SDL.ABStartSelectExit", 0);
|
config->addOption("4buttonexit", "SDL.ABStartSelectExit", 0);
|
||||||
|
|
||||||
|
|
|
@ -349,14 +349,14 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent)
|
||||||
|
|
||||||
act = new QAction(tr("&Click"), this);
|
act = new QAction(tr("&Click"), this);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
act->setChecked(true);
|
act->setChecked( !patternView[0]->getHoverFocus() );
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
subMenu->addAction(act);
|
subMenu->addAction(act);
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(setClickFocus(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(setClickFocus(void)) );
|
||||||
|
|
||||||
act = new QAction(tr("&Hover"), this);
|
act = new QAction(tr("&Hover"), this);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
act->setChecked(false);
|
act->setChecked( patternView[0]->getHoverFocus() );
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
subMenu->addAction(act);
|
subMenu->addAction(act);
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(setHoverFocus(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(setHoverFocus(void)) );
|
||||||
|
@ -467,6 +467,8 @@ ppuPatternView_t::ppuPatternView_t( int patternIndexID, QWidget *parent)
|
||||||
gridColor.setRgb(128,128,128);
|
gridColor.setRgb(128,128,128);
|
||||||
selTile.setX(-1);
|
selTile.setX(-1);
|
||||||
selTile.setY(-1);
|
selTile.setY(-1);
|
||||||
|
|
||||||
|
g_config->getOption("SDL.PPU_TileFocusPolicy", &hover2Focus );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ppuPatternView_t::setPattern( ppuPatternTable_t *p )
|
void ppuPatternView_t::setPattern( ppuPatternTable_t *p )
|
||||||
|
@ -482,6 +484,8 @@ void ppuPatternView_t::setTileLabel( QLabel *l )
|
||||||
void ppuPatternView_t::setHoverFocus( bool h )
|
void ppuPatternView_t::setHoverFocus( bool h )
|
||||||
{
|
{
|
||||||
hover2Focus = h;
|
hover2Focus = h;
|
||||||
|
|
||||||
|
g_config->setOption("SDL.PPU_TileFocusPolicy", hover2Focus );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void ppuPatternView_t::setTileCoord( int x, int y )
|
void ppuPatternView_t::setTileCoord( int x, int y )
|
||||||
|
@ -2589,6 +2593,11 @@ spriteViewerDialog_t::spriteViewerDialog_t(QWidget *parent)
|
||||||
|
|
||||||
spriteViewWindow = this;
|
spriteViewWindow = this;
|
||||||
|
|
||||||
|
oamView = new oamPatternView_t(this);
|
||||||
|
tileView = new oamTileView_t(this);
|
||||||
|
palView = new oamPaletteView_t(this);
|
||||||
|
preView = new oamPreview_t(this);
|
||||||
|
|
||||||
menuBar = new QMenuBar(this);
|
menuBar = new QMenuBar(this);
|
||||||
|
|
||||||
// This is needed for menu bar to show up on MacOS
|
// This is needed for menu bar to show up on MacOS
|
||||||
|
@ -2659,14 +2668,14 @@ spriteViewerDialog_t::spriteViewerDialog_t(QWidget *parent)
|
||||||
|
|
||||||
act = new QAction(tr("&Click"), this);
|
act = new QAction(tr("&Click"), this);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
act->setChecked(true);
|
act->setChecked( !oamView->getHoverFocus() );
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
subMenu->addAction(act);
|
subMenu->addAction(act);
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(setClickFocus(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(setClickFocus(void)) );
|
||||||
|
|
||||||
act = new QAction(tr("&Hover"), this);
|
act = new QAction(tr("&Hover"), this);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
act->setChecked(false);
|
act->setChecked( oamView->getHoverFocus() );
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
subMenu->addAction(act);
|
subMenu->addAction(act);
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(setHoverFocus(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(setHoverFocus(void)) );
|
||||||
|
@ -2695,11 +2704,6 @@ spriteViewerDialog_t::spriteViewerDialog_t(QWidget *parent)
|
||||||
|
|
||||||
setLayout( mainLayout );
|
setLayout( mainLayout );
|
||||||
|
|
||||||
oamView = new oamPatternView_t(this);
|
|
||||||
tileView = new oamTileView_t(this);
|
|
||||||
palView = new oamPaletteView_t(this);
|
|
||||||
preView = new oamPreview_t(this);
|
|
||||||
|
|
||||||
useSprRam = new QRadioButton( tr("Sprite RAM") );
|
useSprRam = new QRadioButton( tr("Sprite RAM") );
|
||||||
useCpuPag = new QRadioButton( tr("CPU Page #") );
|
useCpuPag = new QRadioButton( tr("CPU Page #") );
|
||||||
cpuPagIdx = new QSpinBox(this);
|
cpuPagIdx = new QSpinBox(this);
|
||||||
|
@ -2959,6 +2963,8 @@ oamPatternView_t::oamPatternView_t( QWidget *parent )
|
||||||
selSprite.setX(0);
|
selSprite.setX(0);
|
||||||
selSprite.setY(0);
|
selSprite.setY(0);
|
||||||
spriteIdx = 0;
|
spriteIdx = 0;
|
||||||
|
|
||||||
|
g_config->getOption("SDL.OAM_TileFocusPolicy", &hover2Focus );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
oamPatternView_t::~oamPatternView_t(void)
|
oamPatternView_t::~oamPatternView_t(void)
|
||||||
|
@ -2966,7 +2972,12 @@ oamPatternView_t::~oamPatternView_t(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void oamPatternView_t::setHover2Focus(bool val){ hover2Focus = val; }
|
void oamPatternView_t::setHover2Focus(bool val)
|
||||||
|
{
|
||||||
|
hover2Focus = val;
|
||||||
|
|
||||||
|
g_config->setOption("SDL.OAM_TileFocusPolicy", hover2Focus );
|
||||||
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void oamPatternView_t::setGridVisibility(bool val){ showGrid = val; }
|
void oamPatternView_t::setGridVisibility(bool val){ showGrid = val; }
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
|
|
@ -58,6 +58,7 @@ class ppuPatternView_t : public QWidget
|
||||||
void setHoverFocus( bool h );
|
void setHoverFocus( bool h );
|
||||||
QPoint convPixToTile( QPoint p );
|
QPoint convPixToTile( QPoint p );
|
||||||
|
|
||||||
|
bool getHoverFocus(void){ return hover2Focus; };
|
||||||
bool getDrawTileGrid(void){ return drawTileGrid; };
|
bool getDrawTileGrid(void){ return drawTileGrid; };
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *event);
|
void paintEvent(QPaintEvent *event);
|
||||||
|
@ -328,6 +329,7 @@ class oamPatternView_t : public QWidget
|
||||||
|
|
||||||
int getSpriteIndex(void);
|
int getSpriteIndex(void);
|
||||||
void setHover2Focus(bool val);
|
void setHover2Focus(bool val);
|
||||||
|
bool getHoverFocus(void){ return hover2Focus; };
|
||||||
void setGridVisibility(bool val);
|
void setGridVisibility(bool val);
|
||||||
bool getGridVisibility(void){ return showGrid; };
|
bool getGridVisibility(void){ return showGrid; };
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in New Issue