예제 #1
0
void VlcWidgetSeekProgress::mouseReleaseEvent(QMouseEvent *event)
{
    event->ignore();

    updateEvent(event->pos());

    unlock();
}
예제 #2
0
void VlcWidgetSeekProgress::mouseMoveEvent(QMouseEvent *event)
{
    event->ignore();

    if (!_lock)
        return;

    updateEvent(event->pos());
}
예제 #3
0
void PanelObjectEvent::on_radioButtonEventUser_toggled(bool checked) {
    ui->comboBoxEventsUser->setEnabled(checked);
    m_event->setIsSystem(false);
    QStandardItemModel *model = RPM::get()->project()->gameDatas()
        ->commonEventsDatas()->modelEventsUser();
    SystemEvent *super = reinterpret_cast<SystemEvent *>(model->item(ui
        ->comboBoxEventsUser->currentIndex())->data().value<quintptr>());
    updateEvent(super);
    updateParameters(super);
}
예제 #4
0
void PanelObjectEvent::on_comboBoxEventsUserCurrentIndexChanged(int index) {
    QStandardItemModel *model = RPM::get()->project()->gameDatas()
        ->commonEventsDatas()->modelEventsUser();
    SystemEvent *super = reinterpret_cast<SystemEvent *>(model->item(index)
        ->data().value<quintptr>());
    if (!m_event->isSystem()) {
        updateEvent(super);
        updateParameters(super);
    }
}
예제 #5
0
void MainWindow::makeConnections() {
    connect(&storage, SIGNAL(eventAdded(CalendarEvent)),
            calendar, SLOT(addEvent(CalendarEvent)));
    connect(&storage, SIGNAL(eventRemoved(CalendarEvent)),
            calendar, SLOT(removeEvent(CalendarEvent)));

    connect(calendar, SIGNAL(eventRemoved(CalendarEvent)),
            &storage, SLOT(removeEvent(CalendarEvent)));
    connect(calendar, SIGNAL(eventUpdated(CalendarEvent,CalendarEvent)),
            &storage, SLOT(updateEvent(CalendarEvent,CalendarEvent)));
}
예제 #6
0
//!***************************************************************
//! @details:
//! updates the cursor location
//!
//! @param[in]: x
//! cursor x position
//!
//! @param[in]: y
//! cursor y position
//!
//! @return: 
//! void
//! 
//!***************************************************************
void ScreenScroller::updateLocation(int x, int y)
{
	m_cursorX = x;
	m_cursorY = y;

	// test whether we shoul be scrolling
	evaluateLocation();

	if (m_shouldScroll && !m_eventRegistered)
	{
		// register ourself as an event handler to make
		// sure we can capture if our window looses focus
		// so we don't keep scrolling in that case
		m_timeManager->registerEvent(this);
		m_eventManager->addSdlEventListener(this);
		m_eventRegistered = true;

		// call our internal updater here to kick it off
		updateEvent(-1);
	}
}
예제 #7
0
void ResourceManager::loop()
{
    iMustStopLoop = false;
    
    while( !iMustStopLoop )
    {
        _updateElapsedTime();
        
        UpdateEvent updateEvent(this, iElapsedTime);
        
        // The 'ResourceManager::loop()' function only updates the 'logical' objects. Renderers are updated
        // using the 'Renderer::launch()' function. To draw a RenderTarget, use 'Renderer::registerTarget()' to
        // enable it to drawing.
        
        // This loop only updates every Windows, and every RenderSceneManager.
        
        // First, we update every Windows objects.
        WindowHolderList whlist = iWindowManager->getWindows();
        
        if(whlist.empty() && iCloseBehaviour == CloseBehaviour::AllWindowClosed)
        {
            iMustStopLoop = true;
        }
        
        else
        {
            if( !whlist.empty() )
            {
                for(auto wholder : whlist)
                {
                    if(wholder)
                    {
                        if(wholder->hasBeenClosed())
                        {
                            // Window has been closed, we can destroy it.
                            iWindowManager->remove(wholder->getName());
                        }
                        
                        else
                        {
                            // For now , we have to lock the mutex here to be sure any operations are made
                            // within a valid mutex.
                            
                            wholder->lockGuard();
                            
                            wholder->onEvent(updateEvent);
                            
                            wholder->unlockGuard();
                            
                            iPerWindowBehaviours.call();
                        }
                    }
                }
            }
            
            iLoopBehaviours.call();
        }
        
        // Update also the RenderScene's objects.
        RenderSceneHolderList smhlist = iRenderSceneManager->getAll();
        
        if( !smhlist.empty() )
        {
            for(auto smholder : smhlist)
            {
                if( smholder )
                {
                    smholder->onEvent(updateEvent);
                }
            }
        }
        
        // Finally we send update event to every Listeners.
        sendEvent(updateEvent);
    }
}
예제 #8
0
void aiEvents::eventCausedByBuff(int stages)
{
	aiDebuff* debuff = (personA)->debuff;
	int max = (personA)->debuff->ILL;
	int buffLabel = 0;

	//check which debuff dominates the next person
	if (debuff->SLEEPY > max)
	{
		max = debuff->SLEEPY;
		buffLabel = 1;
	}
	if (debuff->HUNGRY > max)
	{
		max = debuff->HUNGRY;
		buffLabel = 2;
	}
	if (debuff->TIRED > max)
	{
		max = debuff->TIRED;
		buffLabel = 3;
	}
	if (debuff->OVERWORKED > max)
	{
		max = debuff->OVERWORKED;
		buffLabel = 4;
	}
	if (debuff->BEHINDSCHEDULE > max)
	{
		max = debuff->BEHINDSCHEDULE;
		buffLabel = 5;
	}

	if (max > 70)
	{
		if (buffLabel = 0) //ILL
		{
			if (rand() % 5 == 0)
			{
				(personA)->dailyEvents[stages]->eventType = RESTING;
				updateEvent(stages, personA);
			}
		}
		else if (buffLabel = 1)  //SLEEPY
		{
			if (rand() % 5 == 0)
			{
				(personA)->dailyEvents[stages]->eventType = EATING;
				updateEvent(stages, personA);
			}
		}
		else if (buffLabel = 2)  //HUNGRY
		{
			if (rand() % 5 == 0)        //20% possibility to change its objective
			{
				(personA)->dailyEvents[stages]->eventType = RESTING;
				updateEvent(stages, personA);
			}
		}
		else if (buffLabel = 3) //TIRED
		{
			if (rand() % 5 == 0)
			{
				(personA)->dailyEvents[stages]->eventType = RESTING;
				updateEvent(stages, personA);
			}
			else if (rand() % 5 == 1)  
			{ 
				(personA)->dailyEvents[stages]->eventType = EATING;
				updateEvent(stages, personA);
			}
		}
		else if (buffLabel = 4) //OVERWORKED
		{
			if (rand() % 5 == 0)
			{
				(personA)->dailyEvents[stages]->eventType = RESTING;
				updateEvent(stages, personA);
			}
			else if (rand() % 5 == 1)  
			{ 
				(personA)->dailyEvents[stages]->eventType = EATING;
				updateEvent(stages, personA);
			}
		}
		else if (buffLabel = 5)  //BEHINDSCHEDULE
		{
			if (rand() % 5 == 0)
			{
				(personA)->dailyEvents[stages]->eventType = WORKING;
				updateEvent(stages, personA);
			}
		}
	}
}
예제 #9
0
void BaseModel::customEvent( QEvent* e )
{
    if ( e->type() == UpdateEvent::Type )
        updateEvent( static_cast<UpdateEvent*>( e ) );
}
예제 #10
0
파일: swtrack.cpp 프로젝트: krafczyk/AMS
SWTrack::SWTrack(AMSEventR *event, int tid) 
  : SubWindow(event, SW_TRACK, WIN_W, WIN_H, TBAR_H), tID(tid)
{
  updateEvent(event);
}
예제 #11
0
파일: swladder.cpp 프로젝트: krafczyk/AMS
SWLadder::SWLadder(AMSEventR *event, int tkid) 
  : SubWindow(event, SW_LADDER, WIN_W, WIN_H, TBAR_H), tkID(tkid)
{
  updateEvent(event);
}