You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there's no way to to define a constant like it were a constant, but have it at like a function. This ideally just needs to be a single getter with no way of passing in arguments (that's what functions are for!)
In my own game, I'm currently exposing constants like
Where Catspeak.interface.exposeDynamicConstant is similar to Catspeak.interface.exposeFunction, except that it either attaches isDynamic to the method in some way (maybe via constructor so no one can fiddle with the variable directly) or via an alternative database. And then in Catspeak it's just
print(fps);
This ends up translating as if we were doing fps() within our code, without having to explicitly call it.
If #89 gets added, this could be instead be a toggle for allowing dynamic constants.
The text was updated successfully, but these errors were encountered:
What is your feature request?
Currently there's no way to to define a constant like it were a constant, but have it at like a function. This ideally just needs to be a single getter with no way of passing in arguments (that's what functions are for!)
In my own game, I'm currently exposing constants like
And in Catspeak I have to do
I'm personally not a fan of this approach.
Please describe in detail how you expect this new feature to behave.
If we were to have
Catspeak.interface.exposeDynamicConstant(name, function)
, we could then doWhere
Catspeak.interface.exposeDynamicConstant
is similar toCatspeak.interface.exposeFunction
, except that it either attachesisDynamic
to the method in some way (maybe via constructor so no one can fiddle with the variable directly) or via an alternative database. And then in Catspeak it's justThis ends up translating as if we were doing
fps()
within our code, without having to explicitly call it.If #89 gets added, this could be instead be a toggle for allowing dynamic constants.
The text was updated successfully, but these errors were encountered: