Whenever I close the UI box (e.g. save screen) in SugarCube I'm getting a 1 second pause between clicking close and the dark UI overlay disappearing. I want it to be faster, but can't seem to make it faster. Is there CSS controlling this I'm missing?
SugarCube 1.x dialogs use a hard-coded 200ms delay via the jQuery fadeTo()/fadeOut() methods to control the display state and opacity of the overlay.
SugarCube 2.x dialogs use CSS transitions (see: ui-dialog.css, lines 21–31) to control the visibility and opacity of the overlay.
I checked it again, and what happens is it's in steps. The ui dialog takes its 200ms to disappear, then then overlay takes another step to disappear. I want it to be one flowing thing rather than distinct steps.
If that's hard coded I suppose I can experiment with transitioning to 2.x.
The UI popup goes first, then the black background goes, giving it a noticeable step effect. This happens with the save/load screen as well. I'd like both elements - the dialog and the background to disappear at the same time.
Is that normal?
EDIT: Time linking didn't work. It's at 40 seconds in.
Normal? Assuming you mean, is it normal for the dialog box to simply close while the overlay fades out over 200ms? Yes. That was previously established up thread. If you really want to compare what you're seeing to what's normal, simply compile an empty project with vanilla SugarCube (i.e. sans any format hacking or library inclusions) and compare.
As to how to get both the dialog box and overlay to close, roughly, simultaneously, then answer depends on the version of SugarCube.
SugarCube 1.x: Since, as noted previously, the 200ms overlay fade out is hard-coded, changing it will require hacking the story format.
SugarCube 2.x: Since, as noted previously, the 200ms overlay fade out is controlled by CSS transition (see: ui-dialog.css, lines 21–31), changing it only requires creating a style rule to do so. For example, to disable the transition completely:
But I still get the slowdown even when I load a page that has no background images, nothing - just the UI. Given I haven't touched the UI except added extra time to the fadein, I'm perplexed.
Though I suppose this is as good a reason to upgrade to SugerCube 2 as any.
That was screwing things up. I dunno why, but it was.
I removed that from my CSS and all fixed now, thank you for your responses as always.
Anyway, I'm glad you're back on track.
PS: And now you've got me wanting to play your game (I'm a sucker for the Mythos). :P
Until I upgrade to SugarCube 2 I can put up with the defaults since I think all I'm doing in sugarCube 1 is coding in bugs.
Thanks for the interest in the game!