1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 07:53:51 +00:00

MessageBoxmangerTimer is now working properly

This commit is contained in:
Sebastian Wick 2011-06-16 12:12:50 +02:00
parent a4217f8fb8
commit 4d1db13c8f
2 changed files with 8 additions and 10 deletions

View file

@ -11,14 +11,13 @@ MessageBoxManager::MessageBoxManager (WindowManager *windowManager)
void MessageBoxManager::onFrame (float frameDuration) void MessageBoxManager::onFrame (float frameDuration)
{ {
std::vector<MessageBoxManagerTimer*>::const_iterator it; std::vector<MessageBoxManagerTimer>::iterator it;
for(it = mTimers.begin(); it != mTimers.end(); it++) for(it = mTimers.begin(); it != mTimers.end(); it++)
{ {
(*it)->current += frameDuration; it->current += frameDuration;
if((*it)->current >= (*it)->max) if(it->current >= it->max)
{ {
// FIXME: delete the messagebox and erase it from the vector // FIXME: delete the messagebox and erase it from the vector
std::cout << "delete MessageBox" << std::endl;
} }
} }
} }
@ -67,10 +66,10 @@ void MessageBoxManager::createInteractiveMessageBox (const std::string& message,
void MessageBoxManager::removeMessageBox (float time, MessageBox *msgbox) void MessageBoxManager::removeMessageBox (float time, MessageBox *msgbox)
{ {
MessageBoxManagerTimer *timer; MessageBoxManagerTimer timer;
timer->current = 0; timer.current = 0;
timer->max = time; timer.max = time;
timer->messageBox = msgbox; timer.messageBox = msgbox;
mTimers.insert(mTimers.end(), timer); mTimers.insert(mTimers.end(), timer);
} }

View file

@ -3,7 +3,6 @@
#include <openengine/gui/layout.hpp> #include <openengine/gui/layout.hpp>
#include <MyGUI.h> #include <MyGUI.h>
#include <OgreTimer.h>
#include "window_base.hpp" #include "window_base.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"
@ -36,7 +35,7 @@ namespace MWGui
private: private:
std::vector<MessageBox*> mMessageBoxes; std::vector<MessageBox*> mMessageBoxes;
std::vector<MessageBoxManagerTimer*> mTimers; std::vector<MessageBoxManagerTimer> mTimers;
float mMessageBoxSpeed; float mMessageBoxSpeed;
}; };