psiberx / cp2077-codeware

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

Extend IPlacedComponent with world position/orientation getters. #20

Closed poirierlouis closed 4 months ago

poirierlouis commented 4 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 4 months ago

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

psiberx commented 4 months ago

It doesn't have an example for properties.

poirierlouis commented 4 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 4 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 4 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.