Title: Added the ability to add callbacks to ConVar that will be called when ConVar is changed. by CookStar · Pull Request #421 · Source-Python-Dev-Team/Source.Python · GitHub
Open Graph Title: Added the ability to add callbacks to ConVar that will be called when ConVar is changed. by CookStar · Pull Request #421 · Source-Python-Dev-Team/Source.Python
X Title: Added the ability to add callbacks to ConVar that will be called when ConVar is changed. by CookStar · Pull Request #421 · Source-Python-Dev-Team/Source.Python
Description: There is already OnConVarChanged, but it is wasteful if you only want to know the changes of a specific ConVar. This was made to match SourceMod's AddChangeHook feature. https://wiki.alliedmods.net/ConVars_(SourceMod_Scripting)#Change_Callbacks Code: # Cvars from cvars import ConVar from cvars import ConVarChanged @ConVarChanged(ConVar("test", "1", "test convar.")) def on_test_changed(convar, old_value, new_value): print("ConVar changed.") print(f" Name: {convar.name}\n" \ f" Old Value: {old_value}\n" \ f" New Value: {new_value}\n") test2 = ConVar("test2", "999", "test2 convar.") test3 = ConVar("test3", "999", "test3 convar.") @ConVarChanged(test2, "test3") def on_test2_test3_changed(convar, old_value, new_value): convar.set_int(999) Output: test 0 ConVar changed. Name: test Old Value: 1 New Value: 0 test2 0 test3 1000 test2 "test2" = "999" - test2 convar. test3 "test3" = "999" - test3 convar.
Open Graph Description: There is already OnConVarChanged, but it is wasteful if you only want to know the changes of a specific ConVar. This was made to match SourceMod's AddChangeHook feature. https://wiki.alliedmods...
X Description: There is already OnConVarChanged, but it is wasteful if you only want to know the changes of a specific ConVar. This was made to match SourceMod's AddChangeHook feature. https://wiki.allied...
Opengraph URL: https://github.com/Source-Python-Dev-Team/Source.Python/pull/421
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:20c48de0-ad44-7c1d-88ff-b39df3110a90 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | D868:85314:77A05B:A79EE3:6970B075 |
| html-safe-nonce | 4926908bdb33d8af2dbe550894290906777a94fb9c92032b6358166f0f33d1ed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODY4Ojg1MzE0Ojc3QTA1QjpBNzlFRTM6Njk3MEIwNzUiLCJ2aXNpdG9yX2lkIjoiNDU4Mjc5OTA3NTE4NTgzMjA1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fadde643cca06164294ffd0f450fb0c732753efe1798a51ceb4969114d1fb618 |
| hovercard-subject-tag | pull_request:748119236 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/Source-Python-Dev-Team/Source.Python/pull/421/checks |
| twitter:image | https://avatars.githubusercontent.com/u/30329245?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/30329245?s=400&v=4 |
| og:image:alt | There is already OnConVarChanged, but it is wasteful if you only want to know the changes of a specific ConVar. This was made to match SourceMod's AddChangeHook feature. https://wiki.alliedmods... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8e0be80373b724b033cdf8a7b1f78bf5fb6a5d7a2182a9a403aa30894606e390 |
| turbo-cache-control | no-preview |
| go-import | github.com/Source-Python-Dev-Team/Source.Python git https://github.com/Source-Python-Dev-Team/Source.Python.git |
| octolytics-dimension-user_id | 5440368 |
| octolytics-dimension-user_login | Source-Python-Dev-Team |
| octolytics-dimension-repository_id | 12771934 |
| octolytics-dimension-repository_nwo | Source-Python-Dev-Team/Source.Python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 12771934 |
| octolytics-dimension-repository_network_root_nwo | Source-Python-Dev-Team/Source.Python |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b8714db0002cf78dc2d2566571807e404d6cb817 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width