Skip to content
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

Assigning a metatable to _G #57

Open
LarsIngo opened this issue May 10, 2023 · 2 comments
Open

Assigning a metatable to _G #57

LarsIngo opened this issue May 10, 2023 · 2 comments

Comments

@LarsIngo
Copy link

LarsIngo commented May 10, 2023

It would be awesome to have a similar logic as ULuaUserDataObject::ReceiveLuaMetaIndex(Key) and ULuaUserDataObject::ReceiveLuaMetaNewIndex(Key, Value), but for ULuaState so you would be able to intercept whenever the global table tries to access a field that does not exist etc.

The goal for me is to intercept simple code lite this:
ULuaBlueprintFunctionLibrary::LuaRunString(GetWorld(), URCLuaReflectionState::StaticClass(),"Foo");
and be able to return a dynamic FLuaValue based on the Key:"Foo" from a C++ callback.

@LarsIngo
Copy link
Author

LarsIngo commented May 10, 2023

Issue opened after discussion on discord:
Screenshot 2023-05-10 181553

@LarsIngo
Copy link
Author

Adding the metatable as you described workes for "Foo.Bar", "Bar = Foo".
However, it does not trigger for only "Foo" (expected behaviour?)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant