-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: move ESCCondition parsing logic out of the constructor #713
base: develop
Are you sure you want to change the base?
Conversation
Note that the PR does something very wrong, as-is, which is it passes I see that sometime in the past 18 months, the |
This makes it possible to create an `ESCCondition` programmatically. Unfortunately, this does not fix the issue with `ESCCondition` where `comparison_regex.compile(REGEX)` is called *every time* an `ESCCondition` is instantiated. I have read all sorts of forums, and no one seems to address this issue head-on. The question of, "Why doesn't GDScript support static variables" is not addressed clearly in the docs, IMHO. The only "workaround" I can find is this article on Singletons/Autoload: https://docs.godotengine.org/en/latest/tutorials/scripting/singletons_autoload.html Though this seems incredibly heavyweight for caching a `RegEx`.
This change looks interesting, thank you for it. |
Though before anyone merges this, nb:
How should I fix that? |
@StraToN do we want to merge this in despite us moving to the new interpreter? |
Logging methods require the calling class so its name is put in the log message. You may simply pass |
@bolinfest Any news on this? I think it only needs the logger parameter to be set. When this is done I am fine merging this @BHSDuncan no matter if we're to moving to the new interpreter. |
Is https://chat.openai.com/share/9d22a90e-c1d4-4ca6-8c34-21f6b6d25370 |
Ah, ok I missed your point. Here is what I can propose then: add a new error_static() method in ESCLogger that you should be able to call in a static way:
You can then call it like so:
|
Wait for #718 to be merged and apply logger "static" calls
fix: move ESCCondition parsing logic out of the constructor
This makes it possible to create an
ESCCondition
programmatically.Unfortunately, this does not fix the issue with
ESCCondition
where
comparison_regex.compile(REGEX)
is called every time anESCCondition
is instantiated.I have read all sorts of forums, and no one seems to address this
issue head-on. The question of, "Why doesn't GDScript support static
variables" is not addressed clearly in the docs, IMHO.
The only "workaround" I can find is this article on Singletons/Autoload:
https://docs.godotengine.org/en/latest/tutorials/scripting/singletons_autoload.html
Though this seems incredibly heavyweight for caching a
RegEx
.