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

Implement CVariant functions #569

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

zonical
Copy link
Collaborator

@zonical zonical commented Sep 1, 2024

Very work in progress - working on it in small bits at a time

This PR aims to implement functions to CVariant which accesses data from variant_t on the C++ side. Useful for functions that hook into the Entity IO system. Unsure if a Set function is needed - but it can probably be done.

@zonical
Copy link
Collaborator Author

zonical commented Sep 1, 2024

I've also added a function to get a string from a CUtlSymbolLarge class for plugin authors that wish to hook into AcceptInput without dealing with memory shenanigans on the C# side. Does not appear to have an easy way to modify it (from my little knowledge of hl2sdk) so it will remain as read-only.

@Yarukon
Copy link
Contributor

Yarukon commented Sep 16, 2024

you can just use fieldtype_t to replace VariantFieldTypes, fieldtype_t is generated from the schema

@KillStr3aK
Copy link
Contributor

KillStr3aK commented Oct 7, 2024

LGTM!

Does not appear to have an easy way to modify it (from my little knowledge of hl2sdk) so it will remain as read-only.

Maybe modify it through a native call?

@zonical
Copy link
Collaborator Author

zonical commented Oct 8, 2024

Finally had the time to work on this again. Added a Set() function with corresponding native functions. Currently untested (and I can't test at the moment - so I would be grateful if someone could!)

@Yarukon - I've also used the generated field as you suggested. Thanks for the suggestion!

@zonical zonical marked this pull request as ready for review October 8, 2024 05:56
@zonical zonical requested a review from roflmuffin as a code owner October 8, 2024 05:56
@KillStr3aK
Copy link
Contributor

I've left probably my last reviews on this, good job!

@zonical
Copy link
Collaborator Author

zonical commented Oct 9, 2024

@KillStr3aK Your cleanup suggestions have been made!

Copy link
Contributor

@KillStr3aK KillStr3aK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

4 participants