psiberx / cp2077-codeware

Cyberpunk 2077 library and framework for creating script mods.
MIT License
73 stars 11 forks source link

Extend IPlacedComponent with world position/orientation getters. #20

Closed poirierlouis closed 3 months ago

poirierlouis commented 3 months ago

Provide getters on scripting side since RE of property with https://github.com/WopsS/RED4ext.SDK/pull/138.

I tested the code in my own RED4ext plugin up until now, which is working fine. But I haven't tried with Codeware (workspace not configured to build plugin/scripts and test it yet).

poirierlouis commented 3 months ago

Done :) Is README of RedLib obsolete regarding extension of class properties? Or I'm missing something in this case?

psiberx commented 3 months ago

It doesn't have an example for properties.

poirierlouis commented 3 months ago

My bad, should be good now.

Properties cannot be added to existing classes.

I was talking about this note. Which I guess is an old statement?

psiberx commented 3 months ago

You can't add properties to a C++ class through extension like you do with methods, but you can register more properties in RTTI.

poirierlouis commented 3 months ago

Thanks! Alright, well the later was my expectation when using RTTI_PROPERTY, but the note was not explicit to me, I thought it wasn't possible to declare more RTTI properties when extending. I'll write a PR about this.