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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/ulx/modules/cl/xgui_helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function xgui.load_helpers()
local max = restrictions.max or 10 * 60 * 24 * 365 --default slider max 10 years

local outPanel = xlib.makepanel{ h=40, parent=parent }
xlib.makelabel{ x=5, y=3, label="Ban Length:", parent=outPanel }
xlib.makelabel{ x=5, y=3, label=arg.hint or "Time:", parent=outPanel }
outPanel.interval = xlib.makecombobox{ x=90, w=75, parent=outPanel }
outPanel.val = xlib.makeslider{ w=165, y=20, label="<--->", min=min, max=max, value=min, decimal=0, parent=outPanel }

Expand Down
4 changes: 2 additions & 2 deletions lua/ulx/modules/sh/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function ulx.ban( calling_ply, target_ply, minutes, reason )
end
local ban = ulx.command( CATEGORY_NAME, "ulx ban", ulx.ban, "!ban", false, false, true )
ban:addParam{ type=ULib.cmds.PlayerArg }
ban:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
ban:addParam{ type=ULib.cmds.NumArg, hint="Ban Length", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
ban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
ban:defaultAccess( ULib.ACCESS_ADMIN )
ban:help( "Bans target." )
Expand Down Expand Up @@ -142,7 +142,7 @@ function ulx.banid( calling_ply, steamid, minutes, reason )
end
local banid = ulx.command( CATEGORY_NAME, "ulx banid", ulx.banid, "!banid", false, false, true )
banid:addParam{ type=ULib.cmds.StringArg, hint="steamid" }
banid:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
banid:addParam{ type=ULib.cmds.NumArg, hint="Ban Length", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
banid:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
banid:defaultAccess( ULib.ACCESS_SUPERADMIN )
banid:help( "Bans steamid." )
Expand Down