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

[Exiled::API] Adding a game's constant patching #2419

Merged
merged 19 commits into from
May 28, 2024

Conversation

VALERA771
Copy link
Contributor

Adding a transpiler-based editing of game's constants. In current system can be some mistakes with replacing other values that has just the same value cuz we can't check whether the constant is used. (everyone know this tbh).

Opened for all suggestions. Now I can't test it so hope that someone will do this faster.

@NaoUnderscore
Copy link
Collaborator

Looks interesting, I'll support you if needed by making some integrations with existing Core features if needed.
Keep us up to date.

@NaoUnderscore NaoUnderscore added enhancement New feature or request regarding-api requires-testing Things need to be verified by an Exiled Developer/Contributor regarding-transpiler P2 Medium priority labels Feb 1, 2024
@NaoUnderscore NaoUnderscore added this to the Exiled 9 milestone Feb 1, 2024
@VALERA771
Copy link
Contributor Author

Patches are partially tested. No errors on setting role while/patching methods.
Current methods could be optimized by using one patch for method and/or checking if value is presented in method body. I'm currently working on second.

@NaoUnderscore
Copy link
Collaborator

@VALERA771 Keep me up to date

@VALERA771
Copy link
Contributor Author

Now I'm on final test part. I've implemented patching only for methods which have constant value in them. Currently I want to optimize patch cuz I've noticed that there can be some errors in several types. I'm going to fix it and add support for all constants which are presented in Playable SCPs classes

@VALERA771
Copy link
Contributor Author

  1. Added a class to edit Readonly fields. Working same as Constants patching so I don't need that it requers tesing.
  2. Modified transpiler so now it's looking better.
  3. Added some new properties to some Items classes.
  4. I'm going to test new version, if test is successful, I'll make it normal PR (not draft).

@VALERA771 VALERA771 marked this pull request as ready for review April 23, 2024 10:12
@VALERA771
Copy link
Contributor Author

I've decided to remove ReadonlyField{T} cuz after a long time searching for readonly field that we can edit (and it'll make profit), I haven't found anything.

@Misfiy
Copy link
Contributor

Misfiy commented May 26, 2024

@VALERA771 is this ready to be merge?

@VALERA771
Copy link
Contributor Author

It's tested so I think yes

@Misfiy Misfiy merged commit 631c13b into Exiled-Team:apis-rework May 28, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2 Medium priority regarding-api regarding-transpiler requires-testing Things need to be verified by an Exiled Developer/Contributor
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants