WeaselGames / godot_luaAPI

Godot LuaAPI
https://luaapi.weaselgames.info
Other
361 stars 27 forks source link

Implement warn function #128

Closed RadiantUwU closed 12 months ago

RadiantUwU commented 1 year ago

This will call push_warning once lua executes warn()

Trey2k commented 1 year ago

I like the idea of this, however using the built in godot warning print should just be default. User should be able to set their own warnf method as well imo

RadiantUwU commented 1 year ago

I like the idea of this, however using the built in godot warning print should just be default. User should be able to set their own warnf method as well imo

That could always be added later, they could also just push a new global with warn() to make it easy, but by default it should still use push_warning as expected.

Trey2k commented 1 year ago

That could always be added later, they could also just push a new global with warn() to make it easy, but by default it should still use push_warning as expected.

IMO the ability to prevent the warning output from going to through the build in warning system is a must. Since the lua API allows a special method to be set for the warning (special as in its not a lua_CFunction) there should be a method like we have for set_hook but for the warning. Where possible we just want to expose a convenient version of the base lua API

RadiantUwU commented 1 year ago

IMO the ability to prevent the warning output from going to through the build in warning system is a must. Since the lua API allows a special method to be set for the warning (special as in its not a lua_CFunction) there should be a method like we have for set_hook but for the warning. Where possible we just want to expose a convenient version of the base lua API

I could try adding one, just a private callable member would work?

Trey2k commented 1 year ago

I could try adding one, just a private callable member would work?

Yeah just a callable that if it exists it is called to handle the warning instead of the build in handling you have done.

RadiantUwU commented 1 year ago

Ummmm, it seems like i will have to move the implementation over to luaState....

RadiantUwU commented 1 year ago

bruh

RadiantUwU commented 1 year ago

Oops, i forgor :skull: