Skip to content
Snippets Groups Projects

Add can_change for console variables

Merged Lactozilla requested to merge cv-can-change into next

What it says on the tin

CV_RegisterVar({
	name = "no_number_november",
	defaultvalue = "abc",
	flags = CV_CALL,
	func = function(cv)
		print("Changed " .. cv.name .. " to " .. cv.string)
	end,
	can_change = function(cv, valstr)
		if valstr:match("%d+") then
			print("Cannot change " .. cv.name .. " to " .. valstr)
			return false
		end
		return true
	end
})

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
Please register or sign in to reply
Loading