Welcome, Guest
Username: Password: Remember me

TOPIC: Paste to the filter's inputfield bug in v2.8.0 b6

Paste to the filter's inputfield bug in v2.8.0 b6 2 months 5 days ago #2484

  • RoKo0
  • RoKo0's Avatar
  • Offline
  • New Member
  • Posts: 15
  • Karma: 0
I updated to this version because of the filter's bug fix. But now I cannot paste strings to the filters' input field in the latest version.
It is a really annoying problem. When this input field will work correctly?

How can I fix this?
Last Edit: 2 months 5 days ago by RoKo0.
The administrator has disabled public write access.

Paste to the filter's inputfield bug in v2.8.0 b6 2 months 4 days ago #2487

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 915
  • Thank you received: 196
  • Karma: 58
Because of the way that Unity handles TextFields and ControlIDs, I had to use reflection to access the internal editor calls to bypass the ControlID that was generated.
That fixed the TextField loosing focus, but I used the normal GUI.TextField. I forgot that EditorGUI version is the one that allows copy/paste.

So, I went and made new fix using the EditorGUI version.
You can download 2.8.1a1 from the beta folder,
or replace the TextField function in Assets\i2\common\editor\editortools.cs line 588 by this one:
        public static object s_RecycledEditor;
        public static string TextField ( Rect position, string text, int maxLength, GUIStyle style, int controlID )
	{
            if (s_RecycledEditor==null)
            {
                FieldInfo info = typeof(EditorGUI).GetField("s_RecycledEditor", BindingFlags.NonPublic | BindingFlags.Static);
                s_RecycledEditor = info.GetValue(null);
            }

            if (s_RecycledEditor == null)
                return "";

            return Reflection_InvokeMethod( typeof( EditorGUI ), "DoTextField", s_RecycledEditor, controlID, position, text, style, null, false, false, false, false ) as string;
	}

Hope that helps,
Frank
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
Last Edit: 2 months 4 days ago by Frank.
The administrator has disabled public write access.

Paste to the filter's inputfield bug in v2.8.0 b6 2 months 4 days ago #2490

  • RoKo0
  • RoKo0's Avatar
  • Offline
  • New Member
  • Posts: 15
  • Karma: 0
Thank you!
The administrator has disabled public write access.
Time to create page: 0.129 seconds
Colors