Ulysses

General => Developers Corner => Topic started by: elfnet_gaming on July 25, 2018, 11:22:12 PM

Title: Custom URL links that can be edited via the ULX admin panel
Post by: elfnet_gaming on July 25, 2018, 11:22:12 PM
Ok so I got this code

Code: [Select]
CATEGORY_NAME = "Our Community"

//Our Website
function ulx.website(ply)
ply:SendLua([[gui.OpenURL("URL your website Here")]])
end
local website = ulx.command( CATEGORY_NAME, "visit website", ulx.website, "!website" )
website:defaultAccess( ULib.ACCESS_ALL )
website:help( "Displays our Website." )

// Youtube Channel
function ulx.youtube(ply)
ply:SendLua([[gui.OpenURL("URL to your Youtube channel here")]])
end
local youtube = ulx.command( CATEGORY_NAME, "visit youtube", ulx.youtube, "!youtube" )
twitter:defaultAccess( ULib.ACCESS_ALL )
twitter:help( "Visit our Youtube Channel." )

What I want to do here is have this where I can change the URL for this button via the admin level panel in ULX. Is that possible?

Thanks guys
Title: Re: Custom URL links that can be edited via the ULX admin panel
Post by: MrPresident on July 25, 2018, 11:44:27 PM
No, I don't think there's a way to add more data fields to the XGUI menu. Stickly can correct me on this if I'm wrong..
Title: Re: Custom URL links that can be edited via the ULX admin panel
Post by: JamminR on July 26, 2018, 08:37:57 PM
I've long since forgotten where, but Stickly has discussed this here somewhere before.
That being said, you MIGHT be able to figure out the way XGUI adds a URL input line by actually looking into the code.
https://github.com/TeamUlysses/ulx/blob/b3815da088ed03b880a29dfd3dae309d1679471d/lua/ulx/xgui/settings/server.lua#L592

There's lots of other code in that file that allows for input also. May wish to compare them (gimps, adverts, etc)