TwinedRope / TwinedRope.github.io

1 stars 0 forks source link

Asynchronize All "setTimeout" Shenanigans #29

Closed JeffreyGaydos closed 1 year ago

JeffreyGaydos commented 2 years ago

It appears that RefreshWindow() is the main culprit to all of our rendering problems. As such knocking out this could lead to other issues disappearing. Now that our tool quite complex, we really need this render to be async so we can (a)wait on it. Everytime we have a 1 ms timeout, we are literally just waiting long enough for the thing to render out

JeffreyGaydos commented 2 years ago

There is something happening between the time SubmitLine() finishes and Select() continues that sets selected to undefined every time you add a line, consistently. This was monkey patched by re-getting the DialogueObject selected through the sequence number attribute found on the selectedElement variable (which remains untouched). This is related to something that causes the "selected" styling to be removed at the same point.

JeffreyGaydos commented 1 year ago

The culprit of this mess was of course the fact that the parsing/display logic for the input tellraw code was coupled heavily to the UI. Making a seperate function that just outputs the HTML (that you can then put anywhere) helps with both performance and other issues. Marking this as resolved and creating a new ticket with a more accurate description of what will be changing