Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom hints in XGUI for time parameters #224

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JoshuaLeivers
Copy link

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.

Time arguments can be used for things other than ban lengths, but
having it like this would always show the hint in XGUI of
"Ban Length:".
XGUI now sets its hint for time arguments based on the parameter's hint,
rather than a hardcoded "Ban Length:" value.
@JoshuaLeivers
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant