8 public override object CreateExtra()
25 public override bool ShowStyleMenu
35 public override bool AlwaysTop
44 public override void OnActivate()
49 UnityEngine.Object.DestroyImmediate(this.box.gameObject);
52 WidgetMainText.boxBk.GetComponentInChildren<UIDragPanel>(
true).SetTarget(this.Rect());
53 WidgetMainText.boxBk =
null;
56 this.dragPanel = this.box.dragPanel;
57 this.imageBG = this.box.imageBg;
58 WidgetMainText.Instance =
this;
59 this.box.maxBlock = this.extra.maxLine;
60 this.box.fadeLines = this.extra.fadeLines;
61 if (base.config.skin.bgColor.Equals(
new Color(0f, 0f, 0f, 0f)))
63 base.config.skin.bgColor =
EMono.core.refs.bg_msg[this.extra.bg].color;
66 this.OnChangeResolution();
70 this.Append(
"welcome_intro".langGame(
EMono.core.version.GetText(),
null,
null,
null),
null);
71 this.Append(this.spriteElin);
73 this.Append(
"welcome".langGame(EInput.keys.report.key.ToString() ??
"",
null,
null,
null),
null);
80 public void RefreshBG()
82 this.box.SetBG(
EMono.core.refs.bg_msg[
this.extra.bg], base.config.skin.bgColor);
86 public void Append(
string s,
Point pos =
null)
88 this.Append(s,
Msg.colors.Default, pos);
92 public void Append(
string s, Color col,
Point pos =
null)
94 if (s.IsEmpty() || s ==
" ")
100 this.box.Load(
"MsgFocus").button1.onClick.AddListener(delegate()
102 EMono.screen.Focus(pos);
105 if (s.StartsWith(
"*"))
109 if (Lang.setting.useSpace)
114 s = s.TrimStart(
' ');
117 else if (s.EndsWith(
"*"))
121 if (MsgBlock.lastBlock !=
null && MsgBlock.lastText == s)
123 MsgBlock lastBlock = MsgBlock.lastBlock;
124 if (lastBlock.txt !=
null)
126 UIText txt = lastBlock.txt;
128 string text = txt.text;
129 if (text.EndsWith(
") ") && text.Contains(
"(x"))
131 text = text.Substring(0, text.IndexOf(
"(x"));
133 txt.text = text +
"(x" + (lastBlock.repeat + 1).ToString() +
") ";
134 if (lastBlock.repeat == 1)
136 txt.RebuildLayout(
false);
137 this.box.RebuildLayout(
true);
142 this.box.Append(s, col);
147 public void Append(Sprite sprite)
149 this.box.Append(sprite,
false);
154 public static void HideLog()
164 public static void ToggleLog()
168 EMono.ui.widgets.Activate(
"MainText");
175 public void _ToggleLog()
177 this.box.ToggleLog();
179 if (this.box.isShowingLog)
185 this.box.RebuildLayout(
true);
190 public void NewLine()
192 this.box.MarkNewBlock();
196 public static void Refresh()
205 private void _Refresh()
207 this.box.SetActive(this.box.isShowingLog || !
WidgetFeed.Intercept, delegate(
bool enabled)
211 this.box.RebuildLayout(
true);
217 public override void OnSetContextMenu(UIContextMenu m)
219 SkinConfig cfg = base.config.skin;
220 UIContextMenu uicontextMenu = m.AddChild(
"setting");
221 uicontextMenu.AddSlider(
"msgLines", (
float n) => n.ToString() ??
"", (
float)
this.box.maxBlock, delegate(
float a)
223 this.box.maxBlock = (int)a;
224 this.extra.maxLine = (int)a;
225 }, 2f, 10f,
true,
false,
false);
226 uicontextMenu.AddSlider(
"width", (
float a) => a.ToString() ??
"", (
float)
this.extra.width, delegate(
float a)
228 this.extra.width = (int)a;
229 this.OnChangeResolution();
230 }, 30f, 100f,
true,
true,
false);
231 UIContextMenu uicontextMenu2 = m.AddChild(
"style");
232 uicontextMenu2.AddToggle(
"fadeLines", this.extra.fadeLines, delegate(
bool a)
235 this.box.fadeLines = a;
237 this.box.RefreshAlpha();
239 uicontextMenu2.AddSlider(
"changeBG", (
float n) => n.ToString() +
"/" + (
EMono.core.refs.bg_msg.Count - 1).ToString(), (
float)
this.extra.bg, delegate(
float a)
241 this.extra.bg = (int)a;
242 cfg.bgColor =
EMono.core.refs.bg_msg[this.extra.bg].color;
244 }, 0f, (float)(EMono.core.refs.bg_msg.Count - 1),
true,
true,
false);
245 Action<PickerState, Color> <>9__8;
246 uicontextMenu2.AddButton(
"colorBG", delegate()
249 Color bgColor = cfg.bgColor;
250 Color color =
EMono.ui.skins.skinSets[cfg.id].bgs[cfg.bg].color;
251 Action<PickerState, Color> onChangeColor;
252 if ((onChangeColor = <>9__8) ==
null)
254 onChangeColor = (<>9__8 = delegate(PickerState state, Color _c)
260 layerColorPicker.SetColor(bgColor, color, onChangeColor);
262 base.SetBaseContextMenu(m);
266 public override void OnChangeResolution()
268 base.OnChangeResolution();
269 RectTransform rectTransform = this.Rect();
270 rectTransform.sizeDelta =
new Vector2(0.01f * (
float)Screen.width * (
float)
this.extra.width, rectTransform.sizeDelta.y);
277 public static MsgBox boxBk;
283 private UIItem currentItem;
286 public UIItem moldLine;
289 public int visibleLines;
292 public Transform layout;
295 public Sprite spriteElin;
298 public Sprite spriteDestroy;
301 public Sprite spriteEther;
305 public bool newLine =
true;
320 public bool fadeLines;