Skip to content

Commit

Permalink
Revert change for m_RevealCursor, as it seems to sometimes cause er…
Browse files Browse the repository at this point in the history
…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).
  • Loading branch information
SokyranTheDragon committed Aug 26, 2024
1 parent 1290a62 commit 5e20f7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Client/Util/MpUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public static void DoPasswordField(Rect rect, string controlName, ref string pas
{
te.scrollOffset = scrollOffset;
te.text = new string(PassChar, password.Length);
AccessTools.Field(typeof(TextEditor), nameof(TextEditor.m_RevealCursor)).SetValue(te, true);
AccessTools.Field(typeof(TextEditor), "m_RevealCursor").SetValue(te, true);
te.UpdateScrollOffsetIfNeeded(new Event());
}
}
Expand Down

0 comments on commit 5e20f7f

Please sign in to comment.