I have an issue with queuing events. Here's a short description of the situation. When a user presses a button, the game processes a bunch of different stuff. Some of that stuff may be in-game events. And, there's a game event that causes a window to pop up, with a listbox and a confirmation button (let's call it selection window).
I have an event receiver class, and everything is fine. The selection window has functionality. The problem is, if the in-game event triggering its appearance happens twice in a row, I get two of these windows. What I want to do is to delay the appearance of further windows until the current one has been dealt with by making a choice in it. How would I go about doing it? I have a segment like:
Code: Select all
public void ProcessMessageQueue()
{
foreach (GameGUIMessage msg in GUIMessageQueue)
{
if (msg == null) break;
ProcessMessage(msg);
}
GUIMessageQueue.Clear();
}