Files
2026-06-04 11:42:34 +02:00

1862 lines
52 KiB
C#

using System;
using System.Collections.Generic;
using UnityEngine.Scripting;
namespace UnityEngine
{
// Token: 0x02000282 RID: 642
public class TextEditor
{
// Token: 0x06002C1D RID: 11293 RVA: 0x0003B3D4 File Offset: 0x000395D4
[RequiredByNativeCode]
public TextEditor()
{
}
// Token: 0x17000A11 RID: 2577
// (get) Token: 0x06002C1E RID: 11294 RVA: 0x0003B464 File Offset: 0x00039664
// (set) Token: 0x06002C1F RID: 11295 RVA: 0x0003B480 File Offset: 0x00039680
[Obsolete("Please use 'text' instead of 'content'", false)]
public GUIContent content
{
get
{
return this.m_Content;
}
set
{
this.m_Content = value;
}
}
// Token: 0x17000A12 RID: 2578
// (get) Token: 0x06002C20 RID: 11296 RVA: 0x0003B48C File Offset: 0x0003968C
// (set) Token: 0x06002C21 RID: 11297 RVA: 0x0003B4AC File Offset: 0x000396AC
public string text
{
get
{
return this.m_Content.text;
}
set
{
this.m_Content.text = value ?? string.Empty;
this.ClampTextIndex(ref this.m_CursorIndex);
this.ClampTextIndex(ref this.m_SelectIndex);
}
}
// Token: 0x17000A13 RID: 2579
// (get) Token: 0x06002C22 RID: 11298 RVA: 0x0003B4E0 File Offset: 0x000396E0
// (set) Token: 0x06002C23 RID: 11299 RVA: 0x0003B4FC File Offset: 0x000396FC
public Rect position
{
get
{
return this.m_Position;
}
set
{
if (!(this.m_Position == value))
{
this.m_Position = value;
this.UpdateScrollOffset();
}
}
}
// Token: 0x17000A14 RID: 2580
// (get) Token: 0x06002C24 RID: 11300 RVA: 0x0003B524 File Offset: 0x00039724
internal virtual Rect localPosition
{
get
{
return this.position;
}
}
// Token: 0x17000A15 RID: 2581
// (get) Token: 0x06002C25 RID: 11301 RVA: 0x0003B540 File Offset: 0x00039740
// (set) Token: 0x06002C26 RID: 11302 RVA: 0x0003B55C File Offset: 0x0003975C
public int cursorIndex
{
get
{
return this.m_CursorIndex;
}
set
{
int cursorIndex = this.m_CursorIndex;
this.m_CursorIndex = value;
this.ClampTextIndex(ref this.m_CursorIndex);
if (this.m_CursorIndex != cursorIndex)
{
this.m_RevealCursor = true;
}
}
}
// Token: 0x17000A16 RID: 2582
// (get) Token: 0x06002C27 RID: 11303 RVA: 0x0003B598 File Offset: 0x00039798
// (set) Token: 0x06002C28 RID: 11304 RVA: 0x0003B5B4 File Offset: 0x000397B4
public int selectIndex
{
get
{
return this.m_SelectIndex;
}
set
{
this.m_SelectIndex = value;
this.ClampTextIndex(ref this.m_SelectIndex);
}
}
// Token: 0x06002C29 RID: 11305 RVA: 0x0003B5CC File Offset: 0x000397CC
private void ClearCursorPos()
{
this.hasHorizontalCursorPos = false;
this.m_iAltCursorPos = -1;
}
// Token: 0x17000A17 RID: 2583
// (get) Token: 0x06002C2A RID: 11306 RVA: 0x0003B5E0 File Offset: 0x000397E0
// (set) Token: 0x06002C2B RID: 11307 RVA: 0x0003B5FC File Offset: 0x000397FC
public TextEditor.DblClickSnapping doubleClickSnapping
{
get
{
return this.m_DblClickSnap;
}
set
{
this.m_DblClickSnap = value;
}
}
// Token: 0x17000A18 RID: 2584
// (get) Token: 0x06002C2C RID: 11308 RVA: 0x0003B608 File Offset: 0x00039808
// (set) Token: 0x06002C2D RID: 11309 RVA: 0x0003B624 File Offset: 0x00039824
public int altCursorPosition
{
get
{
return this.m_iAltCursorPos;
}
set
{
this.m_iAltCursorPos = value;
}
}
// Token: 0x06002C2E RID: 11310 RVA: 0x0003B630 File Offset: 0x00039830
public void OnFocus()
{
if (this.multiline)
{
int num = 0;
this.selectIndex = num;
this.cursorIndex = num;
}
else
{
this.SelectAll();
}
this.m_HasFocus = true;
Input.imeCompositionMode = IMECompositionMode.On;
}
// Token: 0x06002C2F RID: 11311 RVA: 0x0003B674 File Offset: 0x00039874
public void OnLostFocus()
{
this.m_HasFocus = false;
this.scrollOffset = Vector2.zero;
Input.imeCompositionMode = IMECompositionMode.Auto;
}
// Token: 0x06002C30 RID: 11312 RVA: 0x0003B690 File Offset: 0x00039890
private void GrabGraphicalCursorPos()
{
if (!this.hasHorizontalCursorPos)
{
this.graphicalCursorPos = this.style.GetCursorPixelPosition(this.localPosition, this.m_Content, this.cursorIndex);
this.graphicalSelectCursorPos = this.style.GetCursorPixelPosition(this.localPosition, this.m_Content, this.selectIndex);
this.hasHorizontalCursorPos = false;
}
}
// Token: 0x06002C31 RID: 11313 RVA: 0x0003B6F8 File Offset: 0x000398F8
public bool HandleKeyEvent(Event e)
{
this.InitKeyActions();
EventModifiers modifiers = e.modifiers;
e.modifiers &= ~EventModifiers.CapsLock;
bool flag;
if (TextEditor.s_Keyactions.ContainsKey(e))
{
TextEditor.TextEditOp textEditOp = TextEditor.s_Keyactions[e];
this.PerformOperation(textEditOp);
e.modifiers = modifiers;
flag = true;
}
else
{
e.modifiers = modifiers;
flag = false;
}
return flag;
}
// Token: 0x06002C32 RID: 11314 RVA: 0x0003B764 File Offset: 0x00039964
public bool DeleteLineBack()
{
bool flag;
if (this.hasSelection)
{
this.DeleteSelection();
flag = true;
}
else
{
int num = this.cursorIndex;
int num2 = num;
while (num2-- != 0)
{
if (this.text[num2] == '\n')
{
num = num2 + 1;
break;
}
}
if (num2 == -1)
{
num = 0;
}
if (this.cursorIndex != num)
{
this.m_Content.text = this.text.Remove(num, this.cursorIndex - num);
int num3 = num;
this.cursorIndex = num3;
this.selectIndex = num3;
flag = true;
}
else
{
flag = false;
}
}
return flag;
}
// Token: 0x06002C33 RID: 11315 RVA: 0x0003B818 File Offset: 0x00039A18
public bool DeleteWordBack()
{
bool flag;
if (this.hasSelection)
{
this.DeleteSelection();
flag = true;
}
else
{
int num = this.FindEndOfPreviousWord(this.cursorIndex);
if (this.cursorIndex != num)
{
this.m_Content.text = this.text.Remove(num, this.cursorIndex - num);
int num2 = num;
this.cursorIndex = num2;
this.selectIndex = num2;
flag = true;
}
else
{
flag = false;
}
}
return flag;
}
// Token: 0x06002C34 RID: 11316 RVA: 0x0003B898 File Offset: 0x00039A98
public bool DeleteWordForward()
{
bool flag;
if (this.hasSelection)
{
this.DeleteSelection();
flag = true;
}
else
{
int num = this.FindStartOfNextWord(this.cursorIndex);
if (this.cursorIndex < this.text.Length)
{
this.m_Content.text = this.text.Remove(this.cursorIndex, num - this.cursorIndex);
flag = true;
}
else
{
flag = false;
}
}
return flag;
}
// Token: 0x06002C35 RID: 11317 RVA: 0x0003B918 File Offset: 0x00039B18
public bool Delete()
{
bool flag;
if (this.hasSelection)
{
this.DeleteSelection();
flag = true;
}
else if (this.cursorIndex < this.text.Length)
{
this.m_Content.text = this.text.Remove(this.cursorIndex, 1);
flag = true;
}
else
{
flag = false;
}
return flag;
}
// Token: 0x06002C36 RID: 11318 RVA: 0x0003B984 File Offset: 0x00039B84
public bool CanPaste()
{
return GUIUtility.systemCopyBuffer.Length != 0;
}
// Token: 0x06002C37 RID: 11319 RVA: 0x0003B9AC File Offset: 0x00039BAC
public bool Backspace()
{
bool flag;
if (this.hasSelection)
{
this.DeleteSelection();
flag = true;
}
else if (this.cursorIndex > 0)
{
this.m_Content.text = this.text.Remove(this.cursorIndex - 1, 1);
int num = this.cursorIndex - 1;
this.cursorIndex = num;
this.selectIndex = num;
this.ClearCursorPos();
flag = true;
}
else
{
flag = false;
}
return flag;
}
// Token: 0x06002C38 RID: 11320 RVA: 0x0003BA2C File Offset: 0x00039C2C
public void SelectAll()
{
this.cursorIndex = 0;
this.selectIndex = this.text.Length;
this.ClearCursorPos();
}
// Token: 0x06002C39 RID: 11321 RVA: 0x0003BA50 File Offset: 0x00039C50
public void SelectNone()
{
this.selectIndex = this.cursorIndex;
this.ClearCursorPos();
}
// Token: 0x17000A19 RID: 2585
// (get) Token: 0x06002C3A RID: 11322 RVA: 0x0003BA68 File Offset: 0x00039C68
public bool hasSelection
{
get
{
return this.cursorIndex != this.selectIndex;
}
}
// Token: 0x17000A1A RID: 2586
// (get) Token: 0x06002C3B RID: 11323 RVA: 0x0003BA90 File Offset: 0x00039C90
public string SelectedText
{
get
{
string text;
if (this.cursorIndex == this.selectIndex)
{
text = "";
}
else if (this.cursorIndex < this.selectIndex)
{
text = this.text.Substring(this.cursorIndex, this.selectIndex - this.cursorIndex);
}
else
{
text = this.text.Substring(this.selectIndex, this.cursorIndex - this.selectIndex);
}
return text;
}
}
// Token: 0x06002C3C RID: 11324 RVA: 0x0003BB14 File Offset: 0x00039D14
public bool DeleteSelection()
{
bool flag;
if (this.cursorIndex == this.selectIndex)
{
flag = false;
}
else
{
if (this.cursorIndex < this.selectIndex)
{
this.m_Content.text = this.text.Substring(0, this.cursorIndex) + this.text.Substring(this.selectIndex, this.text.Length - this.selectIndex);
this.selectIndex = this.cursorIndex;
}
else
{
this.m_Content.text = this.text.Substring(0, this.selectIndex) + this.text.Substring(this.cursorIndex, this.text.Length - this.cursorIndex);
this.cursorIndex = this.selectIndex;
}
this.ClearCursorPos();
flag = true;
}
return flag;
}
// Token: 0x06002C3D RID: 11325 RVA: 0x0003BC04 File Offset: 0x00039E04
public void ReplaceSelection(string replace)
{
this.DeleteSelection();
this.m_Content.text = this.text.Insert(this.cursorIndex, replace);
this.selectIndex = (this.cursorIndex += replace.Length);
this.ClearCursorPos();
}
// Token: 0x06002C3E RID: 11326 RVA: 0x0003BC58 File Offset: 0x00039E58
public void Insert(char c)
{
this.ReplaceSelection(c.ToString());
}
// Token: 0x06002C3F RID: 11327 RVA: 0x0003BC70 File Offset: 0x00039E70
public void MoveSelectionToAltCursor()
{
if (this.m_iAltCursorPos != -1)
{
int iAltCursorPos = this.m_iAltCursorPos;
string selectedText = this.SelectedText;
this.m_Content.text = this.text.Insert(iAltCursorPos, selectedText);
if (iAltCursorPos < this.cursorIndex)
{
this.cursorIndex += selectedText.Length;
this.selectIndex += selectedText.Length;
}
this.DeleteSelection();
int num = iAltCursorPos;
this.cursorIndex = num;
this.selectIndex = num;
this.ClearCursorPos();
}
}
// Token: 0x06002C40 RID: 11328 RVA: 0x0003BD08 File Offset: 0x00039F08
public void MoveRight()
{
this.ClearCursorPos();
if (this.selectIndex == this.cursorIndex)
{
this.cursorIndex++;
this.DetectFocusChange();
this.selectIndex = this.cursorIndex;
}
else if (this.selectIndex > this.cursorIndex)
{
this.cursorIndex = this.selectIndex;
}
else
{
this.selectIndex = this.cursorIndex;
}
}
// Token: 0x06002C41 RID: 11329 RVA: 0x0003BD84 File Offset: 0x00039F84
public void MoveLeft()
{
if (this.selectIndex == this.cursorIndex)
{
this.cursorIndex--;
this.selectIndex = this.cursorIndex;
}
else if (this.selectIndex > this.cursorIndex)
{
this.selectIndex = this.cursorIndex;
}
else
{
this.cursorIndex = this.selectIndex;
}
this.ClearCursorPos();
}
// Token: 0x06002C42 RID: 11330 RVA: 0x0003BDFC File Offset: 0x00039FFC
public void MoveUp()
{
if (this.selectIndex < this.cursorIndex)
{
this.selectIndex = this.cursorIndex;
}
else
{
this.cursorIndex = this.selectIndex;
}
this.GrabGraphicalCursorPos();
this.graphicalCursorPos.y = this.graphicalCursorPos.y - 1f;
int cursorStringIndex = this.style.GetCursorStringIndex(this.localPosition, this.m_Content, this.graphicalCursorPos);
this.selectIndex = cursorStringIndex;
this.cursorIndex = cursorStringIndex;
if (this.cursorIndex <= 0)
{
this.ClearCursorPos();
}
}
// Token: 0x06002C43 RID: 11331 RVA: 0x0003BE94 File Offset: 0x0003A094
public void MoveDown()
{
if (this.selectIndex > this.cursorIndex)
{
this.selectIndex = this.cursorIndex;
}
else
{
this.cursorIndex = this.selectIndex;
}
this.GrabGraphicalCursorPos();
this.graphicalCursorPos.y = this.graphicalCursorPos.y + (this.style.lineHeight + 5f);
int cursorStringIndex = this.style.GetCursorStringIndex(this.localPosition, this.m_Content, this.graphicalCursorPos);
this.selectIndex = cursorStringIndex;
this.cursorIndex = cursorStringIndex;
if (this.cursorIndex == this.text.Length)
{
this.ClearCursorPos();
}
}
// Token: 0x06002C44 RID: 11332 RVA: 0x0003BF44 File Offset: 0x0003A144
public void MoveLineStart()
{
int num = ((this.selectIndex >= this.cursorIndex) ? this.cursorIndex : this.selectIndex);
int num2 = num;
int num3;
while (num2-- != 0)
{
if (this.text[num2] == '\n')
{
num3 = num2 + 1;
this.cursorIndex = num3;
this.selectIndex = num3;
return;
}
}
num3 = 0;
this.cursorIndex = num3;
this.selectIndex = num3;
}
// Token: 0x06002C45 RID: 11333 RVA: 0x0003BFC4 File Offset: 0x0003A1C4
public void MoveLineEnd()
{
int num = ((this.selectIndex <= this.cursorIndex) ? this.cursorIndex : this.selectIndex);
int i = num;
int length = this.text.Length;
int num2;
while (i < length)
{
if (this.text[i] == '\n')
{
num2 = i;
this.cursorIndex = num2;
this.selectIndex = num2;
return;
}
i++;
}
num2 = length;
this.cursorIndex = num2;
this.selectIndex = num2;
}
// Token: 0x06002C46 RID: 11334 RVA: 0x0003C050 File Offset: 0x0003A250
public void MoveGraphicalLineStart()
{
int graphicalLineStart = this.GetGraphicalLineStart((this.cursorIndex >= this.selectIndex) ? this.selectIndex : this.cursorIndex);
this.selectIndex = graphicalLineStart;
this.cursorIndex = graphicalLineStart;
}
// Token: 0x06002C47 RID: 11335 RVA: 0x0003C098 File Offset: 0x0003A298
public void MoveGraphicalLineEnd()
{
int graphicalLineEnd = this.GetGraphicalLineEnd((this.cursorIndex <= this.selectIndex) ? this.selectIndex : this.cursorIndex);
this.selectIndex = graphicalLineEnd;
this.cursorIndex = graphicalLineEnd;
}
// Token: 0x06002C48 RID: 11336 RVA: 0x0003C0E0 File Offset: 0x0003A2E0
public void MoveTextStart()
{
int num = 0;
this.cursorIndex = num;
this.selectIndex = num;
}
// Token: 0x06002C49 RID: 11337 RVA: 0x0003C100 File Offset: 0x0003A300
public void MoveTextEnd()
{
int length = this.text.Length;
this.cursorIndex = length;
this.selectIndex = length;
}
// Token: 0x06002C4A RID: 11338 RVA: 0x0003C128 File Offset: 0x0003A328
private int IndexOfEndOfLine(int startIndex)
{
int num = this.text.IndexOf('\n', startIndex);
return (num == -1) ? this.text.Length : num;
}
// Token: 0x06002C4B RID: 11339 RVA: 0x0003C164 File Offset: 0x0003A364
public void MoveParagraphForward()
{
this.cursorIndex = ((this.cursorIndex <= this.selectIndex) ? this.selectIndex : this.cursorIndex);
if (this.cursorIndex < this.text.Length)
{
int num = this.IndexOfEndOfLine(this.cursorIndex + 1);
this.cursorIndex = num;
this.selectIndex = num;
}
}
// Token: 0x06002C4C RID: 11340 RVA: 0x0003C1D0 File Offset: 0x0003A3D0
public void MoveParagraphBackward()
{
this.cursorIndex = ((this.cursorIndex >= this.selectIndex) ? this.selectIndex : this.cursorIndex);
if (this.cursorIndex > 1)
{
int num = this.text.LastIndexOf('\n', this.cursorIndex - 2) + 1;
this.cursorIndex = num;
this.selectIndex = num;
}
else
{
int num = 0;
this.cursorIndex = num;
this.selectIndex = num;
}
}
// Token: 0x06002C4D RID: 11341 RVA: 0x0003C250 File Offset: 0x0003A450
public void MoveCursorToPosition(Vector2 cursorPosition)
{
this.MoveCursorToPosition_Internal(cursorPosition, Event.current.shift);
}
// Token: 0x06002C4E RID: 11342 RVA: 0x0003C264 File Offset: 0x0003A464
protected internal void MoveCursorToPosition_Internal(Vector2 cursorPosition, bool shift)
{
this.selectIndex = this.style.GetCursorStringIndex(this.localPosition, this.m_Content, cursorPosition + this.scrollOffset);
if (!shift)
{
this.cursorIndex = this.selectIndex;
}
this.DetectFocusChange();
}
// Token: 0x06002C4F RID: 11343 RVA: 0x0003C2B8 File Offset: 0x0003A4B8
public void MoveAltCursorToPosition(Vector2 cursorPosition)
{
int cursorStringIndex = this.style.GetCursorStringIndex(this.localPosition, this.m_Content, cursorPosition + this.scrollOffset);
this.m_iAltCursorPos = Mathf.Min(this.text.Length, cursorStringIndex);
this.DetectFocusChange();
}
// Token: 0x06002C50 RID: 11344 RVA: 0x0003C308 File Offset: 0x0003A508
public bool IsOverSelection(Vector2 cursorPosition)
{
int cursorStringIndex = this.style.GetCursorStringIndex(this.localPosition, this.m_Content, cursorPosition + this.scrollOffset);
return cursorStringIndex < Mathf.Max(this.cursorIndex, this.selectIndex) && cursorStringIndex > Mathf.Min(this.cursorIndex, this.selectIndex);
}
// Token: 0x06002C51 RID: 11345 RVA: 0x0003C370 File Offset: 0x0003A570
public void SelectToPosition(Vector2 cursorPosition)
{
if (!this.m_MouseDragSelectsWholeWords)
{
this.cursorIndex = this.style.GetCursorStringIndex(this.localPosition, this.m_Content, cursorPosition + this.scrollOffset);
}
else
{
int num = this.style.GetCursorStringIndex(this.localPosition, this.m_Content, cursorPosition + this.scrollOffset);
if (this.m_DblClickSnap == TextEditor.DblClickSnapping.WORDS)
{
if (num < this.m_DblClickInitPos)
{
this.cursorIndex = this.FindEndOfClassification(num, -1);
this.selectIndex = this.FindEndOfClassification(this.m_DblClickInitPos, 1);
}
else
{
if (num >= this.text.Length)
{
num = this.text.Length - 1;
}
this.cursorIndex = this.FindEndOfClassification(num, 1);
this.selectIndex = this.FindEndOfClassification(this.m_DblClickInitPos - 1, -1);
}
}
else if (num < this.m_DblClickInitPos)
{
if (num > 0)
{
this.cursorIndex = this.text.LastIndexOf('\n', Mathf.Max(0, num - 2)) + 1;
}
else
{
this.cursorIndex = 0;
}
this.selectIndex = this.text.LastIndexOf('\n', this.m_DblClickInitPos);
}
else
{
if (num < this.text.Length)
{
this.cursorIndex = this.IndexOfEndOfLine(num);
}
else
{
this.cursorIndex = this.text.Length;
}
this.selectIndex = this.text.LastIndexOf('\n', Mathf.Max(0, this.m_DblClickInitPos - 2)) + 1;
}
}
}
// Token: 0x06002C52 RID: 11346 RVA: 0x0003C524 File Offset: 0x0003A724
public void SelectLeft()
{
if (this.m_bJustSelected && this.cursorIndex > this.selectIndex)
{
int cursorIndex = this.cursorIndex;
this.cursorIndex = this.selectIndex;
this.selectIndex = cursorIndex;
}
this.m_bJustSelected = false;
this.cursorIndex--;
}
// Token: 0x06002C53 RID: 11347 RVA: 0x0003C580 File Offset: 0x0003A780
public void SelectRight()
{
if (this.m_bJustSelected && this.cursorIndex < this.selectIndex)
{
int cursorIndex = this.cursorIndex;
this.cursorIndex = this.selectIndex;
this.selectIndex = cursorIndex;
}
this.m_bJustSelected = false;
this.cursorIndex++;
}
// Token: 0x06002C54 RID: 11348 RVA: 0x0003C5DC File Offset: 0x0003A7DC
public void SelectUp()
{
this.GrabGraphicalCursorPos();
this.graphicalCursorPos.y = this.graphicalCursorPos.y - 1f;
this.cursorIndex = this.style.GetCursorStringIndex(this.localPosition, this.m_Content, this.graphicalCursorPos);
}
// Token: 0x06002C55 RID: 11349 RVA: 0x0003C62C File Offset: 0x0003A82C
public void SelectDown()
{
this.GrabGraphicalCursorPos();
this.graphicalCursorPos.y = this.graphicalCursorPos.y + (this.style.lineHeight + 5f);
this.cursorIndex = this.style.GetCursorStringIndex(this.localPosition, this.m_Content, this.graphicalCursorPos);
}
// Token: 0x06002C56 RID: 11350 RVA: 0x0003C688 File Offset: 0x0003A888
public void SelectTextEnd()
{
this.cursorIndex = this.text.Length;
}
// Token: 0x06002C57 RID: 11351 RVA: 0x0003C69C File Offset: 0x0003A89C
public void SelectTextStart()
{
this.cursorIndex = 0;
}
// Token: 0x06002C58 RID: 11352 RVA: 0x0003C6A8 File Offset: 0x0003A8A8
public void MouseDragSelectsWholeWords(bool on)
{
this.m_MouseDragSelectsWholeWords = on;
this.m_DblClickInitPos = this.cursorIndex;
}
// Token: 0x06002C59 RID: 11353 RVA: 0x0003C6C0 File Offset: 0x0003A8C0
public void DblClickSnap(TextEditor.DblClickSnapping snapping)
{
this.m_DblClickSnap = snapping;
}
// Token: 0x06002C5A RID: 11354 RVA: 0x0003C6CC File Offset: 0x0003A8CC
private int GetGraphicalLineStart(int p)
{
Vector2 cursorPixelPosition = this.style.GetCursorPixelPosition(this.localPosition, this.m_Content, p);
cursorPixelPosition.x = 0f;
return this.style.GetCursorStringIndex(this.localPosition, this.m_Content, cursorPixelPosition);
}
// Token: 0x06002C5B RID: 11355 RVA: 0x0003C720 File Offset: 0x0003A920
private int GetGraphicalLineEnd(int p)
{
Vector2 cursorPixelPosition = this.style.GetCursorPixelPosition(this.localPosition, this.m_Content, p);
cursorPixelPosition.x += 5000f;
return this.style.GetCursorStringIndex(this.localPosition, this.m_Content, cursorPixelPosition);
}
// Token: 0x06002C5C RID: 11356 RVA: 0x0003C77C File Offset: 0x0003A97C
private int FindNextSeperator(int startPos)
{
int length = this.text.Length;
while (startPos < length && !TextEditor.isLetterLikeChar(this.text[startPos]))
{
startPos++;
}
while (startPos < length && TextEditor.isLetterLikeChar(this.text[startPos]))
{
startPos++;
}
return startPos;
}
// Token: 0x06002C5D RID: 11357 RVA: 0x0003C7EC File Offset: 0x0003A9EC
private static bool isLetterLikeChar(char c)
{
return char.IsLetterOrDigit(c) || c == '\'';
}
// Token: 0x06002C5E RID: 11358 RVA: 0x0003C814 File Offset: 0x0003AA14
private int FindPrevSeperator(int startPos)
{
startPos--;
while (startPos > 0 && !TextEditor.isLetterLikeChar(this.text[startPos]))
{
startPos--;
}
while (startPos >= 0 && TextEditor.isLetterLikeChar(this.text[startPos]))
{
startPos--;
}
return startPos + 1;
}
// Token: 0x06002C5F RID: 11359 RVA: 0x0003C880 File Offset: 0x0003AA80
public void MoveWordRight()
{
this.cursorIndex = ((this.cursorIndex <= this.selectIndex) ? this.selectIndex : this.cursorIndex);
int num = this.FindNextSeperator(this.cursorIndex);
this.selectIndex = num;
this.cursorIndex = num;
this.ClearCursorPos();
}
// Token: 0x06002C60 RID: 11360 RVA: 0x0003C8D8 File Offset: 0x0003AAD8
public void MoveToStartOfNextWord()
{
this.ClearCursorPos();
if (this.cursorIndex != this.selectIndex)
{
this.MoveRight();
}
else
{
int num = this.FindStartOfNextWord(this.cursorIndex);
this.selectIndex = num;
this.cursorIndex = num;
}
}
// Token: 0x06002C61 RID: 11361 RVA: 0x0003C924 File Offset: 0x0003AB24
public void MoveToEndOfPreviousWord()
{
this.ClearCursorPos();
if (this.cursorIndex != this.selectIndex)
{
this.MoveLeft();
}
else
{
int num = this.FindEndOfPreviousWord(this.cursorIndex);
this.selectIndex = num;
this.cursorIndex = num;
}
}
// Token: 0x06002C62 RID: 11362 RVA: 0x0003C970 File Offset: 0x0003AB70
public void SelectToStartOfNextWord()
{
this.ClearCursorPos();
this.cursorIndex = this.FindStartOfNextWord(this.cursorIndex);
}
// Token: 0x06002C63 RID: 11363 RVA: 0x0003C98C File Offset: 0x0003AB8C
public void SelectToEndOfPreviousWord()
{
this.ClearCursorPos();
this.cursorIndex = this.FindEndOfPreviousWord(this.cursorIndex);
}
// Token: 0x06002C64 RID: 11364 RVA: 0x0003C9A8 File Offset: 0x0003ABA8
private TextEditor.CharacterType ClassifyChar(char c)
{
TextEditor.CharacterType characterType;
if (char.IsWhiteSpace(c))
{
characterType = TextEditor.CharacterType.WhiteSpace;
}
else if (char.IsLetterOrDigit(c) || c == '\'')
{
characterType = TextEditor.CharacterType.LetterLike;
}
else
{
characterType = TextEditor.CharacterType.Symbol;
}
return characterType;
}
// Token: 0x06002C65 RID: 11365 RVA: 0x0003C9EC File Offset: 0x0003ABEC
public int FindStartOfNextWord(int p)
{
int length = this.text.Length;
int num;
if (p == length)
{
num = p;
}
else
{
char c = this.text[p];
TextEditor.CharacterType characterType = this.ClassifyChar(c);
if (characterType != TextEditor.CharacterType.WhiteSpace)
{
p++;
while (p < length && this.ClassifyChar(this.text[p]) == characterType)
{
p++;
}
}
else if (c == '\t' || c == '\n')
{
return p + 1;
}
if (p == length)
{
num = p;
}
else
{
c = this.text[p];
if (c == ' ')
{
while (p < length && char.IsWhiteSpace(this.text[p]))
{
p++;
}
}
else if (c == '\t' || c == '\n')
{
return p;
}
num = p;
}
}
return num;
}
// Token: 0x06002C66 RID: 11366 RVA: 0x0003CAF4 File Offset: 0x0003ACF4
private int FindEndOfPreviousWord(int p)
{
int num;
if (p == 0)
{
num = p;
}
else
{
p--;
while (p > 0 && this.text[p] == ' ')
{
p--;
}
TextEditor.CharacterType characterType = this.ClassifyChar(this.text[p]);
if (characterType != TextEditor.CharacterType.WhiteSpace)
{
while (p > 0 && this.ClassifyChar(this.text[p - 1]) == characterType)
{
p--;
}
}
num = p;
}
return num;
}
// Token: 0x06002C67 RID: 11367 RVA: 0x0003CB88 File Offset: 0x0003AD88
public void MoveWordLeft()
{
this.cursorIndex = ((this.cursorIndex >= this.selectIndex) ? this.selectIndex : this.cursorIndex);
this.cursorIndex = this.FindPrevSeperator(this.cursorIndex);
this.selectIndex = this.cursorIndex;
}
// Token: 0x06002C68 RID: 11368 RVA: 0x0003CBDC File Offset: 0x0003ADDC
public void SelectWordRight()
{
this.ClearCursorPos();
int selectIndex = this.selectIndex;
if (this.cursorIndex < this.selectIndex)
{
this.selectIndex = this.cursorIndex;
this.MoveWordRight();
this.selectIndex = selectIndex;
this.cursorIndex = ((this.cursorIndex >= this.selectIndex) ? this.selectIndex : this.cursorIndex);
}
else
{
this.selectIndex = this.cursorIndex;
this.MoveWordRight();
this.selectIndex = selectIndex;
}
}
// Token: 0x06002C69 RID: 11369 RVA: 0x0003CC68 File Offset: 0x0003AE68
public void SelectWordLeft()
{
this.ClearCursorPos();
int selectIndex = this.selectIndex;
if (this.cursorIndex > this.selectIndex)
{
this.selectIndex = this.cursorIndex;
this.MoveWordLeft();
this.selectIndex = selectIndex;
this.cursorIndex = ((this.cursorIndex <= this.selectIndex) ? this.selectIndex : this.cursorIndex);
}
else
{
this.selectIndex = this.cursorIndex;
this.MoveWordLeft();
this.selectIndex = selectIndex;
}
}
// Token: 0x06002C6A RID: 11370 RVA: 0x0003CCF4 File Offset: 0x0003AEF4
public void ExpandSelectGraphicalLineStart()
{
this.ClearCursorPos();
if (this.cursorIndex < this.selectIndex)
{
this.cursorIndex = this.GetGraphicalLineStart(this.cursorIndex);
}
else
{
int cursorIndex = this.cursorIndex;
this.cursorIndex = this.GetGraphicalLineStart(this.selectIndex);
this.selectIndex = cursorIndex;
}
}
// Token: 0x06002C6B RID: 11371 RVA: 0x0003CD54 File Offset: 0x0003AF54
public void ExpandSelectGraphicalLineEnd()
{
this.ClearCursorPos();
if (this.cursorIndex > this.selectIndex)
{
this.cursorIndex = this.GetGraphicalLineEnd(this.cursorIndex);
}
else
{
int cursorIndex = this.cursorIndex;
this.cursorIndex = this.GetGraphicalLineEnd(this.selectIndex);
this.selectIndex = cursorIndex;
}
}
// Token: 0x06002C6C RID: 11372 RVA: 0x0003CDB4 File Offset: 0x0003AFB4
public void SelectGraphicalLineStart()
{
this.ClearCursorPos();
this.cursorIndex = this.GetGraphicalLineStart(this.cursorIndex);
}
// Token: 0x06002C6D RID: 11373 RVA: 0x0003CDD0 File Offset: 0x0003AFD0
public void SelectGraphicalLineEnd()
{
this.ClearCursorPos();
this.cursorIndex = this.GetGraphicalLineEnd(this.cursorIndex);
}
// Token: 0x06002C6E RID: 11374 RVA: 0x0003CDEC File Offset: 0x0003AFEC
public void SelectParagraphForward()
{
this.ClearCursorPos();
bool flag = this.cursorIndex < this.selectIndex;
if (this.cursorIndex < this.text.Length)
{
this.cursorIndex = this.IndexOfEndOfLine(this.cursorIndex + 1);
if (flag && this.cursorIndex > this.selectIndex)
{
this.cursorIndex = this.selectIndex;
}
}
}
// Token: 0x06002C6F RID: 11375 RVA: 0x0003CE60 File Offset: 0x0003B060
public void SelectParagraphBackward()
{
this.ClearCursorPos();
bool flag = this.cursorIndex > this.selectIndex;
if (this.cursorIndex > 1)
{
this.cursorIndex = this.text.LastIndexOf('\n', this.cursorIndex - 2) + 1;
if (flag && this.cursorIndex < this.selectIndex)
{
this.cursorIndex = this.selectIndex;
}
}
else
{
int num = 0;
this.cursorIndex = num;
this.selectIndex = num;
}
}
// Token: 0x06002C70 RID: 11376 RVA: 0x0003CEE8 File Offset: 0x0003B0E8
public void SelectCurrentWord()
{
this.ClearCursorPos();
int length = this.text.Length;
this.selectIndex = this.cursorIndex;
if (length != 0)
{
if (this.cursorIndex >= length)
{
this.cursorIndex = length - 1;
}
if (this.selectIndex >= length)
{
this.selectIndex--;
}
if (this.cursorIndex < this.selectIndex)
{
this.cursorIndex = this.FindEndOfClassification(this.cursorIndex, -1);
this.selectIndex = this.FindEndOfClassification(this.selectIndex, 1);
}
else
{
this.cursorIndex = this.FindEndOfClassification(this.cursorIndex, 1);
this.selectIndex = this.FindEndOfClassification(this.selectIndex, -1);
}
this.m_bJustSelected = true;
}
}
// Token: 0x06002C71 RID: 11377 RVA: 0x0003CFBC File Offset: 0x0003B1BC
private int FindEndOfClassification(int p, int dir)
{
int length = this.text.Length;
int num;
if (p >= length || p < 0)
{
num = p;
}
else
{
TextEditor.CharacterType characterType = this.ClassifyChar(this.text[p]);
for (;;)
{
p += dir;
if (p < 0)
{
break;
}
if (p >= length)
{
goto Block_3;
}
if (this.ClassifyChar(this.text[p]) != characterType)
{
goto Block_4;
}
}
return 0;
Block_3:
return length;
Block_4:
if (dir == 1)
{
num = p;
}
else
{
num = p + 1;
}
}
return num;
}
// Token: 0x06002C72 RID: 11378 RVA: 0x0003D054 File Offset: 0x0003B254
public void SelectCurrentParagraph()
{
this.ClearCursorPos();
int length = this.text.Length;
if (this.cursorIndex < length)
{
this.cursorIndex = this.IndexOfEndOfLine(this.cursorIndex) + 1;
}
if (this.selectIndex != 0)
{
this.selectIndex = this.text.LastIndexOf('\n', this.selectIndex - 1) + 1;
}
}
// Token: 0x06002C73 RID: 11379 RVA: 0x0003D0C0 File Offset: 0x0003B2C0
public void UpdateScrollOffsetIfNeeded(Event evt)
{
if (evt.type != EventType.Repaint && evt.type != EventType.Layout)
{
this.UpdateScrollOffset();
}
}
// Token: 0x06002C74 RID: 11380 RVA: 0x0003D0E4 File Offset: 0x0003B2E4
protected void UpdateScrollOffset()
{
int cursorIndex = this.cursorIndex;
this.graphicalCursorPos = this.style.GetCursorPixelPosition(new Rect(0f, 0f, this.position.width, this.position.height), this.m_Content, cursorIndex);
Rect rect = this.style.padding.Remove(this.position);
Vector2 vector = new Vector2(this.style.CalcSize(this.m_Content).x, this.style.CalcHeight(this.m_Content, this.position.width));
if (vector.x < this.position.width)
{
this.scrollOffset.x = 0f;
}
else if (this.m_RevealCursor)
{
if (this.graphicalCursorPos.x + 1f > this.scrollOffset.x + rect.width)
{
this.scrollOffset.x = this.graphicalCursorPos.x - rect.width;
}
if (this.graphicalCursorPos.x < this.scrollOffset.x + (float)this.style.padding.left)
{
this.scrollOffset.x = this.graphicalCursorPos.x - (float)this.style.padding.left;
}
}
if (vector.y < rect.height)
{
this.scrollOffset.y = 0f;
}
else if (this.m_RevealCursor)
{
if (this.graphicalCursorPos.y + this.style.lineHeight > this.scrollOffset.y + rect.height + (float)this.style.padding.top)
{
this.scrollOffset.y = this.graphicalCursorPos.y - rect.height - (float)this.style.padding.top + this.style.lineHeight;
}
if (this.graphicalCursorPos.y < this.scrollOffset.y + (float)this.style.padding.top)
{
this.scrollOffset.y = this.graphicalCursorPos.y - (float)this.style.padding.top;
}
}
if (this.scrollOffset.y > 0f && vector.y - this.scrollOffset.y < rect.height)
{
this.scrollOffset.y = vector.y - rect.height - (float)this.style.padding.top - (float)this.style.padding.bottom;
}
this.scrollOffset.y = ((this.scrollOffset.y >= 0f) ? this.scrollOffset.y : 0f);
this.m_RevealCursor = false;
}
// Token: 0x06002C75 RID: 11381 RVA: 0x0003D428 File Offset: 0x0003B628
public void DrawCursor(string newText)
{
string text = this.text;
int num = this.cursorIndex;
if (Input.compositionString.Length > 0)
{
this.m_Content.text = newText.Substring(0, this.cursorIndex) + Input.compositionString + newText.Substring(this.selectIndex);
num += Input.compositionString.Length;
}
else
{
this.m_Content.text = newText;
}
this.graphicalCursorPos = this.style.GetCursorPixelPosition(new Rect(0f, 0f, this.position.width, this.position.height), this.m_Content, num);
Vector2 contentOffset = this.style.contentOffset;
this.style.contentOffset -= this.scrollOffset;
this.style.Internal_clipOffset = this.scrollOffset;
Input.compositionCursorPos = this.graphicalCursorPos + new Vector2(this.position.x, this.position.y + this.style.lineHeight) - this.scrollOffset;
if (Input.compositionString.Length > 0)
{
this.style.DrawWithTextSelection(this.position, this.m_Content, this.controlID, this.cursorIndex, this.cursorIndex + Input.compositionString.Length, true);
}
else
{
this.style.DrawWithTextSelection(this.position, this.m_Content, this.controlID, this.cursorIndex, this.selectIndex);
}
if (this.m_iAltCursorPos != -1)
{
this.style.DrawCursor(this.position, this.m_Content, this.controlID, this.m_iAltCursorPos);
}
this.style.contentOffset = contentOffset;
this.style.Internal_clipOffset = Vector2.zero;
this.m_Content.text = text;
}
// Token: 0x06002C76 RID: 11382 RVA: 0x0003D634 File Offset: 0x0003B834
private bool PerformOperation(TextEditor.TextEditOp operation)
{
this.m_RevealCursor = true;
switch (operation)
{
case TextEditor.TextEditOp.MoveLeft:
this.MoveLeft();
goto IL_2BA;
case TextEditor.TextEditOp.MoveRight:
this.MoveRight();
goto IL_2BA;
case TextEditor.TextEditOp.MoveUp:
this.MoveUp();
goto IL_2BA;
case TextEditor.TextEditOp.MoveDown:
this.MoveDown();
goto IL_2BA;
case TextEditor.TextEditOp.MoveLineStart:
this.MoveLineStart();
goto IL_2BA;
case TextEditor.TextEditOp.MoveLineEnd:
this.MoveLineEnd();
goto IL_2BA;
case TextEditor.TextEditOp.MoveTextStart:
this.MoveTextStart();
goto IL_2BA;
case TextEditor.TextEditOp.MoveTextEnd:
this.MoveTextEnd();
goto IL_2BA;
case TextEditor.TextEditOp.MoveGraphicalLineStart:
this.MoveGraphicalLineStart();
goto IL_2BA;
case TextEditor.TextEditOp.MoveGraphicalLineEnd:
this.MoveGraphicalLineEnd();
goto IL_2BA;
case TextEditor.TextEditOp.MoveWordLeft:
this.MoveWordLeft();
goto IL_2BA;
case TextEditor.TextEditOp.MoveWordRight:
this.MoveWordRight();
goto IL_2BA;
case TextEditor.TextEditOp.MoveParagraphForward:
this.MoveParagraphForward();
goto IL_2BA;
case TextEditor.TextEditOp.MoveParagraphBackward:
this.MoveParagraphBackward();
goto IL_2BA;
case TextEditor.TextEditOp.MoveToStartOfNextWord:
this.MoveToStartOfNextWord();
goto IL_2BA;
case TextEditor.TextEditOp.MoveToEndOfPreviousWord:
this.MoveToEndOfPreviousWord();
goto IL_2BA;
case TextEditor.TextEditOp.SelectLeft:
this.SelectLeft();
goto IL_2BA;
case TextEditor.TextEditOp.SelectRight:
this.SelectRight();
goto IL_2BA;
case TextEditor.TextEditOp.SelectUp:
this.SelectUp();
goto IL_2BA;
case TextEditor.TextEditOp.SelectDown:
this.SelectDown();
goto IL_2BA;
case TextEditor.TextEditOp.SelectTextStart:
this.SelectTextStart();
goto IL_2BA;
case TextEditor.TextEditOp.SelectTextEnd:
this.SelectTextEnd();
goto IL_2BA;
case TextEditor.TextEditOp.ExpandSelectGraphicalLineStart:
this.ExpandSelectGraphicalLineStart();
goto IL_2BA;
case TextEditor.TextEditOp.ExpandSelectGraphicalLineEnd:
this.ExpandSelectGraphicalLineEnd();
goto IL_2BA;
case TextEditor.TextEditOp.SelectGraphicalLineStart:
this.SelectGraphicalLineStart();
goto IL_2BA;
case TextEditor.TextEditOp.SelectGraphicalLineEnd:
this.SelectGraphicalLineEnd();
goto IL_2BA;
case TextEditor.TextEditOp.SelectWordLeft:
this.SelectWordLeft();
goto IL_2BA;
case TextEditor.TextEditOp.SelectWordRight:
this.SelectWordRight();
goto IL_2BA;
case TextEditor.TextEditOp.SelectToEndOfPreviousWord:
this.SelectToEndOfPreviousWord();
goto IL_2BA;
case TextEditor.TextEditOp.SelectToStartOfNextWord:
this.SelectToStartOfNextWord();
goto IL_2BA;
case TextEditor.TextEditOp.SelectParagraphBackward:
this.SelectParagraphBackward();
goto IL_2BA;
case TextEditor.TextEditOp.SelectParagraphForward:
this.SelectParagraphForward();
goto IL_2BA;
case TextEditor.TextEditOp.Delete:
return this.Delete();
case TextEditor.TextEditOp.Backspace:
return this.Backspace();
case TextEditor.TextEditOp.DeleteWordBack:
return this.DeleteWordBack();
case TextEditor.TextEditOp.DeleteWordForward:
return this.DeleteWordForward();
case TextEditor.TextEditOp.DeleteLineBack:
return this.DeleteLineBack();
case TextEditor.TextEditOp.Cut:
return this.Cut();
case TextEditor.TextEditOp.Copy:
this.Copy();
goto IL_2BA;
case TextEditor.TextEditOp.Paste:
return this.Paste();
case TextEditor.TextEditOp.SelectAll:
this.SelectAll();
goto IL_2BA;
case TextEditor.TextEditOp.SelectNone:
this.SelectNone();
goto IL_2BA;
}
Debug.Log("Unimplemented: " + operation);
IL_2BA:
return false;
}
// Token: 0x06002C77 RID: 11383 RVA: 0x0003D904 File Offset: 0x0003BB04
public void SaveBackup()
{
this.oldText = this.text;
this.oldPos = this.cursorIndex;
this.oldSelectPos = this.selectIndex;
}
// Token: 0x06002C78 RID: 11384 RVA: 0x0003D92C File Offset: 0x0003BB2C
public void Undo()
{
this.m_Content.text = this.oldText;
this.cursorIndex = this.oldPos;
this.selectIndex = this.oldSelectPos;
}
// Token: 0x06002C79 RID: 11385 RVA: 0x0003D958 File Offset: 0x0003BB58
public bool Cut()
{
bool flag;
if (this.isPasswordField)
{
flag = false;
}
else
{
this.Copy();
flag = this.DeleteSelection();
}
return flag;
}
// Token: 0x06002C7A RID: 11386 RVA: 0x0003D98C File Offset: 0x0003BB8C
public void Copy()
{
if (this.selectIndex != this.cursorIndex)
{
if (!this.isPasswordField)
{
string text;
if (this.cursorIndex < this.selectIndex)
{
text = this.text.Substring(this.cursorIndex, this.selectIndex - this.cursorIndex);
}
else
{
text = this.text.Substring(this.selectIndex, this.cursorIndex - this.selectIndex);
}
GUIUtility.systemCopyBuffer = text;
}
}
}
// Token: 0x06002C7B RID: 11387 RVA: 0x0003DA1C File Offset: 0x0003BC1C
private static string ReplaceNewlinesWithSpaces(string value)
{
value = value.Replace("\r\n", " ");
value = value.Replace('\n', ' ');
value = value.Replace('\r', ' ');
return value;
}
// Token: 0x06002C7C RID: 11388 RVA: 0x0003DA5C File Offset: 0x0003BC5C
public bool Paste()
{
string text = GUIUtility.systemCopyBuffer;
bool flag;
if (text != "")
{
if (!this.multiline)
{
text = TextEditor.ReplaceNewlinesWithSpaces(text);
}
this.ReplaceSelection(text);
flag = true;
}
else
{
flag = false;
}
return flag;
}
// Token: 0x06002C7D RID: 11389 RVA: 0x0003DAAC File Offset: 0x0003BCAC
private static void MapKey(string key, TextEditor.TextEditOp action)
{
TextEditor.s_Keyactions[Event.KeyboardEvent(key)] = action;
}
// Token: 0x06002C7E RID: 11390 RVA: 0x0003DAC0 File Offset: 0x0003BCC0
private void InitKeyActions()
{
if (TextEditor.s_Keyactions == null)
{
TextEditor.s_Keyactions = new Dictionary<Event, TextEditor.TextEditOp>();
TextEditor.MapKey("left", TextEditor.TextEditOp.MoveLeft);
TextEditor.MapKey("right", TextEditor.TextEditOp.MoveRight);
TextEditor.MapKey("up", TextEditor.TextEditOp.MoveUp);
TextEditor.MapKey("down", TextEditor.TextEditOp.MoveDown);
TextEditor.MapKey("#left", TextEditor.TextEditOp.SelectLeft);
TextEditor.MapKey("#right", TextEditor.TextEditOp.SelectRight);
TextEditor.MapKey("#up", TextEditor.TextEditOp.SelectUp);
TextEditor.MapKey("#down", TextEditor.TextEditOp.SelectDown);
TextEditor.MapKey("delete", TextEditor.TextEditOp.Delete);
TextEditor.MapKey("backspace", TextEditor.TextEditOp.Backspace);
TextEditor.MapKey("#backspace", TextEditor.TextEditOp.Backspace);
if (SystemInfo.operatingSystemFamily == OperatingSystemFamily.MacOSX)
{
TextEditor.MapKey("^left", TextEditor.TextEditOp.MoveGraphicalLineStart);
TextEditor.MapKey("^right", TextEditor.TextEditOp.MoveGraphicalLineEnd);
TextEditor.MapKey("&left", TextEditor.TextEditOp.MoveWordLeft);
TextEditor.MapKey("&right", TextEditor.TextEditOp.MoveWordRight);
TextEditor.MapKey("&up", TextEditor.TextEditOp.MoveParagraphBackward);
TextEditor.MapKey("&down", TextEditor.TextEditOp.MoveParagraphForward);
TextEditor.MapKey("%left", TextEditor.TextEditOp.MoveGraphicalLineStart);
TextEditor.MapKey("%right", TextEditor.TextEditOp.MoveGraphicalLineEnd);
TextEditor.MapKey("%up", TextEditor.TextEditOp.MoveTextStart);
TextEditor.MapKey("%down", TextEditor.TextEditOp.MoveTextEnd);
TextEditor.MapKey("#home", TextEditor.TextEditOp.SelectTextStart);
TextEditor.MapKey("#end", TextEditor.TextEditOp.SelectTextEnd);
TextEditor.MapKey("#^left", TextEditor.TextEditOp.ExpandSelectGraphicalLineStart);
TextEditor.MapKey("#^right", TextEditor.TextEditOp.ExpandSelectGraphicalLineEnd);
TextEditor.MapKey("#^up", TextEditor.TextEditOp.SelectParagraphBackward);
TextEditor.MapKey("#^down", TextEditor.TextEditOp.SelectParagraphForward);
TextEditor.MapKey("#&left", TextEditor.TextEditOp.SelectWordLeft);
TextEditor.MapKey("#&right", TextEditor.TextEditOp.SelectWordRight);
TextEditor.MapKey("#&up", TextEditor.TextEditOp.SelectParagraphBackward);
TextEditor.MapKey("#&down", TextEditor.TextEditOp.SelectParagraphForward);
TextEditor.MapKey("#%left", TextEditor.TextEditOp.ExpandSelectGraphicalLineStart);
TextEditor.MapKey("#%right", TextEditor.TextEditOp.ExpandSelectGraphicalLineEnd);
TextEditor.MapKey("#%up", TextEditor.TextEditOp.SelectTextStart);
TextEditor.MapKey("#%down", TextEditor.TextEditOp.SelectTextEnd);
TextEditor.MapKey("%a", TextEditor.TextEditOp.SelectAll);
TextEditor.MapKey("%x", TextEditor.TextEditOp.Cut);
TextEditor.MapKey("%c", TextEditor.TextEditOp.Copy);
TextEditor.MapKey("%v", TextEditor.TextEditOp.Paste);
TextEditor.MapKey("^d", TextEditor.TextEditOp.Delete);
TextEditor.MapKey("^h", TextEditor.TextEditOp.Backspace);
TextEditor.MapKey("^b", TextEditor.TextEditOp.MoveLeft);
TextEditor.MapKey("^f", TextEditor.TextEditOp.MoveRight);
TextEditor.MapKey("^a", TextEditor.TextEditOp.MoveLineStart);
TextEditor.MapKey("^e", TextEditor.TextEditOp.MoveLineEnd);
TextEditor.MapKey("&delete", TextEditor.TextEditOp.DeleteWordForward);
TextEditor.MapKey("&backspace", TextEditor.TextEditOp.DeleteWordBack);
TextEditor.MapKey("%backspace", TextEditor.TextEditOp.DeleteLineBack);
}
else
{
TextEditor.MapKey("home", TextEditor.TextEditOp.MoveGraphicalLineStart);
TextEditor.MapKey("end", TextEditor.TextEditOp.MoveGraphicalLineEnd);
TextEditor.MapKey("%left", TextEditor.TextEditOp.MoveWordLeft);
TextEditor.MapKey("%right", TextEditor.TextEditOp.MoveWordRight);
TextEditor.MapKey("%up", TextEditor.TextEditOp.MoveParagraphBackward);
TextEditor.MapKey("%down", TextEditor.TextEditOp.MoveParagraphForward);
TextEditor.MapKey("^left", TextEditor.TextEditOp.MoveToEndOfPreviousWord);
TextEditor.MapKey("^right", TextEditor.TextEditOp.MoveToStartOfNextWord);
TextEditor.MapKey("^up", TextEditor.TextEditOp.MoveParagraphBackward);
TextEditor.MapKey("^down", TextEditor.TextEditOp.MoveParagraphForward);
TextEditor.MapKey("#^left", TextEditor.TextEditOp.SelectToEndOfPreviousWord);
TextEditor.MapKey("#^right", TextEditor.TextEditOp.SelectToStartOfNextWord);
TextEditor.MapKey("#^up", TextEditor.TextEditOp.SelectParagraphBackward);
TextEditor.MapKey("#^down", TextEditor.TextEditOp.SelectParagraphForward);
TextEditor.MapKey("#home", TextEditor.TextEditOp.SelectGraphicalLineStart);
TextEditor.MapKey("#end", TextEditor.TextEditOp.SelectGraphicalLineEnd);
TextEditor.MapKey("^delete", TextEditor.TextEditOp.DeleteWordForward);
TextEditor.MapKey("^backspace", TextEditor.TextEditOp.DeleteWordBack);
TextEditor.MapKey("%backspace", TextEditor.TextEditOp.DeleteLineBack);
TextEditor.MapKey("^a", TextEditor.TextEditOp.SelectAll);
TextEditor.MapKey("^x", TextEditor.TextEditOp.Cut);
TextEditor.MapKey("^c", TextEditor.TextEditOp.Copy);
TextEditor.MapKey("^v", TextEditor.TextEditOp.Paste);
TextEditor.MapKey("#delete", TextEditor.TextEditOp.Cut);
TextEditor.MapKey("^insert", TextEditor.TextEditOp.Copy);
TextEditor.MapKey("#insert", TextEditor.TextEditOp.Paste);
}
}
}
// Token: 0x06002C7F RID: 11391 RVA: 0x0003DE6C File Offset: 0x0003C06C
public void DetectFocusChange()
{
this.OnDetectFocusChange();
}
// Token: 0x06002C80 RID: 11392 RVA: 0x0003DE78 File Offset: 0x0003C078
internal virtual void OnDetectFocusChange()
{
if (this.m_HasFocus && this.controlID != GUIUtility.keyboardControl)
{
this.OnLostFocus();
}
if (!this.m_HasFocus && this.controlID == GUIUtility.keyboardControl)
{
this.OnFocus();
}
}
// Token: 0x06002C81 RID: 11393 RVA: 0x0003DEC8 File Offset: 0x0003C0C8
private void ClampTextIndex(ref int index)
{
index = Mathf.Clamp(index, 0, this.text.Length);
}
// Token: 0x040007FB RID: 2043
public TouchScreenKeyboard keyboardOnScreen = null;
// Token: 0x040007FC RID: 2044
public int controlID = 0;
// Token: 0x040007FD RID: 2045
public GUIStyle style = GUIStyle.none;
// Token: 0x040007FE RID: 2046
public bool multiline = false;
// Token: 0x040007FF RID: 2047
public bool hasHorizontalCursorPos = false;
// Token: 0x04000800 RID: 2048
public bool isPasswordField = false;
// Token: 0x04000801 RID: 2049
internal bool m_HasFocus;
// Token: 0x04000802 RID: 2050
public Vector2 scrollOffset = Vector2.zero;
// Token: 0x04000803 RID: 2051
private GUIContent m_Content = new GUIContent();
// Token: 0x04000804 RID: 2052
private Rect m_Position;
// Token: 0x04000805 RID: 2053
private int m_CursorIndex = 0;
// Token: 0x04000806 RID: 2054
private int m_SelectIndex = 0;
// Token: 0x04000807 RID: 2055
private bool m_RevealCursor = false;
// Token: 0x04000808 RID: 2056
public Vector2 graphicalCursorPos;
// Token: 0x04000809 RID: 2057
public Vector2 graphicalSelectCursorPos;
// Token: 0x0400080A RID: 2058
private bool m_MouseDragSelectsWholeWords = false;
// Token: 0x0400080B RID: 2059
private int m_DblClickInitPos = 0;
// Token: 0x0400080C RID: 2060
private TextEditor.DblClickSnapping m_DblClickSnap = TextEditor.DblClickSnapping.WORDS;
// Token: 0x0400080D RID: 2061
private bool m_bJustSelected = false;
// Token: 0x0400080E RID: 2062
private int m_iAltCursorPos = -1;
// Token: 0x0400080F RID: 2063
private string oldText;
// Token: 0x04000810 RID: 2064
private int oldPos;
// Token: 0x04000811 RID: 2065
private int oldSelectPos;
// Token: 0x04000812 RID: 2066
private static Dictionary<Event, TextEditor.TextEditOp> s_Keyactions;
// Token: 0x02000283 RID: 643
public enum DblClickSnapping : byte
{
// Token: 0x04000814 RID: 2068
WORDS,
// Token: 0x04000815 RID: 2069
PARAGRAPHS
}
// Token: 0x02000284 RID: 644
private enum CharacterType
{
// Token: 0x04000817 RID: 2071
LetterLike,
// Token: 0x04000818 RID: 2072
Symbol,
// Token: 0x04000819 RID: 2073
Symbol2,
// Token: 0x0400081A RID: 2074
WhiteSpace
}
// Token: 0x02000285 RID: 645
private enum TextEditOp
{
// Token: 0x0400081C RID: 2076
MoveLeft,
// Token: 0x0400081D RID: 2077
MoveRight,
// Token: 0x0400081E RID: 2078
MoveUp,
// Token: 0x0400081F RID: 2079
MoveDown,
// Token: 0x04000820 RID: 2080
MoveLineStart,
// Token: 0x04000821 RID: 2081
MoveLineEnd,
// Token: 0x04000822 RID: 2082
MoveTextStart,
// Token: 0x04000823 RID: 2083
MoveTextEnd,
// Token: 0x04000824 RID: 2084
MovePageUp,
// Token: 0x04000825 RID: 2085
MovePageDown,
// Token: 0x04000826 RID: 2086
MoveGraphicalLineStart,
// Token: 0x04000827 RID: 2087
MoveGraphicalLineEnd,
// Token: 0x04000828 RID: 2088
MoveWordLeft,
// Token: 0x04000829 RID: 2089
MoveWordRight,
// Token: 0x0400082A RID: 2090
MoveParagraphForward,
// Token: 0x0400082B RID: 2091
MoveParagraphBackward,
// Token: 0x0400082C RID: 2092
MoveToStartOfNextWord,
// Token: 0x0400082D RID: 2093
MoveToEndOfPreviousWord,
// Token: 0x0400082E RID: 2094
SelectLeft,
// Token: 0x0400082F RID: 2095
SelectRight,
// Token: 0x04000830 RID: 2096
SelectUp,
// Token: 0x04000831 RID: 2097
SelectDown,
// Token: 0x04000832 RID: 2098
SelectTextStart,
// Token: 0x04000833 RID: 2099
SelectTextEnd,
// Token: 0x04000834 RID: 2100
SelectPageUp,
// Token: 0x04000835 RID: 2101
SelectPageDown,
// Token: 0x04000836 RID: 2102
ExpandSelectGraphicalLineStart,
// Token: 0x04000837 RID: 2103
ExpandSelectGraphicalLineEnd,
// Token: 0x04000838 RID: 2104
SelectGraphicalLineStart,
// Token: 0x04000839 RID: 2105
SelectGraphicalLineEnd,
// Token: 0x0400083A RID: 2106
SelectWordLeft,
// Token: 0x0400083B RID: 2107
SelectWordRight,
// Token: 0x0400083C RID: 2108
SelectToEndOfPreviousWord,
// Token: 0x0400083D RID: 2109
SelectToStartOfNextWord,
// Token: 0x0400083E RID: 2110
SelectParagraphBackward,
// Token: 0x0400083F RID: 2111
SelectParagraphForward,
// Token: 0x04000840 RID: 2112
Delete,
// Token: 0x04000841 RID: 2113
Backspace,
// Token: 0x04000842 RID: 2114
DeleteWordBack,
// Token: 0x04000843 RID: 2115
DeleteWordForward,
// Token: 0x04000844 RID: 2116
DeleteLineBack,
// Token: 0x04000845 RID: 2117
Cut,
// Token: 0x04000846 RID: 2118
Copy,
// Token: 0x04000847 RID: 2119
Paste,
// Token: 0x04000848 RID: 2120
SelectAll,
// Token: 0x04000849 RID: 2121
SelectNone,
// Token: 0x0400084A RID: 2122
ScrollStart,
// Token: 0x0400084B RID: 2123
ScrollEnd,
// Token: 0x0400084C RID: 2124
ScrollPageUp,
// Token: 0x0400084D RID: 2125
ScrollPageDown
}
}
}