thisdp / dgs

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

dxbutton iconImage doesn't update #127

Open ERAGON007 opened 1 year ago

ERAGON007 commented 1 year ago
local btn = dgsCreateButton(0.15, 0.2, 0.3, 0.2, "A simple button", true)
dgsSetProperties(
    btn,
    {
        ["iconImage"] = ":ThisResource/Files/SomeImage.png",
    }
)

The first problem is that dgs won't load the image if you simply use relative path to current resources files, e.g ("File/Images/SomeImage.png")

and the second one works but if you change the file server-side and restart that resource, the texture won't get updated

Solution: Maybe we can attach an event handler with onClientResourceStart/Stop when a file get's loaded from that resource and reload the textures loaded from that resource into dgs

thisdp commented 1 year ago

maybe because MTA doesn't clear the cache of that path. That's why i always recommend to use dxCreateTexture