Exemplo n.º 1
0
void Simon::listenUp() {
    Position read = anyButtonOn();
    
    if (read == None) {
        unflash();
        
        successCount++;
        
        if (successCount > successMax) {
                if (successCount == solutionSize) {
                    state = CompleteSuccess;
                    return;
                }
    
            successMax++;
            
            delay(1000);
            state = Showing;
            return;
        }
        
      
        state = ListeningDown;
        return;
    }
    
     if (solution[successCount] != read) { 
         state = Failed;
         return;
     }
}
Exemplo n.º 2
0
/*
 * refresh_screen: Whenever the REFRESH_SCREEN function is activated, this
 * swoops into effect 
 */
void refresh_screen (unsigned char dumb, char *dumber)
{
extern int need_redraw;

#if !defined(WINNT) && !defined(__EMX__)
	term_clear_screen();
	unflash();
#else
	xterm_settitle();
	term_clear_screen();
#endif

#if 0
	for (tmp = screen_list; tmp; tmp = tmp->next)
		tmp->co = TI_cols, tmp->li = TI_lines;
#endif
	if (term_resize())
		recalculate_windows(current_window->screen);
	else
		redraw_all_windows();
	if (need_redraw)
		need_redraw = 0;
	update_all_windows();
	update_input(UPDATE_ALL);
}
Exemplo n.º 3
0
void	redraw_all_screens (void)
{
	Screen *s, *old_os;

	old_os = output_screen;
	for (s = screen_list; s; s = s->next)
	{
		if (!s->alive)
			continue;

		output_screen = s;
		unflash();
		term_clear_screen();
		if (s == main_screen && term_resize())
			recalculate_windows(current_window->screen);
	}

	/* Logically mark all windows as needing a redraw */
	redraw_all_windows();

	/* Physically redraw all windows and status bars */
	update_all_windows();

	/* Physically redraw all input lines */
	update_input(NULL, UPDATE_ALL);

	output_screen = old_os;
	need_redraw = 0;
}
Exemplo n.º 4
0
void	refresh_a_screen (Screen *screen)
{
	unflash();
	term_clear_screen();

	if (screen != main_screen || term_resize())
		recalculate_windows(screen);
	else
		redraw_all_windows();

	if (need_redraw)
		need_redraw = 0;

	update_all_windows();
	update_input(UPDATE_ALL);
}
Exemplo n.º 5
0
JoyAxisWidget::JoyAxisWidget(JoyAxis *axis, bool displayNames, QWidget *parent) :
    FlashButtonWidget(displayNames, parent)
{
    this->axis = axis;

    refreshLabel();

    JoyAxisButton *nAxisButton = axis->getNAxisButton();
    JoyAxisButton *pAxisButton = axis->getPAxisButton();

    connect(axis, SIGNAL(active(int)), this, SLOT(flash()), Qt::QueuedConnection);
    connect(axis, SIGNAL(released(int)), this, SLOT(unflash()), Qt::QueuedConnection);
    connect(axis, SIGNAL(throttleChanged()), this, SLOT(refreshLabel()));
    connect(axis, SIGNAL(axisNameChanged()), this, SLOT(refreshLabel()));
    connect(nAxisButton, SIGNAL(slotsChanged()), this, SLOT(refreshLabel()));
    connect(nAxisButton, SIGNAL(actionNameChanged()), this, SLOT(refreshLabel()));
    connect(pAxisButton, SIGNAL(slotsChanged()), this, SLOT(refreshLabel()));
    connect(pAxisButton, SIGNAL(actionNameChanged()), this, SLOT(refreshLabel()));

    axis->establishPropertyUpdatedConnection();
    nAxisButton->establishPropertyUpdatedConnections();
    pAxisButton->establishPropertyUpdatedConnections();
}
Exemplo n.º 6
0
void JoyAxisWidget::enableFlashes()
{
    connect(axis, SIGNAL(active(int)), this, SLOT(flash()), Qt::QueuedConnection);
    connect(axis, SIGNAL(released(int)), this, SLOT(unflash()), Qt::QueuedConnection);
}
Exemplo n.º 7
0
void DPadPushButton::enableFlashes()
{
    connect(dpad, SIGNAL(active(int)), this, SLOT(flash()), Qt::QueuedConnection);
    connect(dpad, SIGNAL(released(int)), this, SLOT(unflash()), Qt::QueuedConnection);
}