Closed mysterymagination closed 3 years ago
hmm, curious...
problem re: 1 above was that I misunderstood the mechanism of keyword await -- it essentially just pauses execution until the promise in the expression following it is settled; it does not give any provisions for effectively controlling when that will happen, as .then() provides. Judging by example code, you have to manually have a new Promise with explicit resolve/reject functions within the behavior of the promise you're awaiting on and make sure the outer promise doesn't settle until the inner promise does, e.g. by having another await on the inner promise. Interestingly, you don't actually have to define the resolve/reject functions anyplace -- you can just name them whatever as args in the promise behavior lambda function and then call them as needed therein. I guess default ones that simply set the promise state to fulfilled/rejected and fate to resolved are provided implicitly when the promise is constructed if not given by a then call?
as for point 2 above, I'm still not scrolling to the saved location BUT the Undum scrolling to the basement2_hub situation seems to be working now; I'd guess said situation transition is overriding our manual scroll and that any scrolling is now working because we repaired the await situation in handleCombatResult.
Now where the trype did my victory jingle get to?
hm, I moved the jingle onload def up above the await result switch and it works fine now; not sure why it didn't run when I clicked the image when I had it installed after the await switch... mysterious, but stupid. Pretty sure the issue is that canplaythrough events on audio objects must not be 'sticky' -- if the event fires and there's no one around to hear it, it just gets dropped. Someone coming on by later is not notified that the object already is in a canplaythrough state.
I'm finding myself back up at the top of the transcript whenever I transition back from the combat UI -- behavior should be to scroll to the top of the latest text snoppet written