is there a revese function for surface.GetTextureID ?

is there a reverse function for

surface.GetTextureID ?

:v:

kind of this :


local Tpath = surface.GetTexturePath(55)

i have search but there nothing … :confused:

detour the surface.GetTextureID function to store the path somewhere ?

Why do you need it is the real question.

i want to find the path like : “entities/weapon_frag” from a textureID

okay so i’m updating my addon : http://steamcommunity.com/sharedfiles/filedetails/?id=711681729

and this use Customisable weaponery addon

i’m looking for creating automaticly attachments icons, from customizableWeaponry.registeredAttachments
in this table there is the textureID of the attachment,
ids are numbers and for displaing icons in my menu i use “ContentIcons” who not support texture but material (a path)

ContentIcon:SetMaterial

so i try to find a way to change the textureId into a material path

i can do this :


surface.SetTexture(CustomizableWeaponry.registeredAttachments[1].displayIcon) -- id = 55

but i cant do this



local a = vgui.Create( "ContentIcon", Frame )
a:SetName("blabla")
a:SetMaterial(CustomizableWeaponry.registeredAttachments[1].displayIcon) -- error 


maybe you understand me … this time

Why do you need to do that?

[editline]11th September 2016[/editline]

Write a custom Paint function for your ContentIcon?
Do not use ContentIcon?
See if CustomizableWeaponry supports Material()s
If not, ask for the support to be added

Write a custom Paint function for your ContentIcon? : what do you mean ?

Do not use ContentIcon? : what can i use for this ?

See if CustomizableWeaponry supports Material()s : nope …

If not, ask for the support to be added : i probably will