[0.6.1]create 2 messegadialogs freezes game

This subforum contains all the issues which we already resolved.
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

[0.6.1]create 2 messegadialogs freezes game

Post by drs9999 »

if you create 2 messegedialogs (in the same tick?!) you can only close the second one, so you can not return to game.

Step to reproduce:
- copy this into the command line:

Code: Select all

game.showmessagedialog("test") game.showmessagedialog("test2")
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.6.1]create 2 messegadialogs freezes game

Post by kovarex »

Ok, so I'm not only going to fix that bug, but I will extend the game, so in this case, instead of showing the last one, it will show all of the message dialogs.
In other words, new added dialogs will be added to the queue, this might simplify some scripting.
SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [0.6.1]create 2 messegadialogs freezes game

Post by SilverWarior »

kovarex wrote:In other words, new added dialogs will be added to the queue, this might simplify some scripting.
If you are goind to use this approach make sure that last added dialog is always shown.
Why? This is why Modal dialogs work in windows. The last one shown is always topmost. So modders would be acoustomed with the way how dialogs works.

Another aproach would be so that each dialog maintains its own code for closing. This will alow you to have as many dialogs as wanted, and you could close them in any oder you would want. Coulkd come quite hand for making modul based UI where you can be opening/closing seperate windows so you get customizable UI.
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.6.1]create 2 messegadialogs freezes game

Post by kovarex »

The last is always shown, because every dialog is always shown.

Code: Select all

game.showmessagedialog("test") game.showmessagedialog("test2")
This code will result in message dialog with "test", and when you press tab to continue, you will get another message dialog with "test2"
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: [0.6.1]create 2 messegadialogs freezes game

Post by drs9999 »

Thats sounds great, thanks for that.
Post Reply

Return to “Resolved Problems and Bugs”