thisdp / dgs

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

Fix two animation bugs #121

Closed Pieter-Dewachter closed 1 year ago

Pieter-Dewachter commented 1 year ago

I have found two minor issues (as discussed on Discord) in relation to animations / cleanup of DGS elements

  1. When isElement returns false for an element inside the onAnimQueueProcess, the item does not get removed from the animQueuetable but the index is removed from animItem instead. I think this is a typo and can cause an infinite loop because of the second minor bug I have fixed in this pull request (because normally this piece of code should not be reached, DGS should already have cleaned up the animation in the first place).

  2. dgsCleanElement (called by the onClientElementDestroy event) does not work for plugin elements (such as dgs-dxroundrectangle) because the dgsElementType table is used directly to determine the element type, while plugins should actually use the dgsPluginType table instead. I have fixed this by calling the dgsIsType function as that one is able to correctly return the element type for non-plugin and plugin DGS elements.