EXILED icon indicating copy to clipboard operation
EXILED copied to clipboard

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

Open VALERA771 opened this issue 1 year ago • 6 comments

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.

VALERA771 avatar Feb 01 '24 15:02 VALERA771

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

NaoUnderscore avatar Feb 01 '24 23:02 NaoUnderscore

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.

VALERA771 avatar Feb 13 '24 18:02 VALERA771

@VALERA771 Keep me up to date

NaoUnderscore avatar Apr 06 '24 17:04 NaoUnderscore

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 avatar Apr 10 '24 21:04 VALERA771

  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 avatar Apr 20 '24 12:04 VALERA771

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.

VALERA771 avatar May 19 '24 09:05 VALERA771

@VALERA771 is this ready to be merge?

Misfiy avatar May 26 '24 15:05 Misfiy

It's tested so I think yes

VALERA771 avatar May 26 '24 16:05 VALERA771