scripts
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
|
||||
namespace UnityEngine.Experimental.UIElements
|
||||
{
|
||||
// Token: 0x0200032B RID: 811
|
||||
internal class IMTouchScreenTextField : IMTextField
|
||||
{
|
||||
// Token: 0x06003303 RID: 13059 RVA: 0x0004F208 File Offset: 0x0004D408
|
||||
public IMTouchScreenTextField()
|
||||
{
|
||||
this.secureText = string.Empty;
|
||||
this.maskChar = '\0';
|
||||
}
|
||||
|
||||
// Token: 0x17000B8C RID: 2956
|
||||
// (get) Token: 0x06003304 RID: 13060 RVA: 0x0004F224 File Offset: 0x0004D424
|
||||
// (set) Token: 0x06003305 RID: 13061 RVA: 0x0004F240 File Offset: 0x0004D440
|
||||
public string secureText
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_SecureText;
|
||||
}
|
||||
set
|
||||
{
|
||||
string text = value ?? string.Empty;
|
||||
if (text != this.m_SecureText)
|
||||
{
|
||||
this.m_SecureText = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000B8D RID: 2957
|
||||
// (get) Token: 0x06003306 RID: 13062 RVA: 0x0004F278 File Offset: 0x0004D478
|
||||
// (set) Token: 0x06003307 RID: 13063 RVA: 0x0004F294 File Offset: 0x0004D494
|
||||
public char maskChar
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_MaskChar;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.m_MaskChar != value)
|
||||
{
|
||||
this.m_MaskChar = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003308 RID: 13064 RVA: 0x0004F2AC File Offset: 0x0004D4AC
|
||||
public override bool OnGUI(Event evt)
|
||||
{
|
||||
base.SyncTextEditor();
|
||||
bool flag = false;
|
||||
EventType type = evt.type;
|
||||
if (type != EventType.MouseDown)
|
||||
{
|
||||
if (type == EventType.Repaint)
|
||||
{
|
||||
this.DoRepaint(new StylePainter(evt.mousePosition));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = this.DoMouseDown(new MouseEventArgs(evt.mousePosition, evt.clickCount, evt.modifiers));
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
evt.Use();
|
||||
}
|
||||
base.editor.UpdateScrollOffsetIfNeeded(evt);
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x06003309 RID: 13065 RVA: 0x0004F338 File Offset: 0x0004D538
|
||||
protected override int DoGenerateControlID()
|
||||
{
|
||||
return GUIUtility.GetControlID("TouchScreenTextField".GetHashCode(), base.focusType, base.position);
|
||||
}
|
||||
|
||||
// Token: 0x0600330A RID: 13066 RVA: 0x0004F368 File Offset: 0x0004D568
|
||||
internal override void DoRepaint(IStylePainter args)
|
||||
{
|
||||
if (base.editor.keyboardOnScreen != null)
|
||||
{
|
||||
base.text = base.editor.keyboardOnScreen.text;
|
||||
if (base.maxLength >= 0 && base.text != null && base.text.Length > base.maxLength)
|
||||
{
|
||||
base.text = base.text.Substring(0, base.maxLength);
|
||||
}
|
||||
if (base.editor.keyboardOnScreen.done)
|
||||
{
|
||||
base.editor.keyboardOnScreen = null;
|
||||
GUI.changed = true;
|
||||
}
|
||||
}
|
||||
string text = base.text;
|
||||
if (!string.IsNullOrEmpty(this.secureText))
|
||||
{
|
||||
base.text = GUI.PasswordFieldGetStrToShow(text, this.maskChar);
|
||||
}
|
||||
base.style.Draw(base.position, GUIContent.Temp(base.text), base.id, false);
|
||||
base.text = text;
|
||||
}
|
||||
|
||||
// Token: 0x0600330B RID: 13067 RVA: 0x0004F460 File Offset: 0x0004D660
|
||||
protected override bool DoMouseDown(MouseEventArgs args)
|
||||
{
|
||||
bool flag;
|
||||
if (base.position.Contains(args.mousePosition))
|
||||
{
|
||||
GUIUtility.hotControl = base.id;
|
||||
if (IMTouchScreenTextField.s_HotTextField != -1 && IMTouchScreenTextField.s_HotTextField != base.id)
|
||||
{
|
||||
TextEditor textEditor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), IMTouchScreenTextField.s_HotTextField);
|
||||
textEditor.keyboardOnScreen = null;
|
||||
}
|
||||
IMTouchScreenTextField.s_HotTextField = base.id;
|
||||
if (GUIUtility.keyboardControl != base.id)
|
||||
{
|
||||
GUIUtility.keyboardControl = base.id;
|
||||
}
|
||||
base.editor.keyboardOnScreen = TouchScreenKeyboard.Open(string.IsNullOrEmpty(this.secureText) ? base.text : this.secureText, TouchScreenKeyboardType.Default, true, base.multiline, !string.IsNullOrEmpty(this.secureText));
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
// Token: 0x04000A6D RID: 2669
|
||||
private static int s_HotTextField = -1;
|
||||
|
||||
// Token: 0x04000A6E RID: 2670
|
||||
private string m_SecureText;
|
||||
|
||||
// Token: 0x04000A6F RID: 2671
|
||||
private char m_MaskChar;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user