Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Window Class Reference
Inheritance diagram for Window:
IChangeResolution IUISkin

Classes

class  SaveData
 
class  Setting
 

Public Types

enum  Type { Default , AlignToMouse , Side }
 

Public Member Functions

void Init (Layer _layer=null)
 
void RefreshTipPivotPosition ()
 
void SetRect (RectData data, bool mousePos=false)
 
void UpdateSaveData ()
 
void OnKill ()
 
void ApplySkin ()
 
SwitchContent< T > ()
 
void SwitchContent (UIContent content)
 
void SwitchContent (string name)
 
void SwitchContent (Setting.Tab tab)
 
UIContent SwitchContent (int index)
 
void SetTitles (string langList, string idHeaderRow=null)
 
void SetCaption (string text)
 
void AddHeader (string langLeft=null, string langRight=null)
 
void LoadHeader (string id="HeaderRow")
 
void SetPosition ()
 
SetContent< T > (int tabIndex=-1, string id=null)
 
void SetContent (int tabIndex, UIContent content)
 
GetContent< T > ()
 
bool NextTab (int a)
 
void BuildTabs (int index=-1)
 
Setting.Tab AddTab (string idLang, UIContent content=null, Action action=null, Sprite sprite=null, string langTooltip=null)
 
int GetTab (UIContent content)
 
int GetTab (string name)
 
void ClearBottomButtons ()
 
UIButton AddBottomButton (string idLang, UnityAction onClick, bool setFirst=false)
 
void AddBottomSpace (int size=20)
 
void EnableShadow ()
 
void SetInteractable (bool enable, float alpha=0.5f)
 
void Close ()
 
void InitPanel ()
 
void OnChangeResolution ()
 
void SetAnchor ()
 
void OnApplicationFocus (bool focus)
 
void BringToTop ()
 
void ClampToScreen ()
 
void OnChangeResolution ()
 
void ApplySkin ()
 

Public Attributes

bool leftSide = true
 
bool isFloat
 
Setting setting
 
UIContentView view
 
UIText textCaption
 
UIText textStats
 
Image iconCaption
 
Image deco1
 
Image deco2
 
UIImage imageBG
 
UIImage bgCaption
 
Button buttonClose
 
UIButton buttonHelp
 
UIButton buttonSort
 
UIButton buttonQuickSort
 
UIButton buttonExtra
 
UIButton buttonShared
 
UIButton moldTab
 
UIButton moldBottom
 
RectTransform rectCorner
 
RectTransform rectCaption
 
RectTransform rectTab
 
RectTransform rectBottom
 
RectTransform rectStats
 
RectTransform tipPiovotLeft
 
RectTransform tipPivotRight
 
RectTransform rectDeco
 
RectTransform rectHeader
 
UISelectableGroup groupTab
 
WindowController controller
 
SkinRootStatic skinRoot
 
Tween tweenAnime
 
CanvasGroup cgBG
 
CanvasGroup cgFloatMenu
 
UICollider bgCollider
 
List< CanvasGroup > listCgFloat
 
Layer layer
 
float FrameOffsetL = -15f
 
float FrameOffsetR = -15f
 
float FrameOffsetTop = -30f
 
float FrameThickness = 14f
 
float CaptionHeight = 50f
 
float frameOffsetY = 5f
 
int idTab
 
int windowIndex
 
WindowMenu menuLeft
 
WindowMenu menuLeftBottom
 
WindowMenu menuBottom
 
WindowMenu menuRight
 
CanvasGroup cg
 
Vector2 posBottom
 
Vector2 posTab
 
Vector2 posCaption
 
SaveData saveData
 
Window attachedWindow
 
Vector2 attachFix
 

Static Public Attributes

static Dictionary< string, SaveDatadictData = new Dictionary<string, SaveData>()
 
static Dictionary< string, int > dictTab = new Dictionary<string, int>()
 
static bool openLastTab
 
static bool animateWindow
 

Properties

string idWindow [get]
 
Setting.Tab CurrentTab [get]
 
UIContent CurrentContent [get]
 
bool AutoAnchor [get]
 
SkinRootStatic Skin [get]
 
Canvas Canvas [get]
 
EventTrigger EventTrigger [get]
 
RectTransform RectTransform [get]
 
Vector3 CorrectedLossyScale [get]
 
Vector3[] FrameOuterCorners [get]
 
Vector3[] FrameInnerCorners [get]
 
Vector3[] CaptionCorners [get]
 
bool isStatic [get]
 

Private Member Functions

void Awake ()
 
void RecalculatePositionCaches ()
 
void Update ()
 
void OnPointerEnter (PointerEventData data)
 
void OnPointerExit (PointerEventData data)
 
void OnPointerDown (PointerEventData data)
 
void OnPointerUp (PointerEventData data)
 
void ProcessCursorChanges ()
 
void ProcessMovement ()
 
void ProcessResize ()
 
bool CursorOverTopBorder (bool canExceed=false)
 
bool CursorOverBottomBorder (bool canExceed=false)
 
bool CursorOverLeftBorder (bool canExceed=false)
 
bool CursorOverRightBorder (bool canExceed=false)
 
bool CursorOverCaption ()
 
bool CursorOverWindow ()
 

Private Attributes

RectTransform _rect
 
LayoutGroup layoutWindow
 
bool? shadowEnabled
 
Shadow bgShadow
 
Canvas _canvas
 
EventTrigger _eventTrigger
 
RectTransform _rectTransform
 
Vector3 _correctedLossyScale
 
Vector3[] _frameOuterCorners
 
Vector3[] _frameInnerCorners
 
Vector3[] _captionCorners
 
bool IsProcessingCursorChanges
 
bool IsProcessingMovement
 
bool IsProcessingResize
 
bool IsResizingOverTop
 
bool IsResizingOverBottom
 
bool IsResizingOverLeft
 
bool IsResizingOverRight
 
Vector3 LastScreenCursorPosition
 
Vector3 dragStartPos
 
Vector3 dragOffset
 
bool scrolling
 
bool isTop
 
float floatAlpha
 

Detailed Description

Definition at line 12 of file Window.cs.

Member Enumeration Documentation

◆ Type

Enumerator
Default 
AlignToMouse 
Side 

Definition at line 14 of file Window.cs.

15 {
16 Default,
18 Side
19 }

Member Function Documentation

◆ AddBottomButton()

UIButton Window.AddBottomButton ( string  idLang,
UnityAction  onClick,
bool  setFirst = false 
)
inline

Definition at line 1486 of file Window.cs.

1487 {
1488 UIButton uIButton = (moldBottom ? Util.Instantiate(moldBottom, rectBottom) : Util.Instantiate<UIButton>("UI/Window/Base/Element/ButtonBottom", rectBottom));
1489 uIButton.mainText.SetLang(idLang);
1490 uIButton.onClick.AddListener(onClick);
1491 if (setFirst)
1492 {
1493 uIButton.transform.SetAsFirstSibling();
1494 }
1495 uIButton.RebuildLayout(recursive: true);
1496 return uIButton;
1497 }
UIText mainText
Definition: UIButton.cs:102
void SetLang(string idLang)
Definition: UIText.cs:240
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
RectTransform rectBottom
Definition: Window.cs:646
UIButton moldBottom
Definition: Window.cs:638

References UIButton.mainText, moldBottom, rectBottom, UIText.SetLang(), and Util.

Referenced by Init().

◆ AddBottomSpace()

void Window.AddBottomSpace ( int  size = 20)
inline

Definition at line 1499 of file Window.cs.

1500 {
1501 RectTransform rectTransform = new GameObject().AddComponent<RectTransform>();
1502 rectTransform.sizeDelta = new Vector2(size, 20f);
1503 rectTransform.SetParent(rectBottom, worldPositionStays: false);
1504 }
RectTransform RectTransform
Definition: Window.cs:863

References rectBottom, and RectTransform.

◆ AddHeader()

void Window.AddHeader ( string  langLeft = null,
string  langRight = null 
)
inline

Definition at line 1295 of file Window.cs.

1296 {
1297 if (!rectHeader)
1298 {
1299 LoadHeader();
1300 }
1301 UIHeader[] componentsInChildren = rectHeader.GetComponentsInChildren<UIHeader>(includeInactive: true);
1302 if (!langLeft.IsEmpty())
1303 {
1304 componentsInChildren[0].SetText(langLeft);
1305 }
1306 if (componentsInChildren.Length > 1)
1307 {
1308 if (langRight.IsEmpty())
1309 {
1310 componentsInChildren[1].SetActive(enable: false);
1311 }
1312 else
1313 {
1314 componentsInChildren[1].SetText(langRight);
1315 }
1316 }
1317 }
void SetText(string s)
Definition: UIHeader.cs:24
void LoadHeader(string id="HeaderRow")
Definition: Window.cs:1319
RectTransform rectHeader
Definition: Window.cs:656

References LoadHeader(), rectHeader, and UIHeader.SetText().

◆ AddTab()

Setting.Tab Window.AddTab ( string  idLang,
UIContent  content = null,
Action  action = null,
Sprite  sprite = null,
string  langTooltip = null 
)
inline

Definition at line 1443 of file Window.cs.

1444 {
1445 Setting.Tab tab = new Setting.Tab
1446 {
1447 idLang = idLang,
1448 content = content,
1449 action = action,
1450 sprite = sprite,
1451 langTooltip = langTooltip
1452 };
1453 setting.tabs.Add(tab);
1454 return tab;
1455 }
List< Tab > tabs
Definition: Window.cs:81
Setting setting
Definition: Window.cs:606

References setting, and Window.Setting.tabs.

Referenced by UIMultiList.AddOwner(), and LayerCraft.RefreshCategory().

◆ ApplySkin()

void Window.ApplySkin ( )
inline

Implements IUISkin.

Definition at line 1129 of file Window.cs.

1130 {
1131 SkinRootStatic skin = Skin;
1132 if ((bool)cg && setting.transparent)
1133 {
1134 cg.alpha = skin.transparency;
1135 }
1136 if ((bool)deco1)
1137 {
1138 Image image = deco1;
1139 Color color2 = (deco2.color = skin.colorsEx.deco1);
1140 image.color = color2;
1141 }
1142 layoutWindow.padding = skin.positions.paddingWindow;
1143 rectBottom.anchoredPosition = posBottom + skin.positions.bottom;
1145 {
1146 rectTab.anchoredPosition = posTab + skin.positions.tab;
1147 }
1148 Image image2 = imageBG?.frame;
1149 if (!shadowEnabled.HasValue)
1150 {
1151 shadowEnabled = bgShadow?.enabled ?? false;
1152 }
1153 if ((bool)image2 && skin.useFrame)
1154 {
1155 image2.GetComponent<Shadow>().enabled = shadowEnabled.GetValueOrDefault();
1156 if ((bool)bgShadow)
1157 {
1158 bgShadow.enabled = false;
1159 }
1160 }
1161 else if ((bool)bgShadow)
1162 {
1163 bgShadow.enabled = shadowEnabled.GetValueOrDefault();
1164 }
1165 Outline component = textCaption.GetComponent<Outline>();
1166 if ((bool)component)
1167 {
1168 component.enabled = skin.captionOutline;
1169 }
1170 if ((bool)rectDeco)
1171 {
1172 rectDeco.SetActive(skin.useDeco);
1173 }
1174 if ((bool)rectCorner && imageBG.imageType != ImageType.BG_Window_Board)
1175 {
1176 rectCorner.anchoredPosition = skin.positions.windowCorner;
1177 }
1178 if ((bool)menuLeft.layout)
1179 {
1180 menuLeft.layout.Rect().anchoredPosition = skin.positions.leftMenu;
1181 }
1182 if ((bool)bgCaption)
1183 {
1184 bgCaption.SetActive(skin.captionBG && textCaption.gameObject.activeInHierarchy);
1185 }
1186 if (skin.alwaysShadow || skin.noShadow)
1187 {
1188 EnableShadow();
1189 }
1190 }
ImageType
Definition: ImageType.cs:2
SkinColorProfileEx colorsEx
Positions positions
Image frame
Definition: UIImage.cs:16
LayoutGroup layout
Definition: WindowMenu.cs:11
bool transparent
Definition: Window.cs:71
bool tabAfterCaption
Definition: Window.cs:73
RectTransform rectDeco
Definition: Window.cs:654
UIText textCaption
Definition: Window.cs:610
Vector2 posBottom
Definition: Window.cs:715
CanvasGroup cg
Definition: Window.cs:712
UIImage bgCaption
Definition: Window.cs:622
Image deco1
Definition: Window.cs:616
Vector2 posTab
Definition: Window.cs:718
void EnableShadow()
Definition: Window.cs:1506
SkinRootStatic Skin
Definition: Window.cs:827
RectTransform rectCorner
Definition: Window.cs:640
bool? shadowEnabled
Definition: Window.cs:726
UIImage imageBG
Definition: Window.cs:620
WindowMenu menuLeft
Definition: Window.cs:700
Shadow bgShadow
Definition: Window.cs:728

References SkinRootStatic.alwaysShadow, bgCaption, bgShadow, SkinRootStatic.Positions.bottom, SkinRootStatic.captionBG, SkinRootStatic.captionOutline, cg, Color, SkinRootStatic.colorsEx, SkinColorProfileEx.deco1, deco1, EnableShadow(), UIImage.frame, imageBG, WindowMenu.layout, SkinRootStatic.Positions.leftMenu, menuLeft, SkinRootStatic.noShadow, Outline, SkinRootStatic.Positions.paddingWindow, posBottom, SkinRootStatic.positions, posTab, rectCorner, rectDeco, setting, shadowEnabled, Skin, SkinRootStatic.Positions.tab, Window.Setting.tabAfterCaption, textCaption, SkinRootStatic.transparency, Window.Setting.transparent, SkinRootStatic.useDeco, SkinRootStatic.useFrame, and SkinRootStatic.Positions.windowCorner.

Referenced by Init().

◆ Awake()

void Window.Awake ( )
inlineprivate

Definition at line 934 of file Window.cs.

935 {
936 controller = base.gameObject.GetComponent<WindowController>();
937 if ((bool)controller)
938 {
939 controller.window = this;
940 }
941 menuLeft = new WindowMenu("Left", this);
942 menuRight = new WindowMenu(setting.rightMenuAlias.IsEmpty("Right"), this);
943 menuBottom = new WindowMenu("Bottom", this);
944 menuLeftBottom = new WindowMenu("LeftBottom", this);
945 if (!base.gameObject.GetComponent<Canvas>())
946 {
947 base.gameObject.AddComponent<Canvas>();
948 base.gameObject.AddComponent<GraphicRaycaster>();
949 }
950 cg = base.gameObject.GetComponent<CanvasGroup>();
951 if (cg == null)
952 {
953 cg = base.gameObject.AddComponent<CanvasGroup>();
954 }
955 posTab = rectTab.anchoredPosition;
956 posBottom = rectBottom.anchoredPosition;
957 layoutWindow = GetComponent<LayoutGroup>();
958 posCaption = new Vector2(layoutWindow.padding.left, layoutWindow.padding.top);
960 {
961 rectTab.SetSiblingIndex(rectCaption.GetSiblingIndex());
962 }
963 if ((bool)imageBG)
964 {
965 bgShadow = imageBG.GetComponent<Shadow>();
966 }
967 _rect = this.Rect();
968 }
string rightMenuAlias
Definition: Window.cs:93
WindowMenu menuLeftBottom
Definition: Window.cs:703
WindowMenu menuRight
Definition: Window.cs:709
Canvas Canvas
Definition: Window.cs:839
WindowController controller
Definition: Window.cs:660
LayoutGroup layoutWindow
Definition: Window.cs:679
RectTransform _rect
Definition: Window.cs:674
RectTransform rectCaption
Definition: Window.cs:642
RectTransform rectTab
Definition: Window.cs:644
WindowMenu menuBottom
Definition: Window.cs:706
Vector2 posCaption
Definition: Window.cs:721

References _rect, bgShadow, Canvas, cg, controller, imageBG, layoutWindow, menuBottom, menuLeft, menuLeftBottom, menuRight, posBottom, posCaption, posTab, rectBottom, rectCaption, rectTab, Window.Setting.rightMenuAlias, setting, and Window.Setting.tabAfterCaption.

◆ BringToTop()

void Window.BringToTop ( )
inline

Definition at line 1747 of file Window.cs.

1748 {
1749 if (!layer)
1750 {
1751 return;
1752 }
1753 int num = 0;
1754 foreach (Window window in layer.windows)
1755 {
1756 int siblingIndex = window.transform.GetSiblingIndex();
1757 if (siblingIndex > num)
1758 {
1759 num = siblingIndex;
1760 }
1761 }
1762 base.transform.SetSiblingIndex(num);
1763 }
List< Window > windows
Definition: Layer.cs:116
Definition: Window.cs:13
Layer layer
Definition: Window.cs:677

References layer, and Layer.windows.

Referenced by Update().

◆ BuildTabs()

void Window.BuildTabs ( int  index = -1)
inline

Definition at line 1396 of file Window.cs.

1397 {
1398 if (setting.tabs.Count > 0)
1399 {
1400 bool flag = false;
1401 foreach (Setting.Tab tab in setting.tabs)
1402 {
1403 if (!tab.button)
1404 {
1405 if (!flag && (bool)tab.customTab)
1406 {
1407 GameObject obj = new GameObject();
1408 obj.AddComponent<RectTransform>().sizeDelta = new Vector2(22f, 1f);
1409 obj.transform.SetParent(rectTab);
1410 flag = true;
1411 }
1412 UIButton uIButton = (tab.customTab ? Util.Instantiate(tab.customTab, rectTab) : (moldTab ? Util.Instantiate(moldTab, rectTab) : Util.Instantiate<UIButton>("UI/Window/Base/Element/ButtonTab", rectTab)));
1413 uIButton.mainText.SetLang(tab.idLang);
1414 tab.button = uIButton;
1415 if (!tab.langTooltip.IsEmpty())
1416 {
1417 uIButton.tooltip.enable = true;
1418 uIButton.tooltip.lang = tab.langTooltip;
1419 }
1420 if ((bool)tab.sprite)
1421 {
1422 uIButton.icon.sprite = tab.sprite;
1423 }
1424 if (tab.disable)
1425 {
1426 uIButton.SetActive(enable: false);
1427 }
1428 }
1429 tab.button.onClick.AddListener(delegate
1430 {
1431 SwitchContent(tab);
1432 });
1433 }
1434 }
1435 rectTab.SetActive(setting.tabs.Count > 1 || setting.alwaysShowTab);
1436 rectTab.RebuildLayout(recursive: true);
1437 if ((bool)groupTab)
1438 {
1439 groupTab.Init(index);
1440 }
1441 }
virtual void Init(int index=0, UnityAction< int > action=null, bool directChildren=false)
bool alwaysShowTab
Definition: Window.cs:77
UISelectableGroup groupTab
Definition: Window.cs:658
void SwitchContent(UIContent content)
Definition: Window.cs:1198
UIButton moldTab
Definition: Window.cs:636

References Window.Setting.alwaysShowTab, groupTab, UISelectableGroup.Init(), UIButton.mainText, moldTab, rectTab, RectTransform, UIText.SetLang(), setting, SwitchContent(), Window.Setting.tabs, and Util.

Referenced by Init(), and LayerCraft.RefreshCategory().

◆ ClampToScreen()

void Window.ClampToScreen ( )
inline

Definition at line 1765 of file Window.cs.

1766 {
1767 RectTransform rectTransform = base.transform.parent.Rect();
1768 RectTransform rectTransform2 = base.transform.Rect();
1769 Transform transform = base.transform;
1770 Vector3 localPosition = base.transform.localPosition;
1771 Vector3 vector = rectTransform.rect.min - rectTransform2.rect.min;
1772 Vector3 vector2 = rectTransform.rect.max - rectTransform2.rect.max;
1773 float num = ((setting.clampMargin.x == -1f) ? 20f : setting.clampMargin.x);
1774 float num2 = ((setting.clampMargin.y == -1f) ? 40f : setting.clampMargin.y);
1775 localPosition.x = Mathf.Clamp(transform.localPosition.x, vector.x + num - 50f, vector2.x - num);
1776 localPosition.y = Mathf.Clamp(transform.localPosition.y, vector.y + num2 - 50f, vector2.y - num2 + 50f);
1777 transform.localPosition = localPosition;
1778 }
Vector2 clampMargin
Definition: Window.cs:89

References Window.Setting.clampMargin, RectTransform, and setting.

Referenced by LayerInventory.CreateContainerAlly(), LayerInventory.CreateContainerPC(), InitPanel(), OnChangeResolution(), and ProcessMovement().

◆ ClearBottomButtons()

void Window.ClearBottomButtons ( )
inline

Definition at line 1481 of file Window.cs.

1482 {
1483 rectBottom.DestroyChildren();
1484 }

References rectBottom.

◆ Close()

void Window.Close ( )
inline

Definition at line 1531 of file Window.cs.

1532 {
1533 if ((bool)layer)
1534 {
1536 }
1537 }
void OnClickClose()
Definition: Layer.cs:455

References layer, and Layer.OnClickClose().

Referenced by Init().

◆ CursorOverBottomBorder()

bool Window.CursorOverBottomBorder ( bool  canExceed = false)
inlineprivate

Definition at line 1995 of file Window.cs.

1996 {
1997 UIButton componentOf = InputModuleEX.GetComponentOf<UIButton>();
1998 if ((bool)componentOf && componentOf.GetComponentInParent<Window>() == this)
1999 {
2000 return false;
2001 }
2002 if (canExceed)
2003 {
2004 return LastScreenCursorPosition.y <= FrameInnerCorners[0].y;
2005 }
2007 {
2008 return LastScreenCursorPosition.x <= FrameOuterCorners[2].x;
2009 }
2010 return false;
2011 }
Vector3 LastScreenCursorPosition
Definition: Window.cs:762
Vector3[] FrameOuterCorners
Definition: Window.cs:887
Vector3[] FrameInnerCorners
Definition: Window.cs:900

References FrameInnerCorners, FrameOuterCorners, and LastScreenCursorPosition.

Referenced by OnPointerDown(), and ProcessCursorChanges().

◆ CursorOverCaption()

bool Window.CursorOverCaption ( )
inlineprivate

Definition at line 2049 of file Window.cs.

2050 {
2051 foreach (GameObject item in InputModuleEX.GetList())
2052 {
2053 if (item != null && (bool)item.GetComponent<ScrollRect>())
2054 {
2055 return false;
2056 }
2057 }
2058 return true;
2059 }
static List< GameObject > GetList()

References InputModuleEX.GetList(), and item.

Referenced by OnPointerDown().

◆ CursorOverLeftBorder()

bool Window.CursorOverLeftBorder ( bool  canExceed = false)
inlineprivate

Definition at line 2013 of file Window.cs.

2014 {
2015 if (canExceed)
2016 {
2017 return LastScreenCursorPosition.x <= FrameInnerCorners[0].x;
2018 }
2020 {
2021 return LastScreenCursorPosition.y <= FrameOuterCorners[1].y;
2022 }
2023 return false;
2024 }

References FrameInnerCorners, FrameOuterCorners, and LastScreenCursorPosition.

Referenced by OnPointerDown(), and ProcessCursorChanges().

◆ CursorOverRightBorder()

bool Window.CursorOverRightBorder ( bool  canExceed = false)
inlineprivate

Definition at line 2026 of file Window.cs.

2027 {
2028 Scrollbar componentOf = InputModuleEX.GetComponentOf<Scrollbar>();
2029 if ((bool)componentOf && componentOf.GetComponentInParent<Window>() == this)
2030 {
2031 return false;
2032 }
2033 UIButton componentOf2 = InputModuleEX.GetComponentOf<UIButton>();
2034 if ((bool)componentOf2 && componentOf2.GetComponentInParent<Window>() == this)
2035 {
2036 return false;
2037 }
2038 if (canExceed)
2039 {
2040 return LastScreenCursorPosition.x >= FrameInnerCorners[3].x;
2041 }
2043 {
2044 return LastScreenCursorPosition.y <= FrameOuterCorners[1].y;
2045 }
2046 return false;
2047 }

References FrameInnerCorners, FrameOuterCorners, and LastScreenCursorPosition.

Referenced by OnPointerDown(), and ProcessCursorChanges().

◆ CursorOverTopBorder()

bool Window.CursorOverTopBorder ( bool  canExceed = false)
inlineprivate

Definition at line 1990 of file Window.cs.

1991 {
1992 return false;
1993 }

Referenced by ProcessCursorChanges().

◆ CursorOverWindow()

bool Window.CursorOverWindow ( )
inlineprivate

Definition at line 2061 of file Window.cs.

2062 {
2064 {
2065 return LastScreenCursorPosition.y <= FrameOuterCorners[1].y;
2066 }
2067 return false;
2068 }

References FrameOuterCorners, and LastScreenCursorPosition.

◆ EnableShadow()

void Window.EnableShadow ( )
inline

Definition at line 1506 of file Window.cs.

1507 {
1508 if (!imageBG)
1509 {
1510 return;
1511 }
1512 Shadow component = imageBG.GetComponent<Shadow>();
1513 if ((bool)component)
1514 {
1515 if (Skin.noShadow)
1516 {
1517 component.enabled = false;
1518 return;
1519 }
1520 component.effectColor = Skin.shadowColor;
1521 component.enabled = true;
1522 }
1523 }

References imageBG, SkinRootStatic.noShadow, SkinRootStatic.shadowColor, and Skin.

Referenced by ApplySkin().

◆ GetContent< T >()

T Window.GetContent< T > ( )
inline
Type Constraints
T :UIContent 

Definition at line 1369 of file Window.cs.

1369 : UIContent
1370 {
1371 if ((bool)CurrentContent)
1372 {
1373 return CurrentContent as T;
1374 }
1375 return null;
1376 }
UIContent CurrentContent
Definition: Window.cs:799

References CurrentContent.

◆ GetTab() [1/2]

int Window.GetTab ( string  name)
inline

Definition at line 1469 of file Window.cs.

1470 {
1471 for (int i = 0; i < setting.tabs.Count; i++)
1472 {
1473 if (setting.tabs[i].content.name == name)
1474 {
1475 return i;
1476 }
1477 }
1478 return 0;
1479 }

References setting, and Window.Setting.tabs.

◆ GetTab() [2/2]

int Window.GetTab ( UIContent  content)
inline

Definition at line 1457 of file Window.cs.

1458 {
1459 for (int i = 0; i < setting.tabs.Count; i++)
1460 {
1461 if (content == setting.tabs[i].content)
1462 {
1463 return i;
1464 }
1465 }
1466 return 0;
1467 }

References setting, and Window.Setting.tabs.

Referenced by SwitchContent(), and SwitchContent< T >().

◆ Init()

void Window.Init ( Layer  _layer = null)
inline

Definition at line 970 of file Window.cs.

971 {
972 _rect = this.Rect();
973 layer = _layer;
974 if (!setting.asWidget)
975 {
976 setting.allowResize = false;
977 setting.saveWindow = false;
978 }
980 {
981 saveData = dictData.TryGetValue(idWindow);
982 }
983 if (saveData != null)
984 {
985 if (saveData.customAnchor != 0)
986 {
987 saveData.anchor = saveData.customAnchor;
988 }
989 if (AutoAnchor)
990 {
991 _rect.SetAnchor(saveData.anchor);
992 }
993 _rect.anchoredPosition = new Vector2(saveData.x, saveData.y);
994 _rect.sizeDelta = new Vector2(saveData.w, saveData.h);
995 }
996 else if (setting.usePosFix)
997 {
998 _rect.anchoredPosition += setting.posFix;
999 }
1000 if (openLastTab && setting.openLastTab && setting.tabs.Count > idTab && !setting.tabs[dictTab.TryGetValue(idWindow, 0)].disable)
1001 {
1002 idTab = dictTab.TryGetValue(idWindow, 0);
1003 }
1004 if (setting.textCaption.IsEmpty())
1005 {
1006 textCaption.SetActive(enable: false);
1007 iconCaption.SetActive(enable: false);
1008 }
1009 else
1010 {
1011 if (Lang.GetList(setting.textCaption) != null)
1012 {
1014 }
1015 else
1016 {
1018 }
1019 if ((bool)setting.spriteCaption)
1020 {
1021 iconCaption.sprite = setting.spriteCaption;
1022 }
1023 }
1024 BuildTabs();
1025 bool flag = !(layer == null) && layer.option.canClose;
1026 if (flag && setting.bottomBack)
1027 {
1028 AddBottomButton("back", Close, setFirst: true);
1029 }
1030 if ((bool)buttonClose && buttonClose.gameObject.activeSelf)
1031 {
1032 buttonClose.onClick.RemoveAllListeners();
1033 buttonClose.onClick.AddListener(Close);
1034 buttonClose.SetActive(flag);
1035 }
1036 rectBottom.RebuildLayout(recursive: true);
1037 switch (setting.type)
1038 {
1039 case Type.AlignToMouse:
1040 leftSide = Input.mousePosition.x > (float)Screen.width / 1.5f;
1041 _rect.pivot = new Vector2(leftSide ? 1 : 0, _rect.pivot.y);
1042 _rect.position = Input.mousePosition + new Vector3(60f * (leftSide ? (-1f) : 1f), 0f, 0f);
1043 break;
1044 case Type.Side:
1045 {
1046 leftSide = Input.mousePosition.x > (float)Screen.width / 1.7f;
1047 float num = BaseCore.Instance.uiScale * (_rect.sizeDelta.x * 0.5f + 30f);
1048 _rect.position = new Vector3(leftSide ? num : ((float)Screen.width - num), _rect.position.y, 0f);
1049 setting.anime = Resources.Load<Anime>("Media/Anime/" + (leftSide ? "In Window from left" : "In Window from right"));
1050 break;
1051 }
1052 }
1055 InitPanel();
1056 ApplySkin();
1057 GameObject go = base.gameObject;
1058 if (!setting.anime || !animateWindow)
1059 {
1060 return;
1061 }
1063 {
1064 if ((bool)setting.anime && go != null)
1065 {
1066 tweenAnime = setting.anime.Play(this.Rect());
1067 }
1068 });
1069 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
Definition: Anime.cs:6
virtual float uiScale
Definition: BaseCore.cs:46
static BaseCore Instance
Definition: BaseCore.cs:11
List< Action > actionsLateUpdate
Definition: BaseCore.cs:29
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
bool canClose
Definition: Layer.cs:29
Option option
Definition: Layer.cs:84
RectPosition customAnchor
Definition: Window.cs:291
RectPosition anchor
Definition: Window.cs:195
Sprite spriteCaption
Definition: Window.cs:55
bool openLastTab
Definition: Window.cs:75
bool bottomBack
Definition: Window.cs:67
string textCaption
Definition: Window.cs:53
bool saveWindow
Definition: Window.cs:65
Anime anime
Definition: Window.cs:83
Vector2 posFix
Definition: Window.cs:85
bool asWidget
Definition: Window.cs:59
bool usePosFix
Definition: Window.cs:87
Type type
Definition: Window.cs:79
SaveData saveData
Definition: Window.cs:724
void RefreshTipPivotPosition()
Definition: Window.cs:1071
static bool openLastTab
Definition: Window.cs:598
void BuildTabs(int index=-1)
Definition: Window.cs:1396
Image iconCaption
Definition: Window.cs:614
void SetCaption(string text)
Definition: Window.cs:1289
UIButton AddBottomButton(string idLang, UnityAction onClick, bool setFirst=false)
Definition: Window.cs:1486
int idTab
Definition: Window.cs:694
bool leftSide
Definition: Window.cs:602
void InitPanel()
Definition: Window.cs:1539
static Dictionary< string, SaveData > dictData
Definition: Window.cs:594
static bool animateWindow
Definition: Window.cs:600
string idWindow
Definition: Window.cs:775
Button buttonClose
Definition: Window.cs:624
void Close()
Definition: Window.cs:1531
bool AutoAnchor
Definition: Window.cs:811
void ApplySkin()
Definition: Window.cs:1129
Type
Definition: Window.cs:15
static Dictionary< string, int > dictTab
Definition: Window.cs:596
void SetTitles(string langList, string idHeaderRow=null)
Definition: Window.cs:1262

References _rect, BaseCore.actionsLateUpdate, AddBottomButton(), Window.SaveData.anchor, animateWindow, Window.Setting.anime, ApplySkin(), Window.Setting.asWidget, AutoAnchor, Window.Setting.bottomBack, BuildTabs(), buttonClose, Layer.Option.canClose, Close(), Window.SaveData.customAnchor, dictData, dictTab, Lang.GetList(), Window.SaveData.h, iconCaption, idTab, idWindow, if(), InitPanel(), BaseCore.Instance, layer, leftSide, Window.Setting.openLastTab, openLastTab, Layer.option, Window.Setting.posFix, rectBottom, RefreshTipPivotPosition(), saveData, Window.Setting.saveWindow, SetCaption(), setting, SetTitles(), Window.Setting.spriteCaption, SwitchContent(), Window.Setting.tabs, Window.Setting.textCaption, textCaption, Window.Setting.type, BaseCore.uiScale, Window.Setting.usePosFix, Window.SaveData.w, Window.SaveData.x, and Window.SaveData.y.

◆ InitPanel()

void Window.InitPanel ( )
inline

Definition at line 1539 of file Window.cs.

1540 {
1541 if (!isStatic)
1542 {
1543 EventTrigger.Entry entry = new EventTrigger.Entry();
1544 entry.eventID = EventTriggerType.PointerEnter;
1545 entry.callback.AddListener(delegate(BaseEventData d)
1546 {
1547 OnPointerEnter(d as PointerEventData);
1548 });
1549 EventTrigger.triggers.Add(entry);
1550 entry = new EventTrigger.Entry();
1551 entry.eventID = EventTriggerType.PointerExit;
1552 entry.callback.AddListener(delegate(BaseEventData d)
1553 {
1554 OnPointerExit(d as PointerEventData);
1555 });
1556 EventTrigger.triggers.Add(entry);
1557 entry = new EventTrigger.Entry();
1558 entry.eventID = EventTriggerType.PointerDown;
1559 entry.callback.AddListener(delegate(BaseEventData d)
1560 {
1561 OnPointerDown(d as PointerEventData);
1562 });
1563 EventTrigger.triggers.Add(entry);
1564 entry = new EventTrigger.Entry();
1565 entry.eventID = EventTriggerType.PointerUp;
1566 entry.callback.AddListener(delegate(BaseEventData d)
1567 {
1568 OnPointerUp(d as PointerEventData);
1569 });
1570 EventTrigger.triggers.Add(entry);
1572 if (AutoAnchor)
1573 {
1574 SetAnchor();
1575 }
1576 ClampToScreen();
1577 }
1578 }
bool isStatic
Definition: Window.cs:932
void ClampToScreen()
Definition: Window.cs:1765
void OnPointerEnter(PointerEventData data)
Definition: Window.cs:1780
EventTrigger EventTrigger
Definition: Window.cs:851
void SetAnchor()
Definition: Window.cs:1594
void OnPointerUp(PointerEventData data)
Definition: Window.cs:1810
void OnPointerDown(PointerEventData data)
Definition: Window.cs:1794
void OnPointerExit(PointerEventData data)
Definition: Window.cs:1785
void RecalculatePositionCaches()
Definition: Window.cs:1599

References AutoAnchor, ClampToScreen(), EventTrigger, isStatic, OnPointerDown(), OnPointerEnter(), OnPointerExit(), OnPointerUp(), RecalculatePositionCaches(), and SetAnchor().

Referenced by Init().

◆ LoadHeader()

void Window.LoadHeader ( string  id = "HeaderRow")
inline

Definition at line 1319 of file Window.cs.

1320 {
1321 ScrollRect componentInChildren = GetComponentInChildren<ScrollRect>();
1322 if ((bool)componentInChildren)
1323 {
1324 if ((bool)rectHeader)
1325 {
1326 UnityEngine.Object.DestroyImmediate(rectHeader.gameObject);
1327 }
1328 else
1329 {
1330 RectTransform viewport = componentInChildren.viewport;
1331 Vector2 sizeDelta = viewport.sizeDelta;
1332 sizeDelta.y -= 30f;
1333 viewport.anchoredPosition = sizeDelta;
1334 viewport.sizeDelta = sizeDelta;
1335 }
1336 Transform c = Util.Instantiate("UI/Element/Header/" + id, componentInChildren.transform);
1337 rectHeader = c.Rect();
1338 }
1339 }

References rectHeader, RectTransform, and Util.

Referenced by AddHeader(), and SetTitles().

◆ NextTab()

bool Window.NextTab ( int  a)
inline

Definition at line 1378 of file Window.cs.

1379 {
1380 List<Setting.Tab> list = new List<Setting.Tab>();
1381 foreach (Setting.Tab tab in setting.tabs)
1382 {
1383 if (!tab.disable && (bool)tab.button)
1384 {
1385 list.Add(tab);
1386 }
1387 }
1388 if (list.Count > 1)
1389 {
1390 ((a < 0) ? list.NextItem(CurrentTab) : list.PrevItem(CurrentTab)).button._OnPress();
1391 return true;
1392 }
1393 return false;
1394 }
Setting.Tab CurrentTab
Definition: Window.cs:787

References CurrentTab, setting, and Window.Setting.tabs.

Referenced by Scene.OnUpdate().

◆ OnApplicationFocus()

void Window.OnApplicationFocus ( bool  focus)
inline

Definition at line 1606 of file Window.cs.

1607 {
1609 IsProcessingMovement = false;
1610 IsResizingOverBottom = false;
1611 IsResizingOverLeft = false;
1612 IsResizingOverRight = false;
1613 }
bool IsProcessingMovement
Definition: Window.cs:750
bool IsResizingOverLeft
Definition: Window.cs:758
bool IsResizingOverBottom
Definition: Window.cs:756
bool IsProcessingCursorChanges
Definition: Window.cs:748
bool IsResizingOverRight
Definition: Window.cs:760

References IsProcessingCursorChanges, IsProcessingMovement, IsResizingOverBottom, IsResizingOverLeft, and IsResizingOverRight.

◆ OnChangeResolution()

void Window.OnChangeResolution ( )
inline

Implements IChangeResolution.

Definition at line 1580 of file Window.cs.

1581 {
1582 if (!isStatic)
1583 {
1585 if (AutoAnchor)
1586 {
1587 SetAnchor();
1588 }
1590 ClampToScreen();
1591 }
1592 }

References AutoAnchor, ClampToScreen(), IsProcessingCursorChanges, isStatic, RecalculatePositionCaches(), and SetAnchor().

◆ OnKill()

void Window.OnKill ( )
inline

Definition at line 1116 of file Window.cs.

1117 {
1119 if (saveData != null)
1120 {
1121 saveData.open = false;
1122 }
1123 if (setting.openLastTab)
1124 {
1126 }
1127 }
void UpdateSaveData()
Definition: Window.cs:1093

References dictTab, idTab, idWindow, Window.Setting.openLastTab, saveData, setting, and UpdateSaveData().

Referenced by Layer.Kill().

◆ OnPointerDown()

void Window.OnPointerDown ( PointerEventData  data)
inlineprivate

Definition at line 1794 of file Window.cs.

1795 {
1796 if (data.button == PointerEventData.InputButton.Left && !(EInput.dragHack < 0.1f))
1797 {
1798 base.transform.SetAsLastSibling();
1800 IsResizingOverBottom = setting.allowResize && CursorOverBottomBorder();
1801 IsResizingOverLeft = setting.allowResize && CursorOverLeftBorder();
1802 IsResizingOverRight = setting.allowResize && CursorOverRightBorder();
1804 dragStartPos = Input.mousePosition;
1805 dragOffset = base.transform.position - dragStartPos;
1807 }
1808 }
Definition: EInput.cs:8
static float dragHack
Definition: EInput.cs:327
bool IsResizingOverTop
Definition: Window.cs:754
bool CursorOverCaption()
Definition: Window.cs:2049
Vector3 dragStartPos
Definition: Window.cs:764
bool CursorOverLeftBorder(bool canExceed=false)
Definition: Window.cs:2013
bool CursorOverRightBorder(bool canExceed=false)
Definition: Window.cs:2026
Vector3 dragOffset
Definition: Window.cs:766
bool IsProcessingResize
Definition: Window.cs:752
bool CursorOverBottomBorder(bool canExceed=false)
Definition: Window.cs:1995

References CursorOverBottomBorder(), CursorOverCaption(), CursorOverLeftBorder(), CursorOverRightBorder(), EInput.dragHack, dragOffset, dragStartPos, IsProcessingCursorChanges, IsProcessingMovement, IsProcessingResize, IsResizingOverBottom, IsResizingOverLeft, IsResizingOverRight, and IsResizingOverTop.

Referenced by InitPanel().

◆ OnPointerEnter()

void Window.OnPointerEnter ( PointerEventData  data)
inlineprivate

Definition at line 1780 of file Window.cs.

1781 {
1782 IsProcessingCursorChanges = !Input.GetMouseButton(0);
1783 }

References IsProcessingCursorChanges.

Referenced by InitPanel().

◆ OnPointerExit()

void Window.OnPointerExit ( PointerEventData  data)
inlineprivate

Definition at line 1785 of file Window.cs.

1786 {
1788 if (!IsProcessingResize && !Input.GetMouseButton(0))
1789 {
1791 }
1792 }
static void SetCursor(CursorInfo info=null, int _priority=0)

References IsProcessingCursorChanges, IsProcessingResize, and CursorSystem.SetCursor().

Referenced by InitPanel().

◆ OnPointerUp()

void Window.OnPointerUp ( PointerEventData  data)
inlineprivate

Definition at line 1810 of file Window.cs.

1811 {
1812 }

Referenced by InitPanel().

◆ ProcessCursorChanges()

void Window.ProcessCursorChanges ( )
inlineprivate

Definition at line 1814 of file Window.cs.

1815 {
1817 {
1819 {
1820 SetCursor(CursorSystem.ResizeNWSE);
1821 }
1823 {
1824 SetCursor(CursorSystem.ResizeNESW);
1825 }
1827 {
1828 SetCursor(CursorSystem.ResizeNS);
1829 }
1831 {
1832 SetCursor(CursorSystem.ResizeWE);
1833 }
1834 }
1835 void SetCursor(CursorInfo info)
1836 {
1837 Window topComponentOf = InputModuleEX.GetTopComponentOf<Window>();
1838 if (!topComponentOf || !(topComponentOf != this))
1839 {
1840 CursorSystem.SetCursor(info);
1841 }
1842 }
1843 }
static CursorInfo ResizeWE
Definition: CursorSystem.cs:50
static CursorInfo ResizeNWSE
Definition: CursorSystem.cs:52
static CursorInfo ResizeNS
Definition: CursorSystem.cs:48
static CursorInfo ResizeNESW
Definition: CursorSystem.cs:54
bool allowResize
Definition: Window.cs:63
bool CursorOverTopBorder(bool canExceed=false)
Definition: Window.cs:1990
bool isTop
Definition: Window.cs:770

References Window.Setting.allowResize, CursorOverBottomBorder(), CursorOverLeftBorder(), CursorOverRightBorder(), CursorOverTopBorder(), IsProcessingResize, isTop, CursorSystem.ResizeNESW, CursorSystem.ResizeNS, CursorSystem.ResizeNWSE, CursorSystem.ResizeWE, CursorSystem.SetCursor(), and setting.

Referenced by Update().

◆ ProcessMovement()

void Window.ProcessMovement ( )
inlineprivate

Definition at line 1845 of file Window.cs.

1846 {
1847 Vector3 mousePosition = Input.mousePosition;
1848 mousePosition.x = Mathf.Clamp(mousePosition.x, 0f, Canvas.pixelRect.width);
1849 mousePosition.y = Mathf.Clamp(mousePosition.y, 0f, Canvas.pixelRect.height);
1850 base.transform.position = Input.mousePosition + dragOffset;
1851 ClampToScreen();
1852 }

References Canvas, ClampToScreen(), and dragOffset.

Referenced by Update().

◆ ProcessResize()

void Window.ProcessResize ( )
inlineprivate

Definition at line 1854 of file Window.cs.

1855 {
1856 Vector3 vector = Input.mousePosition;
1857 vector.x = Mathf.Clamp(vector.x, 0f, Canvas.pixelRect.width);
1858 vector.y = Mathf.Clamp(vector.y, 0f, Canvas.pixelRect.height);
1859 Vector3 vector2 = LastScreenCursorPosition;
1860 Vector3 vector3 = vector - vector2;
1861 if (vector3.x == 0f && vector3.y == 0f)
1862 {
1863 return;
1864 }
1865 if (Canvas.renderMode == RenderMode.ScreenSpaceCamera)
1866 {
1867 vector = Canvas.worldCamera.ScreenToWorldPoint(new Vector3(vector.x, vector.y, Canvas.planeDistance));
1868 vector2 = Canvas.worldCamera.ScreenToWorldPoint(new Vector3(vector2.x, vector2.y, Canvas.planeDistance));
1869 }
1870 Vector3 vector4 = vector - vector2;
1871 Vector3 position = RectTransform.position;
1872 Vector2 sizeDelta = RectTransform.sizeDelta;
1873 Vector2 size = RectTransform.rect.size;
1874 Vector3 zero = Vector3.zero;
1875 Vector2 zero2 = Vector2.zero;
1876 Rect bound = setting.bound;
1877 float x = bound.x;
1878 float y = bound.y;
1879 float width = bound.width;
1880 float height = bound.height;
1882 {
1883 if (RectTransform.anchorMin.y == RectTransform.anchorMax.y)
1884 {
1886 {
1887 float num = sizeDelta.y + vector3.y;
1888 if (num > y && num < height)
1889 {
1890 zero.y = vector4.y * RectTransform.pivot.y;
1891 zero2.y = vector3.y;
1892 }
1893 }
1894 else if (IsResizingOverBottom)
1895 {
1896 float num2 = sizeDelta.y - vector3.y;
1897 if (num2 > y && num2 < height)
1898 {
1899 zero.y = vector4.y * (1f - RectTransform.pivot.y);
1900 zero2.y = 0f - vector3.y;
1901 }
1902 }
1903 position.y += zero.y;
1904 sizeDelta.y += zero2.y / CorrectedLossyScale.y;
1905 }
1906 else
1907 {
1909 {
1910 float num3 = size.y + vector3.y;
1911 if (num3 > y && num3 < height)
1912 {
1913 zero.y = vector4.y * RectTransform.pivot.y;
1914 zero2.y = vector3.y;
1915 }
1916 }
1917 else if (IsResizingOverBottom)
1918 {
1919 float num4 = size.y - vector3.y;
1920 if (num4 > y && num4 < height)
1921 {
1922 zero.y = vector4.y * (1f - RectTransform.pivot.y);
1923 zero2.y = 0f - vector3.y;
1924 }
1925 }
1926 position.y += zero.y;
1927 sizeDelta.y += zero2.y / CorrectedLossyScale.y;
1928 }
1929 }
1931 {
1932 if (RectTransform.anchorMin.x == RectTransform.anchorMax.x)
1933 {
1935 {
1936 float num5 = sizeDelta.x + vector3.x;
1937 if (num5 > x && num5 < width)
1938 {
1939 zero.x = vector4.x * RectTransform.pivot.x;
1940 zero2.x = vector3.x;
1941 }
1942 }
1943 else if (IsResizingOverLeft)
1944 {
1945 float num6 = sizeDelta.x - vector3.x;
1946 if (num6 > x && num6 < width)
1947 {
1948 zero.x = vector4.x * (1f - RectTransform.pivot.x);
1949 zero2.x = 0f - vector3.x;
1950 }
1951 }
1952 position.x += zero.x;
1953 sizeDelta.x += zero2.x / CorrectedLossyScale.x;
1954 }
1955 else
1956 {
1958 {
1959 float num7 = size.x + vector3.x;
1960 if (num7 > x && num7 < width)
1961 {
1962 zero.x = vector4.x * RectTransform.pivot.x;
1963 zero2.x = vector3.x;
1964 }
1965 }
1966 else if (IsResizingOverLeft)
1967 {
1968 float num8 = size.x - vector3.x;
1969 if (num8 > x && num8 < width)
1970 {
1971 zero.x = vector4.x * (1f - RectTransform.pivot.x);
1972 zero2.x = 0f - vector3.x;
1973 }
1974 }
1975 position.x += zero.x;
1976 sizeDelta.x += zero2.x / CorrectedLossyScale.x;
1977 }
1978 }
1979 if (setting.resizeGrid != Vector2.zero)
1980 {
1981 sizeDelta.x = setting.resizeGrid.x * (float)(int)(sizeDelta.x / setting.resizeGrid.x);
1982 sizeDelta.y = setting.resizeGrid.y * (float)(int)(sizeDelta.y / setting.resizeGrid.y);
1983 }
1984 RectTransform.sizeDelta = sizeDelta;
1985 RectTransform.position = position;
1987 this.RebuildLayout(recursive: true);
1988 }
Rect bound
Definition: Window.cs:57
Vector2 resizeGrid
Definition: Window.cs:91
Vector3 CorrectedLossyScale
Definition: Window.cs:875

References Window.Setting.bound, Canvas, CorrectedLossyScale, IsResizingOverBottom, IsResizingOverLeft, IsResizingOverRight, IsResizingOverTop, LastScreenCursorPosition, RecalculatePositionCaches(), RectTransform, Window.Setting.resizeGrid, and setting.

Referenced by Update().

◆ RecalculatePositionCaches()

void Window.RecalculatePositionCaches ( )
inlineprivate

Definition at line 1599 of file Window.cs.

1600 {
1601 _frameInnerCorners = null;
1602 _frameOuterCorners = null;
1603 _captionCorners = null;
1604 }
Vector3[] _captionCorners
Definition: Window.cs:746
Vector3[] _frameInnerCorners
Definition: Window.cs:744
Vector3[] _frameOuterCorners
Definition: Window.cs:742

References _captionCorners, _frameInnerCorners, and _frameOuterCorners.

Referenced by InitPanel(), OnChangeResolution(), ProcessResize(), and Update().

◆ RefreshTipPivotPosition()

void Window.RefreshTipPivotPosition ( )
inline

Definition at line 1071 of file Window.cs.

1072 {
1073 bool flag = (float)(Screen.width / 2 - 40) > base.transform.position.x;
1074 if ((bool)tipPiovotLeft)
1075 {
1076 tipPiovotLeft.SetActive(!flag || !tipPivotRight);
1077 }
1078 if ((bool)tipPivotRight)
1079 {
1080 tipPivotRight.SetActive(flag || !tipPiovotLeft);
1081 }
1082 }
RectTransform tipPiovotLeft
Definition: Window.cs:650
RectTransform tipPivotRight
Definition: Window.cs:652

References tipPiovotLeft, and tipPivotRight.

Referenced by Init(), and Update().

◆ SetAnchor()

void Window.SetAnchor ( )
inline

Definition at line 1594 of file Window.cs.

1595 {
1596 _rect.SetAnchor((saveData != null) ? saveData.customAnchor : RectPosition.Auto);
1597 }
RectPosition
Definition: RectPosition.cs:2

References _rect, Window.SaveData.customAnchor, and saveData.

Referenced by Widget.AddLayer(), InitPanel(), OnChangeResolution(), and Update().

◆ SetCaption()

void Window.SetCaption ( string  text)
inline

Definition at line 1289 of file Window.cs.

1290 {
1291 textCaption.SetText(text);
1292 textCaption.RebuildLayout();
1293 }
void SetText(string s)
Definition: UIText.cs:159

References UIText.SetText(), and textCaption.

Referenced by Init(), ListOwner< T1, T2 >.OnSwitchContent(), WindowChara.RefreshStatic(), SetTitles(), and SwitchContent().

◆ SetContent()

void Window.SetContent ( int  tabIndex,
UIContent  content 
)
inline

Definition at line 1355 of file Window.cs.

1356 {
1357 if (tabIndex != -1)
1358 {
1359 Setting.Tab tab = setting.tabs[tabIndex];
1360 if ((bool)tab.content && !tab.content.IsPrefab())
1361 {
1362 tab.content.SetActive(enable: false);
1363 }
1364 tab.content = content;
1365 tab.button = rectTab.GetComponentsInChildren<UIButton>()[tabIndex];
1366 }
1367 }

References Window.Setting.Tab.content, rectTab, setting, and Window.Setting.tabs.

Referenced by SetContent< T >().

◆ SetContent< T >()

T Window.SetContent< T > ( int  tabIndex = -1,
string  id = null 
)
inline
Type Constraints
T :UIContent 

Definition at line 1348 of file Window.cs.

1348 : UIContent
1349 {
1350 T val = Util.Instantiate<T>("UI/Content/" + typeof(T).Name, view);
1351 SetContent(tabIndex, val);
1352 return val;
1353 }
void SetContent(int tabIndex, UIContent content)
Definition: Window.cs:1355
UIContentView view
Definition: Window.cs:608

References SetContent(), Util, and view.

◆ SetInteractable()

void Window.SetInteractable ( bool  enable,
float  alpha = 0::5f 
)
inline

Definition at line 1525 of file Window.cs.

1526 {
1527 cg.alpha = (enable ? 1f : alpha);
1528 GetComponent<GraphicRaycaster>().enabled = enable;
1529 }

Referenced by LayerCraft.OnCompleteCraft(), and LayerCraft.SetFactory().

◆ SetPosition()

void Window.SetPosition ( )
inline

Definition at line 1341 of file Window.cs.

1342 {
1343 RectTransform rectTransform = this.Rect();
1344 rectTransform.pivot = new Vector2(0.5f, 0.5f);
1345 rectTransform.anchoredPosition = Vector2.zero;
1346 }

References RectTransform.

◆ SetRect()

void Window.SetRect ( RectData  data,
bool  mousePos = false 
)
inline

Definition at line 1084 of file Window.cs.

1085 {
1086 data.Apply(_rect);
1087 if (mousePos)
1088 {
1089 _rect.position = EInput.uiMousePosition;
1090 }
1091 }
static Vector3 uiMousePosition
Definition: EInput.cs:369
void Apply(RectTransform rect)
Definition: RectData.cs:17

References _rect, RectData.Apply(), and EInput.uiMousePosition.

◆ SetTitles()

void Window.SetTitles ( string  langList,
string  idHeaderRow = null 
)
inline

Definition at line 1262 of file Window.cs.

1263 {
1264 string[] list = Lang.GetList(langList);
1265 if (!list[0].IsEmpty())
1266 {
1267 SetCaption(list[0]);
1268 }
1269 if (list.Length >= 3)
1270 {
1271 if (!rectHeader || idHeaderRow != null)
1272 {
1273 LoadHeader(idHeaderRow);
1274 }
1275 UIHeader[] componentsInChildren = rectHeader.GetComponentsInChildren<UIHeader>(includeInactive: true);
1276 UIHeader[] array = componentsInChildren;
1277 for (int i = 0; i < array.Length; i++)
1278 {
1279 array[i].SetActive(enable: false);
1280 }
1281 for (int j = 0; j < list.Length - 3 && componentsInChildren.Length >= j + 1; j++)
1282 {
1283 componentsInChildren[j].SetActive(!list[j + 3].IsEmpty());
1284 componentsInChildren[j].SetText(list[j + 3]);
1285 }
1286 }
1287 }

References Lang.GetList(), LoadHeader(), rectHeader, SetCaption(), and UIHeader.SetText().

Referenced by Init(), and ListOwner< T1, T2 >.OnSwitchContent().

◆ SwitchContent() [1/4]

UIContent Window.SwitchContent ( int  index)
inline

Definition at line 1213 of file Window.cs.

1214 {
1215 idTab = index;
1216 if (setting.tabs.Count > 0)
1217 {
1218 Setting.Tab tab = setting.tabs[index];
1219 foreach (Setting.Tab tab2 in setting.tabs)
1220 {
1221 if ((bool)tab2.content && !tab2.content.IsPrefab())
1222 {
1223 tab2.content.SetActive(tab2 == tab);
1224 }
1225 }
1226 if ((bool)groupTab)
1227 {
1228 groupTab.Select(setting.tabs[index].button);
1229 }
1230 if ((bool)tab.content)
1231 {
1232 if (tab.content.IsPrefab())
1233 {
1234 tab.content = Util.Instantiate(tab.content, view);
1235 tab.content.SetActive(enable: true);
1236 tab.content.OnInstantiate();
1237 }
1238 tab.content.SetActive(enable: true);
1239 tab.content.OnSwitchContent(idTab);
1240 }
1241 if (tab.action != null)
1242 {
1243 tab.action();
1244 }
1245 string text = ((layer == null) ? "" : layer.GetTextHeader(this));
1246 if (!text.IsEmpty())
1247 {
1248 SetCaption(text);
1249 }
1250 }
1251 if ((bool)controller)
1252 {
1254 }
1255 else if ((bool)layer)
1256 {
1257 layer.OnSwitchContent(this);
1258 }
1259 return CurrentContent;
1260 }
virtual void OnSwitchContent(Window window)
Definition: Layer.cs:684
virtual string GetTextHeader(Window window)
Definition: Layer.cs:131
void Select(UIButton button, bool check=true)
virtual void OnSwitchContent(Window window)

References Window.Setting.Tab.action, Window.Setting.Tab.content, controller, CurrentContent, Layer.GetTextHeader(), groupTab, idTab, layer, UIContent.OnInstantiate(), UIContent.OnSwitchContent(), Layer.OnSwitchContent(), WindowController.OnSwitchContent(), UISelectableGroup.Select(), SetCaption(), setting, Window.Setting.tabs, Util, and view.

◆ SwitchContent() [2/4]

void Window.SwitchContent ( Setting::Tab  tab)
inline

Definition at line 1208 of file Window.cs.

1209 {
1210 SwitchContent(setting.tabs.IndexOf(tab));
1211 }

References setting, SwitchContent(), and Window.Setting.tabs.

◆ SwitchContent() [3/4]

void Window.SwitchContent ( string  name)
inline

Definition at line 1203 of file Window.cs.

1204 {
1205 SwitchContent(GetTab(name));
1206 }
int GetTab(UIContent content)
Definition: Window.cs:1457

References GetTab(), and SwitchContent().

◆ SwitchContent() [4/4]

void Window.SwitchContent ( UIContent  content)
inline

Definition at line 1198 of file Window.cs.

1199 {
1200 SwitchContent(GetTab(content));
1201 }

References GetTab(), and SwitchContent().

Referenced by BuildTabs(), Init(), WindowChara.SetChara(), SwitchContent(), and SwitchContent< T >().

◆ SwitchContent< T >()

T Window.SwitchContent< T > ( )
inline
Type Constraints
T :UIContent 

Definition at line 1192 of file Window.cs.

1192 : UIContent
1193 {
1194 SwitchContent(GetTab(typeof(T).Name.Replace("Content", "")));
1195 return CurrentContent as T;
1196 }

References CurrentContent, GetTab(), and SwitchContent().

◆ Update()

void Window.Update ( )
inlineprivate

Definition at line 1615 of file Window.cs.

1616 {
1618 if (isStatic)
1619 {
1620 return;
1621 }
1622 isTop = InputModuleEX.GetComponentOf<Window>() == this;
1623 if (isFloat && (bool)cgFloatMenu && cgFloatMenu.enabled)
1624 {
1625 bool flag = InputModuleEX.IsPointerOver(this) && (saveData == null || !saveData.shiftToShowMenu || Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift));
1626 floatAlpha = Mathf.Clamp(floatAlpha + (flag ? 2f : (-2f)) * Time.deltaTime * 1.5f, 0.5f, 1f);
1627 if ((bool)cgBG)
1628 {
1629 cgBG.alpha = floatAlpha;
1630 }
1631 float alpha = (floatAlpha - 0.5f) * 2f;
1632 if ((bool)cgFloatMenu)
1633 {
1634 cgFloatMenu.alpha = alpha;
1635 }
1636 cgFloatMenu.SetActive(cgFloatMenu.alpha > 0f);
1637 foreach (CanvasGroup item in listCgFloat)
1638 {
1639 item.alpha = alpha;
1640 }
1641 }
1642 if ((bool)attachedWindow)
1643 {
1644 Vector2 anchoredPosition = attachedWindow._rect.anchoredPosition;
1645 Vector2 anchoredPosition2 = new Vector2(anchoredPosition.x, anchoredPosition.y - attachedWindow._rect.sizeDelta.y) + attachFix;
1646 if (!_rect.anchorMin.Equals(attachedWindow._rect.anchorMin) || !_rect.anchorMax.Equals(attachedWindow._rect.anchorMax))
1647 {
1648 _rect.anchorMin = attachedWindow._rect.anchorMin;
1649 _rect.anchorMax = attachedWindow._rect.anchorMax;
1650 }
1651 if (_rect.anchoredPosition.x != anchoredPosition2.x || _rect.anchoredPosition.y != anchoredPosition2.y)
1652 {
1653 _rect.anchoredPosition = anchoredPosition2;
1654 }
1655 if (_rect.sizeDelta.x != attachedWindow._rect.sizeDelta.x)
1656 {
1657 _rect.sizeDelta = new Vector2(attachedWindow._rect.sizeDelta.x, _rect.sizeDelta.y);
1658 }
1659 rectCaption.SetActive(enable: false);
1660 }
1661 if (setting.dontBringToTop && base.transform.GetSiblingIndex() != 0)
1662 {
1663 base.transform.SetAsFirstSibling();
1664 }
1665 if (scrolling)
1666 {
1668 IsProcessingMovement = false;
1669 IsResizingOverBottom = false;
1670 IsResizingOverLeft = false;
1671 IsResizingOverRight = false;
1673 }
1674 else
1675 {
1677 {
1679 }
1681 {
1683 }
1685 {
1686 ProcessResize();
1687 }
1688 if (isTop)
1689 {
1691 {
1693 }
1695 {
1697 }
1699 {
1701 }
1702 }
1703 }
1704 if (Input.GetMouseButtonDown(0))
1705 {
1706 if ((bool)InputModuleEX.GetComponentOf<Scrollbar>())
1707 {
1708 scrolling = true;
1709 }
1711 {
1712 BringToTop();
1713 }
1714 }
1715 if (Input.GetMouseButtonUp(0))
1716 {
1718 {
1719 IsProcessingMovement = false;
1720 if (AutoAnchor)
1721 {
1722 SetAnchor();
1723 }
1724 }
1725 scrolling = false;
1728 {
1729 UIDynamicList[] componentsInChildren = GetComponentsInChildren<UIDynamicList>();
1730 for (int i = 0; i < componentsInChildren.Length; i++)
1731 {
1732 componentsInChildren[i].OnResizeWindow();
1733 }
1734 IsProcessingResize = false;
1735 }
1737 IsResizingOverTop = false;
1738 IsResizingOverBottom = false;
1739 IsResizingOverLeft = false;
1740 IsResizingOverRight = false;
1741 }
1742 LastScreenCursorPosition = Input.mousePosition;
1743 LastScreenCursorPosition.x = Mathf.Clamp(LastScreenCursorPosition.x, 0f, Canvas.pixelRect.width);
1744 LastScreenCursorPosition.y = Mathf.Clamp(LastScreenCursorPosition.y, 0f, Canvas.pixelRect.height);
1745 }
static bool IsPointerOver(Component c)
void OnResizeWindow()
bool dontBringToTop
Definition: Window.cs:69
void ProcessCursorChanges()
Definition: Window.cs:1814
Window attachedWindow
Definition: Window.cs:730
void ProcessMovement()
Definition: Window.cs:1845
CanvasGroup cgFloatMenu
Definition: Window.cs:668
Vector2 attachFix
Definition: Window.cs:732
void ProcessResize()
Definition: Window.cs:1854
float floatAlpha
Definition: Window.cs:772
List< CanvasGroup > listCgFloat
Definition: Window.cs:672
bool isFloat
Definition: Window.cs:604
bool scrolling
Definition: Window.cs:768
void BringToTop()
Definition: Window.cs:1747
CanvasGroup cgBG
Definition: Window.cs:666

References _rect, attachedWindow, attachFix, AutoAnchor, BringToTop(), Canvas, cgBG, cgFloatMenu, Window.Setting.dontBringToTop, floatAlpha, isFloat, InputModuleEX.IsPointerOver(), IsProcessingCursorChanges, IsProcessingMovement, IsProcessingResize, IsResizingOverBottom, IsResizingOverLeft, IsResizingOverRight, IsResizingOverTop, isStatic, isTop, item, LastScreenCursorPosition, listCgFloat, UIDynamicList.OnResizeWindow(), ProcessCursorChanges(), ProcessMovement(), ProcessResize(), RecalculatePositionCaches(), rectCaption, RefreshTipPivotPosition(), CursorSystem.ResizeNS, CursorSystem.ResizeNWSE, CursorSystem.ResizeWE, saveData, scrolling, SetAnchor(), CursorSystem.SetCursor(), and setting.

◆ UpdateSaveData()

void Window.UpdateSaveData ( )
inline

Definition at line 1093 of file Window.cs.

1094 {
1095 if (setting.saveWindow)
1096 {
1097 if (saveData == null)
1098 {
1099 saveData = new SaveData();
1100 }
1102 }
1103 if (saveData != null)
1104 {
1105 saveData.anchor = ((saveData.customAnchor == RectPosition.Auto) ? _rect.GetAnchor() : saveData.customAnchor);
1106 _rect.SetAnchor(saveData.anchor);
1107 Vector2 anchoredPosition = _rect.anchoredPosition;
1108 Vector2 sizeDelta = _rect.sizeDelta;
1109 saveData.x = anchoredPosition.x;
1110 saveData.y = anchoredPosition.y;
1111 saveData.w = sizeDelta.x;
1112 saveData.h = sizeDelta.y;
1113 }
1114 }

References _rect, Window.SaveData.anchor, Window.SaveData.customAnchor, dictData, idWindow, saveData, Window.Setting.saveWindow, and setting.

Referenced by LayerInventory.CreateContainerAlly(), LayerInventory.CreateContainerPC(), Player.OnBeforeSave(), and OnKill().

Member Data Documentation

◆ _canvas

Canvas Window._canvas
private

Definition at line 734 of file Window.cs.

◆ _captionCorners

Vector3 [] Window._captionCorners
private

Definition at line 746 of file Window.cs.

Referenced by RecalculatePositionCaches().

◆ _correctedLossyScale

Vector3 Window._correctedLossyScale
private

Definition at line 740 of file Window.cs.

◆ _eventTrigger

EventTrigger Window._eventTrigger
private

Definition at line 736 of file Window.cs.

◆ _frameInnerCorners

Vector3 [] Window._frameInnerCorners
private

Definition at line 744 of file Window.cs.

Referenced by RecalculatePositionCaches().

◆ _frameOuterCorners

Vector3 [] Window._frameOuterCorners
private

Definition at line 742 of file Window.cs.

Referenced by RecalculatePositionCaches().

◆ _rect

RectTransform Window._rect
private

Definition at line 674 of file Window.cs.

Referenced by Awake(), Init(), SetAnchor(), SetRect(), Update(), and UpdateSaveData().

◆ _rectTransform

RectTransform Window._rectTransform
private

Definition at line 738 of file Window.cs.

◆ animateWindow

bool Window.animateWindow
static

Definition at line 600 of file Window.cs.

Referenced by Init().

◆ attachedWindow

Window Window.attachedWindow

Definition at line 730 of file Window.cs.

Referenced by Update().

◆ attachFix

Vector2 Window.attachFix

Definition at line 732 of file Window.cs.

Referenced by Update().

◆ bgCaption

UIImage Window.bgCaption

Definition at line 622 of file Window.cs.

Referenced by ApplySkin().

◆ bgCollider

UICollider Window.bgCollider

Definition at line 670 of file Window.cs.

Referenced by Widget.AddLayer().

◆ bgShadow

Shadow Window.bgShadow
private

Definition at line 728 of file Window.cs.

Referenced by ApplySkin(), and Awake().

◆ buttonClose

Button Window.buttonClose

◆ buttonExtra

UIButton Window.buttonExtra

Definition at line 632 of file Window.cs.

◆ buttonHelp

UIButton Window.buttonHelp

Definition at line 626 of file Window.cs.

◆ buttonQuickSort

UIButton Window.buttonQuickSort

Definition at line 630 of file Window.cs.

◆ buttonShared

UIButton Window.buttonShared

Definition at line 634 of file Window.cs.

◆ buttonSort

UIButton Window.buttonSort

Definition at line 628 of file Window.cs.

◆ CaptionHeight

float Window.CaptionHeight = 50f

Definition at line 689 of file Window.cs.

◆ cg

CanvasGroup Window.cg

Definition at line 712 of file Window.cs.

Referenced by ApplySkin(), and Awake().

◆ cgBG

CanvasGroup Window.cgBG

Definition at line 666 of file Window.cs.

Referenced by LayerAbility.RefreshConfig(), and Update().

◆ cgFloatMenu

CanvasGroup Window.cgFloatMenu

Definition at line 668 of file Window.cs.

Referenced by Update().

◆ controller

WindowController Window.controller

Definition at line 660 of file Window.cs.

Referenced by Awake(), and SwitchContent().

◆ deco1

Image Window.deco1

Definition at line 616 of file Window.cs.

Referenced by ApplySkin().

◆ deco2

Image Window.deco2

Definition at line 618 of file Window.cs.

◆ dictData

◆ dictTab

Dictionary<string, int> Window.dictTab = new Dictionary<string, int>()
static

Definition at line 596 of file Window.cs.

Referenced by Init(), Game.Kill(), and OnKill().

◆ dragOffset

Vector3 Window.dragOffset
private

Definition at line 766 of file Window.cs.

Referenced by OnPointerDown(), and ProcessMovement().

◆ dragStartPos

Vector3 Window.dragStartPos
private

Definition at line 764 of file Window.cs.

Referenced by OnPointerDown().

◆ floatAlpha

float Window.floatAlpha
private

Definition at line 772 of file Window.cs.

Referenced by Update().

◆ FrameOffsetL

float Window.FrameOffsetL = -15f

Definition at line 681 of file Window.cs.

◆ FrameOffsetR

float Window.FrameOffsetR = -15f

Definition at line 683 of file Window.cs.

◆ FrameOffsetTop

float Window.FrameOffsetTop = -30f

Definition at line 685 of file Window.cs.

◆ frameOffsetY

float Window.frameOffsetY = 5f

Definition at line 691 of file Window.cs.

◆ FrameThickness

float Window.FrameThickness = 14f

Definition at line 687 of file Window.cs.

◆ groupTab

UISelectableGroup Window.groupTab

Definition at line 658 of file Window.cs.

Referenced by BuildTabs(), LayerCraft.OnCompleteCraft(), and SwitchContent().

◆ iconCaption

Image Window.iconCaption

Definition at line 614 of file Window.cs.

Referenced by Init().

◆ idTab

◆ imageBG

UIImage Window.imageBG

Definition at line 620 of file Window.cs.

Referenced by ApplySkin(), Awake(), and EnableShadow().

◆ isFloat

bool Window.isFloat

Definition at line 604 of file Window.cs.

Referenced by Update().

◆ IsProcessingCursorChanges

bool Window.IsProcessingCursorChanges
private

◆ IsProcessingMovement

bool Window.IsProcessingMovement
private

Definition at line 750 of file Window.cs.

Referenced by OnApplicationFocus(), OnPointerDown(), and Update().

◆ IsProcessingResize

bool Window.IsProcessingResize
private

Definition at line 752 of file Window.cs.

Referenced by OnPointerDown(), OnPointerExit(), ProcessCursorChanges(), and Update().

◆ IsResizingOverBottom

bool Window.IsResizingOverBottom
private

Definition at line 756 of file Window.cs.

Referenced by OnApplicationFocus(), OnPointerDown(), ProcessResize(), and Update().

◆ IsResizingOverLeft

bool Window.IsResizingOverLeft
private

Definition at line 758 of file Window.cs.

Referenced by OnApplicationFocus(), OnPointerDown(), ProcessResize(), and Update().

◆ IsResizingOverRight

bool Window.IsResizingOverRight
private

Definition at line 760 of file Window.cs.

Referenced by OnApplicationFocus(), OnPointerDown(), ProcessResize(), and Update().

◆ IsResizingOverTop

bool Window.IsResizingOverTop
private

Definition at line 754 of file Window.cs.

Referenced by OnPointerDown(), ProcessResize(), and Update().

◆ isTop

bool Window.isTop
private

Definition at line 770 of file Window.cs.

Referenced by ProcessCursorChanges(), and Update().

◆ LastScreenCursorPosition

Vector3 Window.LastScreenCursorPosition
private

◆ layer

Layer Window.layer

Definition at line 677 of file Window.cs.

Referenced by BringToTop(), Close(), Init(), SwitchContent(), and UIBook.Update().

◆ layoutWindow

LayoutGroup Window.layoutWindow
private

Definition at line 679 of file Window.cs.

Referenced by Awake().

◆ leftSide

bool Window.leftSide = true

Definition at line 602 of file Window.cs.

Referenced by Init().

◆ listCgFloat

List<CanvasGroup> Window.listCgFloat

Definition at line 672 of file Window.cs.

Referenced by LayerAbility.RefreshConfig(), and Update().

◆ menuBottom

WindowMenu Window.menuBottom

Definition at line 706 of file Window.cs.

Referenced by Awake().

◆ menuLeft

WindowMenu Window.menuLeft

◆ menuLeftBottom

WindowMenu Window.menuLeftBottom

Definition at line 703 of file Window.cs.

Referenced by Awake().

◆ menuRight

WindowMenu Window.menuRight

Definition at line 709 of file Window.cs.

Referenced by Awake(), and ListOwner< T1, T2 >.OnRefreshMenu().

◆ moldBottom

UIButton Window.moldBottom

Definition at line 638 of file Window.cs.

Referenced by AddBottomButton().

◆ moldTab

UIButton Window.moldTab

Definition at line 636 of file Window.cs.

Referenced by BuildTabs().

◆ openLastTab

bool Window.openLastTab
static

Definition at line 598 of file Window.cs.

Referenced by Init().

◆ posBottom

Vector2 Window.posBottom

Definition at line 715 of file Window.cs.

Referenced by ApplySkin(), and Awake().

◆ posCaption

Vector2 Window.posCaption

Definition at line 721 of file Window.cs.

Referenced by Awake().

◆ posTab

Vector2 Window.posTab

Definition at line 718 of file Window.cs.

Referenced by ApplySkin(), and Awake().

◆ rectBottom

RectTransform Window.rectBottom

Definition at line 646 of file Window.cs.

Referenced by AddBottomButton(), AddBottomSpace(), Awake(), ClearBottomButtons(), and Init().

◆ rectCaption

RectTransform Window.rectCaption

Definition at line 642 of file Window.cs.

Referenced by Awake(), and Update().

◆ rectCorner

RectTransform Window.rectCorner

Definition at line 640 of file Window.cs.

Referenced by ApplySkin().

◆ rectDeco

RectTransform Window.rectDeco

Definition at line 654 of file Window.cs.

Referenced by ApplySkin().

◆ rectHeader

RectTransform Window.rectHeader

Definition at line 656 of file Window.cs.

Referenced by AddHeader(), LoadHeader(), and SetTitles().

◆ rectStats

RectTransform Window.rectStats

Definition at line 648 of file Window.cs.

Referenced by UIScrollView.Awake().

◆ rectTab

RectTransform Window.rectTab

Definition at line 644 of file Window.cs.

Referenced by Awake(), BuildTabs(), Scene.OnUpdate(), and SetContent().

◆ saveData

SaveData Window.saveData

Definition at line 724 of file Window.cs.

Referenced by Init(), OnKill(), SetAnchor(), Update(), and UpdateSaveData().

◆ scrolling

bool Window.scrolling
private

Definition at line 768 of file Window.cs.

Referenced by Update().

◆ setting

◆ shadowEnabled

bool? Window.shadowEnabled
private

Definition at line 726 of file Window.cs.

Referenced by ApplySkin().

◆ skinRoot

SkinRootStatic Window.skinRoot

Definition at line 662 of file Window.cs.

◆ textCaption

UIText Window.textCaption

Definition at line 610 of file Window.cs.

Referenced by ApplySkin(), Init(), SetCaption(), and UIBook.Show().

◆ textStats

UIText Window.textStats

Definition at line 612 of file Window.cs.

◆ tipPiovotLeft

RectTransform Window.tipPiovotLeft

Definition at line 650 of file Window.cs.

Referenced by RefreshTipPivotPosition().

◆ tipPivotRight

RectTransform Window.tipPivotRight

Definition at line 652 of file Window.cs.

Referenced by RefreshTipPivotPosition().

◆ tweenAnime

Tween Window.tweenAnime

Definition at line 664 of file Window.cs.

◆ view

UIContentView Window.view

Definition at line 608 of file Window.cs.

Referenced by SetContent< T >(), and SwitchContent().

◆ windowIndex

Property Documentation

◆ AutoAnchor

bool Window.AutoAnchor
get

Definition at line 810 of file Window.cs.

811 {
812 get
813 {
814 if (!isFloat || (bool)attachedWindow)
815 {
816 if (saveData != null)
817 {
818 return saveData.customAnchor != RectPosition.Auto;
819 }
820 return false;
821 }
822 return true;
823 }
824 }

Referenced by Init(), InitPanel(), OnChangeResolution(), and Update().

◆ Canvas

Canvas Window.Canvas
get

Definition at line 838 of file Window.cs.

839 {
840 get
841 {
842 if (!_canvas)
843 {
844 _canvas = GetComponentInParent<Canvas>();
845 }
846 return _canvas;
847 }
848 }
Canvas _canvas
Definition: Window.cs:734

Referenced by Awake(), ProcessMovement(), ProcessResize(), and Update().

◆ CaptionCorners

Vector3 [] Window.CaptionCorners
get

Definition at line 912 of file Window.cs.

913 {
914 get
915 {
916 if (_captionCorners == null || _captionCorners.Length != 4)
917 {
918 _captionCorners = new Vector3[4];
919 for (int i = 0; i < 4; i++)
920 {
922 }
927 }
928 return _captionCorners;
929 }
930 }
float CaptionHeight
Definition: Window.cs:689
float FrameOffsetTop
Definition: Window.cs:685

◆ CorrectedLossyScale

Vector3 Window.CorrectedLossyScale
get

Definition at line 874 of file Window.cs.

875 {
876 get
877 {
878 if (_correctedLossyScale == Vector3.zero)
879 {
880 _correctedLossyScale = Canvas.CorrectLossyScale();
881 }
883 }
884 }
Vector3 _correctedLossyScale
Definition: Window.cs:740

Referenced by ProcessResize().

◆ CurrentContent

UIContent Window.CurrentContent
get

Definition at line 798 of file Window.cs.

799 {
800 get
801 {
802 if (CurrentTab == null || !CurrentTab.content)
803 {
804 return null;
805 }
806 return CurrentTab.content;
807 }
808 }

Referenced by GetContent< T >(), SwitchContent(), and SwitchContent< T >().

◆ CurrentTab

Setting.Tab Window.CurrentTab
get

Definition at line 786 of file Window.cs.

787 {
788 get
789 {
790 if (setting.tabs.Count <= 0)
791 {
792 return null;
793 }
794 return setting.tabs[idTab];
795 }
796 }

Referenced by Layer.GetTextHeader(), NextTab(), LayerHome.OnSwitchContent(), and LayerTextureViewer.OnSwitchContent().

◆ EventTrigger

EventTrigger Window.EventTrigger
get

Definition at line 850 of file Window.cs.

851 {
852 get
853 {
854 if (!_eventTrigger)
855 {
856 _eventTrigger = GetComponent<EventTrigger>();
857 }
858 return _eventTrigger;
859 }
860 }
EventTrigger _eventTrigger
Definition: Window.cs:736

Referenced by InitPanel().

◆ FrameInnerCorners

Vector3 [] Window.FrameInnerCorners
get

Definition at line 899 of file Window.cs.

900 {
901 get
902 {
903 if (_frameInnerCorners == null || _frameInnerCorners.Length != 4)
904 {
905 _frameInnerCorners = new Vector3[4];
907 }
908 return _frameInnerCorners;
909 }
910 }
float FrameOffsetR
Definition: Window.cs:683
float frameOffsetY
Definition: Window.cs:691
float FrameOffsetL
Definition: Window.cs:681
float FrameThickness
Definition: Window.cs:687

Referenced by CursorOverBottomBorder(), CursorOverLeftBorder(), and CursorOverRightBorder().

◆ FrameOuterCorners

Vector3 [] Window.FrameOuterCorners
get

Definition at line 886 of file Window.cs.

887 {
888 get
889 {
890 if (_frameOuterCorners == null || _frameOuterCorners.Length != 4)
891 {
892 _frameOuterCorners = new Vector3[4];
894 }
895 return _frameOuterCorners;
896 }
897 }

Referenced by CursorOverBottomBorder(), CursorOverLeftBorder(), CursorOverRightBorder(), and CursorOverWindow().

◆ idWindow

string Window.idWindow
get

Definition at line 774 of file Window.cs.

775 {
776 get
777 {
778 if (!(layer == null))
779 {
780 return layer.uid + windowIndex;
781 }
782 return "nolayer";
783 }
784 }
int windowIndex
Definition: Window.cs:697

Referenced by Init(), OnKill(), and UpdateSaveData().

◆ isStatic

bool Window.isStatic
get

Definition at line 932 of file Window.cs.

Referenced by InitPanel(), OnChangeResolution(), and Update().

◆ RectTransform

RectTransform Window.RectTransform
get

Definition at line 862 of file Window.cs.

863 {
864 get
865 {
866 if (!_rectTransform)
867 {
868 _rectTransform = base.transform as RectTransform;
869 }
870 return _rectTransform;
871 }
872 }
RectTransform _rectTransform
Definition: Window.cs:738

Referenced by AddBottomSpace(), BuildTabs(), ClampToScreen(), LoadHeader(), ProcessResize(), and SetPosition().

◆ Skin

SkinRootStatic Window.Skin
get

Definition at line 826 of file Window.cs.

827 {
828 get
829 {
830 if (!(skinRoot != null))
831 {
833 }
834 return skinRoot;
835 }
836 }
static SkinRootStatic CurrentSkin
Definition: SkinManager.cs:82
SkinRootStatic skinRoot
Definition: Window.cs:662

Referenced by ApplySkin(), and EnableShadow().


The documentation for this class was generated from the following file: