TeamUlysses / ulx

ULX: A powerful administration addon for Garry's Mod
https://ulyssesmod.net
Other
163 stars 73 forks source link

Allow custom hints in XGUI for time parameters #224

Open JoshuaLeivers opened 5 months ago

JoshuaLeivers commented 5 months ago

Currently, if you use a param with time strings allowed, the hint in XGUI will always appear as "Ban Length:". This is fine for the default ULX uses of this, where it's only used by ulx ban and ulx banid, but it doesn't make sense for other uses that aren't involving bans. This PR changes this to use the param's hint if it has one, or "Time:" if it doesn't.

JoshuaLeivers commented 5 months ago

I'm a bit unsure on this way of handling it. While it is a quick fix, it causes a bit of a problem when it comes to text-based vs XGUI interactions with parameter hints. With this, you can either keep parameter hints in the same format they currently are, which looks good for text-based usage, but doesn't look good in XGUI; or you can use a format better suited for XGUI, which looks bad in text-based usages.

What I would like to do is to create a whole new option here called something like xguiHint, where XGUI would use this instead of just hint. This way, you can specify a hint that makes sense for text-based uses, and another for XGUI that looks nice with the amount of space provided and the general formatting of everything else in it. I can do this myself, but I'd like some maintainer input on this before I start working on it - do TeamUlysses think this would be a good idea, have other ideas for this, ..?

JoshuaLeivers commented 5 months ago

With the change I'm proposing here, for ulx ban, you would specify: ..., hint="minutes, 0 for perma", xguiHint="Ban Length:", ... You would then see the latter in XGUI, and the former in error messages, etc.