thisdp / dgs

Thisdp's Dx Graphical User Interface System (MTA Dx Lib)
http://wiki.mtasa.com/wiki/dgs
63 stars 34 forks source link

Dgs-exedit sometimes don't display it's content until you click them #118

Closed ERAGON007 closed 1 year ago

thisdp commented 1 year ago

because of the optimization, DGS edit only renders when visual property changes. There may be some condition missing.

ERAGON007 commented 1 year ago

Alright, didn't know about that, feel free to close this issue when you want. or it can be open until conditions are added

xLive commented 1 year ago

How to reproduce this?

ERAGON007 commented 1 year ago

How to reproduce this?

I don't remember rn but you could reproduce it by setting the parent element visible to false first and try to set it to true after creating edit

xLive commented 1 year ago

Just for the record, after a little investigation, I found that the cause of this issue is minimizing the game while the editbox/memo is invisible. When you minimize the game, rendertargets are cleared, but DGS restores them when you restore the game. https://github.com/thisdp/dgs/blob/e1ba5c3df2e5af77c35b5989ac69a667b0c5b271/client.lua#L136-L138 However, since invisible elements do not render, they miss the RTRestoreNeed check, which leads to rendertargets not being restored, causing this issue.

I will investigate more soon when I have some free time, but if someone wants to fix it, feel free to do so

xLive commented 1 year ago

This bug has been resolved in previous commits.