Open
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
191 changes: 173 additions & 18 deletions VPKs/shared_content_v7_0/scripts/vscripts/sqdbg_definitions.nut
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,88 @@

local format = format;
local tmp = { name = null }

foreach ( key, val in this )
{
if ( typeof val == "class" )
{
sqdbg_define_class( val, { name = key } );
tmp.name = key;
sqdbg_define_class( val, tmp );
}
}

local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local SetNetPropString = function( key, val ) { return ::NetProps.SetPropString( this, key, val ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local SetNetPropVector = function( key, val ) { return ::NetProps.SetPropVector( this, key, val ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local SetNetPropEntity = function( key, val ) { return ::NetProps.SetPropEntity( this, key, val ); }

local CArrayAccessor = class
{
// Implementation note:
// Native array elements are going to be listed as custom members of this accessor class.
// Indicate to the debugger that this class is going to have non-string
// members by having existing member names to be escaped
// so that custom number members are evaluated as numbers.
["members\0"] = null;
count = 0;
type = "";
ent = null;
key = null;
iget = null;
iset = null;

constructor ( ent, key, type, count = 0 )
{
this.ent = ent;
this.key = key;
this.type = type;
local maxcount = ::NetProps.GetPropArraySize( ent, key );
if ( count < maxcount )
count = maxcount;
this.count = count;
iget = format("GetProp%sArray", type);
iset = format("SetProp%sArray", type);
local arr = this["members\0"] = ::array( count );
foreach ( i, v in arr )
arr[i] = { name = i, get = get, set = set };
}

get = function( i ) { return ::NetProps[iget]( ent, key, i ); }
set = function( i, v ) { return ::NetProps[iset]( ent, key, v, i ); }
}

CArrayAccessor._get <- CArrayAccessor.get;
CArrayAccessor._set <- CArrayAccessor.set;

sqdbg_define_class( CArrayAccessor,
{
name = "CArrayAccessor",
value = function() { return format("%s[%d]", type, count); },
custommembers = function() { return this["members\0"]; },
} );

local GetNetPropEntityArray = function( key ) { return CArrayAccessor( this, key, "Entity" ); }

if ( SERVER_DLL )
{
local baseentity_custommembers =
[
{ name = "m_vecOrigin", get = GetNetPropVector, set = SetNetPropVector },
// To be able to add data breakpoints on Vector or array elements,
// define indices as members
/*
{
name = "m_vecOrigin[2]",
get = function() { return ::NetProps.GetPropFloatArray( this, "m_vecOrigin", 2 ); },
set = function( val ) { return ::NetProps.SetPropFloatArray( this, "m_vecOrigin", val, 2 ); }
},
*/
{ name = "m_angRotation", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_vecAbsOrigin", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_angAbsRotation", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -66,7 +126,10 @@ if ( SERVER_DLL )
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_flRadius", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSurroundingMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
Expand All@@ -76,6 +139,7 @@ if ( SERVER_DLL )
local baseanimating_custommembers = (clone baseentity_custommembers).extend(
[
{ name = "m_flGroundSpeed", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flLastEventCheck", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_nSequence", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceFinished", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceLoops", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -86,15 +150,19 @@ if ( SERVER_DLL )
{ name = "m_flCycle", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hLightingOrigin", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLightingOriginRelative", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_flFadeScale", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatcharacter_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_flNextAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flFieldOfView", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_LastHitGroup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flDamageAccumulator", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_CurrentWeaponProficiency", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hActiveWeapon", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_bPreventWeaponPickup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hMyWeapons", get = GetNetPropEntityArray },
]);

local player_custommembers = (clone basecombatcharacter_custommembers).extend(
Expand All@@ -109,7 +177,6 @@ if ( SERVER_DLL )
{ name = "m_afButtonForced", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flStepSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flSwimSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_surfaceFriction", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_iFOV", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iFOVStart", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flFOVTime", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -163,6 +230,7 @@ if ( SERVER_DLL )
},
{ name = "m_hPostProcessCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hColorCorrectionCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLocatorTargetEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "pl.v_angle", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_iHideHUD", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_flFOVRate", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -218,6 +286,14 @@ if ( SERVER_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -252,6 +328,14 @@ if ( SERVER_DLL )
{ name = "m_LowerWeaponTimer.m_next", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatweapon_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_iViewModelIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "LocalActiveWeaponData.m_flNextPrimaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flNextSecondaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flTimeWeaponIdle", get = GetNetPropFloat, set = SetNetPropFloat },
]);

sqdbg_define_class( CBaseEntity,
{
value = CBaseEntity.tostring,
Expand All@@ -273,6 +357,11 @@ if ( SERVER_DLL )
custommembers = player_custommembers
} );

sqdbg_define_class( CBaseCombatWeapon,
{
custommembers = basecombatweapon_custommembers
} );

sqdbg_define_class( IPhysicsObject,
{
value = IPhysicsObject.GetName,
Expand DownExpand Up@@ -352,7 +441,7 @@ else if ( CLIENT_DLL )
{ name = "m_iTextureFrameIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderMode", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderFX", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = C_BaseEntity.GetEffects, set = C_BaseEntity.SetEffects },
{ name = "m_fFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iEFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_clrRender", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -365,7 +454,7 @@ else if ( CLIENT_DLL )
{ name = "m_flShadowCastDistance", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hOwnerEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hEffectEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hMoveParent", get = GetNetPropEntity },
{ name = "m_hMoveParent", get = C_BaseEntity.GetMoveParent },
{ name = "m_hNetworkMoveParent", get = GetNetPropEntity },
{ name = "m_iParentAttachment", get = GetNetPropInt },
{ name = "m_MoveType", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -378,7 +467,7 @@ else if ( CLIENT_DLL )
{ name = "m_Collision.m_vecMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
//{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -472,6 +561,14 @@ else if ( CLIENT_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -518,14 +615,20 @@ else if ( CLIENT_DLL )
{
value = function()
{
return ::format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
return format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
}
} );
}

sqdbg_define_class( Vector,
{
value = Vector.ToKVString,
value = function()
{
local FLT_MAX = 3.40282347e+38;
if ( x == FLT_MAX && y == FLT_MAX && z == FLT_MAX )
return "vec3_invalid";
return ToKVString();
},
metamembers = [ "x", "y", "z" ]
} );

Expand All@@ -536,8 +639,8 @@ sqdbg_define_class( CGameTrace,
{
local ent = Entity();
if ( ent )
return ::format( "%f, %s", Fraction(), ""+ent );
return ::format( "%f", Fraction() );
return format( "%f, %s", Fraction(), ""+ent );
return format( "%f", Fraction() );
},
custommembers =
[
Expand All@@ -552,9 +655,56 @@ sqdbg_define_class( CGameTrace,
]
} );

sqdbg_define_class( CTakeDamageInfo,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_vecDamageForce", get = CTakeDamageInfo.GetDamageForce, set = CTakeDamageInfo.SetDamageForce },
{ name = "m_vecDamagePosition", get = CTakeDamageInfo.GetDamagePosition, set = CTakeDamageInfo.SetDamagePosition },
{ name = "m_vecReportedPosition", get = CTakeDamageInfo.GetReportedPosition, set = CTakeDamageInfo.SetReportedPosition },
{ name = "m_hInflictor", get = CTakeDamageInfo.GetInflictor, set = CTakeDamageInfo.SetInflictor },
{ name = "m_hAttacker", get = CTakeDamageInfo.GetAttacker, set = CTakeDamageInfo.SetAttacker },
{ name = "m_hWeapon", get = CTakeDamageInfo.GetWeapon, set = CTakeDamageInfo.SetWeapon },
{ name = "m_flDamage", get = CTakeDamageInfo.GetDamage, set = CTakeDamageInfo.SetDamage },
{ name = "m_flMaxDamage", get = CTakeDamageInfo.GetMaxDamage, set = CTakeDamageInfo.SetMaxDamage },
{ name = "m_flBaseDamage", get = CTakeDamageInfo.GetBaseDamage, set = SetNetPropFloat },
{ name = "m_flDamageBonus", get = CTakeDamageInfo.GetDamageBonus, set = CTakeDamageInfo.SetDamageBonus },
{ name = "m_bitsDamageType", get = CTakeDamageInfo.GetDamageType, set = CTakeDamageInfo.SetDamageType },
{ name = "m_iDamageCustom", get = CTakeDamageInfo.GetDamageCustom, set = CTakeDamageInfo.SetDamageCustom },
{ name = "m_iDamageStats", get = CTakeDamageInfo.GetDamageStats, set = CTakeDamageInfo.SetDamageStats },
{ name = "m_iAmmoType", get = CTakeDamageInfo.GetAmmoType, set = CTakeDamageInfo.SetAmmoType },
{ name = "m_iDamagedOtherPlayers", get = CTakeDamageInfo.GetDamagedOtherPlayers, set = CTakeDamageInfo.SetDamagedOtherPlayers },
{ name = "m_iPlayerPenetrationCount", get = CTakeDamageInfo.GetPlayerPenetrationCount, set = CTakeDamageInfo.SetPlayerPenetrationCount },
{ name = "m_bForceFriendlyFire", get = CTakeDamageInfo.IsForceFriendlyFire, set = CTakeDamageInfo.SetForceFriendlyFire },
]
} );

sqdbg_define_class( FireBulletsInfo_t,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_iShots", get = FireBulletsInfo_t.GetShots, set = FireBulletsInfo_t.SetShots },
{ name = "m_vecSrc", get = FireBulletsInfo_t.GetSource, set = FireBulletsInfo_t.SetSource },
{ name = "m_vecDirShooting", get = FireBulletsInfo_t.GetDirShooting, set = FireBulletsInfo_t.SetDirShooting },
{ name = "m_vecSpread", get = FireBulletsInfo_t.GetSpread, set = FireBulletsInfo_t.SetSpread },
{ name = "m_flDistance", get = FireBulletsInfo_t.GetDistance, set = FireBulletsInfo_t.SetDistance },
{ name = "m_iAmmoType", get = FireBulletsInfo_t.GetAmmoType, set = FireBulletsInfo_t.SetAmmoType },
{ name = "m_iTracerFreq", get = FireBulletsInfo_t.GetTracerFreq, set = FireBulletsInfo_t.SetTracerFreq },
{ name = "m_flDamage", get = FireBulletsInfo_t.GetDamage, set = FireBulletsInfo_t.SetDamage },
{ name = "m_iPlayerDamage", get = FireBulletsInfo_t.GetPlayerDamage, set = FireBulletsInfo_t.SetPlayerDamage },
{ name = "m_nFlags", get = FireBulletsInfo_t.GetFlags, set = FireBulletsInfo_t.SetFlags },
{ name = "m_flDamageForceScale", get = FireBulletsInfo_t.GetDamageForceScale, set = FireBulletsInfo_t.SetDamageForceScale },
{ name = "m_pAttacker", get = FireBulletsInfo_t.GetAttacker, set = FireBulletsInfo_t.SetAttacker },
{ name = "m_pAdditionalIgnoreEnt", get = FireBulletsInfo_t.GetAdditionalIgnoreEnt, set = FireBulletsInfo_t.SetAdditionalIgnoreEnt },
{ name = "m_bPrimaryAttack", get = FireBulletsInfo_t.GetPrimaryAttack, set = FireBulletsInfo_t.SetPrimaryAttack },
]
} );

sqdbg_define_class( cplane_t,
{
value = function() { return ::format( "[%s], %f", normal.ToKVString(), dist ); },
value = function() { return format( "[%s] %f", normal.ToKVString(), dist ); },
metamembers = [ "normal", "dist" ]
} );

Expand DownExpand Up@@ -598,9 +748,14 @@ sqdbg_define_class( EmitSound_t,
{ name = "m_flVolume", get = EmitSound_t.GetVolume, set = EmitSound_t.SetVolume },
{ name = "m_SoundLevel", get = EmitSound_t.GetSoundLevel, set = EmitSound_t.SetSoundLevel },
{ name = "m_nFlags", get = EmitSound_t.GetFlags, set = EmitSound_t.SetFlags },
{ name = "m_nPitch", get = EmitSound_t.GetPitch, set = EmitSound_t.SetPitch },
{ name = "m_nSpecialDSP", get = EmitSound_t.GetSpecialDSP, set = EmitSound_t.SetSpecialDSP },
{ name = "m_flSoundTime", get = EmitSound_t.GetSoundTime, set = EmitSound_t.SetSoundTime },
{ name = "m_pOrigin", get = EmitSound_t.GetOrigin, set = EmitSound_t.SetOrigin },
{
name = "m_pOrigin",
get = function() { if ( HasOrigin() ) return GetOrigin(); },
set = EmitSound_t.SetOrigin
},
]
} );

Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Open
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
191 changes: 173 additions & 18 deletions VPKs/shared_content_v7_0/scripts/vscripts/sqdbg_definitions.nut
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,88 @@

local format = format;
local tmp = { name = null }

foreach ( key, val in this )
{
if ( typeof val == "class" )
{
sqdbg_define_class( val, { name = key } );
tmp.name = key;
sqdbg_define_class( val, tmp );
}
}

local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local SetNetPropString = function( key, val ) { return ::NetProps.SetPropString( this, key, val ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local SetNetPropVector = function( key, val ) { return ::NetProps.SetPropVector( this, key, val ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local SetNetPropEntity = function( key, val ) { return ::NetProps.SetPropEntity( this, key, val ); }

local CArrayAccessor = class
{
// Implementation note:
// Native array elements are going to be listed as custom members of this accessor class.
// Indicate to the debugger that this class is going to have non-string
// members by having existing member names to be escaped
// so that custom number members are evaluated as numbers.
["members\0"] = null;
count = 0;
type = "";
ent = null;
key = null;
iget = null;
iset = null;

constructor ( ent, key, type, count = 0 )
{
this.ent = ent;
this.key = key;
this.type = type;
local maxcount = ::NetProps.GetPropArraySize( ent, key );
if ( count < maxcount )
count = maxcount;
this.count = count;
iget = format("GetProp%sArray", type);
iset = format("SetProp%sArray", type);
local arr = this["members\0"] = ::array( count );
foreach ( i, v in arr )
arr[i] = { name = i, get = get, set = set };
}

get = function( i ) { return ::NetProps[iget]( ent, key, i ); }
set = function( i, v ) { return ::NetProps[iset]( ent, key, v, i ); }
}

CArrayAccessor._get <- CArrayAccessor.get;
CArrayAccessor._set <- CArrayAccessor.set;

sqdbg_define_class( CArrayAccessor,
{
name = "CArrayAccessor",
value = function() { return format("%s[%d]", type, count); },
custommembers = function() { return this["members\0"]; },
} );

local GetNetPropEntityArray = function( key ) { return CArrayAccessor( this, key, "Entity" ); }

if ( SERVER_DLL )
{
local baseentity_custommembers =
[
{ name = "m_vecOrigin", get = GetNetPropVector, set = SetNetPropVector },
// To be able to add data breakpoints on Vector or array elements,
// define indices as members
/*
{
name = "m_vecOrigin[2]",
get = function() { return ::NetProps.GetPropFloatArray( this, "m_vecOrigin", 2 ); },
set = function( val ) { return ::NetProps.SetPropFloatArray( this, "m_vecOrigin", val, 2 ); }
},
*/
{ name = "m_angRotation", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_vecAbsOrigin", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_angAbsRotation", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -66,7 +126,10 @@ if ( SERVER_DLL )
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_flRadius", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSurroundingMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
Expand All@@ -76,6 +139,7 @@ if ( SERVER_DLL )
local baseanimating_custommembers = (clone baseentity_custommembers).extend(
[
{ name = "m_flGroundSpeed", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flLastEventCheck", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_nSequence", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceFinished", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceLoops", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -86,15 +150,19 @@ if ( SERVER_DLL )
{ name = "m_flCycle", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hLightingOrigin", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLightingOriginRelative", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_flFadeScale", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatcharacter_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_flNextAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flFieldOfView", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_LastHitGroup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flDamageAccumulator", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_CurrentWeaponProficiency", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hActiveWeapon", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_bPreventWeaponPickup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hMyWeapons", get = GetNetPropEntityArray },
]);

local player_custommembers = (clone basecombatcharacter_custommembers).extend(
Expand All@@ -109,7 +177,6 @@ if ( SERVER_DLL )
{ name = "m_afButtonForced", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flStepSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flSwimSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_surfaceFriction", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_iFOV", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iFOVStart", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flFOVTime", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -163,6 +230,7 @@ if ( SERVER_DLL )
},
{ name = "m_hPostProcessCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hColorCorrectionCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLocatorTargetEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "pl.v_angle", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_iHideHUD", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_flFOVRate", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -218,6 +286,14 @@ if ( SERVER_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -252,6 +328,14 @@ if ( SERVER_DLL )
{ name = "m_LowerWeaponTimer.m_next", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatweapon_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_iViewModelIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "LocalActiveWeaponData.m_flNextPrimaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flNextSecondaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flTimeWeaponIdle", get = GetNetPropFloat, set = SetNetPropFloat },
]);

sqdbg_define_class( CBaseEntity,
{
value = CBaseEntity.tostring,
Expand All@@ -273,6 +357,11 @@ if ( SERVER_DLL )
custommembers = player_custommembers
} );

sqdbg_define_class( CBaseCombatWeapon,
{
custommembers = basecombatweapon_custommembers
} );

sqdbg_define_class( IPhysicsObject,
{
value = IPhysicsObject.GetName,
Expand DownExpand Up@@ -352,7 +441,7 @@ else if ( CLIENT_DLL )
{ name = "m_iTextureFrameIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderMode", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderFX", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = C_BaseEntity.GetEffects, set = C_BaseEntity.SetEffects },
{ name = "m_fFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iEFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_clrRender", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -365,7 +454,7 @@ else if ( CLIENT_DLL )
{ name = "m_flShadowCastDistance", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hOwnerEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hEffectEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hMoveParent", get = GetNetPropEntity },
{ name = "m_hMoveParent", get = C_BaseEntity.GetMoveParent },
{ name = "m_hNetworkMoveParent", get = GetNetPropEntity },
{ name = "m_iParentAttachment", get = GetNetPropInt },
{ name = "m_MoveType", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -378,7 +467,7 @@ else if ( CLIENT_DLL )
{ name = "m_Collision.m_vecMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
//{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -472,6 +561,14 @@ else if ( CLIENT_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -518,14 +615,20 @@ else if ( CLIENT_DLL )
{
value = function()
{
return ::format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
return format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
}
} );
}

sqdbg_define_class( Vector,
{
value = Vector.ToKVString,
value = function()
{
local FLT_MAX = 3.40282347e+38;
if ( x == FLT_MAX && y == FLT_MAX && z == FLT_MAX )
return "vec3_invalid";
return ToKVString();
},
metamembers = [ "x", "y", "z" ]
} );

Expand All@@ -536,8 +639,8 @@ sqdbg_define_class( CGameTrace,
{
local ent = Entity();
if ( ent )
return ::format( "%f, %s", Fraction(), ""+ent );
return ::format( "%f", Fraction() );
return format( "%f, %s", Fraction(), ""+ent );
return format( "%f", Fraction() );
},
custommembers =
[
Expand All@@ -552,9 +655,56 @@ sqdbg_define_class( CGameTrace,
]
} );

sqdbg_define_class( CTakeDamageInfo,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_vecDamageForce", get = CTakeDamageInfo.GetDamageForce, set = CTakeDamageInfo.SetDamageForce },
{ name = "m_vecDamagePosition", get = CTakeDamageInfo.GetDamagePosition, set = CTakeDamageInfo.SetDamagePosition },
{ name = "m_vecReportedPosition", get = CTakeDamageInfo.GetReportedPosition, set = CTakeDamageInfo.SetReportedPosition },
{ name = "m_hInflictor", get = CTakeDamageInfo.GetInflictor, set = CTakeDamageInfo.SetInflictor },
{ name = "m_hAttacker", get = CTakeDamageInfo.GetAttacker, set = CTakeDamageInfo.SetAttacker },
{ name = "m_hWeapon", get = CTakeDamageInfo.GetWeapon, set = CTakeDamageInfo.SetWeapon },
{ name = "m_flDamage", get = CTakeDamageInfo.GetDamage, set = CTakeDamageInfo.SetDamage },
{ name = "m_flMaxDamage", get = CTakeDamageInfo.GetMaxDamage, set = CTakeDamageInfo.SetMaxDamage },
{ name = "m_flBaseDamage", get = CTakeDamageInfo.GetBaseDamage, set = SetNetPropFloat },
{ name = "m_flDamageBonus", get = CTakeDamageInfo.GetDamageBonus, set = CTakeDamageInfo.SetDamageBonus },
{ name = "m_bitsDamageType", get = CTakeDamageInfo.GetDamageType, set = CTakeDamageInfo.SetDamageType },
{ name = "m_iDamageCustom", get = CTakeDamageInfo.GetDamageCustom, set = CTakeDamageInfo.SetDamageCustom },
{ name = "m_iDamageStats", get = CTakeDamageInfo.GetDamageStats, set = CTakeDamageInfo.SetDamageStats },
{ name = "m_iAmmoType", get = CTakeDamageInfo.GetAmmoType, set = CTakeDamageInfo.SetAmmoType },
{ name = "m_iDamagedOtherPlayers", get = CTakeDamageInfo.GetDamagedOtherPlayers, set = CTakeDamageInfo.SetDamagedOtherPlayers },
{ name = "m_iPlayerPenetrationCount", get = CTakeDamageInfo.GetPlayerPenetrationCount, set = CTakeDamageInfo.SetPlayerPenetrationCount },
{ name = "m_bForceFriendlyFire", get = CTakeDamageInfo.IsForceFriendlyFire, set = CTakeDamageInfo.SetForceFriendlyFire },
]
} );

sqdbg_define_class( FireBulletsInfo_t,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_iShots", get = FireBulletsInfo_t.GetShots, set = FireBulletsInfo_t.SetShots },
{ name = "m_vecSrc", get = FireBulletsInfo_t.GetSource, set = FireBulletsInfo_t.SetSource },
{ name = "m_vecDirShooting", get = FireBulletsInfo_t.GetDirShooting, set = FireBulletsInfo_t.SetDirShooting },
{ name = "m_vecSpread", get = FireBulletsInfo_t.GetSpread, set = FireBulletsInfo_t.SetSpread },
{ name = "m_flDistance", get = FireBulletsInfo_t.GetDistance, set = FireBulletsInfo_t.SetDistance },
{ name = "m_iAmmoType", get = FireBulletsInfo_t.GetAmmoType, set = FireBulletsInfo_t.SetAmmoType },
{ name = "m_iTracerFreq", get = FireBulletsInfo_t.GetTracerFreq, set = FireBulletsInfo_t.SetTracerFreq },
{ name = "m_flDamage", get = FireBulletsInfo_t.GetDamage, set = FireBulletsInfo_t.SetDamage },
{ name = "m_iPlayerDamage", get = FireBulletsInfo_t.GetPlayerDamage, set = FireBulletsInfo_t.SetPlayerDamage },
{ name = "m_nFlags", get = FireBulletsInfo_t.GetFlags, set = FireBulletsInfo_t.SetFlags },
{ name = "m_flDamageForceScale", get = FireBulletsInfo_t.GetDamageForceScale, set = FireBulletsInfo_t.SetDamageForceScale },
{ name = "m_pAttacker", get = FireBulletsInfo_t.GetAttacker, set = FireBulletsInfo_t.SetAttacker },
{ name = "m_pAdditionalIgnoreEnt", get = FireBulletsInfo_t.GetAdditionalIgnoreEnt, set = FireBulletsInfo_t.SetAdditionalIgnoreEnt },
{ name = "m_bPrimaryAttack", get = FireBulletsInfo_t.GetPrimaryAttack, set = FireBulletsInfo_t.SetPrimaryAttack },
]
} );

sqdbg_define_class( cplane_t,
{
value = function() { return ::format( "[%s], %f", normal.ToKVString(), dist ); },
value = function() { return format( "[%s] %f", normal.ToKVString(), dist ); },
metamembers = [ "normal", "dist" ]
} );

Expand DownExpand Up@@ -598,9 +748,14 @@ sqdbg_define_class( EmitSound_t,
{ name = "m_flVolume", get = EmitSound_t.GetVolume, set = EmitSound_t.SetVolume },
{ name = "m_SoundLevel", get = EmitSound_t.GetSoundLevel, set = EmitSound_t.SetSoundLevel },
{ name = "m_nFlags", get = EmitSound_t.GetFlags, set = EmitSound_t.SetFlags },
{ name = "m_nPitch", get = EmitSound_t.GetPitch, set = EmitSound_t.SetPitch },
{ name = "m_nSpecialDSP", get = EmitSound_t.GetSpecialDSP, set = EmitSound_t.SetSpecialDSP },
{ name = "m_flSoundTime", get = EmitSound_t.GetSoundTime, set = EmitSound_t.SetSoundTime },
{ name = "m_pOrigin", get = EmitSound_t.GetOrigin, set = EmitSound_t.SetOrigin },
{
name = "m_pOrigin",
get = function() { if ( HasOrigin() ) return GetOrigin(); },
set = EmitSound_t.SetOrigin
},
]
} );

Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
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
191 changes: 173 additions & 18 deletions VPKs/shared_content_v7_0/scripts/vscripts/sqdbg_definitions.nut
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,88 @@

local format = format;
local tmp = { name = null }

foreach ( key, val in this )
{
if ( typeof val == "class" )
{
sqdbg_define_class( val, { name = key } );
tmp.name = key;
sqdbg_define_class( val, tmp );
}
}

local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local SetNetPropString = function( key, val ) { return ::NetProps.SetPropString( this, key, val ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local SetNetPropVector = function( key, val ) { return ::NetProps.SetPropVector( this, key, val ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local SetNetPropEntity = function( key, val ) { return ::NetProps.SetPropEntity( this, key, val ); }

local CArrayAccessor = class
{
// Implementation note:
// Native array elements are going to be listed as custom members of this accessor class.
// Indicate to the debugger that this class is going to have non-string
// members by having existing member names to be escaped
// so that custom number members are evaluated as numbers.
["members\0"] = null;
count = 0;
type = "";
ent = null;
key = null;
iget = null;
iset = null;

constructor ( ent, key, type, count = 0 )
{
this.ent = ent;
this.key = key;
this.type = type;
local maxcount = ::NetProps.GetPropArraySize( ent, key );
if ( count < maxcount )
count = maxcount;
this.count = count;
iget = format("GetProp%sArray", type);
iset = format("SetProp%sArray", type);
local arr = this["members\0"] = ::array( count );
foreach ( i, v in arr )
arr[i] = { name = i, get = get, set = set };
}

get = function( i ) { return ::NetProps[iget]( ent, key, i ); }
set = function( i, v ) { return ::NetProps[iset]( ent, key, v, i ); }
}

CArrayAccessor._get <- CArrayAccessor.get;
CArrayAccessor._set <- CArrayAccessor.set;

sqdbg_define_class( CArrayAccessor,
{
name = "CArrayAccessor",
value = function() { return format("%s[%d]", type, count); },
custommembers = function() { return this["members\0"]; },
} );

local GetNetPropEntityArray = function( key ) { return CArrayAccessor( this, key, "Entity" ); }

if ( SERVER_DLL )
{
local baseentity_custommembers =
[
{ name = "m_vecOrigin", get = GetNetPropVector, set = SetNetPropVector },
// To be able to add data breakpoints on Vector or array elements,
// define indices as members
/*
{
name = "m_vecOrigin[2]",
get = function() { return ::NetProps.GetPropFloatArray( this, "m_vecOrigin", 2 ); },
set = function( val ) { return ::NetProps.SetPropFloatArray( this, "m_vecOrigin", val, 2 ); }
},
*/
{ name = "m_angRotation", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_vecAbsOrigin", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_angAbsRotation", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -66,7 +126,10 @@ if ( SERVER_DLL )
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_flRadius", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSurroundingMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
Expand All@@ -76,6 +139,7 @@ if ( SERVER_DLL )
local baseanimating_custommembers = (clone baseentity_custommembers).extend(
[
{ name = "m_flGroundSpeed", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flLastEventCheck", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_nSequence", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceFinished", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceLoops", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -86,15 +150,19 @@ if ( SERVER_DLL )
{ name = "m_flCycle", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hLightingOrigin", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLightingOriginRelative", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_flFadeScale", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatcharacter_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_flNextAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flFieldOfView", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_LastHitGroup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flDamageAccumulator", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_CurrentWeaponProficiency", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hActiveWeapon", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_bPreventWeaponPickup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hMyWeapons", get = GetNetPropEntityArray },
]);

local player_custommembers = (clone basecombatcharacter_custommembers).extend(
Expand All@@ -109,7 +177,6 @@ if ( SERVER_DLL )
{ name = "m_afButtonForced", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flStepSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flSwimSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_surfaceFriction", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_iFOV", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iFOVStart", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flFOVTime", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -163,6 +230,7 @@ if ( SERVER_DLL )
},
{ name = "m_hPostProcessCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hColorCorrectionCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLocatorTargetEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "pl.v_angle", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_iHideHUD", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_flFOVRate", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -218,6 +286,14 @@ if ( SERVER_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -252,6 +328,14 @@ if ( SERVER_DLL )
{ name = "m_LowerWeaponTimer.m_next", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatweapon_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_iViewModelIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "LocalActiveWeaponData.m_flNextPrimaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flNextSecondaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flTimeWeaponIdle", get = GetNetPropFloat, set = SetNetPropFloat },
]);

sqdbg_define_class( CBaseEntity,
{
value = CBaseEntity.tostring,
Expand All@@ -273,6 +357,11 @@ if ( SERVER_DLL )
custommembers = player_custommembers
} );

sqdbg_define_class( CBaseCombatWeapon,
{
custommembers = basecombatweapon_custommembers
} );

sqdbg_define_class( IPhysicsObject,
{
value = IPhysicsObject.GetName,
Expand DownExpand Up@@ -352,7 +441,7 @@ else if ( CLIENT_DLL )
{ name = "m_iTextureFrameIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderMode", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderFX", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = C_BaseEntity.GetEffects, set = C_BaseEntity.SetEffects },
{ name = "m_fFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iEFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_clrRender", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -365,7 +454,7 @@ else if ( CLIENT_DLL )
{ name = "m_flShadowCastDistance", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hOwnerEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hEffectEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hMoveParent", get = GetNetPropEntity },
{ name = "m_hMoveParent", get = C_BaseEntity.GetMoveParent },
{ name = "m_hNetworkMoveParent", get = GetNetPropEntity },
{ name = "m_iParentAttachment", get = GetNetPropInt },
{ name = "m_MoveType", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -378,7 +467,7 @@ else if ( CLIENT_DLL )
{ name = "m_Collision.m_vecMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
//{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -472,6 +561,14 @@ else if ( CLIENT_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -518,14 +615,20 @@ else if ( CLIENT_DLL )
{
value = function()
{
return ::format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
return format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
}
} );
}

sqdbg_define_class( Vector,
{
value = Vector.ToKVString,
value = function()
{
local FLT_MAX = 3.40282347e+38;
if ( x == FLT_MAX && y == FLT_MAX && z == FLT_MAX )
return "vec3_invalid";
return ToKVString();
},
metamembers = [ "x", "y", "z" ]
} );

Expand All@@ -536,8 +639,8 @@ sqdbg_define_class( CGameTrace,
{
local ent = Entity();
if ( ent )
return ::format( "%f, %s", Fraction(), ""+ent );
return ::format( "%f", Fraction() );
return format( "%f, %s", Fraction(), ""+ent );
return format( "%f", Fraction() );
},
custommembers =
[
Expand All@@ -552,9 +655,56 @@ sqdbg_define_class( CGameTrace,
]
} );

sqdbg_define_class( CTakeDamageInfo,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_vecDamageForce", get = CTakeDamageInfo.GetDamageForce, set = CTakeDamageInfo.SetDamageForce },
{ name = "m_vecDamagePosition", get = CTakeDamageInfo.GetDamagePosition, set = CTakeDamageInfo.SetDamagePosition },
{ name = "m_vecReportedPosition", get = CTakeDamageInfo.GetReportedPosition, set = CTakeDamageInfo.SetReportedPosition },
{ name = "m_hInflictor", get = CTakeDamageInfo.GetInflictor, set = CTakeDamageInfo.SetInflictor },
{ name = "m_hAttacker", get = CTakeDamageInfo.GetAttacker, set = CTakeDamageInfo.SetAttacker },
{ name = "m_hWeapon", get = CTakeDamageInfo.GetWeapon, set = CTakeDamageInfo.SetWeapon },
{ name = "m_flDamage", get = CTakeDamageInfo.GetDamage, set = CTakeDamageInfo.SetDamage },
{ name = "m_flMaxDamage", get = CTakeDamageInfo.GetMaxDamage, set = CTakeDamageInfo.SetMaxDamage },
{ name = "m_flBaseDamage", get = CTakeDamageInfo.GetBaseDamage, set = SetNetPropFloat },
{ name = "m_flDamageBonus", get = CTakeDamageInfo.GetDamageBonus, set = CTakeDamageInfo.SetDamageBonus },
{ name = "m_bitsDamageType", get = CTakeDamageInfo.GetDamageType, set = CTakeDamageInfo.SetDamageType },
{ name = "m_iDamageCustom", get = CTakeDamageInfo.GetDamageCustom, set = CTakeDamageInfo.SetDamageCustom },
{ name = "m_iDamageStats", get = CTakeDamageInfo.GetDamageStats, set = CTakeDamageInfo.SetDamageStats },
{ name = "m_iAmmoType", get = CTakeDamageInfo.GetAmmoType, set = CTakeDamageInfo.SetAmmoType },
{ name = "m_iDamagedOtherPlayers", get = CTakeDamageInfo.GetDamagedOtherPlayers, set = CTakeDamageInfo.SetDamagedOtherPlayers },
{ name = "m_iPlayerPenetrationCount", get = CTakeDamageInfo.GetPlayerPenetrationCount, set = CTakeDamageInfo.SetPlayerPenetrationCount },
{ name = "m_bForceFriendlyFire", get = CTakeDamageInfo.IsForceFriendlyFire, set = CTakeDamageInfo.SetForceFriendlyFire },
]
} );

sqdbg_define_class( FireBulletsInfo_t,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_iShots", get = FireBulletsInfo_t.GetShots, set = FireBulletsInfo_t.SetShots },
{ name = "m_vecSrc", get = FireBulletsInfo_t.GetSource, set = FireBulletsInfo_t.SetSource },
{ name = "m_vecDirShooting", get = FireBulletsInfo_t.GetDirShooting, set = FireBulletsInfo_t.SetDirShooting },
{ name = "m_vecSpread", get = FireBulletsInfo_t.GetSpread, set = FireBulletsInfo_t.SetSpread },
{ name = "m_flDistance", get = FireBulletsInfo_t.GetDistance, set = FireBulletsInfo_t.SetDistance },
{ name = "m_iAmmoType", get = FireBulletsInfo_t.GetAmmoType, set = FireBulletsInfo_t.SetAmmoType },
{ name = "m_iTracerFreq", get = FireBulletsInfo_t.GetTracerFreq, set = FireBulletsInfo_t.SetTracerFreq },
{ name = "m_flDamage", get = FireBulletsInfo_t.GetDamage, set = FireBulletsInfo_t.SetDamage },
{ name = "m_iPlayerDamage", get = FireBulletsInfo_t.GetPlayerDamage, set = FireBulletsInfo_t.SetPlayerDamage },
{ name = "m_nFlags", get = FireBulletsInfo_t.GetFlags, set = FireBulletsInfo_t.SetFlags },
{ name = "m_flDamageForceScale", get = FireBulletsInfo_t.GetDamageForceScale, set = FireBulletsInfo_t.SetDamageForceScale },
{ name = "m_pAttacker", get = FireBulletsInfo_t.GetAttacker, set = FireBulletsInfo_t.SetAttacker },
{ name = "m_pAdditionalIgnoreEnt", get = FireBulletsInfo_t.GetAdditionalIgnoreEnt, set = FireBulletsInfo_t.SetAdditionalIgnoreEnt },
{ name = "m_bPrimaryAttack", get = FireBulletsInfo_t.GetPrimaryAttack, set = FireBulletsInfo_t.SetPrimaryAttack },
]
} );

sqdbg_define_class( cplane_t,
{
value = function() { return ::format( "[%s], %f", normal.ToKVString(), dist ); },
value = function() { return format( "[%s] %f", normal.ToKVString(), dist ); },
metamembers = [ "normal", "dist" ]
} );

Expand DownExpand Up@@ -598,9 +748,14 @@ sqdbg_define_class( EmitSound_t,
{ name = "m_flVolume", get = EmitSound_t.GetVolume, set = EmitSound_t.SetVolume },
{ name = "m_SoundLevel", get = EmitSound_t.GetSoundLevel, set = EmitSound_t.SetSoundLevel },
{ name = "m_nFlags", get = EmitSound_t.GetFlags, set = EmitSound_t.SetFlags },
{ name = "m_nPitch", get = EmitSound_t.GetPitch, set = EmitSound_t.SetPitch },
{ name = "m_nSpecialDSP", get = EmitSound_t.GetSpecialDSP, set = EmitSound_t.SetSpecialDSP },
{ name = "m_flSoundTime", get = EmitSound_t.GetSoundTime, set = EmitSound_t.SetSoundTime },
{ name = "m_pOrigin", get = EmitSound_t.GetOrigin, set = EmitSound_t.SetOrigin },
{
name = "m_pOrigin",
get = function() { if ( HasOrigin() ) return GetOrigin(); },
set = EmitSound_t.SetOrigin
},
]
} );

Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
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
191 changes: 173 additions & 18 deletions VPKs/shared_content_v7_0/scripts/vscripts/sqdbg_definitions.nut
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,88 @@

local format = format;
local tmp = { name = null }

foreach ( key, val in this )
{
if ( typeof val == "class" )
{
sqdbg_define_class( val, { name = key } );
tmp.name = key;
sqdbg_define_class( val, tmp );
}
}

local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local SetNetPropString = function( key, val ) { return ::NetProps.SetPropString( this, key, val ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local SetNetPropVector = function( key, val ) { return ::NetProps.SetPropVector( this, key, val ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local SetNetPropEntity = function( key, val ) { return ::NetProps.SetPropEntity( this, key, val ); }

local CArrayAccessor = class
{
// Implementation note:
// Native array elements are going to be listed as custom members of this accessor class.
// Indicate to the debugger that this class is going to have non-string
// members by having existing member names to be escaped
// so that custom number members are evaluated as numbers.
["members\0"] = null;
count = 0;
type = "";
ent = null;
key = null;
iget = null;
iset = null;

constructor ( ent, key, type, count = 0 )
{
this.ent = ent;
this.key = key;
this.type = type;
local maxcount = ::NetProps.GetPropArraySize( ent, key );
if ( count < maxcount )
count = maxcount;
this.count = count;
iget = format("GetProp%sArray", type);
iset = format("SetProp%sArray", type);
local arr = this["members\0"] = ::array( count );
foreach ( i, v in arr )
arr[i] = { name = i, get = get, set = set };
}

get = function( i ) { return ::NetProps[iget]( ent, key, i ); }
set = function( i, v ) { return ::NetProps[iset]( ent, key, v, i ); }
}

CArrayAccessor._get <- CArrayAccessor.get;
CArrayAccessor._set <- CArrayAccessor.set;

sqdbg_define_class( CArrayAccessor,
{
name = "CArrayAccessor",
value = function() { return format("%s[%d]", type, count); },
custommembers = function() { return this["members\0"]; },
} );

local GetNetPropEntityArray = function( key ) { return CArrayAccessor( this, key, "Entity" ); }

if ( SERVER_DLL )
{
local baseentity_custommembers =
[
{ name = "m_vecOrigin", get = GetNetPropVector, set = SetNetPropVector },
// To be able to add data breakpoints on Vector or array elements,
// define indices as members
/*
{
name = "m_vecOrigin[2]",
get = function() { return ::NetProps.GetPropFloatArray( this, "m_vecOrigin", 2 ); },
set = function( val ) { return ::NetProps.SetPropFloatArray( this, "m_vecOrigin", val, 2 ); }
},
*/
{ name = "m_angRotation", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_vecAbsOrigin", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_angAbsRotation", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -66,7 +126,10 @@ if ( SERVER_DLL )
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_flRadius", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSurroundingMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
Expand All@@ -76,6 +139,7 @@ if ( SERVER_DLL )
local baseanimating_custommembers = (clone baseentity_custommembers).extend(
[
{ name = "m_flGroundSpeed", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flLastEventCheck", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_nSequence", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceFinished", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceLoops", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -86,15 +150,19 @@ if ( SERVER_DLL )
{ name = "m_flCycle", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hLightingOrigin", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLightingOriginRelative", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_flFadeScale", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatcharacter_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_flNextAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flFieldOfView", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_LastHitGroup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flDamageAccumulator", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_CurrentWeaponProficiency", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hActiveWeapon", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_bPreventWeaponPickup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hMyWeapons", get = GetNetPropEntityArray },
]);

local player_custommembers = (clone basecombatcharacter_custommembers).extend(
Expand All@@ -109,7 +177,6 @@ if ( SERVER_DLL )
{ name = "m_afButtonForced", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flStepSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flSwimSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_surfaceFriction", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_iFOV", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iFOVStart", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flFOVTime", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -163,6 +230,7 @@ if ( SERVER_DLL )
},
{ name = "m_hPostProcessCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hColorCorrectionCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLocatorTargetEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "pl.v_angle", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_iHideHUD", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_flFOVRate", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -218,6 +286,14 @@ if ( SERVER_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -252,6 +328,14 @@ if ( SERVER_DLL )
{ name = "m_LowerWeaponTimer.m_next", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatweapon_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_iViewModelIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "LocalActiveWeaponData.m_flNextPrimaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flNextSecondaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flTimeWeaponIdle", get = GetNetPropFloat, set = SetNetPropFloat },
]);

sqdbg_define_class( CBaseEntity,
{
value = CBaseEntity.tostring,
Expand All@@ -273,6 +357,11 @@ if ( SERVER_DLL )
custommembers = player_custommembers
} );

sqdbg_define_class( CBaseCombatWeapon,
{
custommembers = basecombatweapon_custommembers
} );

sqdbg_define_class( IPhysicsObject,
{
value = IPhysicsObject.GetName,
Expand DownExpand Up@@ -352,7 +441,7 @@ else if ( CLIENT_DLL )
{ name = "m_iTextureFrameIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderMode", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderFX", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = C_BaseEntity.GetEffects, set = C_BaseEntity.SetEffects },
{ name = "m_fFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iEFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_clrRender", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -365,7 +454,7 @@ else if ( CLIENT_DLL )
{ name = "m_flShadowCastDistance", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hOwnerEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hEffectEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hMoveParent", get = GetNetPropEntity },
{ name = "m_hMoveParent", get = C_BaseEntity.GetMoveParent },
{ name = "m_hNetworkMoveParent", get = GetNetPropEntity },
{ name = "m_iParentAttachment", get = GetNetPropInt },
{ name = "m_MoveType", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -378,7 +467,7 @@ else if ( CLIENT_DLL )
{ name = "m_Collision.m_vecMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
//{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -472,6 +561,14 @@ else if ( CLIENT_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -518,14 +615,20 @@ else if ( CLIENT_DLL )
{
value = function()
{
return ::format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
return format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
}
} );
}

sqdbg_define_class( Vector,
{
value = Vector.ToKVString,
value = function()
{
local FLT_MAX = 3.40282347e+38;
if ( x == FLT_MAX && y == FLT_MAX && z == FLT_MAX )
return "vec3_invalid";
return ToKVString();
},
metamembers = [ "x", "y", "z" ]
} );

Expand All@@ -536,8 +639,8 @@ sqdbg_define_class( CGameTrace,
{
local ent = Entity();
if ( ent )
return ::format( "%f, %s", Fraction(), ""+ent );
return ::format( "%f", Fraction() );
return format( "%f, %s", Fraction(), ""+ent );
return format( "%f", Fraction() );
},
custommembers =
[
Expand All@@ -552,9 +655,56 @@ sqdbg_define_class( CGameTrace,
]
} );

sqdbg_define_class( CTakeDamageInfo,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_vecDamageForce", get = CTakeDamageInfo.GetDamageForce, set = CTakeDamageInfo.SetDamageForce },
{ name = "m_vecDamagePosition", get = CTakeDamageInfo.GetDamagePosition, set = CTakeDamageInfo.SetDamagePosition },
{ name = "m_vecReportedPosition", get = CTakeDamageInfo.GetReportedPosition, set = CTakeDamageInfo.SetReportedPosition },
{ name = "m_hInflictor", get = CTakeDamageInfo.GetInflictor, set = CTakeDamageInfo.SetInflictor },
{ name = "m_hAttacker", get = CTakeDamageInfo.GetAttacker, set = CTakeDamageInfo.SetAttacker },
{ name = "m_hWeapon", get = CTakeDamageInfo.GetWeapon, set = CTakeDamageInfo.SetWeapon },
{ name = "m_flDamage", get = CTakeDamageInfo.GetDamage, set = CTakeDamageInfo.SetDamage },
{ name = "m_flMaxDamage", get = CTakeDamageInfo.GetMaxDamage, set = CTakeDamageInfo.SetMaxDamage },
{ name = "m_flBaseDamage", get = CTakeDamageInfo.GetBaseDamage, set = SetNetPropFloat },
{ name = "m_flDamageBonus", get = CTakeDamageInfo.GetDamageBonus, set = CTakeDamageInfo.SetDamageBonus },
{ name = "m_bitsDamageType", get = CTakeDamageInfo.GetDamageType, set = CTakeDamageInfo.SetDamageType },
{ name = "m_iDamageCustom", get = CTakeDamageInfo.GetDamageCustom, set = CTakeDamageInfo.SetDamageCustom },
{ name = "m_iDamageStats", get = CTakeDamageInfo.GetDamageStats, set = CTakeDamageInfo.SetDamageStats },
{ name = "m_iAmmoType", get = CTakeDamageInfo.GetAmmoType, set = CTakeDamageInfo.SetAmmoType },
{ name = "m_iDamagedOtherPlayers", get = CTakeDamageInfo.GetDamagedOtherPlayers, set = CTakeDamageInfo.SetDamagedOtherPlayers },
{ name = "m_iPlayerPenetrationCount", get = CTakeDamageInfo.GetPlayerPenetrationCount, set = CTakeDamageInfo.SetPlayerPenetrationCount },
{ name = "m_bForceFriendlyFire", get = CTakeDamageInfo.IsForceFriendlyFire, set = CTakeDamageInfo.SetForceFriendlyFire },
]
} );

sqdbg_define_class( FireBulletsInfo_t,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_iShots", get = FireBulletsInfo_t.GetShots, set = FireBulletsInfo_t.SetShots },
{ name = "m_vecSrc", get = FireBulletsInfo_t.GetSource, set = FireBulletsInfo_t.SetSource },
{ name = "m_vecDirShooting", get = FireBulletsInfo_t.GetDirShooting, set = FireBulletsInfo_t.SetDirShooting },
{ name = "m_vecSpread", get = FireBulletsInfo_t.GetSpread, set = FireBulletsInfo_t.SetSpread },
{ name = "m_flDistance", get = FireBulletsInfo_t.GetDistance, set = FireBulletsInfo_t.SetDistance },
{ name = "m_iAmmoType", get = FireBulletsInfo_t.GetAmmoType, set = FireBulletsInfo_t.SetAmmoType },
{ name = "m_iTracerFreq", get = FireBulletsInfo_t.GetTracerFreq, set = FireBulletsInfo_t.SetTracerFreq },
{ name = "m_flDamage", get = FireBulletsInfo_t.GetDamage, set = FireBulletsInfo_t.SetDamage },
{ name = "m_iPlayerDamage", get = FireBulletsInfo_t.GetPlayerDamage, set = FireBulletsInfo_t.SetPlayerDamage },
{ name = "m_nFlags", get = FireBulletsInfo_t.GetFlags, set = FireBulletsInfo_t.SetFlags },
{ name = "m_flDamageForceScale", get = FireBulletsInfo_t.GetDamageForceScale, set = FireBulletsInfo_t.SetDamageForceScale },
{ name = "m_pAttacker", get = FireBulletsInfo_t.GetAttacker, set = FireBulletsInfo_t.SetAttacker },
{ name = "m_pAdditionalIgnoreEnt", get = FireBulletsInfo_t.GetAdditionalIgnoreEnt, set = FireBulletsInfo_t.SetAdditionalIgnoreEnt },
{ name = "m_bPrimaryAttack", get = FireBulletsInfo_t.GetPrimaryAttack, set = FireBulletsInfo_t.SetPrimaryAttack },
]
} );

sqdbg_define_class( cplane_t,
{
value = function() { return ::format( "[%s], %f", normal.ToKVString(), dist ); },
value = function() { return format( "[%s] %f", normal.ToKVString(), dist ); },
metamembers = [ "normal", "dist" ]
} );

Expand DownExpand Up@@ -598,9 +748,14 @@ sqdbg_define_class( EmitSound_t,
{ name = "m_flVolume", get = EmitSound_t.GetVolume, set = EmitSound_t.SetVolume },
{ name = "m_SoundLevel", get = EmitSound_t.GetSoundLevel, set = EmitSound_t.SetSoundLevel },
{ name = "m_nFlags", get = EmitSound_t.GetFlags, set = EmitSound_t.SetFlags },
{ name = "m_nPitch", get = EmitSound_t.GetPitch, set = EmitSound_t.SetPitch },
{ name = "m_nSpecialDSP", get = EmitSound_t.GetSpecialDSP, set = EmitSound_t.SetSpecialDSP },
{ name = "m_flSoundTime", get = EmitSound_t.GetSoundTime, set = EmitSound_t.SetSoundTime },
{ name = "m_pOrigin", get = EmitSound_t.GetOrigin, set = EmitSound_t.SetOrigin },
{
name = "m_pOrigin",
get = function() { if ( HasOrigin() ) return GetOrigin(); },
set = EmitSound_t.SetOrigin
},
]
} );

Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Open
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
191 changes: 173 additions & 18 deletions VPKs/shared_content_v7_0/scripts/vscripts/sqdbg_definitions.nut
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,88 @@

local format = format;
local tmp = { name = null }

foreach ( key, val in this )
{
if ( typeof val == "class" )
{
sqdbg_define_class( val, { name = key } );
tmp.name = key;
sqdbg_define_class( val, tmp );
}
}

local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local SetNetPropString = function( key, val ) { return ::NetProps.SetPropString( this, key, val ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local SetNetPropVector = function( key, val ) { return ::NetProps.SetPropVector( this, key, val ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local SetNetPropEntity = function( key, val ) { return ::NetProps.SetPropEntity( this, key, val ); }

local CArrayAccessor = class
{
// Implementation note:
// Native array elements are going to be listed as custom members of this accessor class.
// Indicate to the debugger that this class is going to have non-string
// members by having existing member names to be escaped
// so that custom number members are evaluated as numbers.
["members\0"] = null;
count = 0;
type = "";
ent = null;
key = null;
iget = null;
iset = null;

constructor ( ent, key, type, count = 0 )
{
this.ent = ent;
this.key = key;
this.type = type;
local maxcount = ::NetProps.GetPropArraySize( ent, key );
if ( count < maxcount )
count = maxcount;
this.count = count;
iget = format("GetProp%sArray", type);
iset = format("SetProp%sArray", type);
local arr = this["members\0"] = ::array( count );
foreach ( i, v in arr )
arr[i] = { name = i, get = get, set = set };
}

get = function( i ) { return ::NetProps[iget]( ent, key, i ); }
set = function( i, v ) { return ::NetProps[iset]( ent, key, v, i ); }
}

CArrayAccessor._get <- CArrayAccessor.get;
CArrayAccessor._set <- CArrayAccessor.set;

sqdbg_define_class( CArrayAccessor,
{
name = "CArrayAccessor",
value = function() { return format("%s[%d]", type, count); },
custommembers = function() { return this["members\0"]; },
} );

local GetNetPropEntityArray = function( key ) { return CArrayAccessor( this, key, "Entity" ); }

if ( SERVER_DLL )
{
local baseentity_custommembers =
[
{ name = "m_vecOrigin", get = GetNetPropVector, set = SetNetPropVector },
// To be able to add data breakpoints on Vector or array elements,
// define indices as members
/*
{
name = "m_vecOrigin[2]",
get = function() { return ::NetProps.GetPropFloatArray( this, "m_vecOrigin", 2 ); },
set = function( val ) { return ::NetProps.SetPropFloatArray( this, "m_vecOrigin", val, 2 ); }
},
*/
{ name = "m_angRotation", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_vecAbsOrigin", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_angAbsRotation", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -66,7 +126,10 @@ if ( SERVER_DLL )
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_flRadius", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSurroundingMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
Expand All@@ -76,6 +139,7 @@ if ( SERVER_DLL )
local baseanimating_custommembers = (clone baseentity_custommembers).extend(
[
{ name = "m_flGroundSpeed", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flLastEventCheck", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_nSequence", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceFinished", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceLoops", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -86,15 +150,19 @@ if ( SERVER_DLL )
{ name = "m_flCycle", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hLightingOrigin", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLightingOriginRelative", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_flFadeScale", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatcharacter_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_flNextAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flFieldOfView", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_LastHitGroup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flDamageAccumulator", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_CurrentWeaponProficiency", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hActiveWeapon", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_bPreventWeaponPickup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hMyWeapons", get = GetNetPropEntityArray },
]);

local player_custommembers = (clone basecombatcharacter_custommembers).extend(
Expand All@@ -109,7 +177,6 @@ if ( SERVER_DLL )
{ name = "m_afButtonForced", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flStepSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flSwimSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_surfaceFriction", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_iFOV", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iFOVStart", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flFOVTime", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -163,6 +230,7 @@ if ( SERVER_DLL )
},
{ name = "m_hPostProcessCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hColorCorrectionCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLocatorTargetEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "pl.v_angle", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_iHideHUD", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_flFOVRate", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -218,6 +286,14 @@ if ( SERVER_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -252,6 +328,14 @@ if ( SERVER_DLL )
{ name = "m_LowerWeaponTimer.m_next", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatweapon_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_iViewModelIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "LocalActiveWeaponData.m_flNextPrimaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flNextSecondaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flTimeWeaponIdle", get = GetNetPropFloat, set = SetNetPropFloat },
]);

sqdbg_define_class( CBaseEntity,
{
value = CBaseEntity.tostring,
Expand All@@ -273,6 +357,11 @@ if ( SERVER_DLL )
custommembers = player_custommembers
} );

sqdbg_define_class( CBaseCombatWeapon,
{
custommembers = basecombatweapon_custommembers
} );

sqdbg_define_class( IPhysicsObject,
{
value = IPhysicsObject.GetName,
Expand DownExpand Up@@ -352,7 +441,7 @@ else if ( CLIENT_DLL )
{ name = "m_iTextureFrameIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderMode", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderFX", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = C_BaseEntity.GetEffects, set = C_BaseEntity.SetEffects },
{ name = "m_fFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iEFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_clrRender", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -365,7 +454,7 @@ else if ( CLIENT_DLL )
{ name = "m_flShadowCastDistance", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hOwnerEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hEffectEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hMoveParent", get = GetNetPropEntity },
{ name = "m_hMoveParent", get = C_BaseEntity.GetMoveParent },
{ name = "m_hNetworkMoveParent", get = GetNetPropEntity },
{ name = "m_iParentAttachment", get = GetNetPropInt },
{ name = "m_MoveType", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -378,7 +467,7 @@ else if ( CLIENT_DLL )
{ name = "m_Collision.m_vecMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
//{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -472,6 +561,14 @@ else if ( CLIENT_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -518,14 +615,20 @@ else if ( CLIENT_DLL )
{
value = function()
{
return ::format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
return format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
}
} );
}

sqdbg_define_class( Vector,
{
value = Vector.ToKVString,
value = function()
{
local FLT_MAX = 3.40282347e+38;
if ( x == FLT_MAX && y == FLT_MAX && z == FLT_MAX )
return "vec3_invalid";
return ToKVString();
},
metamembers = [ "x", "y", "z" ]
} );

Expand All@@ -536,8 +639,8 @@ sqdbg_define_class( CGameTrace,
{
local ent = Entity();
if ( ent )
return ::format( "%f, %s", Fraction(), ""+ent );
return ::format( "%f", Fraction() );
return format( "%f, %s", Fraction(), ""+ent );
return format( "%f", Fraction() );
},
custommembers =
[
Expand All@@ -552,9 +655,56 @@ sqdbg_define_class( CGameTrace,
]
} );

sqdbg_define_class( CTakeDamageInfo,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_vecDamageForce", get = CTakeDamageInfo.GetDamageForce, set = CTakeDamageInfo.SetDamageForce },
{ name = "m_vecDamagePosition", get = CTakeDamageInfo.GetDamagePosition, set = CTakeDamageInfo.SetDamagePosition },
{ name = "m_vecReportedPosition", get = CTakeDamageInfo.GetReportedPosition, set = CTakeDamageInfo.SetReportedPosition },
{ name = "m_hInflictor", get = CTakeDamageInfo.GetInflictor, set = CTakeDamageInfo.SetInflictor },
{ name = "m_hAttacker", get = CTakeDamageInfo.GetAttacker, set = CTakeDamageInfo.SetAttacker },
{ name = "m_hWeapon", get = CTakeDamageInfo.GetWeapon, set = CTakeDamageInfo.SetWeapon },
{ name = "m_flDamage", get = CTakeDamageInfo.GetDamage, set = CTakeDamageInfo.SetDamage },
{ name = "m_flMaxDamage", get = CTakeDamageInfo.GetMaxDamage, set = CTakeDamageInfo.SetMaxDamage },
{ name = "m_flBaseDamage", get = CTakeDamageInfo.GetBaseDamage, set = SetNetPropFloat },
{ name = "m_flDamageBonus", get = CTakeDamageInfo.GetDamageBonus, set = CTakeDamageInfo.SetDamageBonus },
{ name = "m_bitsDamageType", get = CTakeDamageInfo.GetDamageType, set = CTakeDamageInfo.SetDamageType },
{ name = "m_iDamageCustom", get = CTakeDamageInfo.GetDamageCustom, set = CTakeDamageInfo.SetDamageCustom },
{ name = "m_iDamageStats", get = CTakeDamageInfo.GetDamageStats, set = CTakeDamageInfo.SetDamageStats },
{ name = "m_iAmmoType", get = CTakeDamageInfo.GetAmmoType, set = CTakeDamageInfo.SetAmmoType },
{ name = "m_iDamagedOtherPlayers", get = CTakeDamageInfo.GetDamagedOtherPlayers, set = CTakeDamageInfo.SetDamagedOtherPlayers },
{ name = "m_iPlayerPenetrationCount", get = CTakeDamageInfo.GetPlayerPenetrationCount, set = CTakeDamageInfo.SetPlayerPenetrationCount },
{ name = "m_bForceFriendlyFire", get = CTakeDamageInfo.IsForceFriendlyFire, set = CTakeDamageInfo.SetForceFriendlyFire },
]
} );

sqdbg_define_class( FireBulletsInfo_t,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_iShots", get = FireBulletsInfo_t.GetShots, set = FireBulletsInfo_t.SetShots },
{ name = "m_vecSrc", get = FireBulletsInfo_t.GetSource, set = FireBulletsInfo_t.SetSource },
{ name = "m_vecDirShooting", get = FireBulletsInfo_t.GetDirShooting, set = FireBulletsInfo_t.SetDirShooting },
{ name = "m_vecSpread", get = FireBulletsInfo_t.GetSpread, set = FireBulletsInfo_t.SetSpread },
{ name = "m_flDistance", get = FireBulletsInfo_t.GetDistance, set = FireBulletsInfo_t.SetDistance },
{ name = "m_iAmmoType", get = FireBulletsInfo_t.GetAmmoType, set = FireBulletsInfo_t.SetAmmoType },
{ name = "m_iTracerFreq", get = FireBulletsInfo_t.GetTracerFreq, set = FireBulletsInfo_t.SetTracerFreq },
{ name = "m_flDamage", get = FireBulletsInfo_t.GetDamage, set = FireBulletsInfo_t.SetDamage },
{ name = "m_iPlayerDamage", get = FireBulletsInfo_t.GetPlayerDamage, set = FireBulletsInfo_t.SetPlayerDamage },
{ name = "m_nFlags", get = FireBulletsInfo_t.GetFlags, set = FireBulletsInfo_t.SetFlags },
{ name = "m_flDamageForceScale", get = FireBulletsInfo_t.GetDamageForceScale, set = FireBulletsInfo_t.SetDamageForceScale },
{ name = "m_pAttacker", get = FireBulletsInfo_t.GetAttacker, set = FireBulletsInfo_t.SetAttacker },
{ name = "m_pAdditionalIgnoreEnt", get = FireBulletsInfo_t.GetAdditionalIgnoreEnt, set = FireBulletsInfo_t.SetAdditionalIgnoreEnt },
{ name = "m_bPrimaryAttack", get = FireBulletsInfo_t.GetPrimaryAttack, set = FireBulletsInfo_t.SetPrimaryAttack },
]
} );

sqdbg_define_class( cplane_t,
{
value = function() { return ::format( "[%s], %f", normal.ToKVString(), dist ); },
value = function() { return format( "[%s] %f", normal.ToKVString(), dist ); },
metamembers = [ "normal", "dist" ]
} );

Expand DownExpand Up@@ -598,9 +748,14 @@ sqdbg_define_class( EmitSound_t,
{ name = "m_flVolume", get = EmitSound_t.GetVolume, set = EmitSound_t.SetVolume },
{ name = "m_SoundLevel", get = EmitSound_t.GetSoundLevel, set = EmitSound_t.SetSoundLevel },
{ name = "m_nFlags", get = EmitSound_t.GetFlags, set = EmitSound_t.SetFlags },
{ name = "m_nPitch", get = EmitSound_t.GetPitch, set = EmitSound_t.SetPitch },
{ name = "m_nSpecialDSP", get = EmitSound_t.GetSpecialDSP, set = EmitSound_t.SetSpecialDSP },
{ name = "m_flSoundTime", get = EmitSound_t.GetSoundTime, set = EmitSound_t.SetSoundTime },
{ name = "m_pOrigin", get = EmitSound_t.GetOrigin, set = EmitSound_t.SetOrigin },
{
name = "m_pOrigin",
get = function() { if ( HasOrigin() ) return GetOrigin(); },
set = EmitSound_t.SetOrigin
},
]
} );

Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
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
191 changes: 173 additions & 18 deletions VPKs/shared_content_v7_0/scripts/vscripts/sqdbg_definitions.nut
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,88 @@

local format = format;
local tmp = { name = null }

foreach ( key, val in this )
{
if ( typeof val == "class" )
{
sqdbg_define_class( val, { name = key } );
tmp.name = key;
sqdbg_define_class( val, tmp );
}
}

local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local SetNetPropString = function( key, val ) { return ::NetProps.SetPropString( this, key, val ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local SetNetPropVector = function( key, val ) { return ::NetProps.SetPropVector( this, key, val ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local SetNetPropEntity = function( key, val ) { return ::NetProps.SetPropEntity( this, key, val ); }

local CArrayAccessor = class
{
// Implementation note:
// Native array elements are going to be listed as custom members of this accessor class.
// Indicate to the debugger that this class is going to have non-string
// members by having existing member names to be escaped
// so that custom number members are evaluated as numbers.
["members\0"] = null;
count = 0;
type = "";
ent = null;
key = null;
iget = null;
iset = null;

constructor ( ent, key, type, count = 0 )
{
this.ent = ent;
this.key = key;
this.type = type;
local maxcount = ::NetProps.GetPropArraySize( ent, key );
if ( count < maxcount )
count = maxcount;
this.count = count;
iget = format("GetProp%sArray", type);
iset = format("SetProp%sArray", type);
local arr = this["members\0"] = ::array( count );
foreach ( i, v in arr )
arr[i] = { name = i, get = get, set = set };
}

get = function( i ) { return ::NetProps[iget]( ent, key, i ); }
set = function( i, v ) { return ::NetProps[iset]( ent, key, v, i ); }
}

CArrayAccessor._get <- CArrayAccessor.get;
CArrayAccessor._set <- CArrayAccessor.set;

sqdbg_define_class( CArrayAccessor,
{
name = "CArrayAccessor",
value = function() { return format("%s[%d]", type, count); },
custommembers = function() { return this["members\0"]; },
} );

local GetNetPropEntityArray = function( key ) { return CArrayAccessor( this, key, "Entity" ); }

if ( SERVER_DLL )
{
local baseentity_custommembers =
[
{ name = "m_vecOrigin", get = GetNetPropVector, set = SetNetPropVector },
// To be able to add data breakpoints on Vector or array elements,
// define indices as members
/*
{
name = "m_vecOrigin[2]",
get = function() { return ::NetProps.GetPropFloatArray( this, "m_vecOrigin", 2 ); },
set = function( val ) { return ::NetProps.SetPropFloatArray( this, "m_vecOrigin", val, 2 ); }
},
*/
{ name = "m_angRotation", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_vecAbsOrigin", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_angAbsRotation", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -66,7 +126,10 @@ if ( SERVER_DLL )
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_flRadius", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSurroundingMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
Expand All@@ -76,6 +139,7 @@ if ( SERVER_DLL )
local baseanimating_custommembers = (clone baseentity_custommembers).extend(
[
{ name = "m_flGroundSpeed", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flLastEventCheck", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_nSequence", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceFinished", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceLoops", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -86,15 +150,19 @@ if ( SERVER_DLL )
{ name = "m_flCycle", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hLightingOrigin", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLightingOriginRelative", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_flFadeScale", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatcharacter_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_flNextAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flFieldOfView", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_LastHitGroup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flDamageAccumulator", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_CurrentWeaponProficiency", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hActiveWeapon", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_bPreventWeaponPickup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hMyWeapons", get = GetNetPropEntityArray },
]);

local player_custommembers = (clone basecombatcharacter_custommembers).extend(
Expand All@@ -109,7 +177,6 @@ if ( SERVER_DLL )
{ name = "m_afButtonForced", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flStepSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flSwimSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_surfaceFriction", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_iFOV", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iFOVStart", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flFOVTime", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -163,6 +230,7 @@ if ( SERVER_DLL )
},
{ name = "m_hPostProcessCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hColorCorrectionCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLocatorTargetEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "pl.v_angle", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_iHideHUD", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_flFOVRate", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -218,6 +286,14 @@ if ( SERVER_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -252,6 +328,14 @@ if ( SERVER_DLL )
{ name = "m_LowerWeaponTimer.m_next", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatweapon_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_iViewModelIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "LocalActiveWeaponData.m_flNextPrimaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flNextSecondaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flTimeWeaponIdle", get = GetNetPropFloat, set = SetNetPropFloat },
]);

sqdbg_define_class( CBaseEntity,
{
value = CBaseEntity.tostring,
Expand All@@ -273,6 +357,11 @@ if ( SERVER_DLL )
custommembers = player_custommembers
} );

sqdbg_define_class( CBaseCombatWeapon,
{
custommembers = basecombatweapon_custommembers
} );

sqdbg_define_class( IPhysicsObject,
{
value = IPhysicsObject.GetName,
Expand DownExpand Up@@ -352,7 +441,7 @@ else if ( CLIENT_DLL )
{ name = "m_iTextureFrameIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderMode", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderFX", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = C_BaseEntity.GetEffects, set = C_BaseEntity.SetEffects },
{ name = "m_fFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iEFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_clrRender", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -365,7 +454,7 @@ else if ( CLIENT_DLL )
{ name = "m_flShadowCastDistance", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hOwnerEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hEffectEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hMoveParent", get = GetNetPropEntity },
{ name = "m_hMoveParent", get = C_BaseEntity.GetMoveParent },
{ name = "m_hNetworkMoveParent", get = GetNetPropEntity },
{ name = "m_iParentAttachment", get = GetNetPropInt },
{ name = "m_MoveType", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -378,7 +467,7 @@ else if ( CLIENT_DLL )
{ name = "m_Collision.m_vecMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
//{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -472,6 +561,14 @@ else if ( CLIENT_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -518,14 +615,20 @@ else if ( CLIENT_DLL )
{
value = function()
{
return ::format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
return format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
}
} );
}

sqdbg_define_class( Vector,
{
value = Vector.ToKVString,
value = function()
{
local FLT_MAX = 3.40282347e+38;
if ( x == FLT_MAX && y == FLT_MAX && z == FLT_MAX )
return "vec3_invalid";
return ToKVString();
},
metamembers = [ "x", "y", "z" ]
} );

Expand All@@ -536,8 +639,8 @@ sqdbg_define_class( CGameTrace,
{
local ent = Entity();
if ( ent )
return ::format( "%f, %s", Fraction(), ""+ent );
return ::format( "%f", Fraction() );
return format( "%f, %s", Fraction(), ""+ent );
return format( "%f", Fraction() );
},
custommembers =
[
Expand All@@ -552,9 +655,56 @@ sqdbg_define_class( CGameTrace,
]
} );

sqdbg_define_class( CTakeDamageInfo,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_vecDamageForce", get = CTakeDamageInfo.GetDamageForce, set = CTakeDamageInfo.SetDamageForce },
{ name = "m_vecDamagePosition", get = CTakeDamageInfo.GetDamagePosition, set = CTakeDamageInfo.SetDamagePosition },
{ name = "m_vecReportedPosition", get = CTakeDamageInfo.GetReportedPosition, set = CTakeDamageInfo.SetReportedPosition },
{ name = "m_hInflictor", get = CTakeDamageInfo.GetInflictor, set = CTakeDamageInfo.SetInflictor },
{ name = "m_hAttacker", get = CTakeDamageInfo.GetAttacker, set = CTakeDamageInfo.SetAttacker },
{ name = "m_hWeapon", get = CTakeDamageInfo.GetWeapon, set = CTakeDamageInfo.SetWeapon },
{ name = "m_flDamage", get = CTakeDamageInfo.GetDamage, set = CTakeDamageInfo.SetDamage },
{ name = "m_flMaxDamage", get = CTakeDamageInfo.GetMaxDamage, set = CTakeDamageInfo.SetMaxDamage },
{ name = "m_flBaseDamage", get = CTakeDamageInfo.GetBaseDamage, set = SetNetPropFloat },
{ name = "m_flDamageBonus", get = CTakeDamageInfo.GetDamageBonus, set = CTakeDamageInfo.SetDamageBonus },
{ name = "m_bitsDamageType", get = CTakeDamageInfo.GetDamageType, set = CTakeDamageInfo.SetDamageType },
{ name = "m_iDamageCustom", get = CTakeDamageInfo.GetDamageCustom, set = CTakeDamageInfo.SetDamageCustom },
{ name = "m_iDamageStats", get = CTakeDamageInfo.GetDamageStats, set = CTakeDamageInfo.SetDamageStats },
{ name = "m_iAmmoType", get = CTakeDamageInfo.GetAmmoType, set = CTakeDamageInfo.SetAmmoType },
{ name = "m_iDamagedOtherPlayers", get = CTakeDamageInfo.GetDamagedOtherPlayers, set = CTakeDamageInfo.SetDamagedOtherPlayers },
{ name = "m_iPlayerPenetrationCount", get = CTakeDamageInfo.GetPlayerPenetrationCount, set = CTakeDamageInfo.SetPlayerPenetrationCount },
{ name = "m_bForceFriendlyFire", get = CTakeDamageInfo.IsForceFriendlyFire, set = CTakeDamageInfo.SetForceFriendlyFire },
]
} );

sqdbg_define_class( FireBulletsInfo_t,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_iShots", get = FireBulletsInfo_t.GetShots, set = FireBulletsInfo_t.SetShots },
{ name = "m_vecSrc", get = FireBulletsInfo_t.GetSource, set = FireBulletsInfo_t.SetSource },
{ name = "m_vecDirShooting", get = FireBulletsInfo_t.GetDirShooting, set = FireBulletsInfo_t.SetDirShooting },
{ name = "m_vecSpread", get = FireBulletsInfo_t.GetSpread, set = FireBulletsInfo_t.SetSpread },
{ name = "m_flDistance", get = FireBulletsInfo_t.GetDistance, set = FireBulletsInfo_t.SetDistance },
{ name = "m_iAmmoType", get = FireBulletsInfo_t.GetAmmoType, set = FireBulletsInfo_t.SetAmmoType },
{ name = "m_iTracerFreq", get = FireBulletsInfo_t.GetTracerFreq, set = FireBulletsInfo_t.SetTracerFreq },
{ name = "m_flDamage", get = FireBulletsInfo_t.GetDamage, set = FireBulletsInfo_t.SetDamage },
{ name = "m_iPlayerDamage", get = FireBulletsInfo_t.GetPlayerDamage, set = FireBulletsInfo_t.SetPlayerDamage },
{ name = "m_nFlags", get = FireBulletsInfo_t.GetFlags, set = FireBulletsInfo_t.SetFlags },
{ name = "m_flDamageForceScale", get = FireBulletsInfo_t.GetDamageForceScale, set = FireBulletsInfo_t.SetDamageForceScale },
{ name = "m_pAttacker", get = FireBulletsInfo_t.GetAttacker, set = FireBulletsInfo_t.SetAttacker },
{ name = "m_pAdditionalIgnoreEnt", get = FireBulletsInfo_t.GetAdditionalIgnoreEnt, set = FireBulletsInfo_t.SetAdditionalIgnoreEnt },
{ name = "m_bPrimaryAttack", get = FireBulletsInfo_t.GetPrimaryAttack, set = FireBulletsInfo_t.SetPrimaryAttack },
]
} );

sqdbg_define_class( cplane_t,
{
value = function() { return ::format( "[%s], %f", normal.ToKVString(), dist ); },
value = function() { return format( "[%s] %f", normal.ToKVString(), dist ); },
metamembers = [ "normal", "dist" ]
} );

Expand DownExpand Up@@ -598,9 +748,14 @@ sqdbg_define_class( EmitSound_t,
{ name = "m_flVolume", get = EmitSound_t.GetVolume, set = EmitSound_t.SetVolume },
{ name = "m_SoundLevel", get = EmitSound_t.GetSoundLevel, set = EmitSound_t.SetSoundLevel },
{ name = "m_nFlags", get = EmitSound_t.GetFlags, set = EmitSound_t.SetFlags },
{ name = "m_nPitch", get = EmitSound_t.GetPitch, set = EmitSound_t.SetPitch },
{ name = "m_nSpecialDSP", get = EmitSound_t.GetSpecialDSP, set = EmitSound_t.SetSpecialDSP },
{ name = "m_flSoundTime", get = EmitSound_t.GetSoundTime, set = EmitSound_t.SetSoundTime },
{ name = "m_pOrigin", get = EmitSound_t.GetOrigin, set = EmitSound_t.SetOrigin },
{
name = "m_pOrigin",
get = function() { if ( HasOrigin() ) return GetOrigin(); },
set = EmitSound_t.SetOrigin
},
]
} );

Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
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
191 changes: 173 additions & 18 deletions VPKs/shared_content_v7_0/scripts/vscripts/sqdbg_definitions.nut
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,88 @@

local format = format;
local tmp = { name = null }

foreach ( key, val in this )
{
if ( typeof val == "class" )
{
sqdbg_define_class( val, { name = key } );
tmp.name = key;
sqdbg_define_class( val, tmp );
}
}

local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local SetNetPropString = function( key, val ) { return ::NetProps.SetPropString( this, key, val ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local SetNetPropVector = function( key, val ) { return ::NetProps.SetPropVector( this, key, val ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local SetNetPropEntity = function( key, val ) { return ::NetProps.SetPropEntity( this, key, val ); }

local CArrayAccessor = class
{
// Implementation note:
// Native array elements are going to be listed as custom members of this accessor class.
// Indicate to the debugger that this class is going to have non-string
// members by having existing member names to be escaped
// so that custom number members are evaluated as numbers.
["members\0"] = null;
count = 0;
type = "";
ent = null;
key = null;
iget = null;
iset = null;

constructor ( ent, key, type, count = 0 )
{
this.ent = ent;
this.key = key;
this.type = type;
local maxcount = ::NetProps.GetPropArraySize( ent, key );
if ( count < maxcount )
count = maxcount;
this.count = count;
iget = format("GetProp%sArray", type);
iset = format("SetProp%sArray", type);
local arr = this["members\0"] = ::array( count );
foreach ( i, v in arr )
arr[i] = { name = i, get = get, set = set };
}

get = function( i ) { return ::NetProps[iget]( ent, key, i ); }
set = function( i, v ) { return ::NetProps[iset]( ent, key, v, i ); }
}

CArrayAccessor._get <- CArrayAccessor.get;
CArrayAccessor._set <- CArrayAccessor.set;

sqdbg_define_class( CArrayAccessor,
{
name = "CArrayAccessor",
value = function() { return format("%s[%d]", type, count); },
custommembers = function() { return this["members\0"]; },
} );

local GetNetPropEntityArray = function( key ) { return CArrayAccessor( this, key, "Entity" ); }

if ( SERVER_DLL )
{
local baseentity_custommembers =
[
{ name = "m_vecOrigin", get = GetNetPropVector, set = SetNetPropVector },
// To be able to add data breakpoints on Vector or array elements,
// define indices as members
/*
{
name = "m_vecOrigin[2]",
get = function() { return ::NetProps.GetPropFloatArray( this, "m_vecOrigin", 2 ); },
set = function( val ) { return ::NetProps.SetPropFloatArray( this, "m_vecOrigin", val, 2 ); }
},
*/
{ name = "m_angRotation", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_vecAbsOrigin", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_angAbsRotation", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -66,7 +126,10 @@ if ( SERVER_DLL )
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_flRadius", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSurroundingMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
Expand All@@ -76,6 +139,7 @@ if ( SERVER_DLL )
local baseanimating_custommembers = (clone baseentity_custommembers).extend(
[
{ name = "m_flGroundSpeed", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flLastEventCheck", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_nSequence", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceFinished", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceLoops", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -86,15 +150,19 @@ if ( SERVER_DLL )
{ name = "m_flCycle", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hLightingOrigin", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLightingOriginRelative", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_flFadeScale", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatcharacter_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_flNextAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flFieldOfView", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_LastHitGroup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flDamageAccumulator", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_CurrentWeaponProficiency", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hActiveWeapon", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_bPreventWeaponPickup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hMyWeapons", get = GetNetPropEntityArray },
]);

local player_custommembers = (clone basecombatcharacter_custommembers).extend(
Expand All@@ -109,7 +177,6 @@ if ( SERVER_DLL )
{ name = "m_afButtonForced", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flStepSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flSwimSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_surfaceFriction", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_iFOV", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iFOVStart", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flFOVTime", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -163,6 +230,7 @@ if ( SERVER_DLL )
},
{ name = "m_hPostProcessCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hColorCorrectionCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLocatorTargetEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "pl.v_angle", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_iHideHUD", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_flFOVRate", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -218,6 +286,14 @@ if ( SERVER_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -252,6 +328,14 @@ if ( SERVER_DLL )
{ name = "m_LowerWeaponTimer.m_next", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatweapon_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_iViewModelIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "LocalActiveWeaponData.m_flNextPrimaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flNextSecondaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flTimeWeaponIdle", get = GetNetPropFloat, set = SetNetPropFloat },
]);

sqdbg_define_class( CBaseEntity,
{
value = CBaseEntity.tostring,
Expand All@@ -273,6 +357,11 @@ if ( SERVER_DLL )
custommembers = player_custommembers
} );

sqdbg_define_class( CBaseCombatWeapon,
{
custommembers = basecombatweapon_custommembers
} );

sqdbg_define_class( IPhysicsObject,
{
value = IPhysicsObject.GetName,
Expand DownExpand Up@@ -352,7 +441,7 @@ else if ( CLIENT_DLL )
{ name = "m_iTextureFrameIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderMode", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderFX", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = C_BaseEntity.GetEffects, set = C_BaseEntity.SetEffects },
{ name = "m_fFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iEFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_clrRender", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -365,7 +454,7 @@ else if ( CLIENT_DLL )
{ name = "m_flShadowCastDistance", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hOwnerEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hEffectEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hMoveParent", get = GetNetPropEntity },
{ name = "m_hMoveParent", get = C_BaseEntity.GetMoveParent },
{ name = "m_hNetworkMoveParent", get = GetNetPropEntity },
{ name = "m_iParentAttachment", get = GetNetPropInt },
{ name = "m_MoveType", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -378,7 +467,7 @@ else if ( CLIENT_DLL )
{ name = "m_Collision.m_vecMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
//{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -472,6 +561,14 @@ else if ( CLIENT_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -518,14 +615,20 @@ else if ( CLIENT_DLL )
{
value = function()
{
return ::format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
return format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
}
} );
}

sqdbg_define_class( Vector,
{
value = Vector.ToKVString,
value = function()
{
local FLT_MAX = 3.40282347e+38;
if ( x == FLT_MAX && y == FLT_MAX && z == FLT_MAX )
return "vec3_invalid";
return ToKVString();
},
metamembers = [ "x", "y", "z" ]
} );

Expand All@@ -536,8 +639,8 @@ sqdbg_define_class( CGameTrace,
{
local ent = Entity();
if ( ent )
return ::format( "%f, %s", Fraction(), ""+ent );
return ::format( "%f", Fraction() );
return format( "%f, %s", Fraction(), ""+ent );
return format( "%f", Fraction() );
},
custommembers =
[
Expand All@@ -552,9 +655,56 @@ sqdbg_define_class( CGameTrace,
]
} );

sqdbg_define_class( CTakeDamageInfo,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_vecDamageForce", get = CTakeDamageInfo.GetDamageForce, set = CTakeDamageInfo.SetDamageForce },
{ name = "m_vecDamagePosition", get = CTakeDamageInfo.GetDamagePosition, set = CTakeDamageInfo.SetDamagePosition },
{ name = "m_vecReportedPosition", get = CTakeDamageInfo.GetReportedPosition, set = CTakeDamageInfo.SetReportedPosition },
{ name = "m_hInflictor", get = CTakeDamageInfo.GetInflictor, set = CTakeDamageInfo.SetInflictor },
{ name = "m_hAttacker", get = CTakeDamageInfo.GetAttacker, set = CTakeDamageInfo.SetAttacker },
{ name = "m_hWeapon", get = CTakeDamageInfo.GetWeapon, set = CTakeDamageInfo.SetWeapon },
{ name = "m_flDamage", get = CTakeDamageInfo.GetDamage, set = CTakeDamageInfo.SetDamage },
{ name = "m_flMaxDamage", get = CTakeDamageInfo.GetMaxDamage, set = CTakeDamageInfo.SetMaxDamage },
{ name = "m_flBaseDamage", get = CTakeDamageInfo.GetBaseDamage, set = SetNetPropFloat },
{ name = "m_flDamageBonus", get = CTakeDamageInfo.GetDamageBonus, set = CTakeDamageInfo.SetDamageBonus },
{ name = "m_bitsDamageType", get = CTakeDamageInfo.GetDamageType, set = CTakeDamageInfo.SetDamageType },
{ name = "m_iDamageCustom", get = CTakeDamageInfo.GetDamageCustom, set = CTakeDamageInfo.SetDamageCustom },
{ name = "m_iDamageStats", get = CTakeDamageInfo.GetDamageStats, set = CTakeDamageInfo.SetDamageStats },
{ name = "m_iAmmoType", get = CTakeDamageInfo.GetAmmoType, set = CTakeDamageInfo.SetAmmoType },
{ name = "m_iDamagedOtherPlayers", get = CTakeDamageInfo.GetDamagedOtherPlayers, set = CTakeDamageInfo.SetDamagedOtherPlayers },
{ name = "m_iPlayerPenetrationCount", get = CTakeDamageInfo.GetPlayerPenetrationCount, set = CTakeDamageInfo.SetPlayerPenetrationCount },
{ name = "m_bForceFriendlyFire", get = CTakeDamageInfo.IsForceFriendlyFire, set = CTakeDamageInfo.SetForceFriendlyFire },
]
} );

sqdbg_define_class( FireBulletsInfo_t,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_iShots", get = FireBulletsInfo_t.GetShots, set = FireBulletsInfo_t.SetShots },
{ name = "m_vecSrc", get = FireBulletsInfo_t.GetSource, set = FireBulletsInfo_t.SetSource },
{ name = "m_vecDirShooting", get = FireBulletsInfo_t.GetDirShooting, set = FireBulletsInfo_t.SetDirShooting },
{ name = "m_vecSpread", get = FireBulletsInfo_t.GetSpread, set = FireBulletsInfo_t.SetSpread },
{ name = "m_flDistance", get = FireBulletsInfo_t.GetDistance, set = FireBulletsInfo_t.SetDistance },
{ name = "m_iAmmoType", get = FireBulletsInfo_t.GetAmmoType, set = FireBulletsInfo_t.SetAmmoType },
{ name = "m_iTracerFreq", get = FireBulletsInfo_t.GetTracerFreq, set = FireBulletsInfo_t.SetTracerFreq },
{ name = "m_flDamage", get = FireBulletsInfo_t.GetDamage, set = FireBulletsInfo_t.SetDamage },
{ name = "m_iPlayerDamage", get = FireBulletsInfo_t.GetPlayerDamage, set = FireBulletsInfo_t.SetPlayerDamage },
{ name = "m_nFlags", get = FireBulletsInfo_t.GetFlags, set = FireBulletsInfo_t.SetFlags },
{ name = "m_flDamageForceScale", get = FireBulletsInfo_t.GetDamageForceScale, set = FireBulletsInfo_t.SetDamageForceScale },
{ name = "m_pAttacker", get = FireBulletsInfo_t.GetAttacker, set = FireBulletsInfo_t.SetAttacker },
{ name = "m_pAdditionalIgnoreEnt", get = FireBulletsInfo_t.GetAdditionalIgnoreEnt, set = FireBulletsInfo_t.SetAdditionalIgnoreEnt },
{ name = "m_bPrimaryAttack", get = FireBulletsInfo_t.GetPrimaryAttack, set = FireBulletsInfo_t.SetPrimaryAttack },
]
} );

sqdbg_define_class( cplane_t,
{
value = function() { return ::format( "[%s], %f", normal.ToKVString(), dist ); },
value = function() { return format( "[%s] %f", normal.ToKVString(), dist ); },
metamembers = [ "normal", "dist" ]
} );

Expand DownExpand Up@@ -598,9 +748,14 @@ sqdbg_define_class( EmitSound_t,
{ name = "m_flVolume", get = EmitSound_t.GetVolume, set = EmitSound_t.SetVolume },
{ name = "m_SoundLevel", get = EmitSound_t.GetSoundLevel, set = EmitSound_t.SetSoundLevel },
{ name = "m_nFlags", get = EmitSound_t.GetFlags, set = EmitSound_t.SetFlags },
{ name = "m_nPitch", get = EmitSound_t.GetPitch, set = EmitSound_t.SetPitch },
{ name = "m_nSpecialDSP", get = EmitSound_t.GetSpecialDSP, set = EmitSound_t.SetSpecialDSP },
{ name = "m_flSoundTime", get = EmitSound_t.GetSoundTime, set = EmitSound_t.SetSoundTime },
{ name = "m_pOrigin", get = EmitSound_t.GetOrigin, set = EmitSound_t.SetOrigin },
{
name = "m_pOrigin",
get = function() { if ( HasOrigin() ) return GetOrigin(); },
set = EmitSound_t.SetOrigin
},
]
} );

Expand Down
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Open
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
191 changes: 173 additions & 18 deletions VPKs/shared_content_v7_0/scripts/vscripts/sqdbg_definitions.nut
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,88 @@

local format = format;
local tmp = { name = null }

foreach ( key, val in this )
{
if ( typeof val == "class" )
{
sqdbg_define_class( val, { name = key } );
tmp.name = key;
sqdbg_define_class( val, tmp );
}
}

local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local GetNetPropString = function( key ) { return ::NetProps.GetPropString( this, key ); }
local SetNetPropString = function( key, val ) { return ::NetProps.SetPropString( this, key, val ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local GetNetPropInt = function( key ) { return ::NetProps.GetPropInt( this, key ); }
local SetNetPropInt = function( key, val ) { return ::NetProps.SetPropInt( this, key, val ); }
local GetNetPropFloat = function( key ) { return ::NetProps.GetPropFloat( this, key ); }
local SetNetPropFloat = function( key, val ) { return ::NetProps.SetPropFloat( this, key, val ); }
local GetNetPropVector = function( key ) { return ::NetProps.GetPropVector( this, key ); }
local SetNetPropVector = function( key, val ) { return ::NetProps.SetPropVector( this, key, val ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local GetNetPropEntity = function( key ) { return ::NetProps.GetPropEntity( this, key ); }
local SetNetPropEntity = function( key, val ) { return ::NetProps.SetPropEntity( this, key, val ); }

local CArrayAccessor = class
{
// Implementation note:
// Native array elements are going to be listed as custom members of this accessor class.
// Indicate to the debugger that this class is going to have non-string
// members by having existing member names to be escaped
// so that custom number members are evaluated as numbers.
["members\0"] = null;
count = 0;
type = "";
ent = null;
key = null;
iget = null;
iset = null;

constructor ( ent, key, type, count = 0 )
{
this.ent = ent;
this.key = key;
this.type = type;
local maxcount = ::NetProps.GetPropArraySize( ent, key );
if ( count < maxcount )
count = maxcount;
this.count = count;
iget = format("GetProp%sArray", type);
iset = format("SetProp%sArray", type);
local arr = this["members\0"] = ::array( count );
foreach ( i, v in arr )
arr[i] = { name = i, get = get, set = set };
}

get = function( i ) { return ::NetProps[iget]( ent, key, i ); }
set = function( i, v ) { return ::NetProps[iset]( ent, key, v, i ); }
}

CArrayAccessor._get <- CArrayAccessor.get;
CArrayAccessor._set <- CArrayAccessor.set;

sqdbg_define_class( CArrayAccessor,
{
name = "CArrayAccessor",
value = function() { return format("%s[%d]", type, count); },
custommembers = function() { return this["members\0"]; },
} );

local GetNetPropEntityArray = function( key ) { return CArrayAccessor( this, key, "Entity" ); }

if ( SERVER_DLL )
{
local baseentity_custommembers =
[
{ name = "m_vecOrigin", get = GetNetPropVector, set = SetNetPropVector },
// To be able to add data breakpoints on Vector or array elements,
// define indices as members
/*
{
name = "m_vecOrigin[2]",
get = function() { return ::NetProps.GetPropFloatArray( this, "m_vecOrigin", 2 ); },
set = function( val ) { return ::NetProps.SetPropFloatArray( this, "m_vecOrigin", val, 2 ); }
},
*/
{ name = "m_angRotation", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_vecAbsOrigin", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_angAbsRotation", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -66,7 +126,10 @@ if ( SERVER_DLL )
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_flRadius", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSurroundingMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMins", get = GetNetPropVector, set = SetNetPropVector },
Expand All@@ -76,6 +139,7 @@ if ( SERVER_DLL )
local baseanimating_custommembers = (clone baseentity_custommembers).extend(
[
{ name = "m_flGroundSpeed", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flLastEventCheck", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_nSequence", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceFinished", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_bSequenceLoops", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -86,15 +150,19 @@ if ( SERVER_DLL )
{ name = "m_flCycle", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hLightingOrigin", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLightingOriginRelative", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_flFadeScale", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatcharacter_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_flNextAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flFieldOfView", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_LastHitGroup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flDamageAccumulator", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_CurrentWeaponProficiency", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hActiveWeapon", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_bPreventWeaponPickup", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_hMyWeapons", get = GetNetPropEntityArray },
]);

local player_custommembers = (clone basecombatcharacter_custommembers).extend(
Expand All@@ -109,7 +177,6 @@ if ( SERVER_DLL )
{ name = "m_afButtonForced", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flStepSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_flSwimSoundTime", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_surfaceFriction", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_iFOV", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iFOVStart", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_flFOVTime", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -163,6 +230,7 @@ if ( SERVER_DLL )
},
{ name = "m_hPostProcessCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hColorCorrectionCtrl", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hLocatorTargetEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "pl.v_angle", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_iHideHUD", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_flFOVRate", get = GetNetPropFloat, set = SetNetPropFloat },
Expand DownExpand Up@@ -218,6 +286,14 @@ if ( SERVER_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -252,6 +328,14 @@ if ( SERVER_DLL )
{ name = "m_LowerWeaponTimer.m_next", get = GetNetPropFloat, set = SetNetPropFloat },
]);

local basecombatweapon_custommembers = (clone baseanimating_custommembers).extend(
[
{ name = "m_iViewModelIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "LocalActiveWeaponData.m_flNextPrimaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flNextSecondaryAttack", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "LocalActiveWeaponData.m_flTimeWeaponIdle", get = GetNetPropFloat, set = SetNetPropFloat },
]);

sqdbg_define_class( CBaseEntity,
{
value = CBaseEntity.tostring,
Expand All@@ -273,6 +357,11 @@ if ( SERVER_DLL )
custommembers = player_custommembers
} );

sqdbg_define_class( CBaseCombatWeapon,
{
custommembers = basecombatweapon_custommembers
} );

sqdbg_define_class( IPhysicsObject,
{
value = IPhysicsObject.GetName,
Expand DownExpand Up@@ -352,7 +441,7 @@ else if ( CLIENT_DLL )
{ name = "m_iTextureFrameIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderMode", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_nRenderFX", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_fEffects", get = C_BaseEntity.GetEffects, set = C_BaseEntity.SetEffects },
{ name = "m_fFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_iEFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_clrRender", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -365,7 +454,7 @@ else if ( CLIENT_DLL )
{ name = "m_flShadowCastDistance", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_hOwnerEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hEffectEntity", get = GetNetPropEntity, set = SetNetPropEntity },
{ name = "m_hMoveParent", get = GetNetPropEntity },
{ name = "m_hMoveParent", get = C_BaseEntity.GetMoveParent },
{ name = "m_hNetworkMoveParent", get = GetNetPropEntity },
{ name = "m_iParentAttachment", get = GetNetPropInt },
{ name = "m_MoveType", get = GetNetPropInt, set = SetNetPropInt },
Expand All@@ -378,7 +467,7 @@ else if ( CLIENT_DLL )
{ name = "m_Collision.m_vecMaxs", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_nSolidType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_usSolidFlags", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
//{ name = "m_Collision.m_nSurroundType", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_triggerBloat", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Collision.m_vecSpecifiedSurroundingMinsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Collision.m_vecSpecifiedSurroundingMaxsPreScaled", get = GetNetPropVector, set = SetNetPropVector },
Expand DownExpand Up@@ -472,6 +561,14 @@ else if ( CLIENT_DLL )
{ name = "m_Local.m_TonemapParams.m_flBloomScale", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMin", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_TonemapParams.m_flAutoExposureMax", get = GetNetPropFloat, set = SetNetPropFloat },
{ name = "m_Local.m_audio.localSound[0]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[1]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[2]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[3]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[4]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[5]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[6]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.localSound[7]", get = GetNetPropVector, set = SetNetPropVector },
{ name = "m_Local.m_audio.soundscapeIndex", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.localBits", get = GetNetPropInt, set = SetNetPropInt },
{ name = "m_Local.m_audio.ent", get = GetNetPropEntity, set = SetNetPropEntity },
Expand DownExpand Up@@ -518,14 +615,20 @@ else if ( CLIENT_DLL )
{
value = function()
{
return ::format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
return format( "(%s) %d %d %d %d", GetName(), GetXPos(), GetYPos(), GetWide(), GetTall() );
}
} );
}

sqdbg_define_class( Vector,
{
value = Vector.ToKVString,
value = function()
{
local FLT_MAX = 3.40282347e+38;
if ( x == FLT_MAX && y == FLT_MAX && z == FLT_MAX )
return "vec3_invalid";
return ToKVString();
},
metamembers = [ "x", "y", "z" ]
} );

Expand All@@ -536,8 +639,8 @@ sqdbg_define_class( CGameTrace,
{
local ent = Entity();
if ( ent )
return ::format( "%f, %s", Fraction(), ""+ent );
return ::format( "%f", Fraction() );
return format( "%f, %s", Fraction(), ""+ent );
return format( "%f", Fraction() );
},
custommembers =
[
Expand All@@ -552,9 +655,56 @@ sqdbg_define_class( CGameTrace,
]
} );

sqdbg_define_class( CTakeDamageInfo,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_vecDamageForce", get = CTakeDamageInfo.GetDamageForce, set = CTakeDamageInfo.SetDamageForce },
{ name = "m_vecDamagePosition", get = CTakeDamageInfo.GetDamagePosition, set = CTakeDamageInfo.SetDamagePosition },
{ name = "m_vecReportedPosition", get = CTakeDamageInfo.GetReportedPosition, set = CTakeDamageInfo.SetReportedPosition },
{ name = "m_hInflictor", get = CTakeDamageInfo.GetInflictor, set = CTakeDamageInfo.SetInflictor },
{ name = "m_hAttacker", get = CTakeDamageInfo.GetAttacker, set = CTakeDamageInfo.SetAttacker },
{ name = "m_hWeapon", get = CTakeDamageInfo.GetWeapon, set = CTakeDamageInfo.SetWeapon },
{ name = "m_flDamage", get = CTakeDamageInfo.GetDamage, set = CTakeDamageInfo.SetDamage },
{ name = "m_flMaxDamage", get = CTakeDamageInfo.GetMaxDamage, set = CTakeDamageInfo.SetMaxDamage },
{ name = "m_flBaseDamage", get = CTakeDamageInfo.GetBaseDamage, set = SetNetPropFloat },
{ name = "m_flDamageBonus", get = CTakeDamageInfo.GetDamageBonus, set = CTakeDamageInfo.SetDamageBonus },
{ name = "m_bitsDamageType", get = CTakeDamageInfo.GetDamageType, set = CTakeDamageInfo.SetDamageType },
{ name = "m_iDamageCustom", get = CTakeDamageInfo.GetDamageCustom, set = CTakeDamageInfo.SetDamageCustom },
{ name = "m_iDamageStats", get = CTakeDamageInfo.GetDamageStats, set = CTakeDamageInfo.SetDamageStats },
{ name = "m_iAmmoType", get = CTakeDamageInfo.GetAmmoType, set = CTakeDamageInfo.SetAmmoType },
{ name = "m_iDamagedOtherPlayers", get = CTakeDamageInfo.GetDamagedOtherPlayers, set = CTakeDamageInfo.SetDamagedOtherPlayers },
{ name = "m_iPlayerPenetrationCount", get = CTakeDamageInfo.GetPlayerPenetrationCount, set = CTakeDamageInfo.SetPlayerPenetrationCount },
{ name = "m_bForceFriendlyFire", get = CTakeDamageInfo.IsForceFriendlyFire, set = CTakeDamageInfo.SetForceFriendlyFire },
]
} );

sqdbg_define_class( FireBulletsInfo_t,
{
value = function() { return "m_flDamage = " + GetDamage(); },
custommembers =
[
{ name = "m_iShots", get = FireBulletsInfo_t.GetShots, set = FireBulletsInfo_t.SetShots },
{ name = "m_vecSrc", get = FireBulletsInfo_t.GetSource, set = FireBulletsInfo_t.SetSource },
{ name = "m_vecDirShooting", get = FireBulletsInfo_t.GetDirShooting, set = FireBulletsInfo_t.SetDirShooting },
{ name = "m_vecSpread", get = FireBulletsInfo_t.GetSpread, set = FireBulletsInfo_t.SetSpread },
{ name = "m_flDistance", get = FireBulletsInfo_t.GetDistance, set = FireBulletsInfo_t.SetDistance },
{ name = "m_iAmmoType", get = FireBulletsInfo_t.GetAmmoType, set = FireBulletsInfo_t.SetAmmoType },
{ name = "m_iTracerFreq", get = FireBulletsInfo_t.GetTracerFreq, set = FireBulletsInfo_t.SetTracerFreq },
{ name = "m_flDamage", get = FireBulletsInfo_t.GetDamage, set = FireBulletsInfo_t.SetDamage },
{ name = "m_iPlayerDamage", get = FireBulletsInfo_t.GetPlayerDamage, set = FireBulletsInfo_t.SetPlayerDamage },
{ name = "m_nFlags", get = FireBulletsInfo_t.GetFlags, set = FireBulletsInfo_t.SetFlags },
{ name = "m_flDamageForceScale", get = FireBulletsInfo_t.GetDamageForceScale, set = FireBulletsInfo_t.SetDamageForceScale },
{ name = "m_pAttacker", get = FireBulletsInfo_t.GetAttacker, set = FireBulletsInfo_t.SetAttacker },
{ name = "m_pAdditionalIgnoreEnt", get = FireBulletsInfo_t.GetAdditionalIgnoreEnt, set = FireBulletsInfo_t.SetAdditionalIgnoreEnt },
{ name = "m_bPrimaryAttack", get = FireBulletsInfo_t.GetPrimaryAttack, set = FireBulletsInfo_t.SetPrimaryAttack },
]
} );

sqdbg_define_class( cplane_t,
{
value = function() { return ::format( "[%s], %f", normal.ToKVString(), dist ); },
value = function() { return format( "[%s] %f", normal.ToKVString(), dist ); },
metamembers = [ "normal", "dist" ]
} );

Expand DownExpand Up@@ -598,9 +748,14 @@ sqdbg_define_class( EmitSound_t,
{ name = "m_flVolume", get = EmitSound_t.GetVolume, set = EmitSound_t.SetVolume },
{ name = "m_SoundLevel", get = EmitSound_t.GetSoundLevel, set = EmitSound_t.SetSoundLevel },
{ name = "m_nFlags", get = EmitSound_t.GetFlags, set = EmitSound_t.SetFlags },
{ name = "m_nPitch", get = EmitSound_t.GetPitch, set = EmitSound_t.SetPitch },
{ name = "m_nSpecialDSP", get = EmitSound_t.GetSpecialDSP, set = EmitSound_t.SetSpecialDSP },
{ name = "m_flSoundTime", get = EmitSound_t.GetSoundTime, set = EmitSound_t.SetSoundTime },
{ name = "m_pOrigin", get = EmitSound_t.GetOrigin, set = EmitSound_t.SetOrigin },
{
name = "m_pOrigin",
get = function() { if ( HasOrigin() ) return GetOrigin(); },
set = EmitSound_t.SetOrigin
},
]
} );

Expand Down