Jump to content

[SOLVED] How to spawn DialogFile during shutdown?


photo

Recommended Posts

I am building a document editor in UnigineScript. In world shutdown, the user is prompted "Do you want to save changes? yes/no". If the user chooses "yes" and the document has a known filename, it saves to that file, but if the document has not previously been saved, a filename must first be chosen.

 

Unfortunately, it appears that calling 'wait' during shutdown process does not actually wait for the dialog to finish. See attached script:

// this is called by world shutdown() function
int OnSave(){
	Unigine::Widgets::DialogFile dialog=new Unigine::Widgets::DialogFile("Save");
	dialog.arrange();
	Unigine::Widgets::addChild(dialog);
	dialog.setPermanentFocus();
	log.message("TEST 1\n");
	while(dialog.isDone() == 0) wait;
	log.message("TEST 2\n");
}

This function works as expected during normal usage, but does not finish during world shutdown. "TEST 1" is logged but "TEST 2" does not log -- the app closes first.

 

How can I spawn a DialogFile during world shutdown?

Link to comment
×
×
  • Create New...