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

Classes

class  Prefabs
 

Public Member Functions

void Init ()
 
void Append (string s, Color col)
 
void Append (Sprite s, bool fitLine=false)
 
UIItem Load (string id)
 
void CreateNewBlock ()
 
void MarkNewBlock ()
 
void RefreshAlpha ()
 
void SetBG (SpriteAsset s, Color c)
 
void Clear ()
 
void AddLog ()
 
void ToggleLog ()
 
void ToggleLog (bool show)
 

Public Attributes

VerticalLayoutGroup layout
 
VerticalLayoutGroup layoutLog
 
GameObject goLog
 
GameObject goBox
 
Prefabs prefabs
 
Image imageBg
 
UIDragPanel dragPanel
 
int maxBlock
 
int maxLog
 
bool reverseOrder
 
bool multiLine
 
bool fadeLines
 
bool newblock
 
bool isShowingLog
 
MsgBlock currentBlock
 
List< MsgBlockblocks = new List<MsgBlock>()
 
List< MsgBlocklogs = new List<MsgBlock>()
 

Properties

float maxWidth [get]
 

Private Member Functions

void SetCurrentBlock ()
 

Private Attributes

SpriteAsset bg
 
Color bgColor
 

Detailed Description

Definition at line 7 of file MsgBox.cs.

Member Function Documentation

◆ AddLog()

void MsgBox.AddLog ( )
inline

Definition at line 192 of file MsgBox.cs.

193 {
194 MsgBlock msgBlock = blocks[0];
195 blocks.RemoveAt(0);
196 logs.Add(msgBlock);
197 if (!isShowingLog)
198 {
199 msgBlock.transform.SetParent(layoutLog.transform, worldPositionStays: false);
200 }
201 if (logs.Count > maxLog)
202 {
203 msgBlock = logs[0];
204 logs.RemoveAt(0);
205 PoolManager.Despawn(msgBlock);
206 }
207 }
List< MsgBlock > logs
Definition: MsgBox.cs:64
VerticalLayoutGroup layoutLog
Definition: MsgBox.cs:25
int maxLog
Definition: MsgBox.cs:39
List< MsgBlock > blocks
Definition: MsgBox.cs:61
bool isShowingLog
Definition: MsgBox.cs:55
static void Despawn(Component c)
Definition: PoolManager.cs:128

References blocks, PoolManager.Despawn(), isShowingLog, layoutLog, logs, and maxLog.

Referenced by CreateNewBlock().

◆ Append() [1/2]

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

Definition at line 80 of file MsgBox.cs.

81 {
83 currentBlock.Append(s, fitLine);
84 }
void Append(string s, Color col)
Definition: MsgBlock.cs:35
void SetCurrentBlock()
Definition: MsgBox.cs:130
MsgBlock currentBlock
Definition: MsgBox.cs:58

References MsgBlock.Append(), currentBlock, and SetCurrentBlock().

◆ Append() [2/2]

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

Definition at line 74 of file MsgBox.cs.

75 {
77 currentBlock.Append(s, col);
78 }

References MsgBlock.Append(), currentBlock, and SetCurrentBlock().

Referenced by WidgetMainText.Append().

◆ Clear()

void MsgBox.Clear ( )
inline

Definition at line 176 of file MsgBox.cs.

177 {
178 foreach (MsgBlock block in blocks)
179 {
181 }
182 foreach (MsgBlock log in logs)
183 {
184 PoolManager.Despawn(log);
185 }
186 blocks.Clear();
187 logs.Clear();
188 currentBlock = null;
189 newblock = false;
190 }
bool newblock
Definition: MsgBox.cs:52

References block, blocks, currentBlock, PoolManager.Despawn(), logs, and newblock.

◆ CreateNewBlock()

void MsgBox.CreateNewBlock ( )
inline

Definition at line 92 of file MsgBox.cs.

93 {
95 currentBlock.box = this;
96 currentBlock.bg.sprite = bg.sprite;
97 currentBlock.bg.Rect().sizeDelta = bg.size;
98 currentBlock.bg.color = bgColor;
100 newblock = false;
101 if (reverseOrder)
102 {
103 currentBlock.transform.SetAsFirstSibling();
104 }
105 blocks.Add(currentBlock);
106 if (blocks.Count > maxBlock)
107 {
108 int num = blocks.Count - maxBlock;
109 for (int i = 0; i < num; i++)
110 {
111 AddLog();
112 }
113 }
114 if (isShowingLog)
115 {
116 currentBlock.transform.SetParent(layoutLog.transform, worldPositionStays: false);
117 Image image = currentBlock.bg;
118 bool flag2 = (currentBlock.cg.enabled = false);
119 image.enabled = flag2;
120 }
121 else
122 {
123 Image image2 = currentBlock.bg;
124 bool flag2 = (currentBlock.cg.enabled = true);
125 image2.enabled = flag2;
126 RefreshAlpha();
127 }
128 }
void Reset()
Definition: MsgBlock.cs:86
Image bg
Definition: MsgBlock.cs:13
MsgBlock block
Definition: MsgBox.cs:12
bool reverseOrder
Definition: MsgBox.cs:41
void AddLog()
Definition: MsgBox.cs:192
int maxBlock
Definition: MsgBox.cs:37
SpriteAsset bg
Definition: MsgBox.cs:47
VerticalLayoutGroup layout
Definition: MsgBox.cs:23
Prefabs prefabs
Definition: MsgBox.cs:31
Color bgColor
Definition: MsgBox.cs:49
void RefreshAlpha()
Definition: MsgBox.cs:143
static Transform Spawn(string id, string path, Transform parent)
Definition: PoolManager.cs:86
Vector2Int size
Definition: SpriteAsset.cs:11
Sprite sprite
Definition: SpriteAsset.cs:9

References AddLog(), MsgBlock.bg, bg, bgColor, MsgBox.Prefabs.block, blocks, currentBlock, isShowingLog, layout, layoutLog, maxBlock, newblock, prefabs, RefreshAlpha(), MsgBlock.Reset(), reverseOrder, SpriteAsset.size, PoolManager.Spawn(), and SpriteAsset.sprite.

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

◆ Init()

void MsgBox.Init ( )
inline

Definition at line 68 of file MsgBox.cs.

69 {
70 goLog.SetActive(value: false);
71 isShowingLog = false;
72 }
GameObject goLog
Definition: MsgBox.cs:27

References goLog, and isShowingLog.

Referenced by WidgetMainText.OnActivate().

◆ Load()

UIItem MsgBox.Load ( string  id)
inline

Definition at line 86 of file MsgBox.cs.

87 {
89 return currentBlock.Load(id);
90 }
UIItem Load(string id)
Definition: MsgBlock.cs:63

References currentBlock, MsgBlock.Load(), and SetCurrentBlock().

Referenced by WidgetMainText.Append().

◆ MarkNewBlock()

void MsgBox.MarkNewBlock ( )
inline

Definition at line 138 of file MsgBox.cs.

139 {
140 newblock = true;
141 }

References newblock.

Referenced by WidgetMainText.NewLine().

◆ RefreshAlpha()

void MsgBox.RefreshAlpha ( )
inline

Definition at line 143 of file MsgBox.cs.

144 {
145 for (int i = 0; i < blocks.Count; i++)
146 {
147 float alpha = 1f;
148 if (fadeLines && blocks.Count >= 3)
149 {
150 switch (i)
151 {
152 case 1:
153 alpha = 0.8f;
154 break;
155 case 0:
156 alpha = 0.65f;
157 break;
158 }
159 }
160 blocks[i].cg.alpha = alpha;
161 }
162 }
bool fadeLines
Definition: MsgBox.cs:45

References blocks, and fadeLines.

Referenced by CreateNewBlock(), WidgetMainText.OnSetContextMenu(), and ToggleLog().

◆ SetBG()

void MsgBox.SetBG ( SpriteAsset  s,
Color  c 
)
inline

Definition at line 164 of file MsgBox.cs.

165 {
166 bg = s;
167 bgColor = c;
168 foreach (MsgBlock item in blocks.Concat(logs))
169 {
170 item.bg.sprite = bg.sprite;
171 item.bg.color = bgColor;
172 item.bg.Rect().sizeDelta = bg.size;
173 }
174 }

References bg, bgColor, blocks, item, logs, SpriteAsset.size, and SpriteAsset.sprite.

Referenced by WidgetMainText.RefreshBG().

◆ SetCurrentBlock()

void MsgBox.SetCurrentBlock ( )
inlineprivate

Definition at line 130 of file MsgBox.cs.

131 {
133 {
135 }
136 }
int countElements
Definition: MsgBlock.cs:11
void CreateNewBlock()
Definition: MsgBox.cs:92

References MsgBlock.countElements, CreateNewBlock(), currentBlock, and newblock.

Referenced by Append(), and Load().

◆ ToggleLog() [1/2]

void MsgBox.ToggleLog ( )
inline

Definition at line 209 of file MsgBox.cs.

210 {
212 }
void ToggleLog()
Definition: MsgBox.cs:209

References isShowingLog, and ToggleLog().

Referenced by WidgetMainText._ToggleLog(), and ToggleLog().

◆ ToggleLog() [2/2]

void MsgBox.ToggleLog ( bool  show)
inline

Definition at line 214 of file MsgBox.cs.

215 {
216 isShowingLog = show;
217 goBox.SetActive(!show);
218 goLog.SetActive(show);
219 if (show)
220 {
221 foreach (MsgBlock block in blocks)
222 {
223 block.transform.SetParent(layoutLog.transform, worldPositionStays: false);
224 }
225 MsgBlock[] componentsInChildren = layoutLog.GetComponentsInChildren<MsgBlock>();
226 foreach (MsgBlock msgBlock in componentsInChildren)
227 {
228 CanvasGroup cg = msgBlock.cg;
229 bool flag2 = (msgBlock.bg.enabled = false);
230 cg.enabled = flag2;
231 }
232 return;
233 }
234 foreach (MsgBlock block2 in blocks)
235 {
236 block2.transform.SetParent(layout.transform, worldPositionStays: false);
237 CanvasGroup cg2 = block2.cg;
238 bool flag2 = (block2.bg.enabled = true);
239 cg2.enabled = flag2;
240 }
241 RefreshAlpha();
242 layout.RebuildLayout();
243 }
CanvasGroup cg
Definition: MsgBlock.cs:17
GameObject goBox
Definition: MsgBox.cs:29

References block, blocks, MsgBlock.cg, goBox, goLog, isShowingLog, layout, layoutLog, and RefreshAlpha().

Member Data Documentation

◆ bg

SpriteAsset MsgBox.bg
private

Definition at line 47 of file MsgBox.cs.

Referenced by CreateNewBlock(), and SetBG().

◆ bgColor

Color MsgBox.bgColor
private

Definition at line 49 of file MsgBox.cs.

Referenced by CreateNewBlock(), and SetBG().

◆ blocks

List<MsgBlock> MsgBox.blocks = new List<MsgBlock>()

Definition at line 61 of file MsgBox.cs.

Referenced by AddLog(), Clear(), CreateNewBlock(), RefreshAlpha(), SetBG(), and ToggleLog().

◆ currentBlock

MsgBlock MsgBox.currentBlock

Definition at line 58 of file MsgBox.cs.

Referenced by MsgBlock.AddElement(), Append(), Clear(), CreateNewBlock(), Load(), and SetCurrentBlock().

◆ dragPanel

UIDragPanel MsgBox.dragPanel

Definition at line 35 of file MsgBox.cs.

Referenced by WidgetMainText.OnActivate().

◆ fadeLines

bool MsgBox.fadeLines

Definition at line 45 of file MsgBox.cs.

Referenced by RefreshAlpha().

◆ goBox

GameObject MsgBox.goBox

Definition at line 29 of file MsgBox.cs.

Referenced by ToggleLog().

◆ goLog

GameObject MsgBox.goLog

Definition at line 27 of file MsgBox.cs.

Referenced by Init(), and ToggleLog().

◆ imageBg

Image MsgBox.imageBg

Definition at line 33 of file MsgBox.cs.

Referenced by WidgetMainText.OnActivate().

◆ isShowingLog

◆ layout

VerticalLayoutGroup MsgBox.layout

Definition at line 23 of file MsgBox.cs.

Referenced by CreateNewBlock(), and ToggleLog().

◆ layoutLog

VerticalLayoutGroup MsgBox.layoutLog

Definition at line 25 of file MsgBox.cs.

Referenced by AddLog(), CreateNewBlock(), and ToggleLog().

◆ logs

List<MsgBlock> MsgBox.logs = new List<MsgBlock>()

Definition at line 64 of file MsgBox.cs.

Referenced by AddLog(), Clear(), and SetBG().

◆ maxBlock

int MsgBox.maxBlock

Definition at line 37 of file MsgBox.cs.

Referenced by CreateNewBlock(), and WidgetMainText.OnSetContextMenu().

◆ maxLog

int MsgBox.maxLog

Definition at line 39 of file MsgBox.cs.

Referenced by AddLog().

◆ multiLine

bool MsgBox.multiLine

Definition at line 43 of file MsgBox.cs.

◆ newblock

bool MsgBox.newblock

Definition at line 52 of file MsgBox.cs.

Referenced by Clear(), CreateNewBlock(), MarkNewBlock(), and SetCurrentBlock().

◆ prefabs

Prefabs MsgBox.prefabs

Definition at line 31 of file MsgBox.cs.

Referenced by MsgBlock.Append(), and CreateNewBlock().

◆ reverseOrder

bool MsgBox.reverseOrder

Definition at line 41 of file MsgBox.cs.

Referenced by CreateNewBlock().

Property Documentation

◆ maxWidth

float MsgBox.maxWidth
get

Definition at line 66 of file MsgBox.cs.

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


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