Open
Conversation
Owner
|
The idea with webaudio and other lua scripts in the same folder is that they're supposed to be independent from pac. You could just check if pac exists in its dprint function though. |
Owner
|
Feel free to change the format too, it's not like anything relies on it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Debug prints seem pretty neglected in PAC3. This PR aims to make it slightly more usable.
Summary
Remove
pace.dprintpac.dprintandpace.dprintwere identical and had multiple declarations.Instead, we just use
pac.dprintfor everything, even if it happens in the editor realm.This also means we only have a single
pac.dprintdefined in the Shared util file.Create a new
pac_debugconvarInstead of relying on vars set on the
pac/pacetables, this new convar determines if the debug prints should happen. It has three levels:0: Off1: Debug Logs2: Debug Logs + TraceThis closely matches the original behavior, but makes it easier to use.
Format
I think the current format is pretty gross, but I left it as-is. If you'd like me to change that here, I'd be happy to do that.
Problems
pac.debugvs.pac_debugThere are other cases around the addon that rely on
pac.debugto change the behavior, so without changing those, a developer would need to setpac.debug = trueandpac_debug 1.We could change all
if pac.debugtoif debugConVar:GetInt() > 0(or whatever) and then we could just have the single convar.If that's preferable, I can do that in this PR.
Webaudio
The webaudio file has its own
dprintfunction that uses thewebaudio.debugvar to decide whether or not to print.I left it alone because I wasn't sure why they were separate, but if you think it's within the scope of this PR, I can make it use the standard
pac.dprintas well.