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

Use more nameof and use Harmony to access properties rather than methods #503

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SokyranTheDragon
Copy link
Member

String constant, wherever possible (assuming I haven't missed some), were replaced by the use of nameof.

Replaced places where properties are accessed with AccessTools.PropertyGetter or AccessTools.IndexerGetter, rather than AccessTools.Method by using get_ in the method name.

Also, I've changed array initialization to use collection expressions in SyncThingFilters class, since I was already modifying it.

…thods

String constant, wherever possible (assuming I haven't missed some), were replaced by the use of `nameof`.

Replaced places where properties are accessed with `AccessTools.PropertyGetter` or `AccessTools.IndexerGetter`, rather than `AccessTools.Method` by using `get_` in the method name.

Also, I've changed array initialization to use collection expressions in `SyncThingFilters` class, since I was already modifying it.
@SokyranTheDragon SokyranTheDragon added the 1.5 Fixes or bugs relating to 1.5 (Not Anomaly). label Aug 26, 2024
…rors

Not sure why (I've tried to clear my publicizer cache, etc.). It seems that, for me, Rider is refusing to acknowledge that this field is public. It still compiles fine and without any errors, however this causes annoying errors in code.

So for the sake of safety (in case anyone else is going to encounter this issue) - I've decided to just revert this specific change.

On top of that, one thing I did not consider at the time - rather than using reflection, we could have just replaced this with `te.m_RevealCursor = true` (if there was no issue after publicizing).
@SokyranTheDragon
Copy link
Member Author

I've reverted change for m_RevealCursor, as it seems to sometimes cause errors

Not sure why (I've tried to clear my publicizer cache, etc.). It seems that, for me, Rider is refusing to acknowledge that this field is public. It still compiles fine and without any errors, however this causes annoying errors while working on the project.

So for the sake of safety (in case anyone else is going to encounter this issue) - I've decided to just revert this specific change.

On top of that, one thing I did not consider at the time - rather than using reflection, we could have just replaced this with te.m_RevealCursor = true (if there was no issue after publicizing).

@SokyranTheDragon SokyranTheDragon added the low priority Quality of life or ignorable to an extent. label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.5 Fixes or bugs relating to 1.5 (Not Anomaly). low priority Quality of life or ignorable to an extent.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant