Fixed #1680 (notification shown at wrong place after changing resolution).
This commit is contained in:
parent
5401e7f3b7
commit
bfe7bff877
@ -42,6 +42,7 @@
|
||||
#include "graphics/water.hpp"
|
||||
#include "graphics/wind.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/message_queue.hpp"
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
#include "guiengine/screen.hpp"
|
||||
@ -863,7 +864,7 @@ void IrrDriver::applyResolutionSettings()
|
||||
// No need to reload cached track data (track_manager->cleanAllCachedData
|
||||
// above) - this happens dynamically when the tracks are loaded.
|
||||
GUIEngine::reshowCurrentScreen();
|
||||
|
||||
MessageQueue::updatePosition();
|
||||
} // applyResolutionSettings
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -121,6 +121,16 @@ void createLabel(const Message *message)
|
||||
g_area = irr::core::recti(x, y, x+dim.Width, y+dim.Height);
|
||||
} // createLabel
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Called when the screen resolution is changed to compute the new
|
||||
* position of the message. */
|
||||
void updatePosition()
|
||||
{
|
||||
if (g_all_messages.size() == 0) return;
|
||||
Message *last = g_all_messages.top();
|
||||
createLabel(last);
|
||||
} // updatePosition
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Adds a message to the message queue.
|
||||
* \param mt The MessageType of the message.
|
||||
|
@ -37,6 +37,7 @@ namespace MessageQueue
|
||||
enum MessageType {MT_FRIEND, MT_ACHIEVEMENT};
|
||||
|
||||
void add(MessageType mt, const core::stringw &message);
|
||||
void updatePosition();
|
||||
void update(float dt);
|
||||
|
||||
}; // namespace GUIEngine
|
||||
|
Loading…
x
Reference in New Issue
Block a user