mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
fix and changes
* win32 compilation fix * add buttons to miniwindow * dispatcher events fixes * ui fixes
This commit is contained in:
@@ -35,7 +35,7 @@ void EventDispatcher::flush()
|
||||
m_scheduledEventList.pop();
|
||||
}
|
||||
|
||||
void EventDispatcher::poll()
|
||||
void EventDispatcher::poll(bool allEvents)
|
||||
{
|
||||
while(!m_scheduledEventList.empty()) {
|
||||
ScheduledEventPtr scheduledEvent = m_scheduledEventList.top();
|
||||
@@ -45,12 +45,16 @@ void EventDispatcher::poll()
|
||||
scheduledEvent->execute();
|
||||
}
|
||||
|
||||
m_pollEventsSize = m_eventList.size();
|
||||
for(int i=0;i<m_pollEventsSize;++i) {
|
||||
EventPtr event = m_eventList.front();
|
||||
m_eventList.pop_front();
|
||||
event->execute();
|
||||
}
|
||||
do {
|
||||
m_pollEventsSize = m_eventList.size();
|
||||
if(m_pollEventsSize == 0)
|
||||
break;
|
||||
for(int i=0;i<m_pollEventsSize;++i) {
|
||||
EventPtr event = m_eventList.front();
|
||||
m_eventList.pop_front();
|
||||
event->execute();
|
||||
}
|
||||
} while(allEvents);
|
||||
}
|
||||
|
||||
ScheduledEventPtr EventDispatcher::scheduleEvent(const SimpleCallback& callback, int delay)
|
||||
|
@@ -73,7 +73,7 @@ class EventDispatcher
|
||||
{
|
||||
public:
|
||||
void flush();
|
||||
void poll();
|
||||
void poll(bool allEvents = false);
|
||||
|
||||
EventPtr addEvent(const SimpleCallback& callback, bool pushFront = false);
|
||||
ScheduledEventPtr scheduleEvent(const SimpleCallback& callback, int delay);
|
||||
|
Reference in New Issue
Block a user