mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-17 20:10:21 +03:00
Merge branch 'develop' into feature/vscript/hook-handler-prototype-1
# Conflicts: # sp/src/vscript/vscript_squirrel.nut
This commit is contained in:
@@ -122,6 +122,8 @@ class CSimpleCallChainer
|
||||
chain = null;
|
||||
}
|
||||
|
||||
local developer = (delete developer)()
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Hook handler
|
||||
//---------------------------------------------------------
|
||||
@@ -234,12 +236,22 @@ Hooks <-
|
||||
//---------------------------------------------------------
|
||||
__Documentation <- {}
|
||||
|
||||
local DocumentedFuncs = {}
|
||||
local DocumentedClasses = {}
|
||||
local DocumentedEnums = {}
|
||||
local DocumentedConsts = {}
|
||||
local DocumentedHooks = {}
|
||||
local DocumentedMembers = {}
|
||||
local DocumentedFuncs
|
||||
local DocumentedClasses
|
||||
local DocumentedEnums
|
||||
local DocumentedConsts
|
||||
local DocumentedHooks
|
||||
local DocumentedMembers
|
||||
|
||||
if (developer)
|
||||
{
|
||||
DocumentedFuncs = {}
|
||||
DocumentedClasses = {}
|
||||
DocumentedEnums = {}
|
||||
DocumentedConsts = {}
|
||||
DocumentedHooks = {}
|
||||
DocumentedMembers = {}
|
||||
}
|
||||
|
||||
local function AddAliasedToTable(name, signature, description, table)
|
||||
{
|
||||
@@ -259,6 +271,9 @@ local function AddAliasedToTable(name, signature, description, table)
|
||||
|
||||
function __Documentation::RegisterHelp(name, signature, description)
|
||||
{
|
||||
if ( !developer )
|
||||
return
|
||||
|
||||
if (description.len() && description[0] == '#')
|
||||
{
|
||||
AddAliasedToTable(name, signature, description, DocumentedFuncs)
|
||||
@@ -271,16 +286,25 @@ function __Documentation::RegisterHelp(name, signature, description)
|
||||
|
||||
function __Documentation::RegisterClassHelp(name, baseclass, description)
|
||||
{
|
||||
if ( !developer )
|
||||
return
|
||||
|
||||
DocumentedClasses[name] <- [baseclass, description];
|
||||
}
|
||||
|
||||
function __Documentation::RegisterEnumHelp(name, num_elements, description)
|
||||
{
|
||||
if ( !developer )
|
||||
return
|
||||
|
||||
DocumentedEnums[name] <- [num_elements, description];
|
||||
}
|
||||
|
||||
function __Documentation::RegisterConstHelp(name, signature, description)
|
||||
{
|
||||
if ( !developer )
|
||||
return
|
||||
|
||||
if (description.len() && description[0] == '#')
|
||||
{
|
||||
AddAliasedToTable(name, signature, description, DocumentedConsts)
|
||||
@@ -293,11 +317,17 @@ function __Documentation::RegisterConstHelp(name, signature, description)
|
||||
|
||||
function __Documentation::RegisterHookHelp(name, signature, description)
|
||||
{
|
||||
if ( !developer )
|
||||
return
|
||||
|
||||
DocumentedHooks[name] <- [signature, description];
|
||||
}
|
||||
|
||||
function __Documentation::RegisterMemberHelp(name, signature, description)
|
||||
{
|
||||
if ( !developer )
|
||||
return
|
||||
|
||||
DocumentedMembers[name] <- [signature, description];
|
||||
}
|
||||
|
||||
@@ -427,6 +457,12 @@ local function PrintMatchesInDocList(pattern, list, printfunc)
|
||||
|
||||
function __Documentation::PrintHelp(pattern = "*")
|
||||
{
|
||||
if ( !developer )
|
||||
{
|
||||
printdocl("Documentation is not enabled. To enable documentation, restart the server with the 'developer' cvar set to 1 or higher.");
|
||||
return
|
||||
}
|
||||
|
||||
local patternLower = pattern.tolower();
|
||||
|
||||
// Have a specific order
|
||||
|
||||
Reference in New Issue
Block a user