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

More
6 years 6 months ago - 6 years 6 months ago #2484 by RoKo0
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: 6 years 6 months ago by RoKo0.

Please Log in or Create an account to join the conversation.

More
6 years 6 months ago - 6 years 6 months ago #2487 by Frank
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: 6 years 6 months ago by Frank.

Please Log in or Create an account to join the conversation.

More
6 years 6 months ago #2490 by RoKo0

Please Log in or Create an account to join the conversation.

Time to create page: 0.149 seconds
Template by JoomlaShine