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

Public Member Functions

void Append (string s, Color col)
 
void Append (Sprite s, bool fitLine=false)
 
UIItem Load (string id)
 
void Reset ()
 

Public Attributes

int countElements
 
Image bg
 
LayoutGroup layout
 
CanvasGroup cg
 
MsgBox box
 
UIText txt
 
int repeat
 

Static Public Attributes

static MsgBlock lastBlock
 
static string lastText
 

Private Member Functions

void Awake ()
 
void AddElement (Component c, bool autoNewLine=true)
 
void AddElement (Component c, MsgBlock block)
 

Private Attributes

RectTransform rect
 

Detailed Description

Definition at line 5 of file MsgBlock.cs.

Member Function Documentation

◆ AddElement() [1/2]

void MsgBlock.AddElement ( Component  c,
bool  autoNewLine = true 
)
inlineprivate

Definition at line 70 of file MsgBlock.cs.

71 {
72 if (rect.rect.width + c.Rect().rect.width > box.maxWidth)
73 {
75 }
77 }
MsgBox box
Definition: MsgBlock.cs:22
RectTransform rect
Definition: MsgBlock.cs:19
void AddElement(Component c, bool autoNewLine=true)
Definition: MsgBlock.cs:70
void CreateNewBlock()
Definition: MsgBox.cs:92
float maxWidth
Definition: MsgBox.cs:66
MsgBlock currentBlock
Definition: MsgBox.cs:58

References AddElement(), box, MsgBox.CreateNewBlock(), MsgBox.currentBlock, MsgBox.maxWidth, and rect.

Referenced by AddElement(), Append(), and Load().

◆ AddElement() [2/2]

void MsgBlock.AddElement ( Component  c,
MsgBlock  block 
)
inlineprivate

Definition at line 79 of file MsgBlock.cs.

80 {
81 c.transform.SetParent(block.transform, worldPositionStays: false);
82 block.layout.RebuildLayout();
84 }
int countElements
Definition: MsgBlock.cs:11

References block, and countElements.

◆ Append() [1/2]

void MsgBlock.Append ( Sprite  s,
bool  fitLine = false 
)
inline

Definition at line 46 of file MsgBlock.cs.

47 {
48 Transform transform = PoolManager.Spawn(box.prefabs.image, layout);
49 Image componentInChildren = transform.GetComponentInChildren<Image>();
50 componentInChildren.sprite = s;
51 if (fitLine)
52 {
53 componentInChildren.Rect().sizeDelta = new Vector2(rect.sizeDelta.y, rect.sizeDelta.y);
54 }
55 else
56 {
57 componentInChildren.SetNativeSize();
58 }
59 transform.transform.Rect().sizeDelta = componentInChildren.Rect().sizeDelta;
60 AddElement(transform);
61 }
LayoutGroup layout
Definition: MsgBlock.cs:15
Transform image
Definition: MsgBox.cs:18
Prefabs prefabs
Definition: MsgBox.cs:31
static Transform Spawn(string id, string path, Transform parent)
Definition: PoolManager.cs:86

References AddElement(), box, MsgBox.Prefabs.image, layout, MsgBox.prefabs, rect, and PoolManager.Spawn().

◆ Append() [2/2]

void MsgBlock.Append ( string  s,
Color  col 
)
inline

Definition at line 35 of file MsgBlock.cs.

36 {
38 txt.SetText(s, col);
39 txt.RebuildLayout();
41 lastBlock = this;
42 lastText = s;
43 repeat = 0;
44 }
static MsgBlock lastBlock
Definition: MsgBlock.cs:7
int repeat
Definition: MsgBlock.cs:28
static string lastText
Definition: MsgBlock.cs:9
UIText txt
Definition: MsgBlock.cs:25
UIText text
Definition: MsgBox.cs:16
void SetText(string s)
Definition: UIText.cs:159

References AddElement(), box, lastBlock, lastText, layout, MsgBox.prefabs, repeat, UIText.SetText(), PoolManager.Spawn(), MsgBox.Prefabs.text, and txt.

Referenced by MsgBox.Append().

◆ Awake()

void MsgBlock.Awake ( )
inlineprivate

Definition at line 30 of file MsgBlock.cs.

31 {
32 rect = this.Rect();
33 }

References rect.

◆ Load()

UIItem MsgBlock.Load ( string  id)
inline

Definition at line 63 of file MsgBlock.cs.

64 {
65 UIItem uIItem = UnityEngine.Object.Instantiate(ResourceCache.Load<UIItem>("UI/Element/Msg/" + id));
66 AddElement(uIItem, autoNewLine: false);
67 return uIItem;
68 }
Definition: UIItem.cs:5

References AddElement().

Referenced by MsgBox.Load().

◆ Reset()

void MsgBlock.Reset ( )
inline

Definition at line 86 of file MsgBlock.cs.

87 {
88 for (int num = base.transform.childCount - 1; num >= 0; num--)
89 {
90 Transform child = base.transform.GetChild(num);
91 if (!child.tag.Contains("IgnoreDestroy"))
92 {
94 }
95 }
96 this.RebuildLayout();
97 }
static void DespawnOrDestroy(Component c)
Definition: PoolManager.cs:158

References PoolManager.DespawnOrDestroy().

Referenced by MsgBox.CreateNewBlock().

Member Data Documentation

◆ bg

Image MsgBlock.bg

Definition at line 13 of file MsgBlock.cs.

Referenced by MsgBox.CreateNewBlock().

◆ box

MsgBox MsgBlock.box

Definition at line 22 of file MsgBlock.cs.

Referenced by MsgLine.AddElement(), AddElement(), and Append().

◆ cg

CanvasGroup MsgBlock.cg

Definition at line 17 of file MsgBlock.cs.

Referenced by MsgBox.ToggleLog().

◆ countElements

int MsgBlock.countElements

Definition at line 11 of file MsgBlock.cs.

Referenced by AddElement(), and MsgBox.SetCurrentBlock().

◆ lastBlock

MsgBlock MsgBlock.lastBlock
static

Definition at line 7 of file MsgBlock.cs.

Referenced by Append(), and WidgetMainText.Append().

◆ lastText

string MsgBlock.lastText
static

Definition at line 9 of file MsgBlock.cs.

Referenced by Append(), and WidgetMainText.Append().

◆ layout

LayoutGroup MsgBlock.layout

Definition at line 15 of file MsgBlock.cs.

Referenced by Append().

◆ rect

RectTransform MsgBlock.rect
private

Definition at line 19 of file MsgBlock.cs.

Referenced by AddElement(), Append(), and Awake().

◆ repeat

int MsgBlock.repeat

Definition at line 28 of file MsgBlock.cs.

Referenced by Append(), and WidgetMainText.Append().

◆ txt

UIText MsgBlock.txt

Definition at line 25 of file MsgBlock.cs.

Referenced by Append(), and WidgetMainText.Append().


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